Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b20aa2e
[Port] [6000.0] Add correct docs link for ProbeVolumeBakingSet
Oct 21, 2025
8f51369
[Port] [6000.0] [XR][GFX] Fetch the viewport Rect from the RenderPass…
svc-reach-platform-support Oct 23, 2025
25690d2
6000.0/bugfix/uum 73669
SebastienLa Oct 23, 2025
68ccd36
[Port] [6000.0] docg-7965: shader graph asset inspector properties
svc-reach-platform-support Oct 23, 2025
ce9cac7
[Port] [6000.0] docg-8045: Harmonize six-way lighting TOC entry and s…
svc-reach-platform-support Oct 23, 2025
1e62ba7
[Port] [6000.0] Documentation feedback improvements 20 Oct
markg-unity Oct 23, 2025
b6066a8
[Port] [6000.0] [UUM-121472][6000.4][URP 2D] Fix mesh and sprite norm…
kennytann Oct 24, 2025
dc7223c
[Port] [6000.0] [UUM-116762][UUM-116667][6000.4] Fix Custom Render Te…
kennytann Oct 24, 2025
8293112
[Port] [6000.0] Fixed cloud shadow popping when no directional shadow…
svc-reach-platform-support Oct 24, 2025
8e28e63
[Port] [6000.0] [URP] Logged HDR Output events when changing to a RP …
svc-reach-platform-support Oct 26, 2025
9e3c2dd
[Port] [6000.0] Streamline the Shader Graph's Get started instruction…
sebastienduverne Oct 26, 2025
5f81ce8
[Port] [6000.0] DOCG-7982 Move and restructure metallic, specular, an…
svc-reach-platform-support Oct 27, 2025
18d2b88
[Port] [6000.0] [UUM-119276] Fixed sky contribution missing in fog wh…
svc-reach-platform-support Oct 29, 2025
2fa89cd
[Port] [6000.0] [HDRP] fix assertion when HDCamera.allowDynamicResolu…
volkan-unity Oct 29, 2025
aa3fbf0
[Port] [6000.0] [VFX] Six-way : Fix APV sampling position in HDRP
svc-reach-platform-support Oct 30, 2025
27a7b53
[Port] [6000.0] [VFX] Fix output properties order in CustomHLSL operator
svc-reach-platform-support Oct 30, 2025
000b652
SRP-891 - Rename samples to match documentation (6.0)
RoseHirigoyen Oct 30, 2025
4db8447
[Port] [6000.0] [VFX] Update VFX Ray tracing docs + filter out settin…
svc-reach-platform-support Oct 31, 2025
19eb59b
6000.0/bugfix/73675
SebastienLa Oct 31, 2025
a957aec
[Port] [6000.0] UUM-112854 : Split GPUOcclusionCulling indirect args …
svc-reach-platform-support Oct 31, 2025
20755ee
[Port] [6000.0] [HDRP] Fix perceptual smoothness in Specular occlusio…
svc-reach-platform-support Nov 4, 2025
e6d688c
[Port] [6000.0] Graphics docs feedback tickets
svc-reach-platform-support Nov 5, 2025
978e1b5
[Port] [6000.0] DOCG-7704 Clarify Rounded Rectangle node
svc-reach-platform-support Nov 5, 2025
9b315e8
[Port] [6000.0] Fix HDRP undo light crash
svc-reach-platform-support Nov 5, 2025
8e38b07
[Port] [6000.0] Fix thread issue with underline
svc-reach-platform-support Nov 8, 2025
548ba34
[Port] [6000.0] Update Time Node page
svc-reach-platform-support Nov 11, 2025
fa2fca0
[Port] [6000.0] Update UnityInput.hlsl to remove incorrect comment ab…
svc-reach-platform-support Nov 11, 2025
f742305
[Port] [6000.0] RenderGraph - Fix "Cannot return local 'actualPasses'…
YohannVaastUnity Nov 12, 2025
d0343ed
[INSTABILITY] 023_Lighting_Mixed_Indirect_deferred on 6000.0
belgaard Nov 12, 2025
73ca8ba
[Port] [6000.0] Documentation feedback improvements November 2025
svc-reach-platform-support Nov 12, 2025
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 @@ -681,7 +681,7 @@ unsafe public void Execute()
allocInfo.drawCount = outIndirectCommandIndex;
allocInfo.instanceCount = outIndirectVisibleInstanceIndex;

