What is "sampler_ScreenTextures_linear_clamp" and what other options do I have in shaders?

In an example shader I found the use of: half depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, sampler_ScreenTextures_linear_clamp, reflectionScreenPos.xy);. What is ‘sampler_ScreenTextures_linear_clamp’? This variable is defined nowhere in the project but it still seems to function. Is this a variable hidden in the unity source code?

Unity has two types of auto samplers;

  1. Implicitly derived from a texture by the same name.
  2. Created dynamically based on certain keywords.

Number 2 would be the case here, with the ‘linear’ and ‘clamp’ keywords at the end denoting that the texture should be sampled using bilinear texture filtering and clamped texture wrapping. If you wanted to user one yourself, you just need to declare it somewhere in the shader;

//Creates a SamplerState for sampling shadowmaps with hardware bilinear filtering
SamplerComparisonState sampler_LinearClampCompare;
Texture2D _Shadowmap;

...

//Sample the shadowmap using the auto-sampler
float shadow = _Shadowmap.SampleCmpLevelZero (sampler_LinearClampCompare, shadowCoords);