Search Issue Tracker
By Design
By Design in 6000.0.X
Votes
0
Found in
6000.0.22f1
Issue ID
UUM-83641
Regression
No
NullReferenceException is thrown when adding a Blur Renderer Feature
Reproduction steps:
1. Open the attached “IN-85616.zip” project
2. Select the “URP Renderer” from the Project Window (Assets > Settings)
3. In the Inspector enable the “Blur Renderer Feature”
4. Observe the Console
Expected result: No exceptions are thrown
Actual result: “NullReferenceException: Object reference not set to an instance of an object.” exceptions are constantly thrown
Reproducible with: 6000.0.22f1
Couldn’t test with: 2021.3.44f1, 2022.3.49f (RenderGraph is not supported)
Reproducible on: Windows 11
Not reproducible on: No other environment tested
Note:
- The Renderer Feature was created following the documentation: https://docs.unity3d.com/6000.0/Documentation/Manual/urp/renderer-features/create-custom-renderer-feature.html
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Too little validation messages in the "WebAssembly Language Features" Memory settings
- Project Settings Search Highlights are misaligned when using the Bitmap Text Rendering Mode
- "GetControlID at event ValidateCommand returns a controlID different from the one in Layout event" Warning is thrown when undoing the deletion of Sprite Shape Profile
- Memory related fields in the "WebAssembly Language Features" can be set to the negative numbers
- "WebAssembly Language Features" Header in the Player Settings has a smaller indentation
Resolution Note:
There is an issue in BlurRenderPass.cs:
public override void OnCameraCleanup(CommandBuffer cmd)
{
cmd.Release(); // <-- This is the cause of the NullPointerException
}
Removing the OnCameraCleanup override function and/or the call to cmd.Release() fixes the issue.
Calling cmd.Release() destroys the internal CommandBuffer's representation, so when the outer call the EndSample is triggered from the Dispose, the underlying internal representation was released and set to null causing the error. The CommandBuffer is shared between passes, so Release() should not be called manually.
Resolution Note (6000.0.X):
There is an issue in BlurRenderPass.cs:
public override void OnCameraCleanup(CommandBuffer cmd)
{
cmd.Release(); // <-- This is the cause of the NullPointerException
}
Removing the OnCameraCleanup override function and/or the call to cmd.Release() fixes the issue.
Calling cmd.Release() destroys the internal CommandBuffer's representation, so when the outer call the EndSample is triggered from the Dispose, the underlying internal representation was released and set to null causing the error. The CommandBuffer is shared between passes, so Release() should not be called manually.