OpenColorIO icon indicating copy to clipboard operation
OpenColorIO copied to clipboard

Blender: Error using OCIO with AgX Color Space on Apple Silicon

Open berenyiaustin opened this issue 2 years ago • 6 comments

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 image

Punchy image

Green Ink image

Greyscale image

Very High Contrast image

High Contrast image

Medium High Contrast image

Base Contrast image

Medium Low Contrast image

Low Contrast image

Very Low Contrast image

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

berenyiaustin avatar Jun 28 '23 19:06 berenyiaustin

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.

EaryChow avatar Jul 02 '23 21:07 EaryChow

@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 avatar Jul 06 '23 22:07 EaryChow

@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.

remia avatar Jul 10 '23 20:07 remia

Thanks, good to know the bug is already fixed upstream. Maybe now we need to investigate the downstream.

EaryChow avatar Jul 10 '23 20:07 EaryChow

From a quick search, I think this was fixed in 2.1.1+ and 2.2.0+.

remia avatar Jul 10 '23 20:07 remia

It turned out to be Blender using GLSL causing the problem, now fixed

EaryChow avatar Aug 29 '23 07:08 EaryChow