[PATCH 3/5] wined3d: Introduce wined3d_stateblock_set_texture_stage_state().
Zebediah Figura
z.figura12 at gmail.com
Sat Oct 19 12:23:58 CDT 2019
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/wined3d/stateblock.c | 23 +++++++++++++++++++++++
dlls/wined3d/wined3d.spec | 1 +
include/wine/wined3d.h | 2 ++
3 files changed, 26 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 70724f0545..1965a4303f 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1462,6 +1462,29 @@ void CDECL wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *state
stateblock->changed.samplerState[sampler_idx] |= 1u << state;
}
+void CDECL wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock *stateblock,
+ UINT stage, enum wined3d_texture_stage_state state, DWORD value)
+{
+ TRACE("stateblock %p, stage %u, state %s, value %#x.\n",
+ stateblock, stage, debug_d3dtexturestate(state), value);
+
+ if (state > WINED3D_HIGHEST_TEXTURE_STATE)
+ {
+ WARN("Invalid state %#x passed.\n", state);
+ return;
+ }
+
+ if (stage > WINED3D_MAX_TEXTURES)
+ {
+ WARN("Attempting to set stage %u which is higher than the max stage %u, ignoring.\n",
+ stage, WINED3D_MAX_TEXTURES);
+ return;
+ }
+
+ stateblock->stateblock_state.texture_states[stage][state] = value;
+ stateblock->changed.textureState[stage] |= 1u << state;
+}
+
static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info)
{
union
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index bf6b786704..2df6c510b1 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -265,6 +265,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_stage_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)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 2fd16958d5..57f5775409 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2673,6 +2673,8 @@ 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_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,
struct wined3d_vertex_declaration *declaration);
void __cdecl wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader);
--
2.20.1
More information about the wine-devel
mailing list