[PATCH v2 3/6] wined3d: Allow OpenGL index buffer objects to be suballocated from a larger BO.
Zebediah Figura
zfigura at codeweavers.com
Thu Nov 18 21:06:18 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 3868351a4b3..5767258973d 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -4909,10 +4909,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 *)wined3d_bo_gl(bo)->buffer_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