Zebediah Figura : wined3d: Introduce wined3d_stateblock_set_texture().
Alexandre Julliard
julliard at winehq.org
Mon Oct 28 16:43:36 CDT 2019
Module: wine
Branch: master
Commit: e43d91f85f3a959878e98ac76babfda87d1bdf21
URL: https://source.winehq.org/git/wine.git/?a=commit;h=e43d91f85f3a959878e98ac76babfda87d1bdf21
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Thu Oct 24 13:43:07 2019 -0500
wined3d: Introduce wined3d_stateblock_set_texture().
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/stateblock.c | 22 ++++++++++++++++++++++
dlls/wined3d/wined3d.spec | 1 +
include/wine/wined3d.h | 1 +
3 files changed, 24 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 870d916345..fe49fd6754 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -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
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 6fba7b5661..d0ba31bf4e 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -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)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index e328386d6f..a567cfd2f1 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -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,
More information about the wine-cvs
mailing list