Skip to content

[DirectX] DXIL Data Scalarization is not scalarizing GEP for an array of vectors #144608

Open
@Icohedron

Description

@Icohedron

The following shader compiles without error under clang, but fails validation
https://godbolt.org/z/Tnq16cMxh

uint foo(uint2 v[2], uint i) { return v[i]; }
RWStructuredBuffer<uint> output;
[numthreads(1, 1, 1)] 
void CSMain(uint3 Tid : SV_DispatchThreadID) {
  uint2 v[2] = {Tid.xy, Tid.yx};
  output[Tid.z] = foo(v, Tid.z);
}

Validation error:

Invalid record
Validation failed.

The validation error is likely due to this GEP in the resulting DXIL

%13 = getelementptr inbounds nuw [2 x <2 x i32>], ptr %12, i32 0, i32 %7, !dbg !106

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions