wined3d: Only set valid render states in wined3d_device_context_set_state().

Somewhat similar to commit 0170bb0e54,
setting invalid render states ends up invalidating invalid state IDs.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2021-07-01 16:56:33 +02:00 committed by Alexandre Julliard
parent d55348d2b1
commit 87ed274d98
1 changed files with 2 additions and 1 deletions

View File

@ -1774,6 +1774,7 @@ void CDECL wined3d_device_context_set_state(struct wined3d_device_context *conte
for (i = 0; i < WINEHIGHEST_RENDER_STATE + 1; ++i) for (i = 0; i < WINEHIGHEST_RENDER_STATE + 1; ++i)
{ {
if (context->device->state_table[STATE_RENDER(i)].representative)
wined3d_device_context_emit_set_render_state(context, i, state->render_states[i]); wined3d_device_context_emit_set_render_state(context, i, state->render_states[i]);
} }