[Bf-blender-cvs] [d7598c80811] master: Metal: Fix crash when compiling compositor shaders.

Jeroen Bakker noreply at git.blender.org
Thu Jan 5 08:44:32 CET 2023


Commit: d7598c8081168b45bda70bee41003d8e5b622bed
Author: Jeroen Bakker
Date:   Thu Jan 5 08:27:31 2023 +0100
Branches: master
https://developer.blender.org/rBd7598c8081168b45bda70bee41003d8e5b622bed

Metal: Fix crash when compiling compositor shaders.

Although viewport compositor isn't supported yet on Apple deviced the
shaderlibs are compiled. The compositor shaders uses mat3 constructor
with a single vec3 and 6 floats. This constructor wasn't defined in
metal so it failed the compilation.

This patch adds the override to mat3.

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

M	source/blender/gpu/shaders/metal/mtl_shader_defines.msl

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

diff --git a/source/blender/gpu/shaders/metal/mtl_shader_defines.msl b/source/blender/gpu/shaders/metal/mtl_shader_defines.msl
index 93efa16bb02..f1a8af63d72 100644
--- a/source/blender/gpu/shaders/metal/mtl_shader_defines.msl
+++ b/source/blender/gpu/shaders/metal/mtl_shader_defines.msl
@@ -1236,6 +1236,11 @@ mat3 MAT3x3(
 {
   return mat3(vec3(a1, a2, a3), vec3(b1, b2, b3), vec3(c1, c2, c3));
 }
+mat3 MAT3x3(
+    vec3 a, float b1, float b2, float b3, float c1, float c2, float c3)
+{
+  return mat3(a, vec3(b1, b2, b3), vec3(c1, c2, c3));
+}
 mat3 MAT3x3(float f)
 {
   return mat3(f);



More information about the Bf-blender-cvs mailing list