From 98ea06d8530d896e217cc89634c7706dfe913453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20V=C3=A1zquez?= Date: Wed, 8 Sep 2021 10:12:22 +0200 Subject: [PATCH] Fix invalid cast exception --- .../CHANGELOG.md | 1 + .../Runtime/Lighting/Reflection/HDProbe.cs | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 97d43ebb61e..826a0431c39 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -243,6 +243,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed missing API documentation for LTC area light code. - Fixed diffusion profile breaking after upgrading HDRP (case 1337892). - Fixed undo on light anchor. +- Fixed invalid cast exception on HDProbe. - Fixed some depth comparison instabilities with volumetric clouds. - Fixed AxF debug output in certain configurations (case 1333780). - Fixed white flash when camera is reset and SSR Accumulation mode is on. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbe.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbe.cs index 8afa36e268f..e0daa581c7e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbe.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbe.cs @@ -633,15 +633,11 @@ private Vector3 ComputeCapturePositionWS() private void QueueSHBaking() { - var hdrp = (HDRenderPipeline)RenderPipelineManager.currentPipeline; - if (hdrp != null) - { - if (!hdrp.currentPlatformRenderPipelineSettings.supportProbeVolume) return; - } - else - { + if (!(RenderPipelineManager.currentPipeline is HDRenderPipeline hdrp)) + return; + + if (!hdrp.currentPlatformRenderPipelineSettings.supportProbeVolume) return; - } Vector3 capturePositionWS = ComputeCapturePositionWS(); if (m_SHRequestID < 0)