Commit 88d017aa authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Store the material in the wined3d_stateblock_state structure.

parent e78bb552
......@@ -1831,12 +1831,15 @@ 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
wined3d_cs_emit_set_material(device->cs, material);
return;
}
device->state.material = *material;
wined3d_cs_emit_set_material(device->cs, material);
}
void CDECL wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material)
......
......@@ -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);
......
......@@ -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
......
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