Commit: fd387c31005f907f915fc920fc56b6f71284b2f2
Author: Omar Emara
Date:   Thu Mar 31 15:00:08 2022 +0200
Branches: temp-viewport-compositor-compiler
https://developer.blender.org/rBfd387c31005f907f915fc920fc56b6f71284b2f2

Viewport Compositor: Fix GPU material with no UBO

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

M       source/blender/nodes/intern/node_compositor_execute.cc

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

diff --git a/source/blender/nodes/intern/node_compositor_execute.cc 
b/source/blender/nodes/intern/node_compositor_execute.cc
index 2e49f9fa0d9..8a24d9e7eda 100644
--- a/source/blender/nodes/intern/node_compositor_execute.cc
+++ b/source/blender/nodes/intern/node_compositor_execute.cc
@@ -1195,10 +1195,11 @@ InputIdentifierToOutputSocketMap 
&GPUMaterialOperation::get_input_identifier_to_
 
 void GPUMaterialOperation::bind_material_resources(GPUShader *shader)
 {
-  /* Bind the uniform buffer of the material. */
+  /* Bind the uniform buffer of the material if it exists. */
   GPUUniformBuf *ubo = GPU_material_uniform_buffer_get(material_);
-  int ubo_binding_location = GPU_shader_get_uniform_block_binding(shader, 
GPU_UBO_BLOCK_NAME);
-  GPU_uniformbuf_bind(ubo, ubo_binding_location);
+  if (ubo) {
+    GPU_uniformbuf_bind(ubo, GPU_shader_get_uniform_block_binding(shader, 
GPU_UBO_BLOCK_NAME));
+  }
 
   /* Bind color band textures needed by the material. */
   ListBase textures = GPU_material_textures(material_);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to