Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed unneeded cookie texture allocation for cone stop lights.
- Fixed scalarization code for contact shadows.
- Fixed volume debug in playmode
- Fixed issue when toggling anything in HDRP asset that will produce an error (case 1238155)

### Changed
- Improve MIP selection for decals on Transparents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,14 @@ void DisposeProbeCameraPool()

CameraCaptureBridge.enabled = false;

HDUtils.ReleaseComponentSingletons();
// Dispose of Render Pipeline can be call either by OnValidate() or by OnDisable().
// Inside an OnValidate() call we can't call a DestroyImmediate().
// Here we are releasing our singleton to not leak while doing a domain reload.
// However this is doing a call to DestroyImmediate().
// To workaround this, and was we only leak with Singleton while doing domain reload (and not in OnValidate)
// we are detecting if we are in an OnValidate call and releasing the Singleton only if it is not the case.
if (!m_Asset.isInOnValidateCall)
HDUtils.ReleaseComponentSingletons();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ enum ShaderVariantLogLevel
[HelpURL(Documentation.baseURL + Documentation.version + Documentation.subURL + "HDRP-Asset" + Documentation.endURL)]
public partial class HDRenderPipelineAsset : RenderPipelineAsset
{
[System.NonSerialized]
internal bool isInOnValidateCall = false;

HDRenderPipelineAsset()
{
Expand All @@ -36,12 +38,16 @@ protected override RenderPipeline CreatePipeline()
/// </summary>
protected override void OnValidate()
{
isInOnValidateCall = true;

//Do not reconstruct the pipeline if we modify other assets.
//OnValidate is called once at first selection of the asset.
if (GraphicsSettings.currentRenderPipeline == this)
base.OnValidate();

UpdateRenderingLayerNames();

isInOnValidateCall = false;
}

[SerializeField]
Expand Down