Skip to content

Commit 1ce7e28

Browse files
arttu-peltonenEvergreen
authored andcommitted
Disable ProbeReferenceVolume debug code from master builds
1 parent 4d3f08b commit 1ce7e28

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if DEVELOPMENT_BUILD || UNITY_EDITOR
2+
#define PROBEREFERENCEVOLUME_DEBUG
3+
#endif
4+
15
using System;
26
using System.Collections.Generic;
37
using System.Linq;
@@ -261,13 +265,15 @@ public void RenderDebug(Camera camera, Texture exposureTexture)
261265
/// <param name="exposureTexture">Texture containing the exposure value for this frame.</param>
262266
public void RenderDebug(Camera camera, ProbeVolumesOptions options, Texture exposureTexture)
263267
{
268+
#if PROBEREFERENCEVOLUME_DEBUG
264269
if (camera.cameraType != CameraType.Reflection && camera.cameraType != CameraType.Preview)
265270
{
266271
if (options != null)
267272
ProbeVolumeDebug.currentOffset = options.worldOffset.value;
268273

269274
DrawProbeDebug(camera, exposureTexture);
270275
}
276+
#endif
271277
}
272278

273279
/// <summary>
@@ -360,6 +366,7 @@ static void SceneGUI(SceneView sceneView)
360366
}
361367
#endif
362368

369+
#if PROBEREFERENCEVOLUME_DEBUG
363370
bool TryCreateDebugRenderData()
364371
{
365372
if (!GraphicsSettings.TryGetRenderPipelineSettings<ProbeVolumeDebugResources>(out var debugResources))
@@ -436,11 +443,6 @@ void CleanupDebug()
436443
#endif
437444
}
438445

439-
void DebugCellIndexChanged<T>(DebugUI.Field<T> field, T value)
440-
{
441-
ClearDebugData();
442-
}
443-
444446
void RegisterDebug()
445447
{
446448
void RefreshDebug<T>(DebugUI.Field<T> field, T value)
@@ -807,6 +809,8 @@ void UnregisterDebug(bool destroyPanel)
807809
DebugManager.instance.GetPanel(k_DebugPanelName, false).children.Remove(m_DebugItems);
808810
}
809811

812+
#endif // PROBEREFERENCEVOLUME_DEBUG
813+
810814
class RenderFragmentationOverlayPassData
811815
{
812816
public Material debugFragmentationMaterial;
@@ -856,6 +860,7 @@ public void RenderFragmentationOverlay(RenderGraph renderGraph, TextureHandle co
856860
}
857861
}
858862

863+
#if PROBEREFERENCEVOLUME_DEBUG
859864
bool ShouldCullCell(Vector3 cellPosition, Transform cameraTransform, Plane[] frustumPlanes)
860865
{
861866
var volumeAABB = GetCellBounds(cellPosition);
@@ -1082,6 +1087,7 @@ void DrawProbeDebug(Camera camera, Texture exposureTexture)
10821087
}
10831088
}
10841089
}
1090+
#endif // PROBEREFERENCEVOLUME_DEBUG
10851091

10861092
internal void ResetDebugViewToMaxSubdiv()
10871093
{

Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if DEVELOPMENT_BUILD || UNITY_EDITOR
2+
#define PROBEREFERENCEVOLUME_DEBUG
3+
#endif
4+
15
using System;
26
using System.Diagnostics;
37
using System.Collections.Generic;
@@ -1045,7 +1049,9 @@ public void Initialize(in ProbeVolumeSystemParameters parameters)
10451049
// For now this condition is redundant with m_SupportDiskStreaming but we plan to support disk streaming without compute in the future.
10461050
// So we need to split the conditions to plan for that.
10471051
m_DiskStreamingUseCompute = SystemInfo.supportsComputeShaders && streamingUploadCS != null && streamingUploadL2CS != null;
1052+
#if PROBEREFERENCEVOLUME_DEBUG
10481053
InitializeDebug();
1054+
#endif
10491055
ProbeVolumeConstantRuntimeResources.Initialize();
10501056
ProbeBrickPool.Initialize();
10511057
ProbeBrickBlendingPool.Initialize();
@@ -1131,7 +1137,9 @@ public void Cleanup()
11311137
}
11321138

11331139
CleanupLoadedData();
1140+
#if PROBEREFERENCEVOLUME_DEBUG
11341141
CleanupDebug();
1142+
#endif
11351143
CleanupStreaming();
11361144
DeinitProbeReferenceVolume();
11371145
m_IsInitialized = false;
@@ -1675,13 +1683,14 @@ void InitProbeReferenceVolume()
16751683

16761684
m_NeedLoadAsset = true;
16771685
}
1678-
1686+
#if PROBEREFERENCEVOLUME_DEBUG
16791687
// Refresh debug menu
16801688
if (DebugManager.instance.GetPanel(k_DebugPanelName, false) != null)
16811689
{
16821690
instance.UnregisterDebug(false);
16831691
instance.RegisterDebug();
16841692
}
1693+
#endif
16851694
}
16861695

16871696
ProbeReferenceVolume()

0 commit comments

Comments
 (0)