Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/device.c | 16 ++++++++++------ dlls/wined3d/stateblock.c | 7 ++++--- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index b7071dbcc1..dcbdc3d731 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2493,18 +2493,22 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, || count > d3d_info->limits.vs_uniform_count - start_idx) return WINED3DERR_INVALIDCALL;
- memcpy(&device->update_state->vs_consts_f[start_idx], constants, count * sizeof(*constants)); + memcpy(&device->update_stateblock_state->vs_consts_f[start_idx], constants, count * sizeof(*constants)); + if (device->recording) + { + memset(&device->recording->changed.vs_consts_f[start_idx], 1, + count * sizeof(*device->recording->changed.vs_consts_f)); + return WINED3D_OK; + } + + memcpy(&device->state.vs_consts_f[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) { for (i = 0; i < count; ++i) TRACE("Set vec4 constant %u to %s.\n", start_idx + i, debug_vec4(&constants[i])); }
- if (device->recording) - memset(&device->recording->changed.vs_consts_f[start_idx], 1, - count * sizeof(*device->recording->changed.vs_consts_f)); - else - wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_F, start_idx, count, constants); + wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_F, start_idx, count, constants);
return WINED3D_OK; } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 4ead27b1d6..f28c29c33f 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -706,9 +706,9 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) { unsigned int idx = stateblock->contained_vs_consts_f[i];
- TRACE("Setting vs_consts_f[%u] to %s.\n", idx, debug_vec4(&src_state->vs_consts_f[idx])); + TRACE("Setting vs_consts_f[%u] to %s.\n", idx, debug_vec4(&state->vs_consts_f[idx]));
- stateblock->state.vs_consts_f[idx] = src_state->vs_consts_f[idx]; + stateblock->stateblock_state.vs_consts_f[idx] = state->vs_consts_f[idx]; }
/* Vertex shader integer constants. */ @@ -1008,8 +1008,9 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) /* Vertex Shader Constants. */ for (i = 0; i < stateblock->num_contained_vs_consts_f; ++i) { + state->vs_consts_f[i] = stateblock->stateblock_state.vs_consts_f[i]; wined3d_device_set_vs_consts_f(device, stateblock->contained_vs_consts_f[i], - 1, &stateblock->state.vs_consts_f[stateblock->contained_vs_consts_f[i]]); + 1, &stateblock->stateblock_state.vs_consts_f[stateblock->contained_vs_consts_f[i]]); } for (i = 0; i < stateblock->num_contained_vs_consts_i; ++i) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index e45ee7be33..047439d3b0 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2971,6 +2971,7 @@ struct wined3d_dummy_textures struct wined3d_stateblock_state { struct wined3d_shader *vs; + struct wined3d_vec4 vs_consts_f[WINED3D_MAX_VS_CONSTS_F]; };
struct wined3d_device