wined3d: Introduce wined3d_stateblock_set_stream_source().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-11-11 19:55:58 -06:00 committed by Alexandre Julliard
parent e5708c23bb
commit fa4b0690a7
3 changed files with 30 additions and 0 deletions

View File

@ -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

View File

@ -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)

View File

@ -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);