Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2b47830
[Port] [6000.0] [UUM-155361] [UUM-157412] [HDRP] Re-enable 4012_Motio…
JMargevics Oct 20, 2026
866b23e
[Port] [6000.0] Remove the GC allocation check from the SRP image tests
svc-reach-platform-support Oct 20, 2026
2013245
[Port] [6000.0] [UUM-156931][URP 2D][7000.0] Fix Point Light 2D losin…
svc-reach-platform-support Oct 20, 2026
a6c656a
[Port] [6000.0] docg 8142: Create docs pages for Artistic/Mask Shader…
marta-malberti Oct 20, 2026
3a95160
[Port] [6000.0] [UUM-156028] Remove unused import to fix breakage on …
svc-reach-platform-support Oct 20, 2026
9560b4b
[Port] [6000.0] [UUM-154810] Give new Light2D components a default fr…
svc-reach-platform-support Oct 20, 2026
5ebccf7
[Port] [6000.0] Fix shader variant mismatch when additional light sha…
svc-reach-platform-support Oct 22, 2026
452992b
[Port] [6000.0] [UUM-155363] [HDRP] Add 9006_StencilUsage reference i…
JMargevics Oct 22, 2026
ed9f1fe
[Port] [6000.0] UUM-134256: Fixed "Default" being added to Enum value…
svc-reach-platform-support Oct 22, 2026
02396bc
[Port] [6000.0] [UUM-152935] Move ShadowCasterPath into its own file
svc-reach-platform-support Oct 25, 2026
34f5a22
[Port] [6000.0] [UUM-147033] Fix 2D collider shadow flicker across Ed…
unity-cchu Oct 26, 2026
5058c2e
[Port] [6000.0] Fix passes never merging once a native pass exceeds t…
svc-reach-platform-support Oct 27, 2026
a9c32f0
[Port] [6000.0] [6000.3] [URP] [ShaderGraph] [UUM-155529] Fix LOD Cro…
svc-reach-platform-support Oct 27, 2026
782166e
[Port] [6000.0] [UUM-137732] Fix APV probe placement on Vulkan with A…
svc-reach-platform-support Oct 27, 2026
9488d2a
[Port] [6000.0] [UUM-157948] [URP] [7000.0] Fix RenderGraph sample er…
svc-reach-platform-support Oct 27, 2026
f75ff27
[Port] [6000.0] [UUM-149925] Clear the shadow mesh when a shape sourc…
unity-cchu Oct 28, 2026
ee32478
[Port] [6000.0] [UUM-159140 Save URP asset before build
sdalgo-unity3d Oct 30, 2026
b8207e9
[Port] [6000.0] [UUM-158401] [SRP] Apply the native subpass limit to …
YohannVaastUnity Oct 30, 2026
4e5d135
[Port] [6000.0] [UUM-159093] Fix 2D sprites and UI not rendering with…
svc-reach-platform-support Nov 4, 2026
c2850f2
[Port] [6000.0] DOCG-9337 Fix typo in Screen Space Lens Flare
svc-reach-platform-support Nov 10, 2026
1492747
[Port] [6000.0] [UUM-147726] Fix render requests to cubemaps renderin…
RoseHirigoyen Nov 11, 2026
bb43771
[Port] [6000.0] [Core] Fix bad type on DebugOccluder shader causing w…
geunheepark-unity Nov 22, 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 @@ -23,7 +23,7 @@ CBUFFER_END
#define unity_ObjectToWorld _TreeInstanceToWorld[unity_InstanceID]
#endif

RWTexture3D<float> _Output : register(u4);
RWTexture3D<float4> _Output : register(u4);
float3 _OutputSize;
float3 _VolumeWorldOffset;
float3 _VolumeSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,12 +582,18 @@ public SubPassFlags GetSubPassFlagForMerging()
throw new Exception("SubPassFlag for merging can not be determined if native pass doesn't have a depth attachment");
}

// Depth attachment is always at index 0.
return GetSubPassFlagForMerging(fragments[0].accessFlags);
}

