Commit 50949c95 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

wined3d: Use a separate allocation for the device state.

parent 992117ac
...@@ -677,7 +677,7 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) ...@@ -677,7 +677,7 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
{ {
const struct wined3d_state *state = &cs->device->state; const struct wined3d_state *state = cs->device->state;
const struct wined3d_viewport *vp = &state->viewports[0]; const struct wined3d_viewport *vp = &state->viewports[0];
struct wined3d_rendertarget_view *view; struct wined3d_rendertarget_view *view;
struct wined3d_cs_clear *op; struct wined3d_cs_clear *op;
...@@ -886,7 +886,7 @@ static void acquire_compute_pipeline_resources(const struct wined3d_state *state ...@@ -886,7 +886,7 @@ static void acquire_compute_pipeline_resources(const struct wined3d_state *state
void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z)
{ {
const struct wined3d_state *state = &cs->device->state; const struct wined3d_state *state = cs->device->state;
struct wined3d_cs_dispatch *op; struct wined3d_cs_dispatch *op;
op = wined3d_cs_require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op = wined3d_cs_require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
...@@ -904,7 +904,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, ...@@ -904,7 +904,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
void wined3d_cs_emit_dispatch_indirect(struct wined3d_cs *cs, void wined3d_cs_emit_dispatch_indirect(struct wined3d_cs *cs,
struct wined3d_buffer *buffer, unsigned int offset) struct wined3d_buffer *buffer, unsigned int offset)
{ {
const struct wined3d_state *state = &cs->device->state; const struct wined3d_state *state = cs->device->state;
struct wined3d_cs_dispatch *op; struct wined3d_cs_dispatch *op;
op = wined3d_cs_require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op = wined3d_cs_require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
...@@ -1045,7 +1045,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, enum wined3d_primitive_type pri ...@@ -1045,7 +1045,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, enum wined3d_primitive_type pri
unsigned int index_count, unsigned int start_instance, unsigned int instance_count, bool indexed) unsigned int index_count, unsigned int start_instance, unsigned int instance_count, bool indexed)
{ {
const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info;
const struct wined3d_state *state = &cs->device->state; const struct wined3d_state *state = cs->device->state;
struct wined3d_cs_draw *op; struct wined3d_cs_draw *op;
op = wined3d_cs_require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op = wined3d_cs_require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
...@@ -1069,7 +1069,7 @@ void wined3d_cs_emit_draw_indirect(struct wined3d_cs *cs, enum wined3d_primitive ...@@ -1069,7 +1069,7 @@ void wined3d_cs_emit_draw_indirect(struct wined3d_cs *cs, enum wined3d_primitive
unsigned int patch_vertex_count, struct wined3d_buffer *buffer, unsigned int offset, bool indexed) unsigned int patch_vertex_count, struct wined3d_buffer *buffer, unsigned int offset, bool indexed)
{ {
const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info;
const struct wined3d_state *state = &cs->device->state; const struct wined3d_state *state = cs->device->state;
struct wined3d_cs_draw *op; struct wined3d_cs_draw *op;
op = wined3d_cs_require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op = wined3d_cs_require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
......
...@@ -1610,7 +1610,7 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) ...@@ -1610,7 +1610,7 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
wined3d_texture_gl(texture)->texture_srgb.base_level = ~0u; wined3d_texture_gl(texture)->texture_srgb.base_level = ~0u;
if (resource->bind_count) if (resource->bind_count)
wined3d_cs_emit_set_sampler_state(device->cs, texture->sampler, WINED3D_SAMP_MAX_MIP_LEVEL, wined3d_cs_emit_set_sampler_state(device->cs, texture->sampler, WINED3D_SAMP_MAX_MIP_LEVEL,
device->state.sampler_states[texture->sampler][WINED3D_SAMP_MAX_MIP_LEVEL]); device->state->sampler_states[texture->sampler][WINED3D_SAMP_MAX_MIP_LEVEL]);
} }
return old; return old;
......
...@@ -3776,7 +3776,7 @@ struct wined3d_device ...@@ -3776,7 +3776,7 @@ struct wined3d_device
enum wined3d_feature_level feature_level; enum wined3d_feature_level feature_level;
struct wined3d_state state; struct wined3d_state *state;
/* Internal use fields */ /* Internal use fields */
struct wined3d_device_creation_parameters create_parms; struct wined3d_device_creation_parameters create_parms;
......
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