Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HDRP] Fix Invalid Texture Handle Issue in Shadow Atlas #6390

Closed
wants to merge 1 commit into from
Closed
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
Fix Invalid Texture Handle Issue in Shadow Atlas
This change fixes an issue where the shadow atlas could end up with an
invalid texture handle after the render pipeline asset is modified and
reloaded.

The previous code was invalidating the output texture handle in some
particular cases, but a new handle was recently added to the atlas
code without updating the invalidation logic. This change simply adds
the new handle to the existing invalidation logic.

The new handle was added as part of #6030 and merged into master as:
c83cb31

This fix may need to be backported to other branches.
  • Loading branch information
gmitrano-unity committed Nov 24, 2021
commit 8b24331c98a2e7e84997aaa1c415fc6f5692011b
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public void InvalidateOutputIfNeeded()
if (!m_UseSharedTexture)
{
m_Output = TextureHandle.nullHandle;
m_ShadowMapOutput = TextureHandle.nullHandle;
}
}

Expand Down Expand Up @@ -233,6 +234,7 @@ internal void CleanupRenderGraphOutput(RenderGraph renderGraph)
renderGraph.ReleaseSharedTexture(m_Output);
m_UseSharedTexture = false;
m_Output = TextureHandle.nullHandle;
m_ShadowMapOutput = TextureHandle.nullHandle;
}
}

Expand Down