// Same as above, from the access flags of the native pass depth attachment.
static SubPassFlags GetSubPassFlagForMerging(AccessFlags depthAccessFlags)
{
// Only do this for mobile using Vulkan.
#if (PLATFORM_ANDROID)
if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Vulkan)
{
// Depth attachment is always at index 0.
return (fragments[0].accessFlags.HasFlag(AccessFlags.Write)) ? SubPassFlags.None : SubPassFlags.ReadOnlyDepth;
return (depthAccessFlags.HasFlag(AccessFlags.Write)) ? SubPassFlags.None : SubPassFlags.ReadOnlyDepth;
}
else
{
Expand Down Expand Up @@ -812,8 +818,9 @@ public static PassBreakAudit CanMerge(CompilerContextData contextData, int activ
return new PassBreakAudit(PassBreakReason.AttachmentLimitReached, passIdToMerge);
}

// The limit is on native subpasses: graph passes merged into the same native subpass don't count.
bool canMergeNativeSubPass = CanMergeNativeSubPass(contextData, nativePass, passToMerge);
if (!canMergeNativeSubPass && nativePass.numGraphPasses + 1 > NativePassCompiler.k_MaxSubpass)
if (!canMergeNativeSubPass && nativePass.numNativeSubPasses + 1 > NativePassCompiler.k_MaxSubpass)
{
return new PassBreakAudit(PassBreakReason.SubPassLimitReached, passIdToMerge);
}
Expand All @@ -824,6 +831,10 @@ public static PassBreakAudit CanMerge(CompilerContextData contextData, int activ

static bool TotalAttachmentsSizeExceedPixelStorageLimit(CompilerContextData contextData, ref NativePassData nativePass, ref FixedAttachmentArray<PassFragmentData> attachmentsToTryAdding)
{
// A merge that adds no attachment cannot grow the tile footprint, so it can never exceed the limit
if (attachmentsToTryAdding.size == 0)
return false;

// TODO: We are currently only checking for iOS GPU Family 1 to 3 since the storage size is much more restricted (16 bytes for Family 1 and 32 for Family 2 & 3).
// This is temporary. Later on, we should check all iOS GPU Families but also Android (Vulkan) to avoid the same potential restrictions.
if (Application.platform == RuntimePlatform.IPhonePlayer && SystemInfo.maxTiledPixelStorageSize <= 32)
Expand Down Expand Up @@ -959,8 +970,16 @@ static bool CanMergeNativeSubPass(CompilerContextData contextData, NativePassDat
}
}

// If the native pass gets its depth attachment from this merge, TryMerge adds it first and updates
// the flags of the existing subpasses, the last one included (see AddDepthAttachmentFirstDuringMerge)
SubPassFlags lastPassFlags = lastPass.flags;
if (passToMerge.fragmentInfoHasDepth && !nativePass.hasDepth)
{
lastPassFlags |= GetSubPassFlagForMerging(contextData.fragmentData[passToMerge.firstFragment].accessFlags);
}

// last check for flags
return flags == lastPass.flags;
return flags == lastPassFlags;
}

// Try to merge the new graph pass into the last native sub pass or create a new one in the current native pass.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Shader "Hidden/Core/DebugOccluder"
return output;
}

float GetOutputColor(float occluderValue)
float4 GetOutputColor(float occluderValue)
{
float value = saturate((occluderValue - _ValidRange.x) * _ValidRange.y);
return float4(value.xxx, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,107 @@ public void NativeSubPassesLimitNotExceeded()
Assert.AreEqual(Rendering.RenderGraphModule.NativeRenderPassCompiler.PassBreakReason.SubPassLimitReached, passes[0].breakAudit.reason);
}

[Test]
public void NativeSubPassesLimitIgnoresGraphPassesMergedIntoSameSubPass()
{
var g = AllocateRenderGraph();
var renderTargets = ImportAndCreateBuffers(g);

// More graph passes than the native subpasses limit, all using the same attachments so they share a single native subpass
for (int i = 0; i < Rendering.RenderGraphModule.NativeRenderPassCompiler.NativePassCompiler.k_MaxSubpass + 2; i++)
{
using (var builder = g.AddRasterRenderPass<RenderGraphTestPassData>($"TestPass_{i}", out var passData))
{
builder.SetRenderAttachmentDepth(renderTargets.extraDepthBuffer, AccessFlags.Write);
builder.SetRenderAttachment(renderTargets.extraBuffers[0], 0, AccessFlags.Write);
builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { });
builder.AllowPassCulling(false);
}
}

// Different color attachment, so this graph pass needs a second native subpass
using (var builder = g.AddRasterRenderPass<RenderGraphTestPassData>("TestPass_NewSubPass", out var passData))
{
builder.SetRenderAttachmentDepth(renderTargets.extraDepthBuffer, AccessFlags.Write);
builder.SetRenderAttachment(renderTargets.extraBuffers[1], 0, AccessFlags.Write);
builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { });
builder.AllowPassCulling(false);
}

