op.texture.sample-access.hlsl 936 B

12345678910111213141516171819202122232425
  1. // Run: %dxc -T ps_6_0 -E main
  2. // CHECK: [[cu12:%\d+]] = OpConstantComposite %v2uint %uint_1 %uint_2
  3. // CHECK: [[cu123:%\d+]] = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
  4. Texture2DMS <int3> t1;
  5. Texture2DMSArray <float4> t2;
  6. void main() {
  7. uint pos = uint(1);
  8. uint2 pos2 = uint2(1,2);
  9. // CHECK: [[pos2:%\d+]] = OpLoad %v2uint %pos2
  10. // CHECK-NEXT: [[t1:%\d+]] = OpLoad %type_2d_image %t1
  11. // CHECK-NEXT: [[f1:%\d+]] = OpImageFetch %v4int [[t1]] [[pos2]] Sample %uint_7
  12. // CHECK-NEXT: [[val1:%\d+]] = OpVectorShuffle %v3int [[f1]] [[f1]] 0 1 2
  13. // CHECK-NEXT: OpStore %a1 [[val1]]
  14. int3 a1 = t1.sample[7][pos2];
  15. // CHECK-NEXT: [[pos:%\d+]] = OpLoad %uint %pos
  16. // CHECK-NEXT: [[t2:%\d+]] = OpLoad %type_2d_image_array %t2
  17. // CHECK-NEXT: [[f2:%\d+]] = OpImageFetch %v4float [[t2]] [[cu123]] Sample [[pos]]
  18. // CHECK-NEXT: OpStore %a2 [[f2]]
  19. float4 a2 = t2.sample[pos][uint3(1,2,3)];
  20. }