wined3d: Store the material 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:
Zebediah Figura 2019-02-05 23:01:06 -06:00 committed by Alexandre Julliard
parent e78bb5529e
commit 88d017aa7d
3 changed files with 15 additions and 7 deletions

View File

@ -1831,11 +1831,14 @@ void CDECL wined3d_device_set_material(struct wined3d_device *device, const stru
{
TRACE("device %p, material %p.\n", device, material);
device->update_state->material = *material;
device->update_stateblock_state->material = *material;
if (device->recording)
{
device->recording->changed.material = TRUE;
else
return;
}
device->state.material = *material;
wined3d_cs_emit_set_material(device->cs, material);
}

View File

@ -822,11 +822,12 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
}
if (stateblock->changed.material
&& memcmp(&src_state->material, &stateblock->state.material, sizeof(stateblock->state.material)))
&& memcmp(&state->material, &stateblock->stateblock_state.material,
sizeof(stateblock->stateblock_state.material)))
{
TRACE("Updating material.\n");
stateblock->state.material = src_state->material;
stateblock->stateblock_state.material = state->material;
}
assert(src_state->viewport_count <= 1);
@ -1127,7 +1128,10 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
wined3d_device_set_vertex_declaration(device, stateblock->state.vertex_declaration);
if (stateblock->changed.material)
wined3d_device_set_material(device, &stateblock->state.material);
{
state->material = stateblock->stateblock_state.material;
wined3d_device_set_material(device, &stateblock->stateblock_state.material);
}
if (stateblock->changed.viewport)
wined3d_device_set_viewports(device, stateblock->state.viewport_count, stateblock->state.viewports);

View File

@ -2988,6 +2988,7 @@ struct wined3d_stateblock_state
struct wined3d_matrix transforms[HIGHEST_TRANSFORMSTATE + 1];
struct wined3d_vec4 clip_planes[MAX_CLIP_DISTANCES];
struct wined3d_material material;
};
struct wined3d_device