Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
d8f920f
[Port] [6000.4] Exposed serialized m_ShouldUseConservativeEnclosingSp…
svc-reach-platform-support Apr 1, 2026
146eb4f
[Port] [6000.4] Disable unstable Upscalers test
svc-reach-platform-support Apr 2, 2026
769857f
[Port] [6000.4] Disable unstable Materials test
svc-reach-platform-support Apr 2, 2026
44d7c49
[Port] [6000.4] Fix On Tile PostProcessing not rendering properly wit…
svc-reach-platform-support Apr 2, 2026
566c12e
[Port] [6000.4] [2d] Add support for RSUV to 2D Renderers.
svc-reach-platform-support Apr 7, 2026
28307f6
[Port] [6000.4] [UUM-136415][6000.6][URP 2D] Add capture pass for rec…
svc-reach-platform-support Apr 7, 2026
13b4905
[Port] [6000.4] Shader graph documentation feedback improvements - sp…
svc-reach-platform-support Apr 7, 2026
0ce3ee1
[Port] [6000.4] Document variable rate shading
svc-reach-platform-support Apr 7, 2026
70bd114
[Port] [6000.4] DOCG-7573 - Shader Graph documentation for Custom Mat…
sebastienduverne Apr 7, 2026
a4621b6
[Port] [6000.4] Fix NRE in CustomPass editor when DRS is enabled
svc-reach-platform-support Apr 8, 2026
32d4e38
[Port] [6000.4] [SRP] Fix building errors with RSUV sample
svc-reach-platform-support Apr 8, 2026
4573144
[Port] [6000.4] Fixed Default Volume profile bugs
svc-reach-platform-support Apr 9, 2026
590df37
[Port] [6000.4] SRP Core utils - Make sure the folder separator is th…
svc-reach-platform-support Apr 9, 2026
bd4b631
[Port] [6000.4] [Core] Fix obsolete use of FindFirstObjectByType in s…
svc-reach-platform-support Apr 9, 2026
f1c7ca4
[6000.4] Fix MSAA CameraDepthTexture scaling issues by replacing UV s…
Apr 15, 2026
5c632f3
[Adaptive Performance] Backport/6000.4/adp fix rendertexture size
tylerfan Apr 15, 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 @@ -1838,32 +1838,48 @@ public static IEnumerable<T> LoadAllAssets<T>(string extension = "asset", bool a
}
}

const char k_DirectorySeparatorChar = '/';

/// <summary>
/// Create any missing folders in the file path given.
/// </summary>
/// <param name="filePath">File or folder (ending with '/') path to ensure existence of each subfolder in. </param>
/// <param name="filePath">File or folder (ending with '/') path to ensure existence of each subfolder in.</param>
public static void EnsureFolderTreeInAssetFilePath(string filePath)
{
var path = filePath.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
if (!path.StartsWith("Assets" + Path.DirectorySeparatorChar, StringComparison.CurrentCultureIgnoreCase))
throw new ArgumentException($"Path should start with \"Assets/\". Got {filePath}.", filePath);
if (string.IsNullOrEmpty(filePath))
return;

// Normalize to forward slashes (Unity standard)
var path = filePath.Replace('\\', k_DirectorySeparatorChar);

if (!path.StartsWith("Assets/", StringComparison.Ordinal))
throw new ArgumentException($"Path should start with \"Assets/\". Got {filePath}.", nameof(filePath));

var folderPath = Path.GetDirectoryName(path);

if (!UnityEditor.AssetDatabase.IsValidFolder(folderPath))
if (string.IsNullOrEmpty(folderPath))
return;

// GetDirectoryName may reintroduce backslashes on Windows
folderPath = folderPath.Replace('\\', k_DirectorySeparatorChar);

// Early exit if folder already exists
if (AssetDatabase.IsValidFolder(folderPath))
return;

var folderNames = folderPath.Split(k_DirectorySeparatorChar);
string currentPath = "Assets";

for (int i = 1; i < folderNames.Length; ++i)
{
var folderNames = folderPath.Split(Path.DirectorySeparatorChar);
string rootPath = "";
foreach (var folderName in folderNames)
{
var newPath = rootPath + folderName;
if (!UnityEditor.AssetDatabase.IsValidFolder(newPath))
UnityEditor.AssetDatabase.CreateFolder(rootPath.TrimEnd(Path.DirectorySeparatorChar), folderName);
rootPath = newPath + Path.DirectorySeparatorChar;
}
string nextPath = currentPath + k_DirectorySeparatorChar + folderNames[i];
if (!UnityEditor.AssetDatabase.IsValidFolder(nextPath))
UnityEditor.AssetDatabase.CreateFolder(currentPath, folderNames[i]);
currentPath = nextPath;
}
}


