OpenColorIO icon indicating copy to clipboard operation
OpenColorIO copied to clipboard

Invalid vector comparisons in HLSL shader code

Open rplatikanovCG opened this issue 1 year ago • 0 comments

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.

rplatikanovCG avatar Dec 12 '24 18:12 rplatikanovCG