gatherCubeOffset.hlsl 830 B

1234567891011121314151617181920212223242526272829303132333435
  1. // RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
  2. // CHECK: textureGather
  3. // CHECK: i32 0, i32 0, i32 0)
  4. // CHECK: textureGather
  5. // CHECK: i32 -5, i32 7, i32 1)
  6. // CHECK: textureGather
  7. // CHECK: i32 -3, i32 2, i32 3)
  8. // CHECK: textureGather
  9. // CHECK: i32 -3, i32 2, i32 2)
  10. // CHECK: textureGather
  11. // CHECK: i32 undef, i32 undef, i32 2)
  12. SamplerState samp1;
  13. Texture2D<float4> text1;
  14. Texture2DArray<float4> text2;
  15. TextureCubeArray<float4> text3;
  16. float4 main(float4 a : A) : SV_Target
  17. {
  18. uint status;
  19. float4 r = 0;
  20. r += text1.GatherRed(samp1, a.xy);
  21. r += text1.GatherGreen(samp1, a.xy, uint2(-5, 7));
  22. r += text1.GatherAlpha(samp1, a.xy, uint2(-3, 2), status); r += status;
  23. r += text2.GatherBlue(samp1, a.xyz, uint2(-3, 2), status); r += status;
  24. r += text3.GatherBlue(samp1, a, status); r += status;
  25. return r;
  26. }