Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
Some refactoring in preparation for the d3d11 state swap implementation using dynamically created wined3d_state objects.
dlls/wined3d/device.c | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 1fd5f4b012e..ad20d882cf5 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1447,11 +1447,11 @@ static void wined3d_device_set_transform(struct wined3d_device *device, }
static void wined3d_device_get_transform(const struct wined3d_device *device, - enum wined3d_transform_state state, struct wined3d_matrix *matrix) + enum wined3d_transform_state transform_state, struct wined3d_matrix *matrix) { - TRACE("device %p, state %s, matrix %p.\n", device, debug_d3dtstype(state), matrix); + TRACE("device %p, transform_state %s, matrix %p.\n", device, debug_d3dtstype(transform_state), matrix);
- *matrix = device->state.transforms[state]; + *matrix = device->state.transforms[transform_state]; }
/* Note lights are real special cases. Although the device caps state only @@ -1775,21 +1775,21 @@ struct wined3d_blend_state * CDECL wined3d_device_get_blend_state(const struct w }
void CDECL wined3d_device_set_depth_stencil_state(struct wined3d_device *device, - struct wined3d_depth_stencil_state *state, unsigned int stencil_ref) + struct wined3d_depth_stencil_state *depth_stencil_state, unsigned int stencil_ref) { struct wined3d_depth_stencil_state *prev;
- TRACE("device %p, state %p, stencil_ref %u.\n", device, state, stencil_ref); + TRACE("device %p, depth_stencil_state %p, stencil_ref %u.\n", device, depth_stencil_state, stencil_ref);
prev = device->state.depth_stencil_state; - if (prev == state && device->state.stencil_ref == stencil_ref) + if (prev == depth_stencil_state && device->state.stencil_ref == stencil_ref) return;
- if (state) - wined3d_depth_stencil_state_incref(state); - device->state.depth_stencil_state = state; + if (depth_stencil_state) + wined3d_depth_stencil_state_incref(depth_stencil_state); + device->state.depth_stencil_state = depth_stencil_state; device->state.stencil_ref = stencil_ref; - wined3d_cs_emit_set_depth_stencil_state(device->cs, state, stencil_ref); + wined3d_cs_emit_set_depth_stencil_state(device->cs, depth_stencil_state, stencil_ref); if (prev) wined3d_depth_stencil_state_decref(prev); } @@ -1829,52 +1829,52 @@ struct wined3d_rasterizer_state * CDECL wined3d_device_get_rasterizer_state(stru }
void CDECL wined3d_device_set_render_state(struct wined3d_device *device, - enum wined3d_render_state state, DWORD value) + enum wined3d_render_state render_state, DWORD value) { - TRACE("device %p, state %s (%#x), value %#x.\n", device, debug_d3drenderstate(state), state, value); + TRACE("device %p, render_state %s (%#x), value %#x.\n", device, debug_d3drenderstate(render_state), render_state, value);
- if (state > WINEHIGHEST_RENDER_STATE) + if (render_state > WINEHIGHEST_RENDER_STATE) { - WARN("Unhandled render state %#x.\n", state); + WARN("Unhandled render state %#x.\n", render_state); return; }
- if (value == device->state.render_states[state]) + if (value == device->state.render_states[render_state]) TRACE("Application is setting the old value over, nothing to do.\n"); else { - device->state.render_states[state] = value; - wined3d_cs_emit_set_render_state(device->cs, state, value); + device->state.render_states[render_state] = value; + wined3d_cs_emit_set_render_state(device->cs, render_state, value); }
- if (state == WINED3D_RS_POINTSIZE && value == WINED3D_RESZ_CODE) + if (render_state == WINED3D_RS_POINTSIZE && value == WINED3D_RESZ_CODE) { TRACE("RESZ multisampled depth buffer resolve triggered.\n"); resolve_depth_buffer(device); } }
-DWORD CDECL wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state) +DWORD CDECL wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state render_state) { - TRACE("device %p, state %s (%#x).\n", device, debug_d3drenderstate(state), state); + TRACE("device %p, render_state %s (%#x).\n", device, debug_d3drenderstate(render_state), render_state);
- return device->state.render_states[state]; + return device->state.render_states[render_state]; }
static void wined3d_device_set_sampler_state(struct wined3d_device *device, - UINT sampler_idx, enum wined3d_sampler_state state, DWORD value) + UINT sampler_idx, enum wined3d_sampler_state sampler_state, DWORD value) { - TRACE("device %p, sampler_idx %u, state %s, value %#x.\n", - device, sampler_idx, debug_d3dsamplerstate(state), value); + TRACE("device %p, sampler_idx %u, sampler_state %s, value %#x.\n", + device, sampler_idx, debug_d3dsamplerstate(sampler_state), value);
- if (value == device->state.sampler_states[sampler_idx][state]) + if (value == device->state.sampler_states[sampler_idx][sampler_state]) { TRACE("Application is setting the old value over, nothing to do.\n"); return; }
- device->state.sampler_states[sampler_idx][state] = value; - wined3d_cs_emit_set_sampler_state(device->cs, sampler_idx, state, value); + device->state.sampler_states[sampler_idx][sampler_state] = value; + wined3d_cs_emit_set_sampler_state(device->cs, sampler_idx, sampler_state, value); }
void CDECL wined3d_device_set_scissor_rects(struct wined3d_device *device, unsigned int rect_count, @@ -3529,12 +3529,12 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, }
static void wined3d_device_set_texture_stage_state(struct wined3d_device *device, - UINT stage, enum wined3d_texture_stage_state state, DWORD value) + UINT stage, enum wined3d_texture_stage_state texture_state, DWORD value) { const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
- TRACE("device %p, stage %u, state %s, value %#x.\n", - device, stage, debug_d3dtexturestate(state), value); + TRACE("device %p, stage %u, texture_state %s, value %#x.\n", + device, stage, debug_d3dtexturestate(texture_state), value);
if (stage >= d3d_info->limits.ffp_blend_stages) { @@ -3543,15 +3543,15 @@ static void wined3d_device_set_texture_stage_state(struct wined3d_device *device return; }
- if (value == device->state.texture_states[stage][state]) + if (value == device->state.texture_states[stage][texture_state]) { TRACE("Application is setting the old value over, nothing to do.\n"); return; }
- device->state.texture_states[stage][state] = value; + device->state.texture_states[stage][texture_state] = value;
- wined3d_cs_emit_set_texture_state(device->cs, stage, state, value); + wined3d_cs_emit_set_texture_state(device->cs, stage, texture_state, value); }
static void wined3d_device_set_texture(struct wined3d_device *device,