From 483d9550c49a0b6fc5cebe916ebfd07f415c35ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 14 Apr 2015 11:16:23 +0200 Subject: [PATCH] wined3d: Use finer grained colorkey state invalidation. --- 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 8271634cb41..d66850a531e 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,