OpenColorIO
OpenColorIO copied to clipboard
Invalid vector comparisons in HLSL shader code
In some cases OCIO generates invalid HLSL code like this:
if ( gamma != float3(1., 1., 1.) )
This fails compilation with the following error:
error X3019: if statement conditional expressions must evaluate to a scalar
The correct code should be:
if ( any( gamma != float3(1., 1., 1.) ) )
This is essentially the same issue as #1810 but for HLSL. There's already a fix in GpuShaderText::vectorCompareExpression() but it's only for Metal.
Can be reproduced using the OCIO config shipped with recent Blender versions, with some of the AgX looks. In our case we're creating a LegacyViewingPipeline containing a DisplayViewTransform and a looks override, similarly to the ociodisplay app.