Skip to content

Commit 62037b1

Browse files
authored
Merge pull request #8259 from Unity-Technologies/internal/master
Mirror Internal/master
2 parents 410d55f + df3511e commit 62037b1

File tree

192 files changed

+9957
-3577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+9957
-3577
lines changed

Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/ReadonlyMaterialConverter/ReadonlyMaterialConverter.MaterialReferenceChanger.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ internal bool ReassignGameObjectMaterials(GameObject go, StringBuilder errors)
117117
catch (Exception ex)
118118
{
119119
errors.Append($"{ex.Message} while trying to reassign materials from {component}.");
120+
ok = false;
120121
}
121122
}
122123
}

Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/DynamicGI/DynamicGISkyOcclusion.urtshader

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal webgpu
1+
#pragma only_renderers d3d11 xboxone xboxseries vulkan metal webgpu
22
#define UNIFIED_RT_GROUP_SIZE_X 64
33
#define UNIFIED_RT_GROUP_SIZE_Y 1
44

Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,13 @@ public BakingBatch(Vector3Int cellCount, ProbeReferenceVolume refVolume)
306306
maxBrickCount = cellCount * ProbeReferenceVolume.CellSize(refVolume.GetMaxSubdivision());
307307
inverseScale = ProbeBrickPool.kBrickCellCount / refVolume.MinBrickSize();
308308
offset = refVolume.ProbeOffset();
309-
309+
310310
// Initialize NativeHashMaps with reasonable initial capacity
311311
// Using a larger capacity to reduce allocations during baking
312312
positionToIndex = new NativeHashMap<int, int>(100000, Allocator.Persistent);
313313
uniqueBrickSubdiv = new NativeHashMap<int, int>(100000, Allocator.Persistent);
314314
}
315-
315+
316316
public void Dispose()
317317
{
318318
if (positionToIndex.IsCreated)
@@ -1348,7 +1348,7 @@ private static void BakeDelegate(ref float progress, out bool done, InputExtract
13481348
{
13491349
FixSeams(
13501350
s_BakeData.positionRemap,
1351-
s_BakeData.originalPositions,
1351+
s_BakeData.sortedPositions,
13521352
s_BakeData.lightingJob.irradiance,
13531353
s_BakeData.lightingJob.validity,
13541354
s_BakeData.lightingJob.occlusion,
@@ -1574,7 +1574,7 @@ internal static void FixSeams(
15741574
NativeArray<Vector4> skyOcclusion,
15751575
NativeArray<uint> renderingLayerMasks)
15761576
{
1577-
// Seams are caused are caused by probes on the boundary between two subdivision levels
1577+
// Seams are caused by probes on the boundary between two subdivision levels
15781578
// The idea is to find first them and do a kind of dilation to smooth the values on the boundary
15791579
// the dilation process consists in doing a trilinear sample of the higher subdivision brick and override the lower subdiv with that
15801580
// We have to mark the probes on the boundary as valid otherwise leak reduction at runtime will interfere with this method
@@ -1694,7 +1694,8 @@ Vector3Int GetCellPositionFromVoxel(Vector3Int voxelToLookup, int cellSizeInBric
16941694
{
16951695
uint renderingLayerMask = renderingLayerMasks[positionRemap[index]];
16961696
bool commonRenderingLayer = (renderingLayerMask & probeRenderingLayerMask) != 0;
1697-
if (!commonRenderingLayer) continue; // We do not use this probe contribution if it does not share at least a common rendering layer
1697+
if (!commonRenderingLayer)
1698+
continue; // We do not use this probe contribution if it does not share at least a common rendering layer
16981699
}
16991700

17001701
// Do the lerp in compressed format to match result on GPU
@@ -1763,7 +1764,7 @@ static void ApplyPostBakeOperations()
17631764
var chunkSizeInProbes = ProbeBrickPool.GetChunkSizeInProbeCount();
17641765
var hasVirtualOffsets = m_BakingSet.settings.virtualOffsetSettings.useVirtualOffset;
17651766
var hasRenderingLayers = m_BakingSet.useRenderingLayers;
1766-
1767+
17671768
if (!ValidateBakingCellsSize(bakingCellsArray, chunkSizeInProbes, hasVirtualOffsets, hasRenderingLayers))
17681769
return; // Early exit if validation fails
17691770

@@ -1939,7 +1940,8 @@ bool GetProbes(out NativeList<Vector3> positions)
19391940
static void GetValidProbeInstanceIds(EntityId[] entityIds, out List<EntityId> validProbeInstanceIds)
19401941
{
19411942
validProbeInstanceIds = new List<EntityId>();
1942-
foreach (EntityId probeInstanceId in entityIds){
1943+
foreach (EntityId probeInstanceId in entityIds)
1944+
{
19431945
if (AdditionalGIBakeRequestsManager.GetPositionForRequest(probeInstanceId, out Vector3 _))
19441946
{
19451947
validProbeInstanceIds.Add(probeInstanceId);

Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/RenderingLayerMask/TraceRenderingLayerMask.urtshader

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma only_renderers d3d11 xboxone xboxseries vulkan metal webgpu
12
#define UNIFIED_RT_GROUP_SIZE_X 64
23
#define UNIFIED_RT_GROUP_SIZE_Y 1
34

Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/VirtualOffset/TraceVirtualOffset.urtshader

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal webgpu switch switch2
1+
#pragma only_renderers d3d11 xboxone xboxseries vulkan metal webgpu
22
#define UNIFIED_RT_GROUP_SIZE_X 64
33
#define UNIFIED_RT_GROUP_SIZE_Y 1
44

Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ internal static void ConvertInstancesAndMeshes(
418418
else
419419
LightmapIntegrationHelpers.ComputeUVBounds(meshes[i].uv2, out uvBoundsSizes[i], out uvBoundsOffsets[i]);
420420
}
421-
Debug.Assert(meshes.Length == bakeInput.meshData.Length);
422421

423422
// Baking specific settings
424423
RenderedGameObjectsFilter filter = RenderedGameObjectsFilter.OnlyStatic;

Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphEditorRemoteDebugSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void OnMessageFromPlayer(DebugMessageHandler.MessageType messageType, DebugMessa
6262
void RegisterAndUpdateDebugData(string graphName, EntityId executionId, string executionName, DebugData debugData)
6363
{
6464
RegisterGraph(graphName);
65-
RegisterExecution(graphName, executionId, debugData.executionName);
65+
RegisterExecution(graphName, executionId, executionName);
6666
SetDebugData(graphName, executionId, debugData);
6767
}
6868
}

Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.PlayerConnection.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ public PlayerConnection(IConnectionState connectionState, UnityEngine.Events.Uni
2424
EditorConnection.instance.Initialize();
2525
EditorConnection.instance.RegisterConnection(m_OnPlayerConnected);
2626
EditorConnection.instance.RegisterDisconnection(m_OnPlayerDisconnected);
27-
28-
EditorApplication.quitting += OnEditorQuitting;
2927
}
3028

3129
public void Dispose()
@@ -35,27 +33,15 @@ public void Dispose()
3533
EditorConnection.instance.UnregisterConnection(m_OnPlayerConnected);
3634
EditorConnection.instance.UnregisterDisconnection(m_OnPlayerDisconnected);
3735

38-
// NOTE: There is a bug where editor crashes if we call DisconnectAll during shutdown flow. In this case
39-
// it's fine to skip the disconnect as the player will get notified of it anyway.
40-
if (!m_EditorQuitting)
41-
EditorConnection.instance.DisconnectAll();
42-
4336
m_ConnectionState.Dispose();
4437
m_ConnectionState = null;
45-
46-
EditorApplication.quitting -= OnEditorQuitting;
4738
}
4839
}
4940

5041
public void OnConnectionDropdownIMGUI()
5142
{
5243
PlayerConnectionGUILayout.ConnectionTargetSelectionDropdown(m_ConnectionState, EditorStyles.toolbarDropDown, 250);
5344
}
54-
55-
void OnEditorQuitting()
56-
{
57-
m_EditorQuitting = true;
58-
}
5945
}
6046
}
6147
}

Packages/com.unity.render-pipelines.core/Editor/SampleDependencyImportSystem/SampleDependencyImporter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ VisualElement panelRoot
4848
{
4949
get
5050
{
51-
_panelRoot ??= injectingElement.panel.visualTree;
51+
_panelRoot ??= injectingElement?.panel?.visualTree;
5252
return _panelRoot;
5353
}
5454
}
@@ -82,11 +82,11 @@ VisualElement IPackageManagerExtension.CreateExtensionUI()
8282

8383
void RefreshSampleButtons()
8484
{
85-
if (injectingElement == null || m_PackageInfo == null || m_SampleList == null)
85+
if (injectingElement == null || m_PackageInfo == null || m_SampleList == null || panelRoot == null)
8686
return;
8787

8888
// Call refresh of samples and button injection when switching to the "Samples" tab.
89-
if (samplesButton == null )
89+
if (samplesButton == null)
9090
{
9191
samplesButton = panelRoot.Q<Button>(name: samplesButtonName);
9292
if (samplesButton != null)

Packages/com.unity.render-pipelines.core/Editor/UnifiedRayTracing/CreateUnifiedRTShaderMenuItem.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ namespace UnityEditor.Rendering.UnifiedRayTracing
77
{
88
internal class ShaderTemplates
99
{
10+
internal static readonly Texture2D shaderIcon = EditorGUIUtility.IconContent("d_TextAsset Icon").image as Texture2D;
11+
1012
[MenuItem("Assets/Create/Shader/Unified Ray Tracing Shader", false, 1)]
1113
internal static void CreateNewUnifiedRayTracingShader()
1214
{
1315
var action = ScriptableObject.CreateInstance<DoCreateUnifiedRayTracingShader>();
14-
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(EntityId.None, action, "NewUnifiedRayTracingShader.urtshader", null, null);
16+
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(EntityId.None, action, "NewUnifiedRayTracingShader.urtshader", shaderIcon, null);
1517
}
1618

1719
internal class DoCreateUnifiedRayTracingShader : AssetCreationEndAction

0 commit comments

Comments
 (0)