From 87ed274d98ffb9e98f1de760fdbccb2acfcd9e99 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 1 Jul 2021 16:56:33 +0200 Subject: [PATCH] wined3d: Only set valid render states in wined3d_device_context_set_state(). Somewhat similar to commit 0170bb0e548d33e4fa014b73cd2c75ce7ea0dc82, setting invalid render states ends up invalidating invalid state IDs. Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 96657141419..4aaaee75c93 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1774,7 +1774,8 @@ void CDECL wined3d_device_context_set_state(struct wined3d_device_context *conte for (i = 0; i < WINEHIGHEST_RENDER_STATE + 1; ++i) { - wined3d_device_context_emit_set_render_state(context, i, state->render_states[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_blend_state(context, state->blend_state, &state->blend_factor, state->sample_mask);