wined3d: Always set GL_PIXEL_UNPACK_BUFFER binding before calling wined3d_texture_gl_upload_bo().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52116
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jan Sikorski 2021-11-29 11:34:19 +01:00 committed by Alexandre Julliard
parent 547492007e
commit d2ceed3904
1 changed files with 8 additions and 0 deletions

View File

@ -2532,6 +2532,9 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context,
src_mem = wined3d_context_gl_map_bo_address(context_gl, &bo, src_slice_pitch * update_d, WINED3D_MAP_READ);
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
checkGLcall("glBindBuffer");
for (z = 0; z < update_d; ++z, src_mem += src_slice_pitch)
{
if (decompress)
@ -2561,6 +2564,11 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context,
checkGLcall("glBindBuffer");
offset += bo.buffer_object->buffer_offset;
}
else
{
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
checkGLcall("glBindBuffer");
}
wined3d_texture_gl_upload_bo(src_format, target, level, src_row_pitch, src_slice_pitch, dst_x,
dst_y, dst_z, update_w, update_h, update_d, offset, srgb, dst_texture, gl_info);