DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

fxc.exe vs dxc.exe: "static const int" use as compile time constant

Open xxxbxxx opened this issue 5 years ago • 1 comments

This code construct used to work with fxc.exe but doesn't compile with dxc. Is this expected?

static const uint2	c2Thread= uint2(8, 8);
static const uint       cThread = c2Thread.x*c2Thread.y;
groupshared float4      S1[cThread];
[numthreads(c2Thread.x, c2Thread.y, 1)]
void csMain() ....

note: inlining the numerical constants does work fine:

static const uint2	c2Thread= uint2(8, 8);
static const uint       cThread = c2Thread.x*c2Thread.y;
groupshared float4      S1[64];
[numthreads(8, 8, 1)]
void csMain() ....

xxxbxxx avatar May 14 '19 19:05 xxxbxxx