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

wined3d: Introduce wined3d_stateblock_set_texture().

parent 6c51a93b
......@@ -1486,6 +1486,28 @@ void CDECL wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock
stateblock->changed.textureState[stage] |= 1u << state;
}
void CDECL wined3d_stateblock_set_texture(struct wined3d_stateblock *stateblock,
UINT stage, struct wined3d_texture *texture)
{
TRACE("stateblock %p, stage %u, texture %p.\n", stateblock, stage, texture);
if (stage >= WINED3DVERTEXTEXTURESAMPLER0 && stage <= WINED3DVERTEXTEXTURESAMPLER3)
stage -= (WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS);
if (stage >= ARRAY_SIZE(stateblock->stateblock_state.textures))
{
WARN("Ignoring invalid stage %u.\n", stage);
return;
}
if (texture)
wined3d_texture_incref(texture);
if (stateblock->stateblock_state.textures[stage])
wined3d_texture_decref(stateblock->stateblock_state.textures[stage]);
stateblock->stateblock_state.textures[stage] = texture;
stateblock->changed.textures |= 1u << stage;
}
static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info)
{
union
......
......@@ -266,6 +266,7 @@
@ 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_texture(ptr long ptr)
@ cdecl wined3d_stateblock_set_texture_stage_state(ptr long long long)
@ cdecl wined3d_stateblock_set_vertex_declaration(ptr ptr)
@ cdecl wined3d_stateblock_set_vertex_shader(ptr ptr)
......
......@@ -2674,6 +2674,7 @@ void __cdecl wined3d_stateblock_set_render_state(struct wined3d_stateblock *stat
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_texture(struct wined3d_stateblock *stateblock, UINT stage, struct wined3d_texture *texture);
void __cdecl wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock *stateblock,
UINT stage, enum wined3d_texture_stage_state state, DWORD value);
void __cdecl wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *stateblock,
......
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