Henri Verbeet : wined3d: Respect the BO buffer offset in wined3d_context_gl_copy_bo_address().
Alexandre Julliard
julliard at winehq.org
Wed Nov 24 15:17:17 CST 2021
Module: wine
Branch: master
Commit: 0e501c00c496b246e81c2a0a7817c4390610210b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0e501c00c496b246e81c2a0a7817c4390610210b
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Tue Nov 23 21:17:07 2021 -0600
wined3d: Respect the BO buffer offset in wined3d_context_gl_copy_bo_address().
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/context_gl.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index b327b7bba8e..3c57bcbe249 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -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_WRITE_BUFFER, dst_bo->id));
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");
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)
{
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");
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)
{
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");
wined3d_context_gl_reference_bo(context_gl, dst_bo);
More information about the wine-cvs
mailing list