Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53671
---
Unless the application sets something, we use WINED3D_MAX_CONSTANT_BUFFER_SIZE * sizeof(vec4).
https://registry.khronos.org/OpenGL-Refpages/gl4/html/glBindBufferRange.xhtm... says it is an error to set offset + size larger than the buffer size. I don't know why other drivers aren't rejecting our call.
From: Stefan Dösinger stefan@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53671
---
Unless the application sets something, we use WINED3D_MAX_CONSTANT_BUFFER_SIZE * sizeof(vec4).
https://registry.khronos.org/OpenGL-Refpages/gl4/html/glBindBufferRange.xhtm... says it is an error to set offset + size larger than the buffer size. I don't know why other drivers aren't rejecting our call. --- dlls/wined3d/state.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index eb25f01130e..a6d0b174e31 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4618,7 +4618,9 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state buffer = buffer_state->buffer; bo_gl = wined3d_bo_gl(buffer->buffer_object); GL_EXTCALL(glBindBufferRange(GL_UNIFORM_BUFFER, base + i, - bo_gl->id, bo_gl->b.buffer_offset + buffer_state->offset, buffer_state->size)); + bo_gl->id, bo_gl->b.buffer_offset + buffer_state->offset, + min(buffer_state->size, buffer->resource.size - buffer_state->offset))); + buffer->bo_user.valid = true; } checkGLcall("bind constant buffers");
This merge request was approved by Zebediah Figura.
This merge request was approved by Jan Sikorski.