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

Alexandre Julliard julliard at winehq.org
Mon May 22 15:54:03 CDT 2017


Module: wine
Branch: master
Commit: d37146885801ae384a1cae54edea426b7b58a6a9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d37146885801ae384a1cae54edea426b7b58a6a9

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Sun May 21 17:53:39 2017 +0200

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
cad4badbcf25992e0c61521aa15e639c2611f5d6, 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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/arb_program_shader.c |  6 ++++++
 dlls/wined3d/surface.c            | 20 ++++++++++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index aa17fb1..4b35c94 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -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;
     }
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c68c4c1..08bf156 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -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,




More information about the wine-cvs mailing list