var result = g.CompileNativeRenderGraph(g.ComputeGraphHash());
var passes = result.contextData.GetNativePasses();

Assert.AreEqual(1, passes.Count);
Assert.AreEqual(Rendering.RenderGraphModule.NativeRenderPassCompiler.NativePassCompiler.k_MaxSubpass + 3, passes[0].numGraphPasses);
Assert.AreEqual(2, passes[0].numNativeSubPasses);
}

[Test]
public void NativeSubPassesLimitReachedWithMultipleGraphPassesPerSubPass()
{
var g = AllocateRenderGraph();
var renderTargets = ImportAndCreateBuffers(g);

// Two graph passes per native subpass, alternating the color attachment so that each pair needs a new native subpass,
// one pair more than the native subpasses limit
for (int i = 0; i < 2 * (Rendering.RenderGraphModule.NativeRenderPassCompiler.NativePassCompiler.k_MaxSubpass + 1); i++)
{
using (var builder = g.AddRasterRenderPass<RenderGraphTestPassData>($"TestPass_{i}", out var passData))
{
builder.SetRenderAttachmentDepth(renderTargets.extraDepthBuffer, AccessFlags.Write);
builder.SetRenderAttachment(renderTargets.extraBuffers[(i / 2) % 2], 0, AccessFlags.Write);
builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { });
builder.AllowPassCulling(false);
}
}

var result = g.CompileNativeRenderGraph(g.ComputeGraphHash());
var passes = result.contextData.GetNativePasses();

Assert.AreEqual(2, passes.Count);
Assert.AreEqual(2 * Rendering.RenderGraphModule.NativeRenderPassCompiler.NativePassCompiler.k_MaxSubpass, passes[0].numGraphPasses);
Assert.AreEqual(Rendering.RenderGraphModule.NativeRenderPassCompiler.NativePassCompiler.k_MaxSubpass, passes[0].numNativeSubPasses);
Assert.AreEqual(Rendering.RenderGraphModule.NativeRenderPassCompiler.PassBreakReason.SubPassLimitReached, passes[0].breakAudit.reason);
Assert.AreEqual(2, passes[1].numGraphPasses);
Assert.AreEqual(1, passes[1].numNativeSubPasses);
}

[Test]
public void NativeSubPassesLimitNotExceededWhenMergedPassAddsDepth()
{
var g = AllocateRenderGraph();
var renderTargets = ImportAndCreateBuffers(g);

// As many graph passes as the native subpasses limit, without depth and alternating the color attachment, so one native subpass each
for (int i = 0; i < Rendering.RenderGraphModule.NativeRenderPassCompiler.NativePassCompiler.k_MaxSubpass; i++)
{
using (var builder = g.AddRasterRenderPass<RenderGraphTestPassData>($"TestPass_{i}", out var passData))
{
builder.SetRenderAttachment(renderTargets.extraBuffers[i % 2], 0, AccessFlags.Write);
builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { });
builder.AllowPassCulling(false);
}
}

// Same color attachment as the last native subpass, but this graph pass brings the depth attachment of the native pass,
// which changes the flags of the existing native subpasses when merged
using (var builder = g.AddRasterRenderPass<RenderGraphTestPassData>("TestPass_AddsDepth", out var passData))
{
builder.SetRenderAttachmentDepth(renderTargets.extraDepthBuffer, AccessFlags.Write);
builder.SetRenderAttachment(renderTargets.extraBuffers[(Rendering.RenderGraphModule.NativeRenderPassCompiler.NativePassCompiler.k_MaxSubpass - 1) % 2], 0, AccessFlags.Write);
builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { });
builder.AllowPassCulling(false);
}

var result = g.CompileNativeRenderGraph(g.ComputeGraphHash());
var passes = result.contextData.GetNativePasses();

foreach (var pass in passes)
{
Assert.LessOrEqual(pass.numNativeSubPasses, Rendering.RenderGraphModule.NativeRenderPassCompiler.NativePassCompiler.k_MaxSubpass);
}
}

