sample1.hlsl 707 B

123456789101112131415161718192021222324252627282930
  1. // RUN: %dxc -E main -T ps_6_0 %s | tee | FileCheck %s
  2. // This test uses 'tee' simply to exist as a sample; typically it's only
  3. // desirable for looking at the disassembly during investigations.
  4. // CHECK: unused_but_part_of_cbuffer
  5. // CHECK-NOT: !"samp_unused"
  6. // CHECK: !"samp1"
  7. // CHECK-NOT: !"samp_unused"
  8. cbuffer Foo
  9. {
  10. float4 g0;
  11. float4 g1;
  12. float4 g2;
  13. };
  14. int unused_but_part_of_cbuffer;
  15. int used_part;
  16. SamplerState samp_unused : register(s6);
  17. SamplerState samp1 : register(s5);
  18. Texture2D<float4> text1 : register(t3);
  19. float4 unreferenced_fn() {
  20. return text1.Sample(samp_unused, 0) + g2;
  21. }
  22. float4 main(float2 a : A) : SV_Target {
  23. return text1.Sample(samp1, a) + g2 + used_part;
  24. }