Commit b83b897b authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Skip loading current index buffer if the draw is not indexed.

parent a281544b
...@@ -4225,7 +4225,7 @@ static void context_load_stream_output_buffers(struct wined3d_context *context, ...@@ -4225,7 +4225,7 @@ static void context_load_stream_output_buffers(struct wined3d_context *context,
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static BOOL context_apply_draw_state(struct wined3d_context *context, 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; const struct wined3d_state_entry *state_table = context->state_table;
struct wined3d_context_gl *context_gl = wined3d_context_gl(context); struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
...@@ -4277,7 +4277,7 @@ static BOOL context_apply_draw_state(struct wined3d_context *context, ...@@ -4277,7 +4277,7 @@ static BOOL context_apply_draw_state(struct wined3d_context *context,
if (isStateDirty(context, STATE_STREAMSRC)) if (isStateDirty(context, STATE_STREAMSRC))
context_update_stream_info(context, state); context_update_stream_info(context, state);
} }
if (state->index_buffer) if (indexed && state->index_buffer)
{ {
if (context->stream_info.all_vbo) if (context->stream_info.all_vbo)
wined3d_buffer_load(state->index_buffer, context, state); wined3d_buffer_load(state->index_buffer, context, state);
...@@ -5194,7 +5194,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s ...@@ -5194,7 +5194,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
if (parameters->indirect) if (parameters->indirect)
wined3d_buffer_load(parameters->u.indirect.buffer, context, state); 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); context_release(context);
WARN("Unable to apply draw state, skipping draw.\n"); WARN("Unable to apply draw state, skipping draw.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment