wined3d: Allow (some) blits with fixups in the arbfp and ffp blitters with ORM_BACKBUFFER.

When using ORM_BACKBUFFER, formats with fixups may need to be loaded into
WINED3D_LOCATION_DRAWABLE. Before commit
cad4badbcf, surface_load_drawable() would always
use the device blitter, without checking whether the blitter actually supports
the blit. The FBO blitter would be able to handle these blits, but is
unavailable when using ORM_BACKBUFFER.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2017-05-21 17:53:39 +02:00 committed by Alexandre Julliard
parent e2a251a0a3
commit d371468858
2 changed files with 20 additions and 6 deletions

View File

@ -7767,6 +7767,12 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info,
/* We only support YUV conversions. */
if (!is_complex_fixup(src_format->color_fixup))
{
if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER)
{
WARN("Claiming fixup support because of ORM_BACKBUFFER.\n");
return TRUE;
}
TRACE("[FAILED]\n");
return FALSE;
}

View File

@ -2485,8 +2485,8 @@ static void ffp_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_
static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info,
const struct wined3d_d3d_info *d3d_info, enum wined3d_blit_op blit_op,
DWORD src_usage, enum wined3d_pool src_pool, const struct wined3d_format *src_format,
DWORD dst_usage, enum wined3d_pool dst_pool, const struct wined3d_format *dst_format)
DWORD src_usage, enum wined3d_pool src_pool, const struct wined3d_format *src_format, DWORD src_location,
DWORD dst_usage, enum wined3d_pool dst_pool, const struct wined3d_format *dst_format, DWORD dst_location)
{
BOOL decompress;
@ -2521,8 +2521,16 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info,
if (!is_identity_fixup(src_format->color_fixup)
|| !is_identity_fixup(dst_format->color_fixup))
{
TRACE("Fixups are not supported.\n");
return FALSE;
if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER
&& dst_format->id == src_format->id && dst_location == WINED3D_LOCATION_DRAWABLE)
{
WARN("Claiming fixup support because of ORM_BACKBUFFER.\n");
}
else
{
TRACE("Fixups are not supported.\n");
return FALSE;
}
}
if (!(dst_usage & WINED3DUSAGE_RENDERTARGET))
@ -2632,8 +2640,8 @@ static void ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_
device = dst_resource->device;
if (!ffp_blit_supported(&device->adapter->gl_info, &device->adapter->d3d_info, op,
src_resource->usage, src_resource->pool, src_resource->format,
dst_resource->usage, dst_resource->pool, dst_resource->format))
src_resource->usage, src_resource->pool, src_resource->format, src_location,
dst_resource->usage, dst_resource->pool, dst_resource->format, dst_location))
{
if ((next = blitter->next))
next->ops->blitter_blit(next, op, context, src_surface, src_location,