Blender: Error using OCIO with AgX Color Space on Apple Silicon
Below I have renders in all 11 Look options for the EaryChow fork of AgX. It seems that Very High Contrast, High Contrast, Medium High Contrast, Medium Low Contrast, Low Contrast, and Very Low Contrast are all producing identical results. Nothing changes when switching between those looks.
None
Punchy
Green Ink
Greyscale
Very High Contrast
High Contrast
Medium High Contrast
Base Contrast
Medium Low Contrast
Low Contrast
Very Low Contrast
I also receive the following error when changing Look:
Compile Error - Metal Shader Library (Stage: 2), error Error Domain=MTLLibraryErrorDomain Code=3 "program_source:2310:10: error: value of type 'bool attribute((ext_vector_type(3)))' (vector of 3 'bool' values) is not contextually convertible to 'bool' if ( gamma != vec3(1., 1., 1.) ) ^~~~~~~~~~~~~~~~~~~~~~~~~ " UserInfo={NSLocalizedDescription=program_source:2310:10: error: value of type 'bool attribute((ext_vector_type(3)))' (vector of 3 'bool' values) is not contextually convertible to 'bool' if ( gamma != vec3(1., 1., 1.) ) ^~~~~~~~~~~~~~~~~~~~~~~~~ }
Display Device: sRGB View Transform: AgX
Blender 4.0a, MacOS Apple Silicon, Metal Backend
Just to fill in some context, the contrast looks in question were using GradingPrimaryTransform, and it's reported to my fork of AgX that it throws shader error in MacOS, I had them try out the test config for the GradingPrimaryTransform shader error bug and they confirmed it also throws error. Therefore I suspect there is a bug unresolved in OCIO upstream that throws error when using Grading Primary Transform on MacOS, since I remember some similar issue was brought up before, and I thought it was fixed.
@doug-walker @remia Any hope of confirming and fixing this? Maybe this issue needs to be renamed to "Grading Primary Transform having Compile Error on Metal Shader Library", to clear the confusion.
@EaryChow I'm not able to reproduce the issue on OCIO upstream (main branch), do you have a simple way to test? I used ociodisplay -v -gpuinfo -metal on the AgX config you shared above and selected the Look to test the bug but no error happened.
The shader error from the first post seem to indicate that version of Blender is using a version before the bug was fixed, in the newer versions the conditional test is now: if ( any( gamma != float3(1., 1., 1.) ) ).
Happy to investigate if there is a way to reproduce on the last releases of 2.1.x or 2.2.x, I don't think 2.0.x got the fix however.
Thanks, good to know the bug is already fixed upstream. Maybe now we need to investigate the downstream.
From a quick search, I think this was fixed in 2.1.1+ and 2.2.0+.
It turned out to be Blender using GLSL causing the problem, now fixed