Skip to content

Zero initializing array of struct causes error: cast<X>() argument of incompatible type! #8044

@sudonatalie

Description

@sudonatalie

Description
Compiling the following HLSL causes an internal compiler error:

repro.hlsl:

struct s {
  float f;
  float2x4 m;
};

struct t {
  s a[1];
};


static t g = (t)0;
[numthreads(1, 1, 1)]
void main() {
  s h = g.a[0u];
}

Steps to Reproduce
dxc -T cs_6_6 repro.hlsl

Actual Behavior
error: cast<X>() argument of incompatible type!

Environment

  • DXC version: libdxcompiler.dylib: 1.10(dev;5155-60a1c856); libdxil.dylib: 1.10
  • Host Operating System: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashneeds-triageAwaiting triage

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions