hlsl.nonint-index.frag 269 B

12345678910
  1. static const float array[3] = { 1, 2, 3 };
  2. float main(float input : IN) : SV_Target0
  3. {
  4. // non-integer indexes get converted to uints:
  5. // uint(input) 3.0 2.0 1.0
  6. return array[input] + array[2.0] + array[true] + array[false];
  7. }