From: Zebediah Figura zfigura@codeweavers.com
--- dlls/wined3d/stateblock.c | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 2dfc53a8359..3cd7077eab2 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -2398,30 +2398,22 @@ static void wined3d_device_set_light_enable(struct wined3d_device *device, unsig wined3d_device_context_emit_set_light_enable(&device->cs->c, light_idx, enable); }
-static HRESULT wined3d_device_set_clip_plane(struct wined3d_device *device, +static void wined3d_device_set_clip_plane(struct wined3d_device *device, unsigned int plane_idx, const struct wined3d_vec4 *plane) { struct wined3d_vec4 *clip_planes = device->cs->c.state->clip_planes;
TRACE("device %p, plane_idx %u, plane %p.\n", device, plane_idx, plane);
- if (plane_idx >= device->adapter->d3d_info.limits.max_clip_distances) - { - TRACE("Application has requested clipplane this device doesn't support.\n"); - return WINED3DERR_INVALIDCALL; - } - if (!memcmp(&clip_planes[plane_idx], plane, sizeof(*plane))) { TRACE("Application is setting old values over, nothing to do.\n"); - return WINED3D_OK; + return; }
clip_planes[plane_idx] = *plane;
wined3d_device_context_emit_set_clip_plane(&device->cs->c, plane_idx, plane); - - return WINED3D_OK; }
static void resolve_depth_buffer(struct wined3d_device *device) @@ -2446,12 +2438,6 @@ static void resolve_depth_buffer(struct wined3d_device *device) static void wined3d_device_set_render_state(struct wined3d_device *device, enum wined3d_render_state state, unsigned int value) { - if (state > WINEHIGHEST_RENDER_STATE) - { - WARN("Unhandled render state %#x.\n", state); - return; - } - if (value == device->cs->c.state->render_states[state]) { TRACE("Application is setting the old value over, nothing to do.\n"); @@ -2472,18 +2458,9 @@ static void wined3d_device_set_render_state(struct wined3d_device *device, static void wined3d_device_set_texture_stage_state(struct wined3d_device *device, unsigned int stage, enum wined3d_texture_stage_state state, uint32_t 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);
- if (stage >= d3d_info->limits.ffp_blend_stages) - { - WARN("Attempting to set stage %u which is higher than the max stage %u, ignoring.\n", - stage, d3d_info->limits.ffp_blend_stages - 1); - return; - } - if (value == device->cs->c.state->texture_states[stage][state]) { TRACE("Application is setting the old value over, nothing to do.\n"); @@ -2519,12 +2496,6 @@ static void wined3d_device_set_texture(struct wined3d_device *device,
TRACE("device %p, stage %u, texture %p.\n", device, stage, texture);
- if (stage >= ARRAY_SIZE(state->textures)) - { - WARN("Ignoring invalid stage %u.\n", stage); - return; - } - prev = state->textures[stage]; TRACE("Previous texture %p.\n", prev);
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/wined3d/stateblock.c | 4 ++-- dlls/wined3d/wined3d_private.h | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 3cd7077eab2..b263bbb8fda 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -489,7 +489,7 @@ void state_unbind_resources(struct wined3d_state *state) } }
-void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state) +static void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state) { struct wined3d_light_info *light, *cursor; struct wined3d_vertex_declaration *decl; @@ -2065,7 +2065,7 @@ static void stateblock_state_init_default(struct wined3d_stateblock_state *state state->streams[i].frequency = 1; }
-void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state, +static void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state, const struct wined3d_device *device, uint32_t flags) { rb_init(&state->light_state->lights_tree, lights_compare); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 09f078344c8..c89bd191255 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3608,10 +3608,6 @@ struct wined3d_stateblock unsigned int num_contained_sampler_states; };
-void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state, - const struct wined3d_device *device, uint32_t flags) DECLSPEC_HIDDEN; -void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state) DECLSPEC_HIDDEN; - bool wined3d_light_state_enable_light(struct wined3d_light_state *state, const struct wined3d_d3d_info *d3d_info, struct wined3d_light_info *light_info, BOOL enable) DECLSPEC_HIDDEN; struct wined3d_light_info *wined3d_light_state_get_light(const struct wined3d_light_state *state,
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/wined3d/stateblock.c | 57 ++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 59 ---------------------------------- 2 files changed, 57 insertions(+), 59 deletions(-)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index b263bbb8fda..c8d62ad9f85 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -28,6 +28,63 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DECLARE_DEBUG_CHANNEL(winediag);
+struct wined3d_saved_states +{ + uint32_t vs_consts_f[WINED3D_BITMAP_SIZE(WINED3D_MAX_VS_CONSTS_F)]; + uint16_t vertexShaderConstantsI; /* WINED3D_MAX_CONSTS_I, 16 */ + uint16_t vertexShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */ + uint32_t ps_consts_f[WINED3D_BITMAP_SIZE(WINED3D_MAX_PS_CONSTS_F)]; + uint16_t pixelShaderConstantsI; /* WINED3D_MAX_CONSTS_I, 16 */ + uint16_t pixelShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */ + uint32_t transform[WINED3D_BITMAP_SIZE(WINED3D_HIGHEST_TRANSFORM_STATE + 1)]; + uint16_t streamSource; /* WINED3D_MAX_STREAMS, 16 */ + uint16_t streamFreq; /* WINED3D_MAX_STREAMS, 16 */ + uint32_t renderState[WINED3D_BITMAP_SIZE(WINEHIGHEST_RENDER_STATE + 1)]; + uint32_t textureState[WINED3D_MAX_TEXTURES]; /* WINED3D_HIGHEST_TEXTURE_STATE + 1, 18 */ + uint16_t samplerState[WINED3D_MAX_COMBINED_SAMPLERS]; /* WINED3D_HIGHEST_SAMPLER_STATE + 1, 14 */ + uint32_t clipplane; /* WINED3D_MAX_CLIP_DISTANCES, 8 */ + uint32_t textures : 20; /* WINED3D_MAX_COMBINED_SAMPLERS, 20 */ + uint32_t indices : 1; + uint32_t material : 1; + uint32_t viewport : 1; + uint32_t vertexDecl : 1; + uint32_t pixelShader : 1; + uint32_t vertexShader : 1; + uint32_t scissorRect : 1; + uint32_t store_stream_offset : 1; + uint32_t alpha_to_coverage : 1; + uint32_t lights : 1; + uint32_t transforms : 1; + uint32_t padding : 1; + + struct list changed_lights; +}; + +struct stage_state +{ + unsigned int stage, state; +}; + +struct wined3d_stateblock +{ + LONG ref; + struct wined3d_device *device; + + struct wined3d_saved_states changed; + + struct wined3d_stateblock_state stateblock_state; + struct wined3d_light_state light_state; + + unsigned int contained_render_states[WINEHIGHEST_RENDER_STATE + 1]; + unsigned int num_contained_render_states; + unsigned int contained_transform_states[WINED3D_HIGHEST_TRANSFORM_STATE + 1]; + unsigned int num_contained_transform_states; + struct stage_state contained_tss_states[WINED3D_MAX_TEXTURES * (WINED3D_HIGHEST_TEXTURE_STATE + 1)]; + unsigned int num_contained_tss_states; + struct stage_state contained_sampler_states[WINED3D_MAX_COMBINED_SAMPLERS * WINED3D_HIGHEST_SAMPLER_STATE]; + unsigned int num_contained_sampler_states; +}; + static const DWORD pixel_states_render[] = { WINED3D_RS_ALPHABLENDENABLE, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c89bd191255..0b92ae52e64 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3549,65 +3549,6 @@ struct wined3d_vertex_declaration BOOL position_transformed; };
-struct wined3d_saved_states -{ - uint32_t vs_consts_f[WINED3D_BITMAP_SIZE(WINED3D_MAX_VS_CONSTS_F)]; - WORD vertexShaderConstantsI; /* WINED3D_MAX_CONSTS_I, 16 */ - WORD vertexShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */ - uint32_t ps_consts_f[WINED3D_BITMAP_SIZE(WINED3D_MAX_PS_CONSTS_F)]; - WORD pixelShaderConstantsI; /* WINED3D_MAX_CONSTS_I, 16 */ - WORD pixelShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */ - uint32_t transform[WINED3D_BITMAP_SIZE(WINED3D_HIGHEST_TRANSFORM_STATE + 1)]; - WORD streamSource; /* WINED3D_MAX_STREAMS, 16 */ - WORD streamFreq; /* WINED3D_MAX_STREAMS, 16 */ - uint32_t renderState[WINED3D_BITMAP_SIZE(WINEHIGHEST_RENDER_STATE + 1)]; - DWORD textureState[WINED3D_MAX_TEXTURES]; /* WINED3D_HIGHEST_TEXTURE_STATE + 1, 18 */ - WORD samplerState[WINED3D_MAX_COMBINED_SAMPLERS]; /* WINED3D_HIGHEST_SAMPLER_STATE + 1, 14 */ - DWORD clipplane; /* WINED3D_MAX_CLIP_DISTANCES, 8 */ - DWORD textures : 20; /* WINED3D_MAX_COMBINED_SAMPLERS, 20 */ - DWORD indices : 1; - DWORD material : 1; - DWORD viewport : 1; - DWORD vertexDecl : 1; - DWORD pixelShader : 1; - DWORD vertexShader : 1; - DWORD scissorRect : 1; - DWORD store_stream_offset : 1; - DWORD alpha_to_coverage : 1; - DWORD lights : 1; - DWORD transforms : 1; - DWORD padding : 1; - - struct list changed_lights; -}; - -struct StageState { - DWORD stage; - DWORD state; -}; - -struct wined3d_stateblock -{ - LONG ref; /* Note: Ref counting not required */ - struct wined3d_device *device; - - /* Array indicating whether things have been set or changed */ - struct wined3d_saved_states changed; - - struct wined3d_stateblock_state stateblock_state; - struct wined3d_light_state light_state; - - /* Contained state management */ - DWORD contained_render_states[WINEHIGHEST_RENDER_STATE + 1]; - unsigned int num_contained_render_states; - DWORD contained_transform_states[WINED3D_HIGHEST_TRANSFORM_STATE + 1]; - unsigned int num_contained_transform_states; - struct StageState contained_tss_states[WINED3D_MAX_TEXTURES * (WINED3D_HIGHEST_TEXTURE_STATE + 1)]; - unsigned int num_contained_tss_states; - struct StageState contained_sampler_states[WINED3D_MAX_COMBINED_SAMPLERS * WINED3D_HIGHEST_SAMPLER_STATE]; - unsigned int num_contained_sampler_states; -}; - bool wined3d_light_state_enable_light(struct wined3d_light_state *state, const struct wined3d_d3d_info *d3d_info, struct wined3d_light_info *light_info, BOOL enable) DECLSPEC_HIDDEN; struct wined3d_light_info *wined3d_light_state_get_light(const struct wined3d_light_state *state,