Commit 483d9550 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Use finer grained colorkey state invalidation.

parent 382fa588
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment