Skip to content

[HLSL] Invalid error reported for int3 vector with packoffset #124696

@hekota

Description

@hekota

The following code reports error: packoffset cannot cross register boundary in Clang while DXC compiles it fine.

cbuffer CB  {
  int2 c : packoffset(c1.y);
};

[numthreads(4,1,1)]
void main() {}

https://godbolt.org/z/4as9ebned

The problem is that in Clang the width and alignment of the int3 type is 128 bits because it must be a power of 2. HLSL seems to align vectors based on the width of a single element.

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language Support

Type

Projects

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions