[PATCH 2/5] wined3d: Respect the BO memory offset for index buffers.
Zebediah Figura
zfigura at codeweavers.com
Wed Nov 17 18:09:29 CST 2021
From: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
dlls/wined3d/context_gl.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index d00c1ae2b0c..b1d5c1ff9ed 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -4935,10 +4935,12 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
if (parameters->indexed)
{
struct wined3d_buffer *index_buffer = state->index_buffer;
- if (!index_buffer->buffer_object || !stream_info->all_vbo)
+ struct wined3d_bo *bo = index_buffer->buffer_object;
+
+ if (!bo || !stream_info->all_vbo)
idx_data = index_buffer->resource.heap_memory;
else
- idx_data = NULL;
+ idx_data = (void *)bo->memory_offset;
idx_data = (const BYTE *)idx_data + state->index_offset;
if (state->index_format == WINED3DFMT_R16_UINT)
--
2.33.0
More information about the wine-devel
mailing list