|
|
|
|
|
|
#if defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_STEREO_MULTIVIEW_ENABLED) |
|
|
|
#define DEPTH_TEXTURE_MS Texture2DMSArray |
|
|
|
#define DEPTH_TEXTURE(name) TEXTURE2D_ARRAY(name) |
|
|
|
#define LOAD(uv, sampleIndex) LOAD_TEXTURE2D_ARRAY_MSAA(_CameraDepthTexture, uv, unity_StereoEyeIndex, sampleIndex) |
|
|
|
#define SAMPLE(uv) SAMPLE_TEXTURE2D_ARRAY(_CameraDepthTexture, sampler_CameraDepthTexture, uv, unity_StereoEyeIndex).r |
|
|
|
#define LOAD(uv, sampleIndex) LOAD_TEXTURE2D_ARRAY_MSAA(_CameraDepthAttachment, uv, unity_StereoEyeIndex, sampleIndex) |
|
|
|
#define SAMPLE(uv) SAMPLE_TEXTURE2D_ARRAY(_CameraDepthAttachment, sampler_CameraDepthAttachment, uv, unity_StereoEyeIndex).r |
|
|
|
#define LOAD(uv, sampleIndex) LOAD_TEXTURE2D_MSAA(_CameraDepthTexture, uv, sampleIndex) |
|
|
|
#define SAMPLE(uv) SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, sampler_CameraDepthTexture, uv) |
|
|
|
#define LOAD(uv, sampleIndex) LOAD_TEXTURE2D_MSAA(_CameraDepthAttachment, uv, sampleIndex) |
|
|
|
#define SAMPLE(uv) SAMPLE_DEPTH_TEXTURE(_CameraDepthAttachment, sampler_CameraDepthAttachment, uv) |
|
|
|
DEPTH_TEXTURE_MS<float> _CameraDepthTexture; |
|
|
|
DEPTH_TEXTURE_MS<float> _CameraDepthAttachment; |
|
|
|
float4 _CameraDepthTexture_TexelSize; |
|
|
|
float4 _CameraDepthAttachment_TexelSize; |
|
|
|
DEPTH_TEXTURE(_CameraDepthTexture); |
|
|
|
SAMPLER(sampler_CameraDepthTexture); |
|
|
|
DEPTH_TEXTURE(_CameraDepthAttachment); |
|
|
|
SAMPLER(sampler_CameraDepthAttachment); |
|
|
|
int2 coord = int2(uv * _CameraDepthTexture_TexelSize.zw); |
|
|
|
int2 coord = int2(uv * _CameraDepthAttachment_TexelSize.zw); |
|
|
|
int samples = (int)_SampleCount; |
|
|
|
#if UNITY_REVERSED_Z |
|
|
|
float outDepth = 1.0; |
|
|
|