Zebediah Figura : wined3d: Introduce wined3d_stateblock_set_stream_source().
Alexandre Julliard
julliard at winehq.org
Wed Nov 13 16:01:11 CST 2019
Module: wine
Branch: master
Commit: fa4b0690a7cc6598ccc61e23a5bb1d7b343cb31b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=fa4b0690a7cc6598ccc61e23a5bb1d7b343cb31b
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Mon Nov 11 19:55:58 2019 -0600
wined3d: Introduce wined3d_stateblock_set_stream_source().
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 | 27 +++++++++++++++++++++++++++
dlls/wined3d/wined3d.spec | 1 +
include/wine/wined3d.h | 2 ++
3 files changed, 30 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index f8724da967..dd3a38cf0f 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1584,6 +1584,33 @@ void CDECL wined3d_stateblock_set_base_vertex_index(struct wined3d_stateblock *s
stateblock->stateblock_state.base_vertex_index = base_index;
}
+HRESULT CDECL wined3d_stateblock_set_stream_source(struct wined3d_stateblock *stateblock,
+ UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride)
+{
+ struct wined3d_stream_state *stream;
+
+ TRACE("stateblock %p, stream_idx %u, buffer %p, stride %u.\n",
+ stateblock, stream_idx, buffer, stride);
+
+ if (stream_idx >= WINED3D_MAX_STREAMS)
+ {
+ WARN("Stream index %u out of range.\n", stream_idx);
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ stream = &stateblock->stateblock_state.streams[stream_idx];
+
+ if (buffer)
+ wined3d_buffer_incref(buffer);
+ if (stream->buffer)
+ wined3d_buffer_decref(stream->buffer);
+ stream->buffer = buffer;
+ stream->stride = stride;
+ stream->offset = offset;
+ stateblock->changed.streamSource |= 1u << stream_idx;
+ return WINED3D_OK;
+}
+
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 8a9c9858e9..5ff7ab1d0c 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -275,6 +275,7 @@
@ cdecl wined3d_stateblock_set_render_state(ptr long long)
@ cdecl wined3d_stateblock_set_sampler_state(ptr long long long)
@ cdecl wined3d_stateblock_set_scissor_rect(ptr ptr)
+@ cdecl wined3d_stateblock_set_stream_source(ptr long ptr 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_transform(ptr long ptr)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 10e2ae70eb..b31e9573aa 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2688,6 +2688,8 @@ void __cdecl wined3d_stateblock_set_render_state(struct wined3d_stateblock *stat
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_scissor_rect(struct wined3d_stateblock *stateblock, const RECT *rect);
+HRESULT __cdecl wined3d_stateblock_set_stream_source(struct wined3d_stateblock *stateblock,
+ UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride);
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);
More information about the wine-cvs
mailing list