Search Issue Tracker

By Design

Votes

1

Found in

6000.0.50f1

6000.1.6f1

6000.2.0b4

Issue ID

UUM-108189

Regression

No

ProfilingSampler.Get() returns null and makes the Player only render black when building a Release Build

-

Reproduction steps:
1. Open the attached “IN-103525.zip” project
2. Make sure the “Test” Scene is included in the build (File > Build Profiles > Scene List)
3. Build and Run the project
4. Observe the Player

Expected result: The Scene is rendered
Actual result: The Scene is not rendered, the Player is black

Reproducible with: 6000.0.50f1, 6000.1.6f1, 6000.2.0b4
Couldn't test with: 2022.3.62f1, 6000.0.47f1 (Could not resolve Shader compilation errors)

Reproducible on: Windows 11
Not reproducible on: No other environment tested

Note:
- ProfilingSampler.Get(camera.cameraType); in Assets/Custom RP/Runtime/CameraRenderer.cs line 46 returns null only in a Release Build. If "Development Build" is set to true, the Scene renders as expected. This code path is most important to real-time reflection probes, since they do not expose the camera directly and the function works in the Editor

  1. Resolution Note:

    ProfilingSampler.Get<TEnum> is not available in Release builds and intentionally returns null when used in non-development builds.
    The same applies to RenderGraphProfilingScope.
    To avoid any issues you can wrap Profiling code in the preprocessor directives.
    #if DEVELOPMENT_BUILD || UNITY_EDITOR
    //code
    #endif

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.