int drawAllocCount = allocInfo.drawCount + IndirectBufferContextStorage.kExtraDrawAllocationCount;
int drawAllocCount = allocInfo.drawCount;
int drawAllocEnd = Interlocked.Add(ref UnsafeUtility.AsRef<int>(allocCounters + (int)IndirectAllocator.NextDrawIndex), drawAllocCount);
allocInfo.drawAllocIndex = drawAllocEnd - drawAllocCount;

Expand Down Expand Up @@ -1525,6 +1525,7 @@ private static class ShaderIDs
public static readonly int InstanceOcclusionCullerShaderVariables = Shader.PropertyToID("InstanceOcclusionCullerShaderVariables");
public static readonly int _DrawInfo = Shader.PropertyToID("_DrawInfo");
public static readonly int _InstanceInfo = Shader.PropertyToID("_InstanceInfo");
public static readonly int _DispatchArgs = Shader.PropertyToID("_DispatchArgs");
public static readonly int _DrawArgs = Shader.PropertyToID("_DrawArgs");
public static readonly int _InstanceIndices = Shader.PropertyToID("_InstanceIndices");
public static readonly int _InstanceDataBuffer = Shader.PropertyToID("_InstanceDataBuffer");
Expand Down Expand Up @@ -1800,7 +1801,7 @@ public unsafe JobHandle CreateCullJobTree(
cullingOutput = cullingOutput.drawCommands,
indirectBufferLimits = indirectBufferLimits,
visibleInstancesBufferHandle = m_IndirectStorage.visibleInstanceBufferHandle,
indirectArgsBufferHandle = m_IndirectStorage.indirectArgsBufferHandle,
indirectArgsBufferHandle = m_IndirectStorage.indirectDrawArgsBufferHandle,
indirectBufferAllocInfo = indirectBufferAllocInfo,
indirectInstanceInfoGlobalArray = m_IndirectStorage.instanceInfoGlobalArray,
indirectDrawInfoGlobalArray = m_IndirectStorage.drawInfoGlobalArray,
Expand Down Expand Up @@ -2092,7 +2093,7 @@ internal void EnsureValidOcclusionTestResults(int viewInstanceID)
int kernel = m_CopyInstancesKernel;
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawInfo, m_IndirectStorage.drawInfoBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceInfo, m_IndirectStorage.instanceInfoBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, m_IndirectStorage.argsBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, m_IndirectStorage.drawArgsBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceIndices, m_IndirectStorage.instanceBuffer);

cmd.DispatchCompute(cs, kernel, (allocInfo.instanceCount + 63) / 64, 1, 1);
Expand Down Expand Up @@ -2245,10 +2246,10 @@ private void AddOcclusionCullingDispatch(
if (doCopyInstances)
{
int kernel = m_CopyInstancesKernel;
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawInfo, m_IndirectStorage.drawInfoBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceInfo, m_IndirectStorage.instanceInfoBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, m_IndirectStorage.argsBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceIndices, m_IndirectStorage.instanceBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawInfo, bufferHandles.drawInfoBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceInfo, bufferHandles.instanceInfoBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, bufferHandles.drawArgsBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceIndices, bufferHandles.instanceBuffer);

cmd.DispatchCompute(cs, kernel, (allocInfo.instanceCount + 63) / 64, 1, 1);
}
Expand All @@ -2257,7 +2258,10 @@ private void AddOcclusionCullingDispatch(
{
int kernel = m_ResetDrawArgsKernel;
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawInfo, bufferHandles.drawInfoBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, bufferHandles.argsBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, bufferHandles.drawArgsBuffer);
if (isSecondPass)
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DispatchArgs, bufferHandles.dispatchArgsBuffer);

