cbuffer_copy1.hlsl 490 B

1234567891011121314151617181920212223242526272829303132
  1. // RUN: %dxc -E not_main -T ps_6_0 %s | FileCheck %s
  2. // Make sure no load and store
  3. // CHECK-NOT: store float
  4. // CHECK-NOT: = load
  5. cbuffer T
  6. {
  7. float4 a;
  8. float4 b;
  9. }
  10. static struct X
  11. {
  12. float4 a;
  13. float4 b;
  14. } ST = { a, b};
  15. uint t;
  16. // Not use main as entry name to disable GlobalOpt.
  17. float4 not_main() : SV_Target
  18. {
  19. float tmp = 0;
  20. // Make big number of instructions to disable gvn.
  21. [unroll]
  22. for (uint i=0;i<100;i++)
  23. tmp += sin(t+i);
  24. return tmp + i + sin(ST.a) + ST.b;
  25. }