Commit 28b0f53f authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Store vertex shader boolean constants in the wined3d_stateblock_state structure.

parent 96d7437a
......@@ -2396,23 +2396,24 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device,
if (count > WINED3D_MAX_CONSTS_B - start_idx)
count = WINED3D_MAX_CONSTS_B - start_idx;
memcpy(&device->update_state->vs_consts_b[start_idx], constants, count * sizeof(*constants));
if (TRACE_ON(d3d))
{
for (i = 0; i < count; ++i)
TRACE("Set BOOL constant %u to %#x.\n", start_idx + i, constants[i]);
}
memcpy(&device->update_stateblock_state->vs_consts_b[start_idx], constants, count * sizeof(*constants));
if (device->recording)
{
for (i = start_idx; i < count + start_idx; ++i)
device->recording->changed.vertexShaderConstantsB |= (1u << i);
return WINED3D_OK;
}
else
memcpy(&device->state.vs_consts_b[start_idx], constants, count * sizeof(*constants));
if (TRACE_ON(d3d))
{
wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_B, start_idx, count, constants);
for (i = 0; i < count; ++i)
TRACE("Set BOOL constant %u to %#x.\n", start_idx + i, constants[i]);
}
wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_B, start_idx, count, constants);
return WINED3D_OK;
}
......
......@@ -727,9 +727,9 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
unsigned int idx = stateblock->contained_vs_consts_b[i];
TRACE("Setting vs_consts_b[%u] to %s.\n",
idx, src_state->vs_consts_b[idx] ? "TRUE" : "FALSE");
idx, state->vs_consts_b[idx] ? "TRUE" : "FALSE");
stateblock->state.vs_consts_b[idx] = src_state->vs_consts_b[idx];
stateblock->stateblock_state.vs_consts_b[idx] = state->vs_consts_b[idx];
}
/* Pixel shader float constants. */
......@@ -1020,8 +1020,9 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
}
for (i = 0; i < stateblock->num_contained_vs_consts_b; ++i)
{
state->vs_consts_b[i] = stateblock->stateblock_state.vs_consts_b[i];
wined3d_device_set_vs_consts_b(device, stateblock->contained_vs_consts_b[i],
1, &stateblock->state.vs_consts_b[stateblock->contained_vs_consts_b[i]]);
1, &stateblock->stateblock_state.vs_consts_b[stateblock->contained_vs_consts_b[i]]);
}
apply_lights(device, &stateblock->state);
......
......@@ -2973,6 +2973,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];
BOOL vs_consts_b[WINED3D_MAX_CONSTS_B];
};
struct wined3d_device
......
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