From 066619e1a8cafeeaaa948c781fbef0b2d44e739e Mon Sep 17 00:00:00 2001 From: Miguel Pozo Date: Tue, 25 Jun 2024 19:52:39 +0200 Subject: [PATCH] Fix: GPU: GLStorageBuf::async_flush_to_host non named path Fix the read parameter when there's no direct_state_access_support. --- source/blender/gpu/opengl/gl_storage_buffer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/gpu/opengl/gl_storage_buffer.cc b/source/blender/gpu/opengl/gl_storage_buffer.cc index 3a4189282b5..e97bbd452e5 100644 --- a/source/blender/gpu/opengl/gl_storage_buffer.cc +++ b/source/blender/gpu/opengl/gl_storage_buffer.cc @@ -196,6 +196,7 @@ void GLStorageBuf::async_flush_to_host() GL_SHADER_STORAGE_BUFFER, 0, size_in_bytes_, GL_MAP_PERSISTENT_BIT | GL_MAP_READ_BIT); BLI_assert(persistent_ptr_); debug::object_label(GL_SHADER_STORAGE_BUFFER, read_ssbo_id_, name_); + glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0); } if (GLContext::direct_state_access_support) { @@ -204,7 +205,7 @@ void GLStorageBuf::async_flush_to_host() else { glBindBuffer(GL_COPY_READ_BUFFER, ssbo_id_); glBindBuffer(GL_COPY_WRITE_BUFFER, read_ssbo_id_); - glCopyBufferSubData(GL_SHADER_STORAGE_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, size_in_bytes_); + glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, size_in_bytes_); glBindBuffer(GL_COPY_READ_BUFFER, 0); glBindBuffer(GL_COPY_WRITE_BUFFER, 0); }