From dd52105387d7fc52f1436c52f56a5fc2542efda1 Mon Sep 17 00:00:00 2001 From: ccpisheden Date: Thu, 26 Nov 2026 00:48:32 +0100 Subject: [PATCH] Fix asfloat/asuint functions having the wrong return types in the Metal shader compiler. Co-Authored-By: Claude Opus 5.5 --- shadercompiler/ParserState.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shadercompiler/ParserState.cpp b/shadercompiler/ParserState.cpp index 3e604aec0..9b0e83af5 100644 --- a/shadercompiler/ParserState.cpp +++ b/shadercompiler/ParserState.cpp @@ -47,10 +47,10 @@ void ParserState::AddIntrinsics() m_dx9Functions["AllMemoryBarrierWithGroupSync"] = AddFunction( table, "AllMemoryBarrierWithGroupSync", &FunctionDescription0, DimIs<1, 1>> ); m_dx9Functions["any"] = AddFunction( table, "any", &FunctionDescription1, DimIs<1, 1>, TypeSameAsArg<0>, DimSameAsArg<0>> ); m_dx9Functions["asdouble"] = AddFunction( table, "asdouble", &FunctionDescription2, DimIs<1, 1>, TypeIs, DimIs<1, 1>, TypeIs, DimIs<1, 1>> ); - m_dx9Functions["asfloat"] = AddFunction( table, "asfloat", &FunctionDescription1, DimIs<2, 1>, TypeIs, DimIs<1, 1>> ); + m_dx9Functions["asfloat"] = AddFunction( table, "asfloat", &FunctionDescription1, DimSameAsArg<0>, TypeSameAsArg<0>, DimSameAsArg<0>> ); m_dx9Functions["asin"] = AddFunction( table, "asin", &FunctionDescription1, DimSameAsArg<0>, TypeIs, DimSameAsArg<0>> ); - m_dx9Functions["asint"] = AddFunction( table, "asint", &FunctionDescription1, DimIs<2, 1>, TypeIs, DimIs<1, 1>> ); - m_dx9Functions["asuint"] = AddFunction( table, "asuint", &FunctionDescription3, DimIs<1, 1>, TypeIs, DimIs<1, 1>, TypeIs, DimIs<1, 1>, TypeIs, DimIs<1, 1>> ); + m_dx9Functions["asint"] = AddFunction( table, "asint", &FunctionDescription1, DimSameAsArg<0>, TypeSameAsArg<0>, DimSameAsArg<0>> ); + m_dx9Functions["asuint"] = AddFunction( table, "asuint", &FunctionDescription3, DimSameAsArg<0>, TypeSameAsArg<0>, DimSameAsArg<0>, TypeIs, DimIs<1, 1>, TypeIs, DimIs<1, 1>> ); m_dx9Functions["atan"] = AddFunction( table, "atan", &FunctionDescription1, DimSameAsArg<0>, TypeIs, DimSameAsArg<0>> ); m_dx9Functions["atan2"] = AddFunction( table, "atan2", &FunctionDescription2, CommonArgDim, TypeIs, CommonArgDim, TypeIs, CommonArgDim> ); m_dx9Functions["ceil"] = AddFunction( table, "ceil", &FunctionDescription1, DimSameAsArg<0>, TypeIs, DimSameAsArg<0>> );