cmd.DispatchCompute(cs, kernel, (allocInfo.drawCount + 63) / 64, 1, 1);
}

Expand All @@ -2266,7 +2270,7 @@ private void AddOcclusionCullingDispatch(
int kernel = m_CullInstancesKernel;
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawInfo, bufferHandles.drawInfoBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceInfo, bufferHandles.instanceInfoBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, bufferHandles.argsBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, bufferHandles.drawArgsBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceIndices, bufferHandles.instanceBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceDataBuffer, batchersContext.gpuInstanceDataBuffer);
cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._OcclusionDebugCounters, m_OcclusionEventDebugArray.CounterBuffer);
Expand All @@ -2278,7 +2282,7 @@ private void AddOcclusionCullingDispatch(
OcclusionCullingCommon.SetDebugPyramid(cmd, m_OcclusionTestShader, kernel, occluderHandles);

if (isSecondPass)
cmd.DispatchCompute(cs, kernel, bufferHandles.argsBuffer, (uint)(GraphicsBuffer.IndirectDrawIndexedArgs.size * allocInfo.GetExtraDrawInfoSlotIndex()));
cmd.DispatchCompute(cs, kernel, bufferHandles.dispatchArgsBuffer, 0);
else
cmd.DispatchCompute(cs, kernel, (allocInfo.instanceCount + 63) / 64, 1, 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,22 +560,23 @@ internal struct IndirectBufferContextHandles
{
public BufferHandle instanceBuffer;
public BufferHandle instanceInfoBuffer;
public BufferHandle argsBuffer;
public BufferHandle dispatchArgsBuffer;
public BufferHandle drawArgsBuffer;
public BufferHandle drawInfoBuffer;

public void UseForOcclusionTest(IBaseRenderGraphBuilder builder)
{
instanceBuffer = builder.UseBuffer(instanceBuffer, AccessFlags.ReadWrite);
instanceInfoBuffer = builder.UseBuffer(instanceInfoBuffer, AccessFlags.Read);
argsBuffer = builder.UseBuffer(argsBuffer, AccessFlags.ReadWrite);
dispatchArgsBuffer = builder.UseBuffer(dispatchArgsBuffer, AccessFlags.ReadWrite);
drawArgsBuffer = builder.UseBuffer(drawArgsBuffer, AccessFlags.ReadWrite);
drawInfoBuffer = builder.UseBuffer(drawInfoBuffer, AccessFlags.Read);
}
}

internal struct IndirectBufferContextStorage : IDisposable
{
private const int kAllocatorCount = (int)IndirectAllocator.Count;
internal const int kExtraDrawAllocationCount = 1; // over-allocate by one for indirect args scratch space GPU-side
internal const int kInstanceInfoGpuOffsetMultiplier = 2; // GPU side allocates storage for extra copy of instance list

private IndirectBufferLimits m_BufferLimits;
Expand All @@ -584,7 +585,8 @@ internal struct IndirectBufferContextStorage : IDisposable
private GraphicsBuffer m_InstanceInfoBuffer;
private NativeArray<IndirectInstanceInfo> m_InstanceInfoStaging;

private GraphicsBuffer m_ArgsBuffer;
private GraphicsBuffer m_DispatchArgsBuffer;
private GraphicsBuffer m_DrawArgsBuffer;
private GraphicsBuffer m_DrawInfoBuffer;
private NativeArray<IndirectDrawInfo> m_DrawInfoStaging;

Expand All @@ -596,19 +598,21 @@ internal struct IndirectBufferContextStorage : IDisposable

public GraphicsBuffer instanceBuffer { get { return m_InstanceBuffer; } }
public GraphicsBuffer instanceInfoBuffer { get { return m_InstanceInfoBuffer; } }
public GraphicsBuffer argsBuffer { get { return m_ArgsBuffer; } }
public GraphicsBuffer dispatchArgsBuffer { get { return m_DispatchArgsBuffer; } }
public GraphicsBuffer drawArgsBuffer { get { return m_DrawArgsBuffer; } }
public GraphicsBuffer drawInfoBuffer { get { return m_DrawInfoBuffer; } }

public GraphicsBufferHandle visibleInstanceBufferHandle { get { return m_InstanceBuffer.bufferHandle; } }
public GraphicsBufferHandle indirectArgsBufferHandle { get { return m_ArgsBuffer.bufferHandle; } }
public GraphicsBufferHandle indirectDrawArgsBufferHandle { get { return m_DrawArgsBuffer.bufferHandle; } }

public IndirectBufferContextHandles ImportBuffers(RenderGraph renderGraph)
{
return new IndirectBufferContextHandles()
{
instanceBuffer = renderGraph.ImportBuffer(m_InstanceBuffer),
instanceInfoBuffer = renderGraph.ImportBuffer(m_InstanceInfoBuffer),
argsBuffer = renderGraph.ImportBuffer(m_ArgsBuffer),
dispatchArgsBuffer = renderGraph.ImportBuffer(m_DispatchArgsBuffer),
drawArgsBuffer = renderGraph.ImportBuffer(m_DrawArgsBuffer),
drawInfoBuffer = renderGraph.ImportBuffer(m_DrawInfoBuffer),
};
}
Expand Down Expand Up @@ -653,15 +657,18 @@ void FreeInstanceBuffers()

void AllocateDrawBuffers(int maxDrawCount)
{
m_ArgsBuffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured | GraphicsBuffer.Target.IndirectArguments, (maxDrawCount + kExtraDrawAllocationCount) * (GraphicsBuffer.IndirectDrawIndexedArgs.size / sizeof(int)), sizeof(int));
// Compute dispatch arguments are number of thread groups in X,Y and Z dimensions, hence 3 integers for the size.
m_DispatchArgsBuffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured | GraphicsBuffer.Target.IndirectArguments, 3, sizeof(int));
m_DrawArgsBuffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured | GraphicsBuffer.Target.IndirectArguments, maxDrawCount * (GraphicsBuffer.IndirectDrawIndexedArgs.size / sizeof(int)), sizeof(int));
m_DrawInfoBuffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured, maxDrawCount, System.Runtime.InteropServices.Marshal.SizeOf<IndirectDrawInfo>());
m_DrawInfoStaging = new NativeArray<IndirectDrawInfo>(maxDrawCount, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
m_BufferLimits.maxDrawCount = maxDrawCount;
}

