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
Description
Validation fails when asuint is passed a vector literal of signed integers. Of course, this is something that only comes up in generated code where the literal isn't known ahead of time. If this is intended behavior, it seems like at least the error messaging should be improved.
Steps to Reproduce dxc -T cs_6_6
RWByteAddressBuffer prevent_dce : register(u0);
[numthreads(1, 1, 1)]
void main() {
int arg = -1;
int3 vec = (-1).xxx;
prevent_dce.Store3(0u, arg); // !!! WORKS
prevent_dce.Store3(0u, asuint(-1)); // !!! WORKS
prevent_dce.Store3(0u, vec); // !!! WORKS
prevent_dce.Store3(0u, asuint((-1).xxx)); // !!! FAILS
return;
}
This one works in 202x. Unsure what exactly is happening here, but this is likely some odd explosion of the literal to 64-bits. We have some known issues with storing literals to ByteAddressBuffer causing 64-bit stores instead of 32-bit stores (see: #5493).
As this is fixed in 202x, no plans at moment to go back and address this for older language versions. Happy to hear feedback on why we should consider this higher priority.
Description
Validation fails when
asuint
is passed a vector literal of signed integers. Of course, this is something that only comes up in generated code where the literal isn't known ahead of time. If this is intended behavior, it seems like at least the error messaging should be improved.Steps to Reproduce
dxc -T cs_6_6
https://godbolt.org/z/YcE8c1hqa
Expected Behavior
Compilation succeeds, or a relevant error message is produced.
Actual Behavior
Environment
libdxcompiler.so: 1.8(dev;4705-99f2d498)
The text was updated successfully, but these errors were encountered: