Commit 41f521b5 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Introduce wined3d_device_context_set_depth_stencil_state().

parent a3102c7b
......@@ -1761,22 +1761,9 @@ 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 *depth_stencil_state, unsigned int stencil_ref)
{
struct wined3d_state *state = device->cs->c.state;
struct wined3d_depth_stencil_state *prev;
TRACE("device %p, depth_stencil_state %p, stencil_ref %u.\n", device, depth_stencil_state, stencil_ref);
prev = state->depth_stencil_state;
if (prev == depth_stencil_state && state->stencil_ref == stencil_ref)
return;
if (depth_stencil_state)
wined3d_depth_stencil_state_incref(depth_stencil_state);
state->depth_stencil_state = depth_stencil_state;
state->stencil_ref = stencil_ref;
wined3d_device_context_emit_set_depth_stencil_state(&device->cs->c, depth_stencil_state, stencil_ref);
if (prev)
wined3d_depth_stencil_state_decref(prev);
wined3d_device_context_set_depth_stencil_state(&device->cs->c, depth_stencil_state, stencil_ref);
}
struct wined3d_depth_stencil_state * CDECL wined3d_device_get_depth_stencil_state(const struct wined3d_device *device,
......@@ -2142,6 +2129,27 @@ void CDECL wined3d_device_context_set_blend_state(struct wined3d_device_context
wined3d_blend_state_decref(prev);
}
void CDECL wined3d_device_context_set_depth_stencil_state(struct wined3d_device_context *context,
struct wined3d_depth_stencil_state *depth_stencil_state, unsigned int stencil_ref)
{
struct wined3d_state *state = context->state;
struct wined3d_depth_stencil_state *prev;
TRACE("context %p, depth_stencil_state %p, stencil_ref %u.\n", context, depth_stencil_state, stencil_ref);
prev = state->depth_stencil_state;
if (prev == depth_stencil_state && state->stencil_ref == stencil_ref)
return;
if (depth_stencil_state)
wined3d_depth_stencil_state_incref(depth_stencil_state);
state->depth_stencil_state = depth_stencil_state;
state->stencil_ref = stencil_ref;
wined3d_device_context_emit_set_depth_stencil_state(context, depth_stencil_state, stencil_ref);
if (prev)
wined3d_depth_stencil_state_decref(prev);
}
void CDECL wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader)
{
TRACE("device %p, shader %p.\n", device, shader);
......
......@@ -169,6 +169,7 @@
@ cdecl wined3d_device_context_set_blend_state(ptr ptr ptr long)
@ cdecl wined3d_device_context_set_constant_buffer(ptr long long ptr)
@ cdecl wined3d_device_context_set_depth_stencil_state(ptr ptr long)
@ cdecl wined3d_device_context_set_shader(ptr long ptr)
@ cdecl wined3d_output_find_closest_matching_mode(ptr ptr)
......
......@@ -2553,6 +2553,8 @@ void __cdecl wined3d_device_context_set_blend_state(struct wined3d_device_contex
struct wined3d_blend_state *state, const struct wined3d_color *blend_factor, unsigned int sample_mask);
void __cdecl wined3d_device_context_set_constant_buffer(struct wined3d_device_context *context,
enum wined3d_shader_type type, unsigned int idx, struct wined3d_buffer *buffer);
void __cdecl wined3d_device_context_set_depth_stencil_state(struct wined3d_device_context *context,
struct wined3d_depth_stencil_state *depth_stencil_state, unsigned int stencil_ref);
void __cdecl wined3d_device_context_set_shader(struct wined3d_device_context *context,
enum wined3d_shader_type type, struct wined3d_shader *shader);
......
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