Skip to content

Commit 8a93946

Browse files
authored
Fix atan2 argument order for HLSL (#1712)
Signed-off-by: Doug Walker <[email protected]> Signed-off-by: Doug Walker <[email protected]>
1 parent 3ffcc3f commit 8a93946

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/OpenColorIO/GpuShaderUtils.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,8 +1087,10 @@ std::string GpuShaderText::atan2(const std::string & y,
10871087
}
10881088
case GPU_LANGUAGE_HLSL_DX11:
10891089
{
1090-
// note: operand order is swapped in HLSL
1091-
kw << "atan2(" << x << ", " << y << ")";
1090+
// note: Various internet sources claim that the x & y arguments need to be
1091+
// swapped for HLSL (relative to GLSL). However, recent testing on Windows
1092+
// has revealed that the argument order needs to be the same as GLSL.
1093+
kw << "atan2(" << y << ", " << x << ")";
10921094
break;
10931095
}
10941096
case LANGUAGE_OSL_1:

0 commit comments

Comments
 (0)