Search Issue Tracker

By Design

Votes

1

Found in

2020.3.38f1

2021.3.10f1

2022.1.16f1

2022.2.0b7

2023.1.0a10

Issue ID

UUM-15002

Regression

No

Depth texture “_CameraDepthTexture” is not recognized when building for the Windows platform

--

-

Reproduction steps:
1. Open the user’s attached project
2. In the Project window select the “Depth” shader file
3. Make sure there are no errors in the Inspector window
4. Go to File -> Build Settings, for Target Platform select Windows, and press Build
5. When the build finishes, again select “Depth” shader in the Project window
6. Inspect the Console and Inspector windows

Expected result: There are no errors in both windows
Actual result: There is an error in Inspector and Console windows saying that 'sampler_CameraDepthTexture' is an undeclared identifier

Reproducible with: 2020.3.38f1, 2021.3.10f1, 2022.1.16f1 2022.2.0b7, 2023.1.0a10

Reproducible on: macOS 12.5

  1. Resolution Note:

    The variant for XR is failing to compile. This is because SAMPLE_DEPTH_TEXTURE requires different data when compiling for XR (their project has XR enabled). If you want a texture that works for depth sampling across the board, then UNITY_DECLARE_DEPTH_TEXTURE should be used to declared the texture sampler.

Add comment

Log in to post comment