Skip to content

Commit 5083b2b

Browse files
fabien-unitysebastienlagarde
authored andcommitted
Fix GC allocations from XR occlusion mesh when using multipass #3077
1 parent 9fd8595 commit 5083b2b

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRPass.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ internal void AddViewInternal(XRView xrView)
212212
// Must be called after all views have been added to the pass
213213
internal void UpdateOcclusionMesh()
214214
{
215-
if (isOcclusionMeshSupported && TryGetOcclusionMeshCombinedHashCode(out var hashCode))
215+
if (isOcclusionMeshSupported && singlePassEnabled && TryGetOcclusionMeshCombinedHashCode(out var hashCode))
216216
{
217217
if (occlusionMeshCombined == null || hashCode != occlusionMeshCombinedHashCode)
218218
{

com.unity.render-pipelines.universal/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
8484
- Removed Custom.meta which was causing warnings. [case 1314288](https://issuetracker.unity3d.com/issues/urp-warnings-about-missing-metadata-appear-after-installing)
8585
- Fixed an issue such that it is now posible to enqueue render passes at runtime.
8686
- Fixed the default background color for previews to use the original color.
87+
- Fixed GC allocations from XR occlusion mesh when using multipass.
8788

8889
## [10.2.0] - 2020-10-19
8990

com.unity.render-pipelines.universal/Runtime/XR/XRPass.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ internal void AddViewInternal(XRView xrView)
248248
// Must be called after all views have been added to the pass
249249
internal void UpdateOcclusionMesh()
250250
{
251-
if (isOcclusionMeshSupported && TryGetOcclusionMeshCombinedHashCode(out var hashCode))
251+
if (isOcclusionMeshSupported && singlePassEnabled && TryGetOcclusionMeshCombinedHashCode(out var hashCode))
252252
{
253253
if (occlusionMeshCombined == null || hashCode != occlusionMeshCombinedHashCode)
254254
{

0 commit comments

Comments
 (0)