/// <summary>
/// Returns the icon for the given type if it has an IconAttribute.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,25 +328,6 @@ internal void SetOverridesTo(IEnumerable<VolumeParameter> enumerable, bool state
}
}

/// <summary>
/// A custom hashing function that Unity uses to compare the state of parameters.
/// </summary>
/// <returns>A computed hash code for the current instance.</returns>
public override int GetHashCode()
{
unchecked
{
//return parameters.Aggregate(17, (i, p) => i * 23 + p.GetHash());

int hash = 17;

for (int i = 0; i < parameterList.Length; i++)
hash = hash * 23 + parameterList[i].GetHashCode();

return hash;
}
}

/// <summary>
/// Returns true if any of the volume properites has been overridden.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,14 @@ public void Initialize(VolumeProfile globalDefaultVolumeProfile = null, VolumePr
void InitializeBaseTypesArray(VolumeProfile globalDefaultVolumeProfile = null)
{
using var profilerScope = k_ProfilerMarkerInitializeBaseTypesArray.Auto();
#if UNITY_EDITOR
LoadBaseTypesByReflection(GraphicsSettings.currentRenderPipelineAssetType);
#else
#if !UNITY_EDITOR
if (globalDefaultVolumeProfile == null)
{
var defaultVolumeProfileSettings = GraphicsSettings.GetRenderPipelineSettings<IDefaultVolumeProfileAsset>();
globalDefaultVolumeProfile = defaultVolumeProfileSettings?.defaultVolumeProfile;
}
LoadBaseTypes(globalDefaultVolumeProfile);
#endif
LoadBaseTypes(GraphicsSettings.currentRenderPipelineAssetType, globalDefaultVolumeProfile);
}

//This is called by test where the basetypes are tuned for the purpose of the test.
Expand Down Expand Up @@ -311,7 +309,7 @@ public void Deinitialize()
/// <param name="profile">The VolumeProfile to use as the global default profile.</param>
public void SetGlobalDefaultProfile(VolumeProfile profile)
{
LoadBaseTypes(profile);
LoadBaseTypes(GraphicsSettings.currentRenderPipelineAssetType, profile);
globalDefaultProfile = profile;
EvaluateVolumeDefaultState();
}
Expand Down Expand Up @@ -423,8 +421,9 @@ public void DestroyStack(VolumeStack stack)
/// LoadBaseTypes is responsible for loading the list of VolumeComponent types that will be used to build the default state of the VolumeStack. It uses the provided global default profile to determine which component types are relevant for the current render pipeline.
/// This will be called only once at runtime on app boot
/// </summary>
/// <param name="rpType">The Pipeline Type used to check if each VolumeComponent is supported.</param>
/// <param name="globalDefaultVolumeProfile">The global default volume profile to use to build the base component type array.</param>
internal void LoadBaseTypes(VolumeProfile globalDefaultVolumeProfile)
internal void LoadBaseTypesByDefaultVolume(Type rpType, VolumeProfile globalDefaultVolumeProfile)
{
if (globalDefaultVolumeProfile == null)
{
Expand All @@ -434,13 +433,13 @@ internal void LoadBaseTypes(VolumeProfile globalDefaultVolumeProfile)

using (ListPool<Type>.Get(out var list))
{
var pipelineAssetType = GraphicsSettings.currentRenderPipelineAssetType;
foreach (var comp in globalDefaultVolumeProfile.components)
{
if (comp == null) continue;
if (comp == null)
continue;

var componentType = comp.GetType();
if (!SupportedOnRenderPipelineAttribute.IsTypeSupportedOnRenderPipeline(componentType, pipelineAssetType))
if (!SupportedOnRenderPipelineAttribute.IsTypeSupportedOnRenderPipeline(componentType, rpType))
continue;

list.Add(componentType);
Expand Down Expand Up @@ -469,15 +468,30 @@ internal Type[] LoadBaseTypesByReflection(Type pipelineAssetType)
if (!SupportedOnRenderPipelineAttribute.IsTypeSupportedOnRenderPipeline(t, pipelineAssetType))
continue;

if (t.GetCustomAttribute<ObsoleteAttribute>() != null)
continue;

list.Add(t);
}

m_BaseComponentTypeArray = list.ToArray();
}

return m_BaseComponentTypeArray;
}
#endif
/// <summary>
/// Helper to choose a type loading depending if we are in Editor and Standalone.
/// </summary>
/// <param name="pipelineAssetType">The Pipeline Type used to check if each VolumeComponent is supported.</param>
/// <param name="globalDefaultVolumeProfile">The global default volume profile to use to build the base component type array.</param>
void LoadBaseTypes(Type pipelineAssetType, VolumeProfile globalDefaultVolumeProfile = null)
{
#if UNITY_EDITOR
LoadBaseTypesByReflection(pipelineAssetType);
#else
LoadBaseTypesByDefaultVolume(pipelineAssetType, globalDefaultVolumeProfile);
#endif
}

internal void InitializeVolumeComponents()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,33 +321,16 @@ public bool TryGetAllSubclassOf<T>(Type type, List<T> result)
return count != result.Count;
}

