[PATCH 2/5] wined3d: Use finer grained colorkey state invalidation.

Stefan Dösinger stefan at codeweavers.com
Tue Apr 14 04:16:23 CDT 2015


---
 dlls/wined3d/cs.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 8271634..d66850a 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -913,6 +913,13 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
                 break;
 
             case WINED3D_CKEY_SRC_BLT:
+                if (texture == cs->state.textures[0])
+                {
+                    device_invalidate_state(cs->device, STATE_COLOR_KEY);
+                    if (!(texture->async.color_key_flags & WINED3D_CKEY_SRC_BLT))
+                        device_invalidate_state(cs->device, STATE_RENDER(WINED3D_RS_COLORKEYENABLE));
+                }
+
                 texture->async.src_blt_color_key = op->color_key;
                 texture->async.color_key_flags |= WINED3D_CKEY_SRC_BLT;
                 break;
@@ -936,6 +943,9 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
                 break;
 
             case WINED3D_CKEY_SRC_BLT:
+                if (texture == cs->state.textures[0] && texture->async.color_key_flags & WINED3D_CKEY_SRC_BLT)
+                    device_invalidate_state(cs->device, STATE_RENDER(WINED3D_RS_COLORKEYENABLE));
+
                 texture->async.color_key_flags &= ~WINED3D_CKEY_SRC_BLT;
                 break;
 
@@ -944,9 +954,6 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
                 break;
         }
     }
-
-    if (texture->resource.bind_count && op->flags & WINED3D_CKEY_SRC_BLT)
-        device_invalidate_state(cs->device, STATE_RENDER(WINED3D_RS_COLORKEYENABLE));
 }
 
 void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture,
-- 
2.3.4




More information about the wine-patches mailing list