Skip to content

Commit

Permalink
Check if probeVolumeAtlas is null before trying to release a slot fro…
Browse files Browse the repository at this point in the history
…m it. The atlas could be not created yet as we are doing it later in a rendering now to match the selected SH encoding for a given frame. (#108)
  • Loading branch information
AndrewSaraevUnity committed Sep 2, 2022
1 parent 74b4e2a commit 3686dcf
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,10 @@ internal void ReleaseProbeVolumeFromAtlas(ProbeVolumeHandle volume)
// If will get added back to the atlas the next frame any of the remaining enabled probe volumes are seen,
// so functionally, this is fine. It does however put additional pressure on the atlas allocator + blitting.
// Could add reference counting to atlas keys, or could track key use timestamps and evict based on least recently used as needed.
if (probeVolumeAtlas.IsTextureSlotAllocated(pipelineData.UsedAtlasKey)) { probeVolumeAtlas.ReleaseTextureSlot(pipelineData.UsedAtlasKey); }
if (probeVolumeAtlas != null && probeVolumeAtlas.IsTextureSlotAllocated(pipelineData.UsedAtlasKey))
{
probeVolumeAtlas.ReleaseTextureSlot(pipelineData.UsedAtlasKey);
}

if (ShaderConfig.s_ProbeVolumesBilateralFilteringMode == ProbeVolumesBilateralFilteringModes.OctahedralDepth)
{
Expand Down

0 comments on commit 3686dcf

Please sign in to comment.