hlsl.samplecmp.offsetarray.dx10.frag 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. SamplerComparisonState g_sSamp : register(s0);
  2. uniform Texture1D <float4> g_tTex1df4 : register(t0);
  3. Texture1D <int4> g_tTex1di4;
  4. Texture1D <uint4> g_tTex1du4;
  5. Texture2D <float4> g_tTex2df4;
  6. Texture2D <int4> g_tTex2di4;
  7. Texture2D <uint4> g_tTex2du4;
  8. Texture3D <float4> g_tTex3df4;
  9. Texture3D <int4> g_tTex3di4;
  10. Texture3D <uint4> g_tTex3du4;
  11. TextureCube <float4> g_tTexcdf4;
  12. TextureCube <int4> g_tTexcdi4;
  13. TextureCube <uint4> g_tTexcdu4;
  14. Texture1DArray <float4> g_tTex1df4a;
  15. Texture1DArray <int4> g_tTex1di4a;
  16. Texture1DArray <uint4> g_tTex1du4a;
  17. Texture2DArray <float4> g_tTex2df4a;
  18. Texture2DArray <int4> g_tTex2di4a;
  19. Texture2DArray <uint4> g_tTex2du4a;
  20. TextureCubeArray <float4> g_tTexcdf4a;
  21. TextureCubeArray <int4> g_tTexcdi4a;
  22. TextureCubeArray <uint4> g_tTexcdu4a;
  23. struct PS_OUTPUT
  24. {
  25. float4 Color : SV_Target0;
  26. float Depth : SV_Depth;
  27. };
  28. PS_OUTPUT main()
  29. {
  30. PS_OUTPUT psout;
  31. // 1DArray
  32. float r11 = g_tTex1df4a . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75, 2);
  33. float r13 = g_tTex1di4a . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75, 2);
  34. float r15 = g_tTex1du4a . SampleCmp(g_sSamp, float2(0.1, 0.2), 0.75, 2);
  35. // 2DArray
  36. float r31 = g_tTex2df4a . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3));
  37. float r33 = g_tTex2di4a . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3));
  38. float r35 = g_tTex2du4a . SampleCmp(g_sSamp, float3(0.1, 0.2, 0.3), 0.75, int2(2,3));
  39. // *** There's no SampleCmp on 3D textures
  40. // This page: https://msdn.microsoft.com/en-us/library/windows/desktop/bb509696(v=vs.85).aspx
  41. // claims offset is supported for cube textures, but FXC does not accept it, and that does
  42. // not match other methods, so it may be a documentation bug. Those lines are commented
  43. // out below.
  44. // CubeArray
  45. // float r61 = g_tTexcdf4a . SampleCmp(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75, int3(2,3,4));
  46. // float r63 = g_tTexcdi4a . SampleCmp(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75, int3(2,3,4));
  47. // float r65 = g_tTexcdu4a . SampleCmp(g_sSamp, float4(0.1, 0.2, 0.3, 0.4), 0.75, int3(2,3,4));
  48. psout.Color = 1.0;
  49. psout.Depth = 1.0;
  50. return psout;
  51. }