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
{{ message }}
Repository navigation
[SPIR-V] Invalid SPIR-V operand with isnan() #6712
RWStructuredBuffer Out;
[numthreads(1, 1, 1)]
void main(uint id : SV_DispatchThreadID)
{
float value = Out[id];
bool bar = isnan(value); // Check if 'value' is NaN
Out[id] = bar ? 1.0f : 0.0f; // Store 1.0f if 'value' is NaN, otherwise 0.0f
}
Activity
devshgraphicsprogramming commentedon Jun 21, 2024
If you're interested in a quick fix, you can use inline SPIR-V to use
OpIsNandirectlyshobomaru commentedon Jun 21, 2024
Indeed, by defining a new function as follows, we can pass the validation.
gorrila007 commentedon Jun 22, 2024
RWStructuredBuffer Out;
[numthreads(1, 1, 1)]
void main(uint id : SV_DispatchThreadID)
{
float value = Out[id];
bool bar = isnan(value); // Check if 'value' is NaN
Out[id] = bar ? 1.0f : 0.0f; // Store 1.0f if 'value' is NaN, otherwise 0.0f
}
[SPIR-V] Fix invalid isnan codegen
Keenuts commentedon Jul 9, 2024
Thanks for the issue! Sent a PR 😊 Most of the team being OOO, there might be some delays, but it's on its way.
[SPIR-V] Fix invalid isnan codegen (#6754)
[SPIR-V] Fix invalid isnan codegen (microsoft#6754)