Skip to content

Commit e9c4871

Browse files
authored
Fix vector comparison expression for HLSL. (#2270)
Signed-off-by: Eric Renaud-Houde <eric.renaud.houde@gmail.com>
1 parent eaa0281 commit e9c4871

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/OpenColorIO/GpuShaderUtils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ std::string GpuShaderText::declareVarStr(const std::string & name, float v)
482482
std::string GpuShaderText::vectorCompareExpression(const std::string& lhs, const std::string& op, const std::string& rhs)
483483
{
484484
std::string ret = lhs + " " + op + " " + rhs;
485-
if(m_lang == GPU_LANGUAGE_MSL_2_0)
485+
// MSL and HLSL do not allow vector bool in if-conditions: wrap with any().
486+
if(m_lang == GPU_LANGUAGE_MSL_2_0 || m_lang == GPU_LANGUAGE_HLSL_SM_5_0)
486487
{
487488
ret = "any( " + ret + " )";
488489
}

0 commit comments

Comments
 (0)