Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/device.c | 21 +++++++++++---------- dlls/wined3d/stateblock.c | 7 ++++--- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index dcbdc3d731..14cb6204f2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2445,22 +2445,23 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device,
if (count > WINED3D_MAX_CONSTS_I - start_idx) count = WINED3D_MAX_CONSTS_I - start_idx; - memcpy(&device->update_state->vs_consts_i[start_idx], constants, count * sizeof(*constants)); + + memcpy(&device->update_stateblock_state->vs_consts_i[start_idx], constants, count * sizeof(*constants)); + if (device->recording) + { + for (i = start_idx; i < count + start_idx; ++i) + device->recording->changed.vertexShaderConstantsI |= (1u << i); + return WINED3D_OK; + } + + memcpy(&device->state.vs_consts_i[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) { for (i = 0; i < count; ++i) TRACE("Set ivec4 constant %u to %s.\n", start_idx + i, debug_ivec4(&constants[i])); }
- if (device->recording) - { - for (i = start_idx; i < count + start_idx; ++i) - device->recording->changed.vertexShaderConstantsI |= (1u << i); - } - else - { - wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_I, start_idx, count, constants); - } + wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_I, start_idx, count, constants);
return WINED3D_OK; } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index f28c29c33f..dd1e6383f7 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -716,9 +716,9 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) { unsigned int idx = stateblock->contained_vs_consts_i[i];
- TRACE("Setting vs_consts[%u] to %s.\n", idx, debug_ivec4(&src_state->vs_consts_i[idx])); + TRACE("Setting vs_consts_i[%u] to %s.\n", idx, debug_ivec4(&state->vs_consts_i[idx]));
- stateblock->state.vs_consts_i[idx] = src_state->vs_consts_i[idx]; + stateblock->stateblock_state.vs_consts_i[idx] = state->vs_consts_i[idx]; }
/* Vertex shader boolean constants. */ @@ -1014,8 +1014,9 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) } for (i = 0; i < stateblock->num_contained_vs_consts_i; ++i) { + state->vs_consts_i[i] = stateblock->stateblock_state.vs_consts_i[i]; wined3d_device_set_vs_consts_i(device, stateblock->contained_vs_consts_i[i], - 1, &stateblock->state.vs_consts_i[stateblock->contained_vs_consts_i[i]]); + 1, &stateblock->stateblock_state.vs_consts_i[stateblock->contained_vs_consts_i[i]]); } for (i = 0; i < stateblock->num_contained_vs_consts_b; ++i) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 047439d3b0..fedf2b8a37 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2972,6 +2972,7 @@ struct wined3d_stateblock_state { struct wined3d_shader *vs; struct wined3d_vec4 vs_consts_f[WINED3D_MAX_VS_CONSTS_F]; + struct wined3d_ivec4 vs_consts_i[WINED3D_MAX_CONSTS_I]; };
struct wined3d_device