Skip to content

[HLSL] Crash using array parameters #125743

@llvm-beanz

Description

@llvm-beanz

Clang currently crashes when compiling the following simplified compute shader:

typedef uint4  uint32_t4;
typedef uint32_t4 uint32_t8[2];

uint32_t Accumulate(uint32_t8 V) {
  uint32_t4 SumVec = V[0] + V[1];
  return SumVec.x + SumVec.y + SumVec.z + SumVec.w;
}

Buffer<uint4> Buf;
RWBuffer<uint> Out;

[numthreads(8,1,1)]
void main(uint GI : SV_GroupIndex) {
  uint32_t8 Val = {Buf[GI], Buf[GI+8]};
  Out[GI] = Accumulate(Val);
}

Godbolt Link

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language Supportclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions