Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
91da1eb
[Port] [6000.3] Fix performance regression caused by incorrect Meta p…
svc-reach-platform-support Dec 15, 2025
cf630c5
[Port] [6000.3] Fix UUM-125596 AcesTonemap() half precision bug
svc-reach-platform-support Dec 15, 2025
9db776c
[Port] [6000.3] Added a new method to change Global Settings in Player
svc-reach-platform-support Dec 15, 2025
41020ea
[Port] [6000.3] DOCG-8161 Document nested properties and keywords
markg-unity Dec 15, 2025
26960c9
[Port] [6000.3] Fix BRG,GRD and EG on 16KiB cbuffer limited low end m…
svc-reach-platform-support Dec 15, 2025
192d60d
[Port] [6000.3] Manual backport: Fix the FD issue by avoiding pooling…
YohannVaastUnity Dec 17, 2025
b383e08
[Port] [6000.3] Add missing DEBUG_DISPLAY check to MixFogColor
svc-reach-platform-support Dec 17, 2025
b96d1e7
[Port] [6000.3] Adjust the header name on the VRS Runtime Resources g…
svc-reach-platform-support Dec 17, 2025
c06c093
[Port] [6000.3] Fixed Screen Space Lens Flare mip bias 0
svc-reach-platform-support Dec 17, 2025
f3a0b0c
MPPM Fix asset database is read only error by setting VFXManager as d…
kpurcellunity Dec 17, 2025
0b4dc65
[Port] [6000.3] [Shader Graph] Fix for UUM-114439
svc-reach-platform-support Dec 17, 2025
63e10ce
[Port] [6000.3] Graph Settings tab ref page update in Shader Graph docs
sebastienduverne Dec 18, 2025
bf6db15
[Port] [6000.3] [UUM-130317][6000.5] Add back sort at root
svc-reach-platform-support Dec 18, 2025
7127521
[Port] [6000.3] Fixed ClearDispatchIndirect being passed incorrect gr…
svc-reach-platform-support Dec 18, 2025
fcc7b75
[Port] [6000.3] Shader Graph documentation bugfixes Dec 2025
svc-reach-platform-support Dec 19, 2025
de1c65d
[Port] [6000.3] Fix shader warning in TraceTransparentRays.urtshader
svc-reach-platform-support Dec 20, 2025
bbe5155
[Port] [6000.3] [Shader Graph] Toolbar Icons Fixes
svc-reach-platform-support Dec 22, 2025
39c0982
[6.3] Disable test timing out on macos
theo-at-unity Dec 22, 2025
9d88209
[Port] [6000.3] [SRP] Fix Water SSR
svc-reach-platform-support Dec 22, 2025
c0a6245
[Port] [6000.3] [HDRP] Fix DLSS & FSR2 black screen when CustomPass i…
svc-reach-platform-support Jan 2, 2026
533a84b
[Port] [6000.3] Removed old DebugLevel field from URP asset
kirill-titov-u Jan 2, 2026
8a1f23f
[Port] [6000.3] URP: Fix screen-space decals in Deferred
svc-reach-platform-support Jan 5, 2026
1bbc0a5
[Port] [6000.3] Fix minor package sample issues
svc-reach-platform-support Jan 6, 2026
b2ca32b
Backport - Shader Graph's New Nodes Preview option description
sebastienduverne Jan 6, 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 @@ -118,6 +118,7 @@ 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 @@ -1621,6 +1622,15 @@ public void BeginRecording(in RenderGraphParameters parameters)
m_RenderGraphContext.renderGraphPool = m_RenderGraphPool;
m_RenderGraphContext.defaultResources = m_DefaultResources;

// 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 =
#if UNITY_EDITOR || DEVELOPMENT_BUILD
FrameDebugger.enabled;
#else
false;
#endif

