Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
83c81a2
[Port] [6000.2] [VFX][Fix] Fix VFX blackboard losing selection when s…
svc-reach-platform-support Oct 21, 2025
b3f029f
[Port] [6000.2] Fixed UUM-108024. Removed receivesHierarchyGeometryCh…
svc-reach-platform-support Oct 21, 2025
cba26f0
[Port] [6000.2] RenderGraph - Fix a crash on old IOS devices due to a…
YohannVaastUnity Oct 21, 2025
998c10e
Modify First Person Controller to use the Input System
SebastienLa Oct 21, 2025
38c209e
[Port] [6000.2] [XR][GFX] Fetch the viewport Rect from the RenderPass…
svc-reach-platform-support Oct 22, 2025
b046b21
[Port] [6000.2] docg-8045: Harmonize six-way lighting TOC entry and s…
svc-reach-platform-support Oct 22, 2025
dc52b50
[Port] [6000.2] docg-7965: shader graph asset inspector properties
svc-reach-platform-support Oct 22, 2025
62db59e
[Port] [6000.2] Documentation feedback improvements 20 Oct
markg-unity Oct 22, 2025
b71bb5f
[Port] [6000.2] Add correct docs link for ProbeVolumeBakingSet
svc-reach-platform-support Oct 24, 2025
1c549bd
[Backport][6000.2][Tests][HDRP] Enable DLSS tests DX12/Vulkan
volkan-unity Oct 24, 2025
325c4de
[Port] [6000.2] [UUM-121472][6000.4][URP 2D] Fix mesh and sprite norm…
kennytann Oct 24, 2025
7886c30
[Port] [6000.2] [UUM-116762][UUM-116667][6000.4] Fix Custom Render Te…
kennytann Oct 24, 2025
20df1bd
[Port] [6000.2] Fixed cloud shadow popping when no directional shadow…
svc-reach-platform-support Oct 24, 2025
f8e7227
[Port] [6000.2] Streamline the Shader Graph's Get started instruction…
sebastienduverne Oct 24, 2025
241f5b1
[Port] [6000.2] [URP] Logged HDR Output events when changing to a RP …
svc-reach-platform-support Oct 26, 2025
9b62cae
[Port] [6000.2] fix: Fix null reference exception in ShadowMesh2D and…
svc-reach-platform-support Oct 26, 2025
ab1d875
[Port 6000.2] URP Fix partial prepass in deferred - should not be dep…
UnityAljosha Oct 26, 2025
d2e636d
[Port] [6000.2] DOCG-7982 / DOCG-7602 Move and restructure metallic, …
markg-unity Oct 27, 2025
a4fc56f
[Port] [6000.2] [HDRP] fix assertion when HDCamera.allowDynamicResolu…
svc-reach-platform-support Oct 29, 2025
99c5dda
[Port] [6000.2] [UUM-119276] Fixed sky contribution missing in fog wh…
svc-reach-platform-support Oct 29, 2025
5cf8654
[Port 6000.2] URP Fix ZWrite in Forward Pass
UnityAljosha Oct 31, 2025
dad7020
[Port] [6000.2] [VFX] Fix output properties order in CustomHLSL operator
svc-reach-platform-support Oct 31, 2025
52e9414
[Port] [6000.2] [VFX] Six-way : Fix APV sampling position in HDRP
svc-reach-platform-support Oct 31, 2025
e93e74b
[Port] [6000.2] [VFX][Fix] Prevent warning about pow with potential n…
svc-reach-platform-support Oct 31, 2025
ac53853
SRP-891 - Rename samples to match documentation (6.2)
RoseHirigoyen Oct 31, 2025
2566a9c
[Port] [6000.2] [VFX] Update VFX Ray tracing docs + filter out settin…
svc-reach-platform-support Oct 31, 2025
a689a94
[Port] [6000.2] UUM-112854 : Split GPUOcclusionCulling indirect args …
svc-reach-platform-support Oct 31, 2025
7a74f3c
[Port] [6000.2] [HDRP] Fix perceptual smoothness in Specular occlusio…
svc-reach-platform-support Oct 31, 2025
7e3f366
[Port] [6000.2] [VFX] Safe normalize in LookAt operator to prevent NaN
svc-reach-platform-support Oct 31, 2025
48a69ea
[Port] [6000.2] [VFX] Prevent multiple outputs in a same graph to hav…
svc-reach-platform-support Oct 31, 2025
ce9a4e5
[Port] [6000.2] Clustering no longer uses probes with null texture
svc-reach-platform-support Nov 3, 2025
6efe3d4
[Port] [6000.2] fix BRG failing test on android samsung s21
svc-reach-platform-support Nov 3, 2025
5e818ac
[Port] [6000.2] Fix cyclic asset references in Lens Flares
svc-reach-platform-support Nov 3, 2025
3317284
[Port] [6000.2] Graphics docs feedback tickets
svc-reach-platform-support Nov 4, 2025
14be48e
Added fix for depth only shadow strip off variant
Nzollner Nov 5, 2025
25f59c0
[Port] [6000.2] DOCG-7704 Clarify Rounded Rectangle node
svc-reach-platform-support Nov 5, 2025
60f9b12
[Port] [6000.2] [VFX] ColorField get lost after domain reload
svc-reach-platform-support Nov 5, 2025
2a0b661
[Port] [6000.2] Fix HDRP undo light crash
svc-reach-platform-support Nov 6, 2025
c5ad0a6
[Port] [6000.2] Update UnityInput.hlsl to remove incorrect comment ab…
svc-reach-platform-support Nov 7, 2025
9ce05e5
[Port] [6000.2] [UUM-122631][6000.5][URP 2D] Fix Sprite Skinning for …
kennytann Nov 7, 2025
48dddda
[6000.2] Disable progress bar when using Live Update debug view mode …
pema99 Nov 8, 2025
8135052
[Port] [6000.2] Update Time Node page
svc-reach-platform-support Nov 11, 2025
c599e4e
[Port] [6000.2] Fixed disable light settings
svc-reach-platform-support Nov 11, 2025
15e278a
[Port] [6000.2] Documentation feedback improvements November 2025
svc-reach-platform-support Nov 12, 2025
88f67ec
[Port] [6000.2] UUM-120684 : Fixed Scene Visibility toggle button not…
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 @@ -164,7 +164,7 @@ static ProbeSubdivisionResult GetWorldSubdivision(ref bool canceledByUser)
return GetBricksFromLoaded();

