Commit bbb64e7e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Introduce wined3d_stateblock_set_sampler_state().

parent fabd07d5
......@@ -1443,6 +1443,25 @@ void CDECL wined3d_stateblock_set_blend_factor(struct wined3d_stateblock *stateb
stateblock->changed.blend_state = TRUE;
}
void CDECL wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *stateblock,
UINT sampler_idx, enum wined3d_sampler_state state, DWORD value)
{
TRACE("stateblock %p, sampler_idx %u, state %s, value %#x.\n",
stateblock, sampler_idx, debug_d3dsamplerstate(state), value);
if (sampler_idx >= WINED3DVERTEXTEXTURESAMPLER0 && sampler_idx <= WINED3DVERTEXTEXTURESAMPLER3)
sampler_idx -= (WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS);
if (sampler_idx >= ARRAY_SIZE(stateblock->stateblock_state.sampler_states))
{
WARN("Invalid sampler %u.\n", sampler_idx);
return;
}
stateblock->stateblock_state.sampler_states[sampler_idx][state] = value;
stateblock->changed.samplerState[sampler_idx] |= 1u << state;
}
static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info)
{
union
......
......@@ -264,6 +264,7 @@
@ cdecl wined3d_stateblock_set_ps_consts_f(ptr long long ptr)
@ cdecl wined3d_stateblock_set_ps_consts_i(ptr long long ptr)
@ cdecl wined3d_stateblock_set_render_state(ptr long long)
@ cdecl wined3d_stateblock_set_sampler_state(ptr long long long)
@ cdecl wined3d_stateblock_set_vertex_declaration(ptr ptr)
@ cdecl wined3d_stateblock_set_vertex_shader(ptr ptr)
@ cdecl wined3d_stateblock_set_vs_consts_b(ptr long long ptr)
......
......@@ -2671,6 +2671,8 @@ HRESULT __cdecl wined3d_stateblock_set_ps_consts_i(struct wined3d_stateblock *st
unsigned int start_idx, unsigned int count, const struct wined3d_ivec4 *constants);
void __cdecl wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateblock,
enum wined3d_render_state state, DWORD value);
void __cdecl wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *stateblock,
UINT sampler_idx, enum wined3d_sampler_state state, DWORD value);
void __cdecl wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *stateblock,
struct wined3d_vertex_declaration *declaration);
void __cdecl wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *stateblock, 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