Skip to content

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

Open

Description

@xxxbxxx

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() ....

Activity

  1. tristanlabelle commented on May 16, 2019

    @tristanlabelle
    Contributor

    Thanks for reporting! I was able to repro. If this blocking, you can use a #define as a workaround.

  2. added
    fxc-disagrees
    on Jun 11, 2024
  3. added this to the Dormant milestone on Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfxc-disagrees

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions