Module: wine Branch: master Commit: 33d6900b35f510d17d6d5b1dc0936e7cc7136d73 URL: https://gitlab.winehq.org/wine/wine/-/commit/33d6900b35f510d17d6d5b1dc0936e7...
Author: Zebediah Figura zfigura@codeweavers.com Date: Tue Dec 13 20:42:33 2022 -0600
wined3d: Always bind to GL_ELEMENT_ARRAY_BUFFER if the bind flags include WINED3D_BIND_INDEX_BUFFER.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53623
---
dlls/wined3d/buffer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 2f6c52ef36f..fa24f006872 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -141,7 +141,11 @@ GLenum wined3d_buffer_gl_binding_from_bind_flags(const struct wined3d_gl_info *g if (!bind_flags) return GL_PIXEL_UNPACK_BUFFER;
- if (bind_flags == WINED3D_BIND_INDEX_BUFFER) + /* We must always return GL_ELEMENT_ARRAY_BUFFER here; + * wined3d_device_gl_create_bo() checks the GL binding to see whether we + * can suballocate, and we cannot suballocate if this BO might be used for + * an index buffer. */ + if (bind_flags & WINED3D_BIND_INDEX_BUFFER) return GL_ELEMENT_ARRAY_BUFFER;
if (bind_flags & (WINED3D_BIND_SHADER_RESOURCE | WINED3D_BIND_UNORDERED_ACCESS)