mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 06:30:46 +00:00
wined3d: Introduce wined3d_device_context_set_index_buffer().
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:
parent
37e1780408
commit
b21a9e41be
|
@ -1536,29 +1536,10 @@ static void wined3d_device_set_material(struct wined3d_device *device, const str
|
||||||
void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
|
void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
|
||||||
struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset)
|
struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset)
|
||||||
{
|
{
|
||||||
struct wined3d_state *state = device->cs->c.state;
|
|
||||||
enum wined3d_format_id prev_format;
|
|
||||||
struct wined3d_buffer *prev_buffer;
|
|
||||||
unsigned int prev_offset;
|
|
||||||
|
|
||||||
TRACE("device %p, buffer %p, format %s, offset %u.\n",
|
TRACE("device %p, buffer %p, format %s, offset %u.\n",
|
||||||
device, buffer, debug_d3dformat(format_id), offset);
|
device, buffer, debug_d3dformat(format_id), offset);
|
||||||
|
|
||||||
prev_buffer = state->index_buffer;
|
wined3d_device_context_set_index_buffer(&device->cs->c, buffer, format_id, offset);
|
||||||
prev_format = state->index_format;
|
|
||||||
prev_offset = state->index_offset;
|
|
||||||
|
|
||||||
if (prev_buffer == buffer && prev_format == format_id && prev_offset == offset)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (buffer)
|
|
||||||
wined3d_buffer_incref(buffer);
|
|
||||||
state->index_buffer = buffer;
|
|
||||||
state->index_format = format_id;
|
|
||||||
state->index_offset = offset;
|
|
||||||
wined3d_device_context_emit_set_index_buffer(&device->cs->c, buffer, format_id, offset);
|
|
||||||
if (prev_buffer)
|
|
||||||
wined3d_buffer_decref(prev_buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wined3d_buffer * CDECL wined3d_device_get_index_buffer(const struct wined3d_device *device,
|
struct wined3d_buffer * CDECL wined3d_device_get_index_buffer(const struct wined3d_device *device,
|
||||||
|
@ -2372,6 +2353,34 @@ HRESULT CDECL wined3d_device_context_set_stream_source(struct wined3d_device_con
|
||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDECL wined3d_device_context_set_index_buffer(struct wined3d_device_context *context,
|
||||||
|
struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset)
|
||||||
|
{
|
||||||
|
struct wined3d_state *state = context->state;
|
||||||
|
enum wined3d_format_id prev_format;
|
||||||
|
struct wined3d_buffer *prev_buffer;
|
||||||
|
unsigned int prev_offset;
|
||||||
|
|
||||||
|
TRACE("context %p, buffer %p, format %s, offset %u.\n",
|
||||||
|
context, buffer, debug_d3dformat(format_id), offset);
|
||||||
|
|
||||||
|
prev_buffer = state->index_buffer;
|
||||||
|
prev_format = state->index_format;
|
||||||
|
prev_offset = state->index_offset;
|
||||||
|
|
||||||
|
if (prev_buffer == buffer && prev_format == format_id && prev_offset == offset)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (buffer)
|
||||||
|
wined3d_buffer_incref(buffer);
|
||||||
|
state->index_buffer = buffer;
|
||||||
|
state->index_format = format_id;
|
||||||
|
state->index_offset = offset;
|
||||||
|
wined3d_device_context_emit_set_index_buffer(context, buffer, format_id, offset);
|
||||||
|
if (prev_buffer)
|
||||||
|
wined3d_buffer_decref(prev_buffer);
|
||||||
|
}
|
||||||
|
|
||||||
void CDECL wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader)
|
void CDECL wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader)
|
||||||
{
|
{
|
||||||
TRACE("device %p, shader %p.\n", device, shader);
|
TRACE("device %p, shader %p.\n", device, shader);
|
||||||
|
|
|
@ -170,6 +170,7 @@
|
||||||
@ cdecl wined3d_device_context_set_constant_buffer(ptr long long ptr)
|
@ cdecl wined3d_device_context_set_constant_buffer(ptr long long ptr)
|
||||||
@ cdecl wined3d_device_context_set_depth_stencil_state(ptr ptr long)
|
@ cdecl wined3d_device_context_set_depth_stencil_state(ptr ptr long)
|
||||||
@ cdecl wined3d_device_context_set_depth_stencil_view(ptr ptr)
|
@ cdecl wined3d_device_context_set_depth_stencil_view(ptr ptr)
|
||||||
|
@ cdecl wined3d_device_context_set_index_buffer(ptr ptr long long)
|
||||||
@ cdecl wined3d_device_context_set_predication(ptr ptr long)
|
@ cdecl wined3d_device_context_set_predication(ptr ptr long)
|
||||||
@ cdecl wined3d_device_context_set_rasterizer_state(ptr ptr)
|
@ cdecl wined3d_device_context_set_rasterizer_state(ptr ptr)
|
||||||
@ cdecl wined3d_device_context_set_rendertarget_view(ptr long ptr long)
|
@ cdecl wined3d_device_context_set_rendertarget_view(ptr long ptr long)
|
||||||
|
|
|
@ -2563,6 +2563,8 @@ void __cdecl wined3d_device_context_set_depth_stencil_state(struct wined3d_devic
|
||||||
struct wined3d_depth_stencil_state *depth_stencil_state, unsigned int stencil_ref);
|
struct wined3d_depth_stencil_state *depth_stencil_state, unsigned int stencil_ref);
|
||||||
HRESULT __cdecl wined3d_device_context_set_depth_stencil_view(struct wined3d_device_context *context,
|
HRESULT __cdecl wined3d_device_context_set_depth_stencil_view(struct wined3d_device_context *context,
|
||||||
struct wined3d_rendertarget_view *view);
|
struct wined3d_rendertarget_view *view);
|
||||||
|
void __cdecl wined3d_device_context_set_index_buffer(struct wined3d_device_context *context,
|
||||||
|
struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset);
|
||||||
void __cdecl wined3d_device_context_set_predication(struct wined3d_device_context *context,
|
void __cdecl wined3d_device_context_set_predication(struct wined3d_device_context *context,
|
||||||
struct wined3d_query *predicate, BOOL value);
|
struct wined3d_query *predicate, BOOL value);
|
||||||
void __cdecl wined3d_device_context_set_rasterizer_state(struct wined3d_device_context *context,
|
void __cdecl wined3d_device_context_set_rasterizer_state(struct wined3d_device_context *context,
|
||||||
|
|
Loading…
Reference in a new issue