void FreeDrawBuffers()
{
m_ArgsBuffer.Release();
m_DispatchArgsBuffer.Release();
m_DrawArgsBuffer.Release();
m_DrawInfoBuffer.Release();
m_DrawInfoStaging.Dispose();
m_BufferLimits.maxDrawCount = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,18 +911,24 @@ void EvaluateAdaptiveProbeVolume(in float3 posWS, in float3 normalWS, in float3
void EvaluateAdaptiveProbeVolume(in float3 posWS, in float2 positionSS, out float3 bakeDiffuseLighting)
{
APVResources apvRes = FillAPVResources();

posWS = AddNoiseToSamplingPosition(posWS, positionSS, 1);
posWS -= _APVWorldOffset;

float3 ambientProbe = EvaluateAmbientProbe(0);

float3 uvw;
if (TryToGetPoolUVW(apvRes, posWS, 0, 0, uvw))
{
bakeDiffuseLighting = SAMPLE_TEXTURE3D_LOD(apvRes.L0_L1Rx, s_linear_clamp_sampler, uvw, 0).rgb;
if (_APVSkyOcclusionWeight > 0)
{
float skyOcclusionL0 = kSHBasis0 * SAMPLE_TEXTURE3D_LOD(apvRes.SkyOcclusionL0L1, s_linear_clamp_sampler, uvw, 0).x;
bakeDiffuseLighting += ambientProbe * skyOcclusionL0;
}
}
else
{
bakeDiffuseLighting = EvaluateAmbientProbe(0);
bakeDiffuseLighting = ambientProbe;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public LogarithmicAttribute(int min, int max)
/// <summary>
/// An Asset which holds a set of settings to use with a <see cref="Probe Reference Volume"/>.
/// </summary>
[CoreRPHelpURL("probevolumes-usebakingsets", "com.unity.render-pipelines.high-definition")]
public sealed partial class ProbeVolumeBakingSet : ScriptableObject, ISerializationCallbackReceiver
{
internal enum Version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ void DetectMemoryLessResources()
foreach (ref readonly var nativePass in contextData.NativePasses)
{
// Loop over all created resources by this nrp
var graphPasses = nativePass.GraphPasses(contextData);
var graphPasses = nativePass.GraphPasses(contextData, out var actualPasses);
foreach (ref readonly var subPass in graphPasses)
{
foreach (ref readonly var createdRes in subPass.FirstUsedResources(contextData))
Expand Down Expand Up @@ -698,6 +698,8 @@ void DetectMemoryLessResources()
}
}
}
if (actualPasses.IsCreated)
actualPasses.Dispose();
}
}
}
Expand Down Expand Up @@ -742,7 +744,8 @@ private void ExecuteInitializeResource(InternalRenderGraphContext rgContext, Ren
if (pass.mergeState == PassMergeState.Begin || pass.mergeState == PassMergeState.None)
{
ref var nativePass = ref contextData.nativePassData.ElementAt(pass.nativePassIndex);
foreach (ref readonly var subPass in nativePass.GraphPasses(contextData))
var graphPasses = nativePass.GraphPasses(contextData, out var actualPasses);
foreach (ref readonly var subPass in graphPasses)
{
foreach (ref readonly var res in subPass.FirstUsedResources(contextData))
{
Expand Down Expand Up @@ -770,6 +773,8 @@ private void ExecuteInitializeResource(InternalRenderGraphContext rgContext, Ren
}
}
}
if (actualPasses.IsCreated)
actualPasses.Dispose();
}
}
// Other passes just create them at the beginning of the individual pass
Expand Down Expand Up @@ -1290,7 +1295,8 @@ private void ExecuteDestroyResource(InternalRenderGraphContext rgContext, Render
if (pass.mergeState == PassMergeState.End || pass.mergeState == PassMergeState.None)
{
ref var nativePass = ref contextData.nativePassData.ElementAt(pass.nativePassIndex);
foreach (ref readonly var subPass in nativePass.GraphPasses(contextData))
var graphPasses = nativePass.GraphPasses(contextData, out var actualPasses);
foreach (ref readonly var subPass in graphPasses)
{
foreach (ref readonly var res in subPass.LastUsedResources(contextData))
{
Expand All @@ -1301,6 +1307,8 @@ private void ExecuteDestroyResource(InternalRenderGraphContext rgContext, Render
}
}
}
if (actualPasses.IsCreated)
actualPasses.Dispose();
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,15 +615,16 @@ public readonly bool IsValid()
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<PassData> GraphPasses(CompilerContextData ctx)
public readonly ReadOnlySpan<PassData> GraphPasses(CompilerContextData ctx, out NativeArray<PassData> actualPasses)
{
// When there's no pass being culled, we can directly return a Span of the Native List
if (lastGraphPass - firstGraphPass + 1 == numGraphPasses)
{
actualPasses = default;
return ctx.passData.MakeReadOnlySpan(firstGraphPass, numGraphPasses);
}

var actualPasses =
actualPasses =
new NativeArray<PassData>(numGraphPasses, Allocator.Temp,
NativeArrayOptions.UninitializedMemory);

Expand All @@ -642,10 +643,14 @@ public readonly ReadOnlySpan<PassData> GraphPasses(CompilerContextData ctx)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly void GetGraphPassNames(CompilerContextData ctx, DynamicArray<Name> dest)
{
foreach (ref readonly var pass in GraphPasses(ctx))
var span = GraphPasses(ctx, out var actualPasses);
foreach (ref readonly var pass in span)
{
dest.Add(pass.GetName(ctx));
}

if (actualPasses.IsCreated)
actualPasses.Dispose();
}

// This function does not modify the current render graph state, it only evaluates and returns the correct PassBreakAudit
Expand Down
Loading