Commit 09cafcc3 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Clamp the bound buffer range to the buffer size.

parent 95b96a4a
...@@ -4618,7 +4618,9 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state ...@@ -4618,7 +4618,9 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
buffer = buffer_state->buffer; buffer = buffer_state->buffer;
bo_gl = wined3d_bo_gl(buffer->buffer_object); bo_gl = wined3d_bo_gl(buffer->buffer_object);
GL_EXTCALL(glBindBufferRange(GL_UNIFORM_BUFFER, base + i, 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; buffer->bo_user.valid = true;
} }
checkGLcall("bind constant buffers"); checkGLcall("bind constant buffers");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment