hlsl.constantbuffer.frag 340 B

123456789101112131415161718192021222324252627
  1. struct c1_t {
  2. float4 x;
  3. };
  4. struct c2_t {
  5. bool x;
  6. float y;
  7. };
  8. ConstantBuffer<c1_t> cb1 : register(b12);
  9. ConstantBuffer<c2_t> cb2[3];
  10. ConstantBuffer<c2_t> cb3[2][4];
  11. cbuffer cbuff {
  12. int c1;
  13. };
  14. float4 main() : SV_Target0
  15. {
  16. if (cb3[1][2].x)
  17. return cb1.x + cb2[1].y + c1;
  18. else
  19. return cb3[1][3].y;
  20. }