You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#2002 added support for WGSL's unpack2x16float function to the HLSL back end, but the code there may result in code for the argument expression being duplicated. The HLSL back end code reads:
If arg is a baked expression, then this will be fine, but there's no way for the analyzer to know that the HLSL back end intends to use this expression twice, so its reference count could be one. The result would be that a call like:
The impact of this is limited, though: Naga IR ensures that the duplicated expression will never have function calls or side effects. And the result may be cleaned up by the HLSL compiler anyway. But it seemed unintentional.
The fix would probably be a pre-pass over the expressions in the HLSL back end to bump the reference count of expression that appear as the operand of unpack2x64float, or otherwise indicate that they need to be baked.
#2002 added support for WGSL's
unpack2x16float
function to the HLSL back end, but the code there may result in code for the argument expression being duplicated. The HLSL back end code reads:If
arg
is a baked expression, then this will be fine, but there's no way for the analyzer to know that the HLSL back end intends to use this expression twice, so its reference count could be one. The result would be that a call like:would generate HLSL like:
The impact of this is limited, though: Naga IR ensures that the duplicated expression will never have function calls or side effects. And the result may be cleaned up by the HLSL compiler anyway. But it seemed unintentional.
The fix would probably be a pre-pass over the expressions in the HLSL back end to bump the reference count of expression that appear as the operand of
unpack2x64float
, or otherwise indicate that they need to be baked.cc @expenses
The text was updated successfully, but these errors were encountered: