From: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/context_gl.c | 7 ++++++- dlls/wined3d/wined3d_private.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index cec698d7a6b..3868351a4b3 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -2922,6 +2922,7 @@ bool wined3d_context_gl_create_bo(struct wined3d_context_gl *context_gl, GLsizei list_init(&bo->b.users); bo->command_fence_id = 0; bo->b.memory_offset = 0; + bo->buffer_offset = 0; bo->b.map_ptr = NULL;
return true; @@ -5070,7 +5071,11 @@ void wined3d_context_gl_unload_tex_coords(const struct wined3d_context_gl *conte static const void *get_vertex_attrib_pointer(const struct wined3d_stream_info_element *element, const struct wined3d_state *state) { - return element->data.addr + state->load_base_vertex_index * element->stride; + const uint8_t *offset = element->data.addr + state->load_base_vertex_index * element->stride; + + if (element->data.buffer_object) + offset += wined3d_bo_gl(element->data.buffer_object)->buffer_offset; + return offset; }
void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context_gl, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 90824d83290..79b02c2448d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1606,6 +1606,7 @@ struct wined3d_bo_gl struct wined3d_bo b;
GLuint id; + GLsizeiptr buffer_offset; GLsizeiptr size; GLenum binding; GLenum usage;