Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
aaecbcd
Use IMGUI drawer to bypass ui issue with Light Rendering Layer
lochrist Apr 28, 2026
56ccff1
[Port] [6000.5] [UUM-134522][UUM-136056][URP 2D][6000.6] Fix 2d shado…
Apr 28, 2026
e9fd41c
[Port] [6000.5] [UUM-138256] Added shader variant stripping for point…
CalChiu Apr 28, 2026
5c01380
[Port] [6000.5] [UUM-140770][URP 2D][6000.6] Fix Inspector Preview wi…
Apr 29, 2026
594fb8b
[Port] [6000.5] docg-8419: Fix Flipbook Player property visibility de…
Apr 30, 2026
8c40008
[UUM-138337][Switch2] Clear UI overlay texture on base camera if crea…
kaychang-unity Apr 30, 2026
a86f173
[6000.5] VFX out of bounds shader access fix
Adrian1066 Apr 30, 2026
cee93b4
[Port] [6000.5] Fix GPU crash with shadergraph AdditionalLightsBasic …
May 4, 2026
1f3d060
[6000.5 Backport] [HDRP][XR] Update ClearBuffer2D to support XR views
May 4, 2026
79255cb
[Port] [6000.5] [ShaderGraph] Address issue where linkage hints for r…
May 4, 2026
a88508d
[Port] [6000.5] Fixed Main Preview not being updated properly in UITK…
alexandret-unity May 5, 2026
5776c8e
[Port] [6000.5] URP Renderer - When adding/removing scriptable render…
May 5, 2026
334ca94
[Port] [6000.5] Fixed Cancel behavior for ObjectSelector With Confirm…
May 5, 2026
b54a152
[Port] [6000.5] [UUM-137272] Change file access strategy in Shader Gr…
May 7, 2026
721641c
[Port] [6000.5] PanelRenderer UIReloadCallback fixes
May 7, 2026
355f2c0
[Port] [6000.5] [UUM-109492] Fixed UberPostProcess pass viewport scal…
CalChiu May 11, 2026
6c37253
[Port] [6000.5] docg-8030: Replace edge with wire
May 12, 2026
a02b10f
[Port] [6000.5] [HDRP] Fix Variable Rate Shading property overlapping…
May 12, 2026
55f5ef1
[Backport-6000.5] Update Terrain Samples (Fix UUM-140721)
RemyUnity May 12, 2026
520b5ae
[Port] [6000.5] DOCG-8538 - Added concept and instructions for HLSL r…
May 12, 2026
8c2fb4a
[Port] [6000.5] Added navigation to Shader Graph preferences ref page…
May 12, 2026
343904b
[Port] [6000.5] [URP] Fix broken help URL on PostProcessData inspecto…
May 12, 2026
96bd898
[Port] [6000.5] Frame Debugger - Fix Preview icons broken & Memory co…
May 12, 2026
0c279b7
[Port] [6000.5] Re-eanble USE_LEGACY_LIGHTMAPS for all shaders when e…
May 13, 2026
1cf4517
[Port] [6000.5] [UUM-131202] Prune deleted cameras from URP CameraMet…
May 15, 2026
f00c530
[Port] [6000.5] [UUM-141000][6000.6][URP 2D] Fix quality settings not…
May 15, 2026
4d9000d
[content automatically redacted] touching PlatformDependent folder
May 17, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

