mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-16 05:16:27 +00:00
wined3d: Skip loading current index buffer if the draw is not indexed.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a281544bde
commit
b83b897b4a
|
@ -4225,7 +4225,7 @@ static void context_load_stream_output_buffers(struct wined3d_context *context,
|
|||
|
||||
/* Context activation is done by the caller. */
|
||||
static BOOL context_apply_draw_state(struct wined3d_context *context,
|
||||
const struct wined3d_device *device, const struct wined3d_state *state)
|
||||
const struct wined3d_device *device, const struct wined3d_state *state, BOOL indexed)
|
||||
{
|
||||
const struct wined3d_state_entry *state_table = context->state_table;
|
||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||
|
@ -4277,7 +4277,7 @@ static BOOL context_apply_draw_state(struct wined3d_context *context,
|
|||
if (isStateDirty(context, STATE_STREAMSRC))
|
||||
context_update_stream_info(context, state);
|
||||
}
|
||||
if (state->index_buffer)
|
||||
if (indexed && state->index_buffer)
|
||||
{
|
||||
if (context->stream_info.all_vbo)
|
||||
wined3d_buffer_load(state->index_buffer, context, state);
|
||||
|
@ -5194,7 +5194,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
|||
if (parameters->indirect)
|
||||
wined3d_buffer_load(parameters->u.indirect.buffer, context, state);
|
||||
|
||||
if (!context_apply_draw_state(context, device, state))
|
||||
if (!context_apply_draw_state(context, device, state, parameters->indexed))
|
||||
{
|
||||
context_release(context);
|
||||
WARN("Unable to apply draw state, skipping draw.\n");
|
||||
|
|
Loading…
Reference in a new issue