retCBV.hlsl 359 B

12345678910111213141516171819
  1. // RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
  2. // Make sure both a and b are used.
  3. // CHECK:extractvalue %dx.types.CBufRet.f32 %{{.*}}, 0
  4. // CHECK:extractvalue %dx.types.CBufRet.f32 %{{.*}}, 1
  5. struct S {
  6. float a;
  7. float b;
  8. };
  9. ConstantBuffer<S> c: register(b2, space5);;
  10. S getS() {
  11. return c;
  12. }
  13. float main() : SV_Target {
  14. return c.a + getS().b;
  15. }