[assembly: InternalsVisibleTo("Unity.RenderPipelines.Core.Editor")]
[assembly: InternalsVisibleTo("Unity.RenderPipelines.HighDefinition.Editor")]
[assembly: InternalsVisibleTo("Unity.RenderPipelines.Universal.Editor")]
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@ public static void Show(UnityEngine.Object obj, Type requiredType, UnityEngine.O
{
UnityEditor.ObjectSelector.get.Show(obj, requiredType, objectBeingEdited, allowSceneObjects, allowedEntityIds, onObjectSelectorClosed, onObjectSelectedUpdated, showNoneItem);
}

public static void SetVisualSelection(EntityId entityId)
{
UnityEditor.ObjectSelector.get.SetVisualSelection(entityId);
}

public static bool isVisible => UnityEditor.ObjectSelector.isVisible;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,7 @@ static internal void Init()
Lightmapping.bakeStarted += OnBakeStarted;
Lightmapping.bakeCancelled += OnBakeCancelled;
Lightmapping.inputExtraction += OnInputExtraction;
AssemblyReloadEvents.beforeAssemblyReload += CleanUp;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.UIElements;
using Object = UnityEngine.Object;

namespace UnityEditor.Rendering
{
Expand All @@ -17,6 +19,7 @@ public abstract partial class DefaultVolumeProfileSettingsPropertyDrawer : Prope
static DefaultVolumeProfileEditor s_DefaultVolumeProfileEditor;

VisualElement m_Root;
ObjectField m_ObjectField;

/// <summary>SerializedObject representing the settings object</summary>
protected SerializedObject m_SettingsSerializedObject;
Expand All @@ -31,6 +34,9 @@ public abstract partial class DefaultVolumeProfileSettingsPropertyDrawer : Prope
/// <summary>Info box message</summary>
protected abstract GUIContent volumeInfoBoxLabel { get; }

/// <summary>Label and tooltip used for the Default Volume Profile asset field.</summary>
protected abstract GUIContent defaultVolumeProfileAssetLabel { get; }

/// <summary>
/// CreatePropertyGUI implementation.
/// </summary>
Expand Down Expand Up @@ -107,6 +113,142 @@ protected void DestroyDefaultVolumeProfileEditor()
s_DefaultVolumeProfileSerializedProperty = null;
}

/// <summary>
/// Show modal dialog to confirm update of selected volume if needed and apply new volume profile.
/// </summary>
/// <param name="field">Object Field used to display Default Volume profile</param>
/// <param name="newValue">New Volume profile</param>
/// <param name="previousValue">Previous volume profile</param>
/// <param name="defaultVolumeProfileSettings">Optionally provided default volume profile to extract default values</param>
/// <typeparam name="TRenderPipeline">Render Pipeline type</typeparam>
void ShowGlobalDefaultVolumeDialog<TRenderPipeline>(ObjectField field, Object newValue,
Object previousValue, IDefaultVolumeProfileSettings defaultVolumeProfileSettings = null)
where TRenderPipeline : RenderPipeline
{
bool confirmed = VolumeProfileUtils.UpdateGlobalDefaultVolumeProfileWithConfirmation<TRenderPipeline>(newValue as VolumeProfile, defaultVolumeProfileSettings?.volumeProfile);
if (confirmed)
{
UpdateDefaultVolumeSerializedPropertyAndRecreate(field, newValue);
}
else
{
m_VolumeProfileSerializedProperty.objectReferenceValue = previousValue;
m_VolumeProfileSerializedProperty.serializedObject.ApplyModifiedProperties();
field.SetValueWithoutNotify(previousValue);
// Update the ObjectSelector's visual selection if it's still open
if (previousValue != null && ObjectSelector.isVisible)
ObjectSelector.SetVisualSelection(previousValue.GetEntityId());
}
}

/// <summary>
/// Update serialized property for Default Volume profile and recreate related Editors
/// </summary>
/// <param name="field">Object Field used to display Default Volume profile</param>
/// <param name="newValue">New Volume profile</param>
void UpdateDefaultVolumeSerializedPropertyAndRecreate(ObjectField field, Object newValue)
{
m_VolumeProfileSerializedProperty.objectReferenceValue = newValue;
m_VolumeProfileSerializedProperty.serializedObject.ApplyModifiedProperties();
field.SetValueWithoutNotify(newValue);
DestroyDefaultVolumeProfileEditor();
CreateDefaultVolumeProfileEditor();
}

/// <summary>
/// Draw ObjectField for Default Volume.
/// </summary>
/// <param name="defaultVolumeProfileSettings">Default value source if available</param>
/// <typeparam name="TRenderPipeline">Render Pipeline type for Default Volume</typeparam>
/// <typeparam name="TDefaultVolumeSettings">Default Volume settings container type</typeparam>
/// <returns>New Object Field</returns>
protected VisualElement DrawDefaultVolumeObjectField<TRenderPipeline, TDefaultVolumeSettings>(TDefaultVolumeSettings defaultVolumeProfileSettings = null)
where TRenderPipeline: RenderPipeline
where TDefaultVolumeSettings : class, IDefaultVolumeProfileSettings
{
VisualElement profileLine = new();
var toggle = new Toggle();
toggle.AddToClassList(Foldout.toggleUssClassName);
var checkmark = toggle.Q(className: Toggle.checkmarkUssClassName);
checkmark.AddToClassList(Foldout.checkmarkUssClassName);
m_ObjectField = new ObjectField(defaultVolumeProfileAssetLabel.text)
{
tooltip = defaultVolumeProfileAssetLabel.tooltip,
objectType = typeof(VolumeProfile),
value = m_VolumeProfileSerializedProperty.objectReferenceValue as VolumeProfile,
style =
{
flexShrink = 1,
}
};
m_ObjectField.AddToClassList("unity-base-field__aligned"); //Align with other BaseField<T>
m_ObjectField.Q<Label>().RegisterCallback<ClickEvent>(evt => toggle.value ^= true);

toggle.RegisterValueChangedCallback(evt =>
{
m_EditorContainer.style.display = evt.newValue ? DisplayStyle.Flex : DisplayStyle.None;
m_DefaultVolumeProfileFoldoutExpanded.value = evt.newValue;
});
toggle.SetValueWithoutNotify(m_DefaultVolumeProfileFoldoutExpanded.value);
m_EditorContainer.style.display = m_DefaultVolumeProfileFoldoutExpanded.value ? DisplayStyle.Flex : DisplayStyle.None;

profileLine.style.flexDirection = FlexDirection.Row;
m_ObjectField.style.flexGrow = 1;

m_ObjectField.RegisterValueChangedCallback(evt =>
{
if (evt.newValue == evt.previousValue)
return;

if (RenderPipelineManager.currentPipeline is not TRenderPipeline)
{
m_ObjectField.SetValueWithoutNotify(evt.previousValue);
Debug.Log($"Cannot change Default Volume Profile when {typeof(TRenderPipeline).Name} is not active. Rolling back to previous value.");
return;
}

if (evt.newValue == null)
{
m_ObjectField.SetValueWithoutNotify(evt.previousValue);
Debug.Log("This Volume Profile Asset cannot be null. Rolling back to previous value.");
return;
}


if (evt.previousValue != null)
{
var newValue = evt.newValue;
var oldValue = evt.previousValue;
EditorApplication.delayCall += () => ShowGlobalDefaultVolumeDialog<TRenderPipeline>(m_ObjectField, newValue, oldValue, defaultVolumeProfileSettings);
return;
}

VolumeProfileUtils.UpdateGlobalDefaultVolumeProfile<TRenderPipeline>(evt.newValue as VolumeProfile, defaultVolumeProfileSettings?.volumeProfile);
UpdateDefaultVolumeSerializedPropertyAndRecreate(m_ObjectField, evt.newValue);
});

m_ObjectField.RegisterCallback<AttachToPanelEvent>(evt =>
{
if (GraphicsSettings.currentRenderPipeline == null || RenderPipelineManager.pipelineSwitchCompleted)
HandleRenderPipelineChange<TRenderPipeline>();
RenderPipelineManager.activeRenderPipelineTypeChanged += HandleRenderPipelineChange<TRenderPipeline>;
});
m_ObjectField.RegisterCallback<DetachFromPanelEvent>(evt => RenderPipelineManager.activeRenderPipelineTypeChanged -= HandleRenderPipelineChange<TRenderPipeline>);

profileLine.Add(toggle);
profileLine.Add(m_ObjectField);

return profileLine;
}

void HandleRenderPipelineChange<TRenderPipeline>()
where TRenderPipeline: RenderPipeline
{
m_ObjectField.enabledSelf = RenderPipelineManager.currentPipeline is TRenderPipeline;
}



/// <summary>
/// Implementation of the Default Volume Profile asset field.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.UIElements;

namespace UnityEditor.Rendering
{
Expand Down Expand Up @@ -65,7 +64,7 @@ internal static void AssignValuesToProfile(VolumeProfile targetProfile, VolumeCo
}

/// <summary>
/// Assign the global default default profile to VolumeManager. Ensures that defaultVolumeProfile contains
/// Assign the global default profile to VolumeManager. Ensures that defaultVolumeProfile contains
/// overrides for every component. If defaultValueSource is provided, it will be used as the source for
/// default values instead of default-constructing them.
/// If components will be added to the profile, a confirmation dialog is displayed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class RuntimeDebugWindow : MonoBehaviour
bool m_PortraitOrientation;
bool m_IsDirty;

int m_UIVersion = 0;

void Awake()
{
DebugManager.instance.onSetDirty -= RequestRecreateGUI;
Expand All @@ -38,12 +40,17 @@ void Awake()
m_PanelRenderer.RegisterUIReloadCallback(OnUIReload);
}

internal void OnUIReload(PanelRenderer renderer, VisualElement rootElement)
internal void OnUIReload(PanelRenderer renderer, VisualElement rootElement, int version)
{
// Called on initial load AND on any asset change
if (rootElement == null || rootElement.childCount == 0)
return;

if (version == m_UIVersion)
return;

m_UIVersion = version;

m_PanelRootElement = rootElement;
m_RootVisualElement = rootElement[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ internal GPUResidentDrawer(in GPUResidentDrawerSettings settings, in InternalGPU
RenderPipelineManager.beginCameraRendering += OnBeginCameraRendering;
RenderPipelineManager.endCameraRendering += OnEndCameraRendering;

const string useLegacyLightmapsKeyword = "USE_LEGACY_LIGHTMAPS";
Shader.EnableKeyword(useLegacyLightmapsKeyword);

if (!internalSettings.isManagedByUnitTest)
InsertIntoPlayerLoop();

Expand Down Expand Up @@ -522,6 +525,9 @@ internal void Dispose()
if (!m_InternalSettings.isManagedByUnitTest)
RemoveFromPlayerLoop();

const string useLegacyLightmapsKeyword = "USE_LEGACY_LIGHTMAPS";
Shader.DisableKeyword(useLegacyLightmapsKeyword);

m_WorldProcessor.Dispose();
m_WorldProcessor = null;
m_SpeedTreeWindGPUDataUpdater.Dispose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public class InternalRenderGraphContext
internal RenderGraphPass executingPass;
internal NativeRenderPassCompiler.CompilerContextData compilerContext;
internal bool contextlessTesting;
internal bool forceResourceCreation;
}

// InternalRenderGraphContext is public (but all members are internal)
Expand Down Expand Up @@ -1243,12 +1242,13 @@ public void BeginRecording(in RenderGraphParameters parameters)

// With the actual implementation of the Frame Debugger, we cannot re-use resources during the same frame
// or it breaks the rendering of the pass preview, since the FD copies the texture after the execution of the RG.
m_RenderGraphContext.forceResourceCreation =
// When disabled, this mode prevents resources released in the current frame from being reused until the next frame.
#if UNITY_EDITOR || DEVELOPMENT_BUILD
FrameDebugger.enabled;
bool enableMemoryAliasing = !FrameDebugger.enabled;
#else
false;
bool enableMemoryAliasing = true;
#endif
m_Resources.EnableIntraFrameMemoryAliasing(enableMemoryAliasing);
}

/// <summary>
Expand Down Expand Up @@ -1647,6 +1647,33 @@ internal void ClearGlobalBindings()
m_RenderGraphContext.cmd.SetGlobalTexture(globalTex.Key, defaultResources.blackTexture);
}
}

/// <summary>
/// Enables or disables intra-frame memory aliasing for render graph resources.
/// When enabled, resources released within the same execution can be immediately reused by subsequent passes.
/// When disabled, resources released in the current execution cannot be reused until the next execution.
/// Note: An execution corresponds to a single RenderGraph recording/execution cycle. Multiple executions can occur
/// within the same frame (e.g., Frame Debugger cascade-repaints, multiple cameras).
/// This is primarily used for testing purposes and for Frame Debugger compatibility.
/// </summary>
/// <param name="enabled">True to enable intra-frame memory aliasing, false to disable it.</param>
internal void SetIntraFrameMemoryAliasing(bool enabled)
{
m_Resources.EnableIntraFrameMemoryAliasing(enabled);
}

#if UNITY_EDITOR
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
static void ResetStaticsOnLoad()
{
s_RegisteredExecutions.Clear();
s_EnableCompilationCachingForTests = null;
onGraphRegistered = null;
onGraphUnregistered = null;
onExecutionRegistered = null;
s_DebugSessionWasActive = false;
}
#endif
}

/// <summary>
Expand Down
Loading
Loading