sampleCmp.hlsl 1.1 KB

12345678910111213141516171819202122
  1. // RUN: %dxilver 1.5 | %dxc -E main -T ps_6_0 -DTYPE=float4 %s | FileCheck %s -check-prefix=CHECK
  2. // RUN: %dxilver 1.5 | %dxc -E main -T ps_6_2 -DTYPE=half4 -enable-16bit-types %s | FileCheck %s -check-prefix=CHECK
  3. // RUN: %dxilver 1.5 | %dxc -E main -T ps_6_2 -DTYPE=min16float4 -enable-16bit-types %s | FileCheck %s -check-prefix=CHECK
  4. SamplerComparisonState samp1 : register(s5);
  5. Texture2D<TYPE> text1 : register(t3);
  6. half cmpVal;
  7. float main(float2 a
  8. : A) : SV_Target {
  9. uint status;
  10. float r = 0;
  11. // CHECK: call %dx.types.ResRet.f32 @dx.op.sampleCmp.f32(i32 64,
  12. r += text1.SampleCmp(samp1, a, cmpVal);
  13. // CHECK: call %dx.types.ResRet.f32 @dx.op.sampleCmp.f32(i32 64,
  14. r += text1.SampleCmp(samp1, a, cmpVal, uint2(-5, 7));
  15. // CHECK: call %dx.types.ResRet.f32 @dx.op.sampleCmp.f32(i32 64,
  16. r += text1.SampleCmp(samp1, a, cmpVal, uint2(-5, 7), a.x);
  17. // CHECK: call %dx.types.ResRet.f32 @dx.op.sampleCmp.f32(i32 64,
  18. r += text1.SampleCmp(samp1, a, cmpVal, uint2(-3, 2), a.y, status);
  19. r += status;
  20. return r;
  21. }