[Test]
public void AllocateFreeInMergedPassesWorks()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ HDRP adds the following Shader Graph Nodes:
* [HD Scene Color](https://docs.unity3d.com/Packages/com.unity.shadergraph@16.0/manual/HD-Scene-Color-Node.html)
* [HD Scene Depth](https://docs.unity3d.com/Packages/com.unity.shadergraph@16.0/manual/HD-Scene-Depth-Node.html)
* [HD Sample Buffer](https://docs.unity3d.com/Packages/com.unity.shadergraph@16.0/manual/HD-Sample-Buffer-Node.html)
* [Surface Gradient Resolve Normal](https://docs.unity3d.com/Packages/com.unity.shadergraph@16.0/manual/Surface-Gradient-Resolve-Normal-Node.html)
* Eye Shader Graph utilities
* [CirclePupilAnimation](https://docs.unity3d.com/Packages/com.unity.shadergraph@16.0/manual/Circle-Pupil-Animation-Node.html)
* [CorneaRefraction](https://docs.unity3d.com/Packages/com.unity.shadergraph@16.0/manual/Cornea-Refraction-Node.html)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Use the **Flares** settings to control regular flares, reversed flares and warpe
| ----------------------- | ----------------- | ------------------------------------------------------------ |
| **Regular Multiplier** | | Set the strength of regular flares. If the value is 0, HDRP doesn't calculate or render regular flares. The default is 1. |
| **Reversed Multiplier** | | Set the strength of reversed flares. If the value is 0, HDRP doesn't calculate or render reversed flares. The default is 1. |
| **Warped Multipler** | | Set the strength of warped flares. If the value is 0, HDRP doesn't calculate or render warped flares. The default is 1. |
| **Warped Multiplier** | | Set the strength of warped flares. If the value is 0, HDRP doesn't calculate or render warped flares. The default is 1. |
| | **Scale** | Scale the width (**x**) and height (**y**) of warped flares. The defaults are 1. This property only appears if you open the **More** (⋮) menu and select **Show Additional Properties**. |
| **Samples** | | Set the number of times HDRP repeats the regular, reversed and warped flares. The range is 1 through 3. The default is 1. Increasing **Samples** has a big impact on performance. |
| | **Sample Dimmer** | Set the strength of the lens flares HDRP adds if you set **Samples** to 2 or 3. The higher the value, the less intense the flares. This property only appears if you open the **More** (⋮) menu and select **Show Additional Properties**. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera
overrideReferenceName = "_DecalMeshBiasType",
floatType = FloatType.Enum,
value = (int)DecalMeshDepthBiasType.DepthBias,
enumNames = { "Depth Bias", "View Bias" },
enumValues = { (int)DecalMeshDepthBiasType.DepthBias, (int)DecalMeshDepthBiasType.ViewBias },
enumNames = new() { "Depth Bias", "View Bias" },
enumValues = new() { (int)DecalMeshDepthBiasType.DepthBias, (int)DecalMeshDepthBiasType.ViewBias },
hidden = true
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ public static void AddBlendingStatesShaderProperties(
overrideReferenceName = kTransparentCullMode,
floatType = FloatType.Enum,
value = (int)transparentCullMode,
enumNames = { "Front", "Back" },
enumValues = { (int)TransparentCullMode.Front, (int)TransparentCullMode.Back },
enumNames = new() { "Front", "Back" },
enumValues = new() { (int)TransparentCullMode.Front, (int)TransparentCullMode.Back },
hidden = true,
overrideHLSLDeclaration = true,
hlslDeclarationOverride = HLSLDeclaration.DoNotDeclare,
Expand Down Expand Up @@ -242,8 +242,8 @@ public static void AddTessellationShaderProperties(PropertyCollector collector,
overrideReferenceName = kTessellationMode,
floatType = FloatType.Enum,
value = (int)tessellationMode,
enumNames = { "None", "Phong" },
enumValues = { (int)TessellationMode.None, (int)TessellationMode.Phong },
enumNames = new() { "None", "Phong" },
enumValues = new() { (int)TessellationMode.None, (int)TessellationMode.Phong },
hidden = true,
overrideHLSLDeclaration = true,
hlslDeclarationOverride = HLSLDeclaration.DoNotDeclare,
Expand All @@ -270,7 +270,7 @@ public static void AddDoubleSidedProperty(PropertyCollector collector, DoubleSid
collector.AddToggleProperty("_DoubleSidedEnable", mode != DoubleSidedMode.Disabled);
collector.AddShaderProperty(new Vector1ShaderProperty
{
enumNames = { "Flip", "Mirror", "None" }, // values will be 0, 1 and 2
enumNames = new() { "Flip", "Mirror", "None" }, // values will be 0, 1 and 2
floatType = FloatType.Enum,
overrideReferenceName = "_DoubleSidedNormalMode",
hidden = true,
Expand All @@ -288,7 +288,7 @@ public static void AddDoubleSidedProperty(PropertyCollector collector, DoubleSid
});
collector.AddShaderProperty(new Vector1ShaderProperty
{
enumNames = { "Auto", "On", "Off" }, // values will be 0, 1 and 2
enumNames = new() { "Auto", "On", "Off" }, // values will be 0, 1 and 2
floatType = FloatType.Enum,
overrideReferenceName = "_DoubleSidedGIMode",
hidden = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ namespace UnityEditor.Rendering.Universal
{
internal static class FreeformPathPresets
{
public static Vector3[] CreateSquare()
{
Vector3[] returnPath = new Vector3[4]
{
new Vector3(-0.5f, -0.5f),
new Vector3(0.5f, -0.5f),
new Vector3(0.5f, 0.5f),
new Vector3(-0.5f, 0.5f)
};

return returnPath;
}

public static Vector3[] CreateIsometricDiamond()
{
Vector3[] returnPath = new Vector3[4]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static bool CreateLightValidation()
[MenuItem("GameObject/Light/Freeform Light 2D/Square", priority = CoreUtils.Sections.section3 + CoreUtils.Priorities.gameObjectMenuPriority + 4)]
static void CreateSquareFreeformLight2D(MenuCommand menuCommand)
{
CreateLight(menuCommand, Light2D.LightType.Freeform, FreeformPathPresets.CreateSquare());
CreateLight(menuCommand, Light2D.LightType.Freeform);
}

[MenuItem("GameObject/Light/Freeform Light 2D/Circle", priority = CoreUtils.Sections.section3 + CoreUtils.Priorities.gameObjectMenuPriority + 5)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,6 @@

namespace UnityEditor.Rendering.Universal
{
internal class ShadowCasterPath : ScriptablePath
{
internal Bounds GetBounds()
{
ShadowCaster2D shadowCaster = (ShadowCaster2D)owner;
Renderer m_Renderer = shadowCaster.GetComponent<Renderer>();
if (m_Renderer != null)
{
return m_Renderer.bounds;
}
else
{
Collider2D collider = shadowCaster.GetComponent<Collider2D>();
if (collider != null)
return collider.bounds;
}

return new Bounds(shadowCaster.transform.position, shadowCaster.transform.lossyScale);
}

public override void SetDefaultShape()
{
Clear();
Bounds bounds = GetBounds();

AddPoint(new ControlPoint(bounds.min));
AddPoint(new ControlPoint(new Vector3(bounds.min.x, bounds.max.y)));
AddPoint(new ControlPoint(bounds.max));
AddPoint(new ControlPoint(new Vector3(bounds.max.x, bounds.min.y)));

base.SetDefaultShape();
}
}


[CustomEditor(typeof(ShadowCaster2D))]
[CanEditMultipleObjects]
internal class ShadowCaster2DEditor : PathComponentEditor<ShadowCasterPath>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using UnityEditor.Rendering.Universal.Path2D;
using UnityEngine;
using UnityEngine.Rendering.Universal;

namespace UnityEditor.Rendering.Universal
{
internal class ShadowCasterPath : ScriptablePath
{
internal Bounds GetBounds()
{
ShadowCaster2D shadowCaster = (ShadowCaster2D)owner;
Renderer m_Renderer = shadowCaster.GetComponent<Renderer>();
if (m_Renderer != null)
{
return m_Renderer.bounds;
}
else
{
Collider2D collider = shadowCaster.GetComponent<Collider2D>();
if (collider != null)
return collider.bounds;
}

return new Bounds(shadowCaster.transform.position, shadowCaster.transform.lossyScale);
}

public override void SetDefaultShape()
{
Clear();
Bounds bounds = GetBounds();

AddPoint(new ControlPoint(bounds.min));
AddPoint(new ControlPoint(new Vector3(bounds.min.x, bounds.max.y)));
AddPoint(new ControlPoint(bounds.max));
AddPoint(new ControlPoint(new Vector3(bounds.max.x, bounds.min.y)));

base.SetDefaultShape();
}
}
}
Loading
Loading