From 6c6fcff96e5a1188816658871974f1aaaa575955 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 18 Nov 2021 21:06:18 -0600 Subject: [PATCH] wined3d: Allow OpenGL index buffer objects to be suballocated from a larger BO. Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- 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)