wined3d: Respect the BO buffer offset in wined3d_context_gl_copy_bo_address().

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2021-11-23 21:17:07 -06:00 committed by Alexandre Julliard
parent bfbccf1a03
commit 0e501c00c4
1 changed files with 4 additions and 3 deletions

View File

@ -2828,7 +2828,8 @@ void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl,
GL_EXTCALL(glBindBuffer(GL_COPY_READ_BUFFER, src_bo->id)); GL_EXTCALL(glBindBuffer(GL_COPY_READ_BUFFER, src_bo->id));
GL_EXTCALL(glBindBuffer(GL_COPY_WRITE_BUFFER, dst_bo->id)); GL_EXTCALL(glBindBuffer(GL_COPY_WRITE_BUFFER, dst_bo->id));
GL_EXTCALL(glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, GL_EXTCALL(glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER,
(GLintptr)src->addr, (GLintptr)dst->addr, size)); src_bo->b.buffer_offset + (GLintptr)src->addr,
dst_bo->b.buffer_offset + (GLintptr)dst->addr, size));
checkGLcall("direct buffer copy"); checkGLcall("direct buffer copy");
wined3d_context_gl_reference_bo(context_gl, src_bo); wined3d_context_gl_reference_bo(context_gl, src_bo);
@ -2850,7 +2851,7 @@ void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl,
else if (!dst_bo && src_bo) else if (!dst_bo && src_bo)
{ {
wined3d_context_gl_bind_bo(context_gl, src_bo->binding, src_bo->id); wined3d_context_gl_bind_bo(context_gl, src_bo->binding, src_bo->id);
GL_EXTCALL(glGetBufferSubData(src_bo->binding, (GLintptr)src->addr, size, dst->addr)); GL_EXTCALL(glGetBufferSubData(src_bo->binding, src_bo->b.buffer_offset + (GLintptr)src->addr, size, dst->addr));
checkGLcall("buffer download"); checkGLcall("buffer download");
wined3d_context_gl_reference_bo(context_gl, src_bo); wined3d_context_gl_reference_bo(context_gl, src_bo);
@ -2858,7 +2859,7 @@ void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl,
else if (dst_bo && !src_bo) else if (dst_bo && !src_bo)
{ {
wined3d_context_gl_bind_bo(context_gl, dst_bo->binding, dst_bo->id); wined3d_context_gl_bind_bo(context_gl, dst_bo->binding, dst_bo->id);
GL_EXTCALL(glBufferSubData(dst_bo->binding, (GLintptr)dst->addr, size, src->addr)); GL_EXTCALL(glBufferSubData(dst_bo->binding, dst_bo->b.buffer_offset + (GLintptr)dst->addr, size, src->addr));
checkGLcall("buffer upload"); checkGLcall("buffer upload");
wined3d_context_gl_reference_bo(context_gl, dst_bo); wined3d_context_gl_reference_bo(context_gl, dst_bo);