| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- // RUN: %dxc -T ps_6_5 -E main -Vd -validator-version 1.5 %s | %D3DReflect %s | FileCheck %s
- // Flags needed to ensure usage flags are preserved in reflection with -Qkeep_reflect_in_dxil (implied):
- // -T ps_6_5 -Vd -validator-version 1.5
- float4 UnusedGlobal[2];
- float4 LookupTable[2];
- bool TestBool;
- bool TestBool2;
- cbuffer CB {
- int TestInt;
- }
- float4 main() : SV_Target {
- uint Index = 0;
- // This introduces a phi for Index, due to use of new cbuffer.
- // If unhandled, this results in a zero offset into $Globals for LookupTable usage.
- if (TestBool) {
- Index = TestInt;
- }
- return LookupTable[Index]
- // This will produce a select with the same problem.
- + LookupTable[TestBool2 ? Index : 1];
- }
- // {{$}} is used to prevent match to 0x<anything>
- // CHECK: ID3D12ShaderReflection:
- // CHECK: Flags: 0{{$}}
- // CHECK: ConstantBuffers: 2
- // CHECK: BoundResources: 2
- // CHECK: Constant Buffers:
- // CHECK: D3D12_SHADER_BUFFER_DESC: Name: $Globals
- // CHECK: Type: D3D_CT_CBUFFER
- // CHECK: Size: 80
- // CHECK: uFlags: 0{{$}}
- // CHECK: Num Variables: 4
- // CHECK: {
- // CHECK: D3D12_SHADER_VARIABLE_DESC: Name: UnusedGlobal
- // CHECK: uFlags: 0{{$}}
- // CHECK: D3D12_SHADER_VARIABLE_DESC: Name: LookupTable
- // CHECK: uFlags: 0x2
- // CHECK: D3D12_SHADER_VARIABLE_DESC: Name: TestBool
- // CHECK: uFlags: 0x2
- // CHECK: D3D12_SHADER_VARIABLE_DESC: Name: TestBool2
- // CHECK: uFlags: 0x2
- // CHECK: }
- // CHECK: ID3D12ShaderReflectionConstantBuffer:
- // CHECK: D3D12_SHADER_BUFFER_DESC: Name: CB
- // CHECK: {
- // CHECK: D3D12_SHADER_VARIABLE_DESC: Name: TestInt
- // CHECK: uFlags: 0x2
- // CHECK: }
- // CHECK: Bound Resources:
- // CHECK: D3D12_SHADER_BUFFER_DESC: Name: $Globals
- // CHECK: BindCount: 1
- // CHECK: BindPoint: 0
- // CHECK: Space: 0
- // CHECK: uFlags: 0{{$}}
- // CHECK: D3D12_SHADER_BUFFER_DESC: Name: CB
- // CHECK: BindCount: 1
- // CHECK: BindPoint: 1
- // CHECK: Space: 0
- // CHECK: uFlags: 0{{$}}
|