wined3d: Use finer grained colorkey state invalidation.

This commit is contained in:
Stefan Dösinger 2015-04-14 11:16:23 +02:00 committed by Alexandre Julliard
parent 382fa588a9
commit 483d9550c4
1 changed files with 10 additions and 3 deletions

View File

@ -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,