[Bf-blender-cvs] [78abdcf31e9] temp-vulkan-shader: Tweaked gpu_InstanceIndex.

Jeroen Bakker noreply at git.blender.org
Fri Dec 2 12:28:47 CET 2022


Commit: 78abdcf31e95f34797edbb804abe82d700eb4daa
Author: Jeroen Bakker
Date:   Fri Dec 2 12:24:03 2022 +0100
Branches: temp-vulkan-shader
https://developer.blender.org/rB78abdcf31e95f34797edbb804abe82d700eb4daa

Tweaked gpu_InstanceIndex.

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

M	source/blender/gpu/vulkan/vk_shader.cc

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

diff --git a/source/blender/gpu/vulkan/vk_shader.cc b/source/blender/gpu/vulkan/vk_shader.cc
index 58b13ea8747..e8580b66c22 100644
--- a/source/blender/gpu/vulkan/vk_shader.cc
+++ b/source/blender/gpu/vulkan/vk_shader.cc
@@ -502,10 +502,8 @@ static char *glsl_patch_get()
   /* Version need to go first. */
   STR_CONCAT(patch, slen, "#version 450\n");
   STR_CONCAT(patch, slen, "#define gl_VertexID gl_VertexIndex\n");
-  // TODO(jbakker): How does base instance work in vulkan. There seems to be a difference between
-  // OpenGL and Vulkan here. But I am not able to map the change to our code-base yet.
-  STR_CONCAT(patch, slen, "#define gpu_BaseInstance 0\n");
-  STR_CONCAT(patch, slen, "#define gpu_InstanceIndex (gl_InstanceIndex + gpu_BaseInstance)\n");
+  STR_CONCAT(patch, slen, "#define gpu_BaseInstance (0)\n");
+  STR_CONCAT(patch, slen, "#define gpu_InstanceIndex (gl_InstanceIndex)\n");
 
   // TODO: we should remove usage of gl_InstanceID/gl_VertexID.
   STR_CONCAT(patch, slen, "#define gl_InstanceID gpu_InstanceIndex\n");



More information about the Bf-blender-cvs mailing list