/// <summary>
/// A custom hashing function that Unity uses to compare the state of parameters.
/// </summary>
/// <returns>A computed hash code for the current instance.</returns>
public override int GetHashCode()
{
unchecked
{
int hash = 17;

for (int i = 0; i < components.Count; i++)
hash = hash * 23 + components[i].GetHashCode();

return hash;
}
}

internal int GetComponentListHashCode()
{
unchecked
{
int hash = 17;
var hashCode = HashFNV1A32.Create();

for (int i = 0; i < components.Count; i++)
hash = hash * 23 + components[i].GetType().GetHashCode();
hashCode.Append(components[i].GetType().GetHashCode());

return hash;
return hashCode.value;
}
}

Expand Down
5 changes: 5 additions & 0 deletions Packages/com.unity.render-pipelines.core/Runtime/Vrs/Vrs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class VisualizationPassData
/// <summary>
/// Check if conversion of color texture to shading rate image is supported.
/// Convenience to abstract all capabilities checks.
///
/// The `IsColorMaskTextureConversionSupported` method checks for the following:
///- VRS hardware support through [ShadingRateInfo.supportsPerImageTile](xref:UnityEngine.Rendering.ShadingRateInfo.supportsPerImageTile). The `supportsPerImageTile` property determines whether your GPU can define different quality levels to different tiles.
///- Compute shader support through [SystemInfo.supportsComputeShaders](xref:UnityEngine.Device.SystemInfo.supportsComputeShaders)
///- Proper initialization of VRS utility functions and compute shaders required for converting color textures to shading rate image (SRI). This is automatically handled by the render pipeline. However, for custom implementations, you must call <see cref="InitializeResources"/> manually.
/// </summary>
/// <returns>Returns true if conversion of color texture to shading rate image is supported, false otherwise.</returns>
public static bool IsColorMaskTextureConversionSupported()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static void Init()