if (m_DebugParameters.immediateMode)
{
UpdateCurrentCompiledGraph(graphHash: -1, forceNoCaching: true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ internal bool CreatePooledResource(InternalRenderGraphContext rgContext, int typ
var resource = m_RenderGraphResources[type].resourceArray[index];
if (!resource.imported)
{
resource.CreatePooledGraphicsResource();
resource.CreatePooledGraphicsResource(rgContext.forceResourceCreation);

if (m_RenderGraphDebug.enableLogging)
resource.LogCreation(m_FrameInformationLogger);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public virtual bool NeedsFallBack()
return requestFallBack && writeCount == 0;
}

public virtual void CreatePooledGraphicsResource() { }
public virtual void CreatePooledGraphicsResource(bool forceResourceCreation) { }
public virtual void CreateGraphicsResource() { }
public virtual void UpdateGraphicsResource() { }
public virtual void ReleasePooledGraphicsResource(int frameIndex) { }
Expand Down Expand Up @@ -231,7 +231,7 @@ public override void ReleaseGraphicsResource()
graphicsResource = null;
}

public override void CreatePooledGraphicsResource()
public override void CreatePooledGraphicsResource(bool forceResourceCreation)
{
Debug.Assert(m_Pool != null, "RenderGraphResource: CreatePooledGraphicsResource should only be called for regular pooled resources");

Expand All @@ -242,7 +242,7 @@ public override void CreatePooledGraphicsResource()

// If the pool doesn't have any available resource that we can use, we will create one
// In any case, we will update the graphicsResource name based on the RenderGraph resource name
if (!m_Pool.TryGetResource(hashCode, out graphicsResource))
if (forceResourceCreation || !m_Pool.TryGetResource(hashCode, out graphicsResource))
{
CreateGraphicsResource();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace UnityEngine.Rendering
/// </summary>
[Serializable]
[SupportedOnRenderPipeline]
[Categorization.CategoryInfo(Name = "R: VRS - Runtime Resources", Order = 1000)]
[Categorization.CategoryInfo(Name = "VRS - Runtime Resources", Order = 1000)]
public sealed class VrsRenderPipelineRuntimeResources : IRenderPipelineResources
{
/// <summary>
Expand All @@ -18,6 +18,7 @@ public sealed class VrsRenderPipelineRuntimeResources : IRenderPipelineResources
bool IRenderPipelineGraphicsSettings.isAvailableInPlayerBuild => true;

[SerializeField]
[Tooltip("Compute shader used for converting textures to shading rate values")]
[ResourcePath("Runtime/Vrs/Shaders/VrsTexture.compute")]
ComputeShader m_TextureComputeShader;

Expand All @@ -31,6 +32,7 @@ public ComputeShader textureComputeShader
}

[SerializeField]
[Tooltip("Shader used when visualizing shading rate values as a color image")]
[ResourcePath("Runtime/Vrs/Shaders/VrsVisualization.shader")]
Shader m_VisualizationShader;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ float3 AcesTonemap(float3 aces)

// --- Red modifier --- //
half hue = rgb_2_hue(half3(aces));
half centeredHue = center_hue(hue, RRT_RED_HUE);
float centeredHue = center_hue(hue, RRT_RED_HUE); // UUM-125596 Must be float for subsequent calculations
float hueWeight;
{
//hueWeight = cubic_basis_shaper(centeredHue, RRT_RED_WIDTH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void SetupDOTSInstanceSelectMasks() {}

#ifdef UNITY_DOTS_INSTANCING_UNIFORM_BUFFER
CBUFFER_START(unity_DOTSInstancing_IndirectInstanceVisibility)
float4 unity_DOTSInstancing_IndirectInstanceVisibilityRaw[4096];
float4 unity_DOTSInstancing_IndirectInstanceVisibilityRaw[1024];
CBUFFER_END
#else
ByteAddressBuffer unity_DOTSInstancing_IndirectInstanceVisibility;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int _AnyHitDecision;

uint AnyHitExecute(UnifiedRT::HitContext hitContext, inout RayPayload payload)
{
payload.anyHits |= (1 << hitContext.InstanceID());
payload.anyHits |= (1u << hitContext.InstanceID());

return _AnyHitDecision;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
Expand All @@ -16,6 +17,7 @@ internal class HDRPBuildData : IDisposable
public List<HDRenderPipelineAsset> renderPipelineAssets { get; private set; } = new List<HDRenderPipelineAsset>();
public bool playerNeedRaytracing { get; private set; }
public bool stripDebugVariants { get; private set; } = true;
public bool dynamicLightmapsUsed { get; private set; }
public bool waterDecalMaskAndCurrent { get; private set; }
public Dictionary<int, ComputeShader> rayTracingComputeShaderCache { get; private set; } = new();
public Dictionary<int, ComputeShader> computeShaderCache { get; private set; } = new();
Expand Down Expand Up @@ -69,13 +71,43 @@ public HDRPBuildData(BuildTarget buildTarget, bool isDevelopmentBuild)
m_Instance = this;
}

public void SetDynamicLightmapsUsedInBuildScenes()
{
dynamicLightmapsUsed = DynamicLightmapsUsedInBuildScenes();
}

static bool DynamicLightmapsUsedInBuildScenes()
{
var originalSetup = EditorSceneManager.GetSceneManagerSetup();

bool dynamicLightmapsUsed = false;
foreach (EditorBuildSettingsScene scene in EditorBuildSettings.scenes)
{
if (!scene.enabled) continue;

EditorSceneManager.OpenScene(scene.path, OpenSceneMode.Single);

if (Lightmapping.HasDynamicGILightmapTextures())
{
dynamicLightmapsUsed = true;
break;
}
}

if (originalSetup.Length > 0)
EditorSceneManager.RestoreSceneManagerSetup(originalSetup);

return dynamicLightmapsUsed;
}

public void Dispose()
{
renderPipelineAssets?.Clear();
rayTracingComputeShaderCache?.Clear();
computeShaderCache?.Clear();
playerNeedRaytracing = false;
stripDebugVariants = true;
dynamicLightmapsUsed = false;
waterDecalMaskAndCurrent = false;
buildingPlayerForHDRenderPipeline = false;
runtimeShaders = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public void OnPreprocessBuild(BuildReport report)
bool isDevelopmentBuild = (report.summary.options & BuildOptions.Development) != 0;
m_BuildData = new HDRPBuildData(EditorUserBuildSettings.activeBuildTarget, isDevelopmentBuild);

// Since the HDRPBuildData instance is used in a lot of places, doing this check here ensures that it is done before the build starts.
m_BuildData.SetDynamicLightmapsUsedInBuildScenes();

if (m_BuildData.buildingPlayerForHDRenderPipeline)
{
// Now that we know that we are on HDRP we need to make sure everything is correct, otherwise we break the build.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
Expand Down Expand Up @@ -70,8 +71,10 @@ protected override bool DoShadersStripper(HDRenderPipelineAsset hdrpAsset, Shade
// Remove editor only pass
bool isSceneSelectionPass = snippet.passName == "SceneSelectionPass";
bool isScenePickingPass = snippet.passName == "ScenePickingPass";
bool metaPassUnused = (snippet.passName == "META") && (SupportedRenderingFeatures.active.enlighten == false ||
((int)SupportedRenderingFeatures.active.lightmapBakeTypes | (int)LightmapBakeType.Realtime) == 0);

bool isEnlightenSupported = SupportedRenderingFeatures.active.enlighten && ((int)SupportedRenderingFeatures.active.lightmapBakeTypes | (int)LightmapBakeType.Realtime) != 0;
bool metaPassUnused = (snippet.passName == "META") && (!isEnlightenSupported || !HDRPBuildData.instance.dynamicLightmapsUsed);

bool editorVisualization = inputData.shaderKeywordSet.IsEnabled(m_EditorVisualization);
if (isSceneSelectionPass || isScenePickingPass || metaPassUnused || editorVisualization)
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,6 @@ PreLightData GetPreLightData(float3 V, PositionInputs posInput, inout BSDFData b
// Grab the water profile of this surface
WaterSurfaceProfile profile = _WaterSurfaceProfiles[bsdfData.surfaceIndex];

// Make sure to apply the smoothness fade
EvaluateSmoothnessFade(posInput.positionWS, profile, bsdfData);

// Profile data
preLightData.tipScatteringHeight = profile.tipScatteringHeight;
preLightData.bodyScatteringHeight = profile.bodyScatteringHeight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ static void BuildDispatchIndirectArguments(BuildGPULightListPassData data, bool

// clear dispatch indirect buffer
cmd.SetComputeBufferParam(data.clearDispatchIndirectShader, s_ClearDispatchIndirectKernel, HDShaderIDs.g_DispatchIndirectBuffer, data.output.dispatchIndirectBuffer);
cmd.DispatchCompute(data.clearDispatchIndirectShader, s_ClearDispatchIndirectKernel, 1, 1, 1);
cmd.DispatchCompute(data.clearDispatchIndirectShader, s_ClearDispatchIndirectKernel, HDUtils.DivRoundUp(LightDefinitions.s_NumFeatureVariants, k_ThreadGroupOptimalSize), 1, data.viewCount);

// add tiles to indirect buffer
cmd.SetComputeBufferParam(data.buildDispatchIndirectShader, s_BuildIndirectKernel, HDShaderIDs.g_DispatchIndirectBuffer, data.output.dispatchIndirectBuffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4126,6 +4126,7 @@ TextureHandle LensFlareScreenSpacePass(RenderGraph renderGraph, HDCamera hdCamer

int ratio = (int)m_LensFlareScreenSpace.resolution.value;
Color tintColor = m_LensFlareScreenSpace.tintColor.value;
int bloomMip = m_LensFlareScreenSpace.bloomMip.value;

using (var builder = renderGraph.AddUnsafePass<LensFlareScreenSpaceData>("Lens Flare Screen Space", out var passData, ProfilingSampler.Get(HDProfileId.LensFlareScreenSpace)))
{
Expand All @@ -4135,7 +4136,10 @@ TextureHandle LensFlareScreenSpacePass(RenderGraph renderGraph, HDCamera hdCamer
passData.viewport = postProcessViewportSize;
passData.hdCamera = hdCamera;
passData.screenSpaceLensFlareBloomMipTexture = screenSpaceLensFlareBloomMipTexture;
builder.UseTexture(passData.screenSpaceLensFlareBloomMipTexture, AccessFlags.ReadWrite);
// NOTE: SSLF mip texture is usually the bloom.mip[N] and the BloomTexture is bloom.mip[0]. Sometimes N == 0 which causes double UseTexture error.
// Check if we are trying to use the same texture twice in the RG.
if(bloomMip != 0)
builder.UseTexture(passData.screenSpaceLensFlareBloomMipTexture, AccessFlags.ReadWrite);
passData.originalBloomTexture = originalBloomTexture;
builder.UseTexture(passData.originalBloomTexture, AccessFlags.ReadWrite);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public partial class HDRenderPipelineAsset : RenderPipelineAsset<HDRenderPipelin
/// <inheritdoc/>
public override string renderPipelineShaderTag => HDRenderPipeline.k_ShaderTagName;

/// <inheritdoc/>
protected override bool requiresCompatibleRenderPipelineGlobalSettings => true;

[System.NonSerialized]
internal bool isInOnValidateCall = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,11 @@ private void InternalNVIDIARender(in DLSSPass.Parameters parameters, UpscalerRes
dlssViewData.presetDLAA = parameters.drsSettings.DLSSRenderPresetForDLAA;

dlssViewData.inputRes = new UpscalerResolution() { width = (uint)parameters.hdCamera.actualWidth, height = (uint)parameters.hdCamera.actualHeight };
dlssViewData.outputRes = new UpscalerResolution() { width = (uint)DynamicResolutionHandler.instance.finalViewport.x, height = (uint)DynamicResolutionHandler.instance.finalViewport.y };

dlssViewData.outputRes = new UpscalerResolution() {
width = (uint)parameters.hdCamera.finalViewport.width,
height = (uint)parameters.hdCamera.finalViewport.height
};

dlssViewData.jitterX = -parameters.hdCamera.taaJitter.x;
dlssViewData.jitterY = -parameters.hdCamera.taaJitter.y;
dlssViewData.reset = parameters.resetHistory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,10 @@ private void InternalAMDRender(
bool useCameraCustomAttributes = parameters.hdCamera.fidelityFX2SuperResolutionUseCustomAttributes;
var fsr2ViewData = new Fsr2ViewData();
fsr2ViewData.inputRes = new UpscalerResolution() { width = (uint)parameters.hdCamera.actualWidth, height = (uint)parameters.hdCamera.actualHeight };
fsr2ViewData.outputRes = new UpscalerResolution() { width = (uint)DynamicResolutionHandler.instance.finalViewport.x, height = (uint)DynamicResolutionHandler.instance.finalViewport.y };
fsr2ViewData.outputRes = new UpscalerResolution() {
width = (uint)parameters.hdCamera.finalViewport.width,
height = (uint)parameters.hdCamera.finalViewport.height
};
fsr2ViewData.jitterX = parameters.hdCamera.taaJitter.x;
fsr2ViewData.jitterY = parameters.hdCamera.taaJitter.y;
fsr2ViewData.reset = parameters.hdCamera.isFirstFrame;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ void Frag(PackedVaryingsToPS packedInput,

// Compute the BSDF Data
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(input.positionSS.xy, surfaceData);
WaterSurfaceProfile profile = _WaterSurfaceProfiles[bsdfData.surfaceIndex];
EvaluateSmoothnessFade(posInput.positionWS, profile, bsdfData);


// If the camera is in the underwater region of this surface and the the camera is under the surface
#if defined(SHADER_STAGE_FRAGMENT)
Expand Down
Loading