[Bf-blender-cvs] [5be3a68f58d] blender-v3.4-release: Fix hair/curve drawing artifacts when workarounds are enabled.

Jeroen Bakker noreply at git.blender.org
Tue Nov 15 08:08:01 CET 2022


Commit: 5be3a68f58d34935916113f1124787b95572f81e
Author: Jeroen Bakker
Date:   Tue Nov 15 08:07:01 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rB5be3a68f58d34935916113f1124787b95572f81e

Fix hair/curve drawing artifacts when workarounds are enabled.

Regression introduced by {rB601995c3b86986cf8f8e5b6e5a65bcfa7f8f2e32}.
Noticed by Heist project as they render final frames with workarounds enabled.

The mentioned patch introduces attaching VBO as textures. This used to be
done by the caller. The mechanism used a different order hence the VBO
could still be unbound when using. This cannot be solved inside the new
mechanism clearly so this patch will just bind when the buffer isn't bound
just before the drawing command is sent to the GPU driver.

===================================================================

M	source/blender/gpu/opengl/gl_shader.cc

===================================================================

diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc
index dafcf4dbf33..58407db015d 100644
--- a/source/blender/gpu/opengl/gl_shader.cc
+++ b/source/blender/gpu/opengl/gl_shader.cc
@@ -1051,6 +1051,10 @@ bool GLShader::transform_feedback_enable(GPUVertBuf *buf_)
 
   GLVertBuf *buf = static_cast<GLVertBuf *>(unwrap(buf_));
 
+  if (buf->vbo_id_ == 0) {
+    buf->bind();
+  }
+
   BLI_assert(buf->vbo_id_ != 0);
 
   glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, buf->vbo_id_);



More information about the Bf-blender-cvs mailing list