brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · d91d6fe Raw
46 lines · plain
1; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s2 3; This test checks to ensure the behavior of the DXIL shader flag analysis4; for the flag ResMayNotAlias is correct when the DXIL Version is >= 1.7 and the5; DXIL Validator Version < 1.8. The ResMayNotAlias module flag (0x20000000)6; should be set if there are one or more UAVs present globally in the7; module.8 9target triple = "dxil-pc-shadermodel6.7-library"10 11; CHECK:      Combined Shader Flags for Module12; CHECK-NEXT: Shader Flags Value: 0x20001001013 14; CHECK: Note: shader requires additional functionality:15; CHECK:       UAVs at every shader stage16 17; CHECK: Note: extra DXIL module flags:18; CHECK:       Raw and structured buffers19; CHECK:       Any UAV may not alias any other UAV20;21 22; CHECK: Function loadUAV : 0x20001000023define float @loadUAV() #0 {24  %res = call target("dx.TypedBuffer", float, 1, 0, 0)25      @llvm.dx.resource.handlefrombinding(i32 0, i32 0, i32 1, i32 0, ptr null)26  %load = call {float, i1} @llvm.dx.resource.load.typedbuffer(27      target("dx.TypedBuffer", float, 1, 0, 0) %res, i32 0)28  %val = extractvalue {float, i1} %load, 029  ret float %val30}31 32; CHECK: Function loadSRV : 0x20001001033define float @loadSRV() #0 {34  %res = tail call target("dx.RawBuffer", float, 0, 0)35      @llvm.dx.resource.handlefrombinding(i32 0, i32 0, i32 1, i32 0, ptr null)36  %load = call {float, i1} @llvm.dx.resource.load.rawbuffer(37      target("dx.RawBuffer", float, 0, 0) %res, i32 0, i32 0)38  %val = extractvalue { float, i1 } %load, 039  ret float %val40}41 42!dx.valver = !{!0}43!0 = !{i32 1, i32 7}44 45attributes #0 = { convergent norecurse nounwind "hlsl.export"}46