hlsl.rw.swizzle.frag 1.0 KB

1234567891011121314151617181920212223242526272829
  1. RWTexture2D<float3> rwtx;
  2. RWBuffer<float3> buf;
  3. float3 SomeValue() { return float3(1,2,3); }
  4. float4 main() : SV_Target0
  5. {
  6. int2 tc2 = { 0, 0 };
  7. int tc = 0;
  8. // Test swizzles and partial updates of L-values when writing to buffers and writable textures.
  9. rwtx[tc2].zyx = float3(1,2,3); // full swizzle, simple RHS
  10. rwtx[tc2].zyx = SomeValue(); // full swizzle, complex RHS
  11. rwtx[tc2].zyx = 2; // full swizzle, modify op
  12. // Partial updates not yet supported.
  13. // Partial values, which will use swizzles.
  14. // buf[tc].yz = 42; // partial swizzle, simple RHS
  15. // buf[tc].yz = SomeValue().x; // partial swizzle, complex RHS
  16. // buf[tc].yz += 43; // partial swizzle, modify op
  17. // // Partial values, which will use index.
  18. // buf[tc].y = 44; // single index, simple RHS
  19. // buf[tc].y = SomeValue().x; // single index, complex RHS
  20. // buf[tc].y += 45; // single index, modify op
  21. return 0.0;
  22. }