Matteo Bruni : wined3d: Skip loading current index buffer if the draw is not indexed.
Alexandre Julliard
julliard at winehq.org
Thu Mar 26 16:27:24 CDT 2020
Module: wine
Branch: master
Commit: b83b897b4a2f96be7446a7b8ac6678b1559e9386
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b83b897b4a2f96be7446a7b8ac6678b1559e9386
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Thu Mar 26 13:26:00 2020 +0100
wined3d: Skip loading current index buffer if the draw is not indexed.
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/context.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index c6a1d76267..2e363fb1d6 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -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");
More information about the wine-cvs
mailing list