Commit 0170bb0e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Only invalidate valid state IDs in wined3d_cs_exec_reset_state().

Not every state ID between 0 and STATE_HIGHEST is valid; for example, there are holes in the renderstate IDs. While invalidating these works fine, attempting to subsequently apply them in e.g. context_apply_draw_state() ends up calling state_undefined() and printing an ERR. This is especially visible when running the d2d1 tests. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 556121b1
......@@ -2214,15 +2214,21 @@ static void wined3d_cs_mt_push_constants(struct wined3d_device_context *context,
static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_device *device = cs->c.device;
const struct wined3d_cs_reset_state *op = data;
const struct wined3d_state_entry *state_table;
unsigned int state;
state_cleanup(&cs->state);
wined3d_state_reset(&cs->state, &cs->c.device->adapter->d3d_info);
wined3d_state_reset(&cs->state, &device->adapter->d3d_info);
if (op->invalidate)
{
state_table = device->state_table;
for (state = 0; state <= STATE_HIGHEST; ++state)
device_invalidate_state(cs->c.device, state);
{
if (state_table[state].representative)
device_invalidate_state(device, state);
}
}
}
......
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