cfg.hlsl 701 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // RUN: %dxc -E main -T ps_6_0 -Od %s | FileCheck %s
  2. // CHECK: @main
  3. static bool gG;
  4. static bool gG2;
  5. static bool gG3;
  6. Texture2D tex0 : register(t0);
  7. Texture2D tex1 : register(t42);
  8. Texture2D tex2 : register(t2);
  9. Texture2D f(bool foo) {
  10. if (foo)
  11. return tex0;
  12. else
  13. return tex1;
  14. }
  15. Texture2D h(bool foo3) {
  16. return foo3 ? f(gG2) : tex2;
  17. }
  18. [RootSignature("DescriptorTable(SRV(t0, numDescriptors=3), SRV(t42))")]
  19. float4 main() : sv_target {
  20. // CHECK: %[[handle:.+]] = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 0, i32 0, i32 42
  21. gG = true;
  22. gG2 = false;
  23. gG3 = false;
  24. // CHECK: @dx.op.textureLoad.f32(i32 66, %dx.types.Handle %[[handle]]
  25. return h(gG).Load(0);
  26. };