[Bf-blender-cvs] [d0f55aa671f] master: Vulkan: Fix GLSL compilation errors.

Jeroen Bakker noreply at git.blender.org
Mon Jan 30 10:57:27 CET 2023


Commit: d0f55aa671f7063298d3dc076aab5247aa669144
Author: Jeroen Bakker
Date:   Mon Jan 30 10:53:20 2023 +0100
Branches: master
https://developer.blender.org/rBd0f55aa671f7063298d3dc076aab5247aa669144

Vulkan: Fix GLSL compilation errors.

Recent changes in our GLSL libraries didn't compile on Vulkan. This
change reverts a compile directive that was removed, but required
in order to compile using the Vulkan backend.

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

M	source/blender/gpu/shaders/common/gpu_shader_math_matrix_lib.glsl

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

diff --git a/source/blender/gpu/shaders/common/gpu_shader_math_matrix_lib.glsl b/source/blender/gpu/shaders/common/gpu_shader_math_matrix_lib.glsl
index b3712f4077c..80d9f9d93fc 100644
--- a/source/blender/gpu/shaders/common/gpu_shader_math_matrix_lib.glsl
+++ b/source/blender/gpu/shaders/common/gpu_shader_math_matrix_lib.glsl
@@ -469,6 +469,7 @@ mat4x4 invert(mat4x4 mat, out bool r_success)
   return r_success ? inverse(mat) : mat4x4(0.0);
 }
 
+#  ifdef GPU_METAL
 vec2 normalize(vec2 a)
 {
   return a * inversesqrt(length_squared(a));
@@ -481,6 +482,7 @@ vec4 normalize(vec4 a)
 {
   return a * inversesqrt(length_squared(a));
 }
+#  endif
 
 mat2x2 normalize(mat2x2 mat)
 {



More information about the Bf-blender-cvs mailing list