var ctx = PrepareProbeSubdivisionContext();
return BakeBricks(ctx, m_BakingBatch.contributors, ref canceledByUser);
return BakeBricks(ctx, m_BakingBatch.contributors, showProgress: true, ref canceledByUser);
}

static NativeList<Vector3> ApplySubdivisionResults(ProbeSubdivisionResult results, ref bool canceledByUser)
Expand Down Expand Up @@ -319,7 +319,7 @@ static internal ProbeSubdivisionContext PrepareProbeSubdivisionContext(bool live
return ctx;
}

static internal ProbeSubdivisionResult BakeBricks(ProbeSubdivisionContext ctx, in GIContributors contributors, ref bool canceledByUser)
static internal ProbeSubdivisionResult BakeBricks(ProbeSubdivisionContext ctx, in GIContributors contributors, bool showProgress, ref bool canceledByUser)
{
var result = new ProbeSubdivisionResult();

Expand All @@ -334,7 +334,7 @@ static internal ProbeSubdivisionResult BakeBricks(ProbeSubdivisionContext ctx, i
// subdivide all the cells and generate brick positions
foreach (var cell in ctx.cells)
{
if (cellIdx++ % freq == 0) // Don't refresh progress bar at every iteration because it's slow
if (showProgress && cellIdx++ % freq == 0) // Don't refresh progress bar at every iteration because it's slow
{
if (EditorUtility.DisplayCancelableProgressBar("Generating Probe Volume Bricks", $"Processing cell {cellIdx} out of {ctx.cells.Count}", Mathf.Lerp(progress0, progress1, cellIdx / (float)ctx.cells.Count)))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void UpdateRealtimeSubdivisionDebug()
if (s_CurrentSubdivision == null)
{
// Start a new Subdivision
s_CurrentSubdivision = Subdivide();
s_CurrentSubdivision = Subdivide(showProgress: false);
}

// Step the subdivision with the amount of cell per frame in debug menu
Expand All @@ -71,7 +71,7 @@ static void UpdateRealtimeSubdivisionDebug()
}
}

IEnumerator Subdivide()
IEnumerator Subdivide(bool showProgress)
{
var ctx = AdaptiveProbeVolumes.PrepareProbeSubdivisionContext(true);
var contributors = GIContributors.Find(GIContributors.ContributorFilter.All);
Expand Down Expand Up @@ -115,7 +115,7 @@ IEnumerator Subdivide()
ctx.cells.Add(cell);

bool canceledByUser = false;
var result = AdaptiveProbeVolumes.BakeBricks(ctx, contributors, ref canceledByUser);
var result = AdaptiveProbeVolumes.BakeBricks(ctx, contributors, showProgress, ref canceledByUser);

if (result.cells.Count != 0)
ProbeReferenceVolume.instance.realtimeSubdivisionInfo[cell.bounds] = result.cells[0].bricks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ void DrawSummary(Rect summaryRect, SerializedProperty element, int index)
{
SerializedProperty lensFlareDataSRP = element.FindPropertyRelative("lensFlareDataSRP");
fieldRect.MoveNext();
EditorGUI.PropertyField(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP);
DrawLensFlareDataSRPFieldWithCycleDetection(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP);
EditorGUIUtility.labelWidth = oldLabelWidth;
return;
}
Expand Down Expand Up @@ -918,7 +918,7 @@ void DrawTypeCathegory(ref Rect remainingRect, SerializedProperty element)
{
SerializedProperty lensFlareDataSRP = element.FindPropertyRelative("lensFlareDataSRP");
fieldRect.MoveNext();
EditorGUI.PropertyField(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP);
DrawLensFlareDataSRPFieldWithCycleDetection(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP);
}
break;
}
Expand Down Expand Up @@ -1247,6 +1247,67 @@ T GetEnum<T>(SerializedProperty property)

void SetEnum<T>(SerializedProperty property, T value)
=> property.intValue = (int)(object)value;

void DrawLensFlareDataSRPFieldWithCycleDetection(Rect rect, SerializedProperty lensFlareDataSRPProperty, GUIContent label)
{
LensFlareDataSRP currentAsset = target as LensFlareDataSRP;

EditorGUI.BeginChangeCheck();
LensFlareDataSRP newValue = EditorGUI.ObjectField(rect, label, lensFlareDataSRPProperty.objectReferenceValue, typeof(LensFlareDataSRP), false) as LensFlareDataSRP;

if (EditorGUI.EndChangeCheck())
{
// Check for cycles before setting the value
bool wouldCreateCycle = false;

if (newValue != null && currentAsset != null)
{
// Direct self-reference check
if (currentAsset == newValue)
{
wouldCreateCycle = true;
}
else
{
// Multi-level cycle check - see if newValue already references currentAsset
HashSet<LensFlareDataSRP> visited = new HashSet<LensFlareDataSRP>();

// Recursive function to check if targetAsset is found in asset's dependency chain
bool CheckCycle(LensFlareDataSRP asset, LensFlareDataSRP targetAsset)
{
if (asset == null || visited.Contains(asset))
return false;

visited.Add(asset);

foreach (var element in asset.elements)
{
if (element.flareType == SRPLensFlareType.LensFlareDataSRP && element.lensFlareDataSRP != null)
{
if (element.lensFlareDataSRP == targetAsset || CheckCycle(element.lensFlareDataSRP, targetAsset))
return true;
}
}
return false;
}

wouldCreateCycle = CheckCycle(newValue, currentAsset);
}
}

if (wouldCreateCycle)
{
// Cycle detected - set to null and show a warning
lensFlareDataSRPProperty.objectReferenceValue = null;
Debug.LogWarning($"Cannot assign lens flare asset '{newValue.name}' because it would create a cyclic dependency. Setting to null to prevent infinite loop.");
}
else
{
lensFlareDataSRPProperty.objectReferenceValue = newValue;
}
}
}

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,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 @@ -1758,6 +1758,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 @@ -2091,7 +2092,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 @@ -2386,7 +2387,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 @@ -2539,10 +2540,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 @@ -2551,7 +2552,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 @@ -2560,7 +2564,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 @@ -2572,7 +2576,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 Expand Up @@ -2610,6 +2614,7 @@ private void OnEndSceneViewCameraRendering()

public void UpdateFrame(int cameraCount)
{
DisposeSceneViewHiddenBits();
DisposeCompactVisibilityMasks();
if (cameraCount > m_LODParamsToCameraID.Capacity)
m_LODParamsToCameraID.Capacity = cameraCount;
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
Loading