microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
3.05k stars 677 forks source link

Remainder of inout signature element not passed through when one component is modified #2528

Open tex3d opened 4 years ago

tex3d commented 4 years ago

In the case of an inout signature element, we do not pass through components not modified by the shader unless no components are touched.

The following test case succeeds if you do not write to pos.w, but fails with a validation error if you do since we do not output pos.xyz. Fxc does pass these through, so we should fix this.

// RUN: %dxc -E main -T vs_6_0 %s | FileCheck %s

// CHECK: call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 0,
// CHECK: call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 1,
// CHECK: call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 2,
// CHECK: call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 3,

// Should pass the rest (xyz) of SV_Position through
void main(inout float4 pos: SV_Position) {
  pos.w = 1;
}
damyanp commented 3 months ago

It's not entirely clear that this is something that is likely to impact real-life scenarios. Until we have data otherwise, setting this to dormant.