Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c02e760
Use VFS-aware file reads in ShaderGraph importers to support long pat…
pablobayarri May 19, 2026
6cc2577
[Port] [6000.4] Stable Light Index Tracking using dataIndex in HDRP
nanho-lee May 19, 2026
4d59463
[Port] [6000.4] [2d] Fix case where URP-2D shaders are used with Vfx …
May 20, 2026
115f806
[Port] [6000.4] Disable indirect draws for non-tessellated quad topol…
svens-unity May 20, 2026
db12441
[Port] [6000.4] Lighting/uum 141983 apv clear on incompatible layout
May 21, 2026
dcd21c8
[Port] [6000.4] [UUM-142398] Fix preview generation for graphs using …
May 21, 2026
afc1e12
[content automatically redacted] touching PlatformDependent folder
robinb-u3d May 21, 2026
08b84d4
[Port] [6000.4] [VFX] Avoid access of SystemInfo during compilation
May 22, 2026
388b620
[Port] [6000.4] Frame Debugger - Fix Preview icons broken & Memory co…
May 26, 2026
8bc93bf
[Port] [6000.4] Revert "Merge PR #55837 from graphics/hdrp/fix-uum-84…
May 26, 2026
80d88ca
[Port] [6000.4] Fix APV crash caused by stale cell indices in PruneCe…
May 26, 2026
d1d97b9
[Port] [6000.4] [UUM-137796] Fix offscreen UI rendering for HDR Outpu…
mseonkim-unity May 27, 2026
4512650
[Port] [6000.4] [UUM-142661] Fix HDRP post-processing volume override…
May 27, 2026
31c7890
[Port] [6000.4] [UUM-141627][6000.6][URP 2D] Fix picking for sprites …
May 28, 2026
808697b
[Port] [6000.4] [HDRP] Fix motion blur min-velocity sentinel leak (U…
May 29, 2026
cb3fa05
[Port] [6000.4] [UUM-141781][6000.6][URP 2D] Fix Lens Flare NaN error…
May 29, 2026
3e4818f
[Port] [6000.4] [UUM-143038] Fix NRE in ReAllocateOffscreenUIColorBuf…
May 30, 2026
53c906b
[Port] [6000.4] docg-8792: Restructure Block Node documentation into …
May 30, 2026
8a21ec1
[Port] [6000.4] DOCG-8699 Fix color in subsurface scattering document…
Jun 2, 2026
8a41c62
[Port] [6000.4] [UUM-142884] Fix HDR UI overlay missing when path tra…
mseonkim-unity Jun 2, 2026
b4a440e
[Port] [6000.4] DOCG-8860 Fixed a typo in HDRP docs
Jun 2, 2026
cabb158
[Port] [6000.4] Reference updates for Shader Graph side features due …
Jun 3, 2026
d8c8430
[Port] [6000.4] Fix UUM-137798: Update obsolete useRendererSilhouette…
Jun 3, 2026
26d069e
[Port] [6000.4] [HDRP][Docs] Fix missing Preset M and broken preset t…
Jun 8, 2026
9bf3d77
[content automatically redacted] touching PlatformDependent folder
Jun 9, 2026
f66af48
[Port] [6000.4] DOCR-6416 - updates to XR Plugin Architecture
Jun 9, 2026
792502d
[Port] [6000.4] [VFX] Custom HLSL did not support comments inside the…
Jun 9, 2026
fcad135
[Port] [6000.4] docg-7653: Fix obsolete Master Node references in Sha…
Jun 9, 2026
51e079e
[Port] [6000.4] Fix artifacts of applied rotational reflection probe
Jun 9, 2026
29619c3
[Port] [6000.4] VFXSG: Particle Shaders Improvements
Jun 11, 2026
8a3f4bf
[Port] [6000.4] RenderGraph - Fix "Cannot return local 'actualPasses'…
Jun 11, 2026
d3ecd7f
[Port] [6000.4] [UUM-141977] Fix Shader Graph gradient picker undo/re…
Jun 11, 2026
561a8bd
[6.4] HDRP: Fix VT pragma usage
Olof-AV Jun 13, 2026
d86f1c9
[Port] [6000.4] docg-8402: Use the Flipbook Player with a ShaderGraph…
Jun 13, 2026
3da3fc9
[Port] [6000.4] Fix foveated rendering on dx12
Jun 13, 2026
52c1e45
[Port] [6000.4] Fix material leak in VrsResources.DisposeResources()
svc-reach-platform-support Jun 16, 2026
f1d2fe0
[Port] [6000.4] [UUM-143777] Fix APV with probe occlusion, L2 and sha…
svc-reach-platform-support Jun 16, 2026
3958e17
[Port] [6000.4] Better Hash calculation for Vectors
svc-reach-platform-support Jun 16, 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
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ Editor/Resources/unity[[:space:]]editor[[:space:]]resources filter=lfs diff=lfs
**/HDRP_RuntimeTests/Assets/Scenes/002-HDMaterials/cloud2.asset filter=lfs diff=lfs merge=lfs -text
**/HDRP_RuntimeTests/Assets/Scenes/002-HDMaterials/perlin.asset filter=lfs diff=lfs merge=lfs -text

# Gfx ML acceleration test assets
**/MachineLearning/**/*.bytes filter=lfs diff=lfs merge=lfs -text

#GfxTests
**/GfxTestProjectFolder/**/*.[hH][dD][rR] filter=lfs diff=lfs merge=lfs -text
**/GfxTestProjectFolder/**/*.[tT][gG][aA] filter=lfs diff=lfs merge=lfs -text
Expand Down Expand Up @@ -382,3 +385,6 @@ Editor/Resources/unity[[:space:]]editor[[:space:]]resources filter=lfs diff=lfs
# search test cases
/Modules/QuickSearch/Tests/QuickSearch/Assets/Cases/UUM-113048/uum-113048.index filter=lfs diff=lfs merge=lfs -text

# documentation images
Documentation/ManualDocs/uploads/Main/unity-xr-tech-stack.png filter=lfs diff=lfs merge=lfs -text

Original file line number Diff line number Diff line change
Expand Up @@ -1409,8 +1409,11 @@ Vector3Int GetCellPositionFromVoxel(Vector3Int voxelToLookup, int cellSizeInBric
continue;

// 3.
// Overwrite lighting data with trilinear sampled data from the brick with highest subdiv level
float brickSize = ProbeReferenceVolume.instance.BrickSize(largestBrick.subdivisionLevel - 1);
// Overwrite lighting data with trilinear sampled data from the brick with highest subdiv level.
// Use minBrickSize from m_ProfileInfo (live bake settings), not ProbeReferenceVolume.instance,
// because that runtime state is restored to the previous bake's snapshot at the end of
// ApplySubdivisionResults and would be stale here. UUM-141983.
float brickSize = ProbeVolumeUtil.BrickSize(minBrickSize, largestBrick.subdivisionLevel - 1);
float3 uvw = math.clamp((pos - (Vector3)largestBrick.position * minBrickSize) / brickSize, 0, 3);

var probe = Vector3Int.FloorToInt(uvw);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ private static void ProcessRenderer(int i, bool implicitInstanceIndices, in GPUD
Span<GPUDrivenPackedMaterialData> packedMaterialDatas = stackalloc GPUDrivenPackedMaterialData[materialsCount];

var supportsIndirect = true;
var isMetal = SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal;
for (int matIndex = 0; matIndex < materialsCount; ++matIndex)
{
if (matIndex >= submeshCount)
Expand All @@ -198,7 +199,14 @@ private static void ProcessRenderer(int i, bool implicitInstanceIndices, in GPUD
bool isFound = packedMaterialDataHash.TryGetValue(materialID, out packedMaterialData);
Assert.IsTrue(isFound);
}
supportsIndirect &= packedMaterialData.isIndirectSupported;

var submeshIndex = startSubMesh + matIndex;
var subMesh = rendererData.subMeshDesc[subMeshDescOffset + submeshIndex];

// The indirect path does not support topology adjustment; use the direct path when this is required.
// Concretely, for quads, only use the indirect path if we allow quads natively (e.g. tessellation shaders).
supportsIndirect &= subMesh.topology != MeshTopology.Quads || packedMaterialData.hasTessellation;
supportsIndirect &= !isMetal || !packedMaterialData.hasTessellation;

packedMaterialDatas[matIndex] = packedMaterialData;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ internal struct CellStreamingScratchBufferLayout
public int _ProbeCountInChunkSlice;
}

internal struct BufferLayoutBuilder
{
int _Offset;

public BufferLayoutBuilder(int initialOffset = 0)
{
_Offset = initialOffset;
}

public int AddBlock(int blockSize)
{
int currentOffset = _Offset;
_Offset += blockSize;
return currentOffset;
}
}

internal class CellStreamingScratchBuffer
{
public CellStreamingScratchBuffer(int chunkCount, int chunkSize, bool allocateGraphicsBuffers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,13 +769,13 @@ void ReleaseStreamableAssetData<T>(NativeArray<T> buffer) where T : struct
m_ReadOperationScratchBuffers.Push(buffer.Reinterpret<byte>(UnsafeUtility.SizeOf<T>()));
}

void PruneCellIndexList(List<int> cellIndices, List<int> prunedIndexList)
internal void PruneCellIndexList(List<int> cellIndices, List<int> prunedIndexList)
{
prunedIndexList.Clear();
foreach (var cellIndex in cellIndices)
{
// When clearing data only partially (ie: not all scenes are loaded), there can be left over indices here but no cells in the set.
if (!cellDataMap.ContainsKey(cellIndex))
if (!cellDataMap.ContainsKey(cellIndex) && cellDescs.ContainsKey(cellIndex))
{
prunedIndexList.Add(cellIndex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,20 @@ CellStreamingScratchBufferLayout GetOrCreateScratchBufferLayout(int chunkCount)
// First destination chunks at offset 0 (no explicit member for this).
// Then, shared data destination chunks. Can be different from SH data destination in case of blending
// (one pool for blending and one other pool for shared data and blending destination).
bufferLayout._SharedDestChunksOffset = destChunksSize;
bufferLayout._L0L1rxOffset = bufferLayout._SharedDestChunksOffset + destChunksSize;
bufferLayout._L1GryOffset = bufferLayout._L0L1rxOffset + m_L0Size * chunkCount;
bufferLayout._L1BrzOffset = bufferLayout._L1GryOffset + m_L1Size * chunkCount;
bufferLayout._ValidityOffset = bufferLayout._L1BrzOffset + m_L1Size * chunkCount;
bufferLayout._ProbeOcclusionOffset = bufferLayout._ValidityOffset + m_ValiditySize * chunkCount;
bufferLayout._SkyOcclusionOffset = bufferLayout._ProbeOcclusionOffset + m_ProbeOcclusionSize * chunkCount;
bufferLayout._SkyShadingDirectionOffset = bufferLayout._SkyOcclusionOffset + m_SkyOcclusionSize * chunkCount;
bufferLayout._L2_0Offset = bufferLayout._SkyShadingDirectionOffset + m_SkyShadingDirectionSize * chunkCount;
bufferLayout._L2_1Offset = bufferLayout._L2_0Offset + m_L2Size * chunkCount;
bufferLayout._L2_2Offset = bufferLayout._L2_1Offset + m_L2Size * chunkCount;
bufferLayout._L2_3Offset = bufferLayout._L2_2Offset + m_L2Size * chunkCount;

ProbeReferenceVolume.BufferLayoutBuilder layoutBuilder = new(destChunksSize);
bufferLayout._SharedDestChunksOffset = layoutBuilder.AddBlock(destChunksSize);
bufferLayout._L0L1rxOffset = layoutBuilder.AddBlock(m_L0Size * chunkCount);
bufferLayout._L1GryOffset = layoutBuilder.AddBlock(m_L1Size * chunkCount);
bufferLayout._L1BrzOffset = layoutBuilder.AddBlock(m_L1Size * chunkCount);
bufferLayout._ValidityOffset = layoutBuilder.AddBlock(m_ValiditySize * chunkCount);
bufferLayout._SkyOcclusionOffset = layoutBuilder.AddBlock(m_SkyOcclusionSize * chunkCount);
bufferLayout._SkyShadingDirectionOffset = layoutBuilder.AddBlock(m_SkyShadingDirectionSize * chunkCount);
bufferLayout._L2_0Offset = layoutBuilder.AddBlock(m_L2Size * chunkCount);
bufferLayout._L2_1Offset = layoutBuilder.AddBlock(m_L2Size * chunkCount);
bufferLayout._L2_2Offset = layoutBuilder.AddBlock(m_L2Size * chunkCount);
bufferLayout._L2_3Offset = layoutBuilder.AddBlock(m_L2Size * chunkCount);
bufferLayout._ProbeOcclusionOffset = layoutBuilder.AddBlock(m_ProbeOcclusionSize * chunkCount);

bufferLayout._ProbeCountInChunkLine = ProbeBrickPool.kChunkProbeCountPerDim;
bufferLayout._ProbeCountInChunkSlice = ProbeBrickPool.kChunkProbeCountPerDim * ProbeBrickPool.kBrickProbeCountPerDim;
Expand Down Expand Up @@ -234,7 +236,7 @@ public void ReleaseScratchBuffer(CellStreamingScratchBuffer scratchBuffer)
{
if (scratchBuffer.chunkSize != chunkSize)
{
scratchBuffer.Dispose();
scratchBuffer.Dispose();
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -830,15 +830,15 @@ static Vector3 WorldToViewport(Camera camera, bool isLocalLight, bool isCameraRe
{
if (isLocalLight)
{
return WorldToViewportLocal(isCameraRelative, viewProjMatrix, camera.transform.position, positionWS);
return WorldToViewportLocal(isCameraRelative, viewProjMatrix, camera.transform.position, positionWS, !camera.orthographic);
}
else
{
return WorldToViewportDistance(camera, positionWS);
return WorldToViewportDistance(camera, positionWS, !camera.orthographic);
}
}

static Vector3 WorldToViewportLocal(bool isCameraRelative, Matrix4x4 viewProjMatrix, Vector3 cameraPosWS, Vector3 positionWS)
static Vector3 WorldToViewportLocal(bool isCameraRelative, Matrix4x4 viewProjMatrix, Vector3 cameraPosWS, Vector3 positionWS, bool isPerspective)
{
Vector3 localPositionWS = positionWS;
if (isCameraRelative)
Expand All @@ -847,20 +847,22 @@ static Vector3 WorldToViewportLocal(bool isCameraRelative, Matrix4x4 viewProjMat
}
Vector4 viewportPos4 = viewProjMatrix * localPositionWS;
Vector3 viewportPos = new Vector3(viewportPos4.x, viewportPos4.y, 0f);
viewportPos /= viewportPos4.w;
if (isPerspective)
viewportPos /= viewportPos4.w;
viewportPos.x = viewportPos.x * 0.5f + 0.5f;
viewportPos.y = viewportPos.y * 0.5f + 0.5f;
viewportPos.y = 1.0f - viewportPos.y;
viewportPos.z = viewportPos4.w;
return viewportPos;
}

static Vector3 WorldToViewportDistance(Camera cam, Vector3 positionWS)
static Vector3 WorldToViewportDistance(Camera cam, Vector3 positionWS, bool isPerspective)
{
Vector4 camPos = cam.worldToCameraMatrix * positionWS;
Vector4 viewportPos4 = cam.projectionMatrix * camPos;
Vector3 viewportPos = new Vector3(viewportPos4.x, viewportPos4.y, 0f);
viewportPos /= viewportPos4.w;
if (isPerspective)
viewportPos /= viewportPos4.w;
viewportPos.x = viewportPos.x * 0.5f + 0.5f;
viewportPos.y = viewportPos.y * 0.5f + 0.5f;
viewportPos.z = viewportPos4.w;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void AllocateNativeDataStructuresIfNeeded(int estimatedNumPasses)
// These are risky heuristics that only work because we purposely estimate a very high number of passes
// We need to fix this with a proper size computation
passData = new NativeList<PassData>(estimatedNumPasses, AllocatorManager.Persistent);
compactedNonCulledRasterPasses = new NativeList<PassData>(0, AllocatorManager.Persistent); // Will be resized during the compilation
inputData = new NativeList<PassInputData>(estimatedNumPasses * 2, AllocatorManager.Persistent);
outputData = new NativeList<PassOutputData>(estimatedNumPasses * 2, AllocatorManager.Persistent);
fragmentData = new NativeList<PassFragmentData>(estimatedNumPasses * 4, AllocatorManager.Persistent);
Expand Down Expand Up @@ -87,6 +88,7 @@ public void Clear()
if (m_AreNativeListsAllocated)
{
passData.Clear();
compactedNonCulledRasterPasses.Clear();
fences.Clear();
inputData.Clear();
outputData.Clear();
Expand Down Expand Up @@ -139,6 +141,7 @@ public ref ResourceReaderData ResourceReader(in ResourceHandle h, int i)

// Data per graph level renderpass
public NativeList<PassData> passData;
public NativeList<PassData> compactedNonCulledRasterPasses;
public Dictionary<int, GraphicsFence> fences;
public DynamicArray<Name> passNames;

Expand Down Expand Up @@ -369,6 +372,7 @@ void Cleanup()
if (m_AreNativeListsAllocated)
{
passData.Dispose();
compactedNonCulledRasterPasses.Dispose();
inputData.Dispose();
outputData.Dispose();
fragmentData.Dispose();
Expand Down
Loading
Loading