Skip to content

[DirectX] Downgrading raw to typed buffer accesses for SM6.2 and earlier happens too late #144747

@bogner

Description

@bogner

We currently handle downgrading buffer accesses to use the "typedbuffer" loads and stores in SM6.2 and earlier very late, in DXILOpLowering. This is mostly fine, except that we handle typed buffer loads and stores for 64 bit operations, like double, by expanding them into integer operations in DXILIntrinsicExpansion, which is much earlier.

This means that in SM6.2 and earlier, RWStructuredBuffer<double> loads and stores fail to generate DXIL.

This is observable with clang-dxc -Tcs_6_2 and a simple shader like https://hlsl.godbolt.org/z/41MnGsqP1:

StructuredBuffer<double> In : register(t0);
RWStructuredBuffer<double> Out : register(u0);

[numthreads(1,1,4)]
void main(uint DTid : SV_GroupIndex) {
  Out[DTid] = In[DTid];
}

Metadata

Metadata

Assignees

Type

Projects

Status

Active

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions