AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO

Invalid vector comparisons in HLSL shader code

Open
#2,108 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.1k
Forks
503
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.