wined3d: Store pixel shader integer constants in the wined3d_stateblock_state structure.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3a5d7487d5
commit
c49ff2ce74
|
@ -2659,22 +2659,23 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device,
|
||||||
|
|
||||||
if (count > WINED3D_MAX_CONSTS_I - start_idx)
|
if (count > WINED3D_MAX_CONSTS_I - start_idx)
|
||||||
count = WINED3D_MAX_CONSTS_I - start_idx;
|
count = WINED3D_MAX_CONSTS_I - start_idx;
|
||||||
memcpy(&device->update_state->ps_consts_i[start_idx], constants, count * sizeof(*constants));
|
|
||||||
|
memcpy(&device->update_stateblock_state->ps_consts_i[start_idx], constants, count * sizeof(*constants));
|
||||||
|
if (device->recording)
|
||||||
|
{
|
||||||
|
for (i = start_idx; i < count + start_idx; ++i)
|
||||||
|
device->recording->changed.pixelShaderConstantsI |= (1u << i);
|
||||||
|
return WINED3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(&device->state.ps_consts_i[start_idx], constants, count * sizeof(*constants));
|
||||||
if (TRACE_ON(d3d))
|
if (TRACE_ON(d3d))
|
||||||
{
|
{
|
||||||
for (i = 0; i < count; ++i)
|
for (i = 0; i < count; ++i)
|
||||||
TRACE("Set ivec4 constant %u to %s.\n", start_idx + i, debug_ivec4(&constants[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.pixelShaderConstantsI |= (1u << i);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_I, start_idx, count, constants);
|
wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_I, start_idx, count, constants);
|
||||||
}
|
|
||||||
|
|
||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -753,9 +753,9 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
|
||||||
{
|
{
|
||||||
unsigned int idx = stateblock->contained_ps_consts_i[i];
|
unsigned int idx = stateblock->contained_ps_consts_i[i];
|
||||||
|
|
||||||
TRACE("Setting ps_consts_i[%u] to %s.\n", idx, debug_ivec4(&src_state->ps_consts_i[idx]));
|
TRACE("Setting ps_consts_i[%u] to %s.\n", idx, debug_ivec4(&state->ps_consts_i[idx]));
|
||||||
|
|
||||||
stateblock->state.ps_consts_i[idx] = src_state->ps_consts_i[idx];
|
stateblock->stateblock_state.ps_consts_i[idx] = state->ps_consts_i[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pixel shader boolean constants. */
|
/* Pixel shader boolean constants. */
|
||||||
|
@ -1051,8 +1051,9 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
|
||||||
}
|
}
|
||||||
for (i = 0; i < stateblock->num_contained_ps_consts_i; ++i)
|
for (i = 0; i < stateblock->num_contained_ps_consts_i; ++i)
|
||||||
{
|
{
|
||||||
|
state->ps_consts_i[i] = stateblock->stateblock_state.ps_consts_i[i];
|
||||||
wined3d_device_set_ps_consts_i(device, stateblock->contained_ps_consts_i[i],
|
wined3d_device_set_ps_consts_i(device, stateblock->contained_ps_consts_i[i],
|
||||||
1, &stateblock->state.ps_consts_i[stateblock->contained_ps_consts_i[i]]);
|
1, &stateblock->stateblock_state.ps_consts_i[stateblock->contained_ps_consts_i[i]]);
|
||||||
}
|
}
|
||||||
for (i = 0; i < stateblock->num_contained_ps_consts_b; ++i)
|
for (i = 0; i < stateblock->num_contained_ps_consts_b; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2977,6 +2977,7 @@ struct wined3d_stateblock_state
|
||||||
|
|
||||||
struct wined3d_shader *ps;
|
struct wined3d_shader *ps;
|
||||||
struct wined3d_vec4 ps_consts_f[WINED3D_MAX_PS_CONSTS_F];
|
struct wined3d_vec4 ps_consts_f[WINED3D_MAX_PS_CONSTS_F];
|
||||||
|
struct wined3d_ivec4 ps_consts_i[WINED3D_MAX_CONSTS_I];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wined3d_device
|
struct wined3d_device
|
||||||
|
|
Loading…
Reference in New Issue