static void SceneOpened(Scene scene, OpenSceneMode openSceneMode)
{
var currentShowcase = (SamplesShowcase)FindFirstObjectByType(typeof(SamplesShowcase));
var currentShowcase = (SamplesShowcase)FindAnyObjectByType(typeof(SamplesShowcase));
if(currentShowcase != null)
Selection.activeGameObject = currentShowcase.gameObject;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
Expand Down Expand Up @@ -122,4 +123,5 @@ void BakeVATArray(GameObject target, List<AnimationClip> clips, int fps)

Debug.Log($"VAT Array (RGBAHalf) baked: {path} with {clips.Count} clips. Max frames = {maxFrames}");
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Text;
using NUnit.Framework;
using UnityEngine.Rendering;

Expand All @@ -23,7 +24,13 @@ partial class CoreUtilsTests
[TestCase("Assets/TestFolder/Folder#Test/SubFolder/", TestName = "Folder name containing a hash character")]
[TestCase("Assets/TestFolder/Folder@Test/SubFolder/File.txt", TestName = "File name containing @ character")]
[TestCase("Assets/TestFolder/Folder\\SubFolder/File", TestName = "File without extension")]

[TestCase("Assets/TestFolder//DoubleSlash/File.txt", TestName = "Path with double slashes")]
[TestCase("Assets/TestFolder///TripleSlash/File.txt", TestName = "Path with triple slashes")]
[TestCase("Assets/TestFolder/Mixed\\Separators/File.txt", TestName = "Mixed forward and backslashes")]
[TestCase("Assets/TestFolder/A/B/C/D/E/F/G/H/I/J/Deep.txt", TestName = "Deep nested path (10 levels)")]
[TestCase("Assets/TestFolder/Unicode文件夹/File.txt", TestName = "Unicode characters in folder name")]
[TestCase("Assets/TestFolder/Émojis😀/File.txt", TestName = "Emoji in folder name")]
[TestCase("Assets/TestFolder/VeryLongFolderNameThatExceedsNormalLength123456789012345678901234567890/File.txt", TestName = "Very long folder name")]
public void EnsureFolderTreeInAssetFilePath(string path)
{
string folderPath = Path.GetDirectoryName(path);
Expand All @@ -34,15 +41,31 @@ public void EnsureFolderTreeInAssetFilePath(string path)
[Test]
[TestCase("Assets", TestName = "Just Assets and not Assets/")]
[TestCase("NotAssetsFolder/TestFolder/", TestName = "FilePath does not start with Assets/")]
[TestCase("assets/TestFolder/", TestName = "Lowercase assets (case sensitivity)")]
[TestCase("ASSETS/TestFolder/", TestName = "Uppercase ASSETS")]
[TestCase("FileName.txt", TestName = "FileName.txt")]
[TestCase("C:\\Filename.txt", TestName = "C:\\Filename.txt")]
public void EnsureFolderTreeInAssetFilePathThrows(string folderPath)
{
Assert.Throws<ArgumentException>(() => CoreUtils.EnsureFolderTreeInAssetFilePath(folderPath));
}

[Test]
public void EnsureFolderTreeInAssetFilePath_NullOrEmpty_DoesNotThrow()
{
Assert.DoesNotThrow(() => CoreUtils.EnsureFolderTreeInAssetFilePath(null));
Assert.DoesNotThrow(() => CoreUtils.EnsureFolderTreeInAssetFilePath(""));
Assert.DoesNotThrow(() => CoreUtils.EnsureFolderTreeInAssetFilePath(string.Empty));
}

[TearDown]
public void TearDown()
{
AssetDatabase.DeleteAsset("Assets/TestFolder");
if (AssetDatabase.IsValidFolder("Assets/TestFolder"))
{
AssetDatabase.DeleteAsset("Assets/TestFolder");
}
AssetDatabase.Refresh();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3088,6 +3088,7 @@ out ScriptableCullingParameters cullingParams
frozenCullingParamAvailable = false;
}

cullingParams.conservativeEnclosingSphere = currentAsset.m_ShouldUseConservativeEnclosingSphere;
LightLoopUpdateCullingParameters(ref cullingParams, hdCamera);

// If we don't use environment light (like when rendering reflection probes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace UnityEngine.Rendering.HighDefinition
#endif
public partial class HDRenderPipelineAsset : RenderPipelineAsset<HDRenderPipeline>, IVirtualTexturingEnabledRenderPipeline, IProbeVolumeEnabledRenderPipeline, IGPUResidentRenderPipeline, IRenderGraphEnabledRenderPipeline, ISTPEnabledRenderPipeline
{
//This is not exposed to the UI. It can be enabled via Debug inspector if it is really needed.
[SerializeField] internal bool m_ShouldUseConservativeEnclosingSphere;
/// <inheritdoc/>
public override string renderPipelineShaderTag => HDRenderPipeline.k_ShaderTagName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ internal TargetBuffer getConstrainedDepthBuffer()
{
TargetBuffer depth = targetDepthBuffer;
if (depth == TargetBuffer.Camera &&
HDRenderPipeline.currentAsset != null &&
HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.dynamicResolutionSettings.enabled &&
currentHDCamera.allowDynamicResolution &&
currentHDCamera != null && currentHDCamera.allowDynamicResolution &&
injectionPoint == CustomPassInjectionPoint.AfterPostProcess)
{
// This custom pass is injected after postprocessing, and Dynamic Resolution Scaling is enabled, which
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,18 @@ public void Render(RenderGraph graph, ContextContainer frameData, int batchIndex
// Early out for preview camera
if (cameraData.cameraType == CameraType.Preview)
isLitView = false;

DebugHandler debugHandler = GetActiveDebugHandler(cameraData);
if (debugHandler != null)
isLitView = debugHandler.IsLightingActive;
#endif

// Preset global light textures for first batch
if (batchIndex == 0)
{
using (var builder = graph.AddRasterRenderPass<SetGlobalPassData>(k_SetLightBlendTexture, out var passData, m_SetLightBlendTextureProfilingSampler))
{
if (layerBatch.lightStats.useLights)
if (layerBatch.lightStats.useLights && isLitView)
{
passData.lightTextures = universal2DResourceData.lightTextures[batchIndex];
for (var i = 0; i < passData.lightTextures.Length; i++)
Expand Down Expand Up @@ -164,7 +168,7 @@ public void Render(RenderGraph graph, ContextContainer frameData, int batchIndex
builder.UseRendererList(passData.rendererList);
}

if (passData.layerUseLights)
if (passData.layerUseLights && isLitView)
{
passData.lightTextures = universal2DResourceData.lightTextures[batchIndex];
for (var i = 0; i < passData.lightTextures.Length; i++)
Expand Down
Loading
Loading