Open Keenuts opened 1 year ago
Description
Had a bug on a compute shader. Spent quite some time to figure out what's the issue (concurrent read/write to some buffers from multiple threads, etc, so LOTS of places things could go wrong). Turns out the issue is simple:
uint thread_count = 32; uint width = 4096 uint height = 2048 uint2 size = (width, height) / thread_count
I had forgotten the uint2 in the initializer:
uint2
uint2 size = uint2(width, height) / thread_count
Steps to Reproduce
[numthreads(1, 1, 1)] void main() { uint2 a = (1, 2) / 2; }
dxc -T cs_6_6 repro.hlsl -Od
Dxc builds with no complaints.
Actual Behavior
Maybe DXC should complain that a constructor list may have been intended? This code does generates the warning:
[numthreads(1, 1, 1)] void main() { uint2 a = (1, 2); }
Environment
libdxcompiler.so: 1.7(dev;4028-56db6cef)
1d6b5627ac46a8b433f21fae50b9192689336c15
Note that clang current does emit a warning in these cases.
Description
Had a bug on a compute shader. Spent quite some time to figure out what's the issue (concurrent read/write to some buffers from multiple threads, etc, so LOTS of places things could go wrong). Turns out the issue is simple:
I had forgotten the
uint2
in the initializer:Steps to Reproduce
dxc -T cs_6_6 repro.hlsl -Od
Dxc builds with no complaints.
Actual Behavior
Maybe DXC should complain that a constructor list may have been intended? This code does generates the warning:
Environment
libdxcompiler.so: 1.7(dev;4028-56db6cef)
1d6b5627ac46a8b433f21fae50b9192689336c15