diff --git a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/ReadonlyMaterialConverter/ReadonlyMaterialConverter.MaterialReferenceChanger.cs b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/ReadonlyMaterialConverter/ReadonlyMaterialConverter.MaterialReferenceChanger.cs index 7c9a20ac876..abbb14bddbe 100644 --- a/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/ReadonlyMaterialConverter/ReadonlyMaterialConverter.MaterialReferenceChanger.cs +++ b/Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/ReadonlyMaterialConverter/ReadonlyMaterialConverter.MaterialReferenceChanger.cs @@ -117,6 +117,7 @@ internal bool ReassignGameObjectMaterials(GameObject go, StringBuilder errors) catch (Exception ex) { errors.Append($"{ex.Message} while trying to reassign materials from {component}."); + ok = false; } } } diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/DynamicGI/DynamicGISkyOcclusion.urtshader b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/DynamicGI/DynamicGISkyOcclusion.urtshader index ce153c3c74a..c149aa3d06b 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/DynamicGI/DynamicGISkyOcclusion.urtshader +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/DynamicGI/DynamicGISkyOcclusion.urtshader @@ -1,4 +1,4 @@ -#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal webgpu +#pragma only_renderers d3d11 xboxone xboxseries vulkan metal webgpu #define UNIFIED_RT_GROUP_SIZE_X 64 #define UNIFIED_RT_GROUP_SIZE_Y 1 diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs index a749bf754b4..10d597db8fd 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs @@ -306,13 +306,13 @@ public BakingBatch(Vector3Int cellCount, ProbeReferenceVolume refVolume) maxBrickCount = cellCount * ProbeReferenceVolume.CellSize(refVolume.GetMaxSubdivision()); inverseScale = ProbeBrickPool.kBrickCellCount / refVolume.MinBrickSize(); offset = refVolume.ProbeOffset(); - + // Initialize NativeHashMaps with reasonable initial capacity // Using a larger capacity to reduce allocations during baking positionToIndex = new NativeHashMap(100000, Allocator.Persistent); uniqueBrickSubdiv = new NativeHashMap(100000, Allocator.Persistent); } - + public void Dispose() { if (positionToIndex.IsCreated) @@ -1348,7 +1348,7 @@ private static void BakeDelegate(ref float progress, out bool done, InputExtract { FixSeams( s_BakeData.positionRemap, - s_BakeData.originalPositions, + s_BakeData.sortedPositions, s_BakeData.lightingJob.irradiance, s_BakeData.lightingJob.validity, s_BakeData.lightingJob.occlusion, @@ -1574,7 +1574,7 @@ internal static void FixSeams( NativeArray skyOcclusion, NativeArray renderingLayerMasks) { - // Seams are caused are caused by probes on the boundary between two subdivision levels + // Seams are caused by probes on the boundary between two subdivision levels // The idea is to find first them and do a kind of dilation to smooth the values on the boundary // the dilation process consists in doing a trilinear sample of the higher subdivision brick and override the lower subdiv with that // 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 { uint renderingLayerMask = renderingLayerMasks[positionRemap[index]]; bool commonRenderingLayer = (renderingLayerMask & probeRenderingLayerMask) != 0; - if (!commonRenderingLayer) continue; // We do not use this probe contribution if it does not share at least a common rendering layer + if (!commonRenderingLayer) + continue; // We do not use this probe contribution if it does not share at least a common rendering layer } // Do the lerp in compressed format to match result on GPU @@ -1763,7 +1764,7 @@ static void ApplyPostBakeOperations() var chunkSizeInProbes = ProbeBrickPool.GetChunkSizeInProbeCount(); var hasVirtualOffsets = m_BakingSet.settings.virtualOffsetSettings.useVirtualOffset; var hasRenderingLayers = m_BakingSet.useRenderingLayers; - + if (!ValidateBakingCellsSize(bakingCellsArray, chunkSizeInProbes, hasVirtualOffsets, hasRenderingLayers)) return; // Early exit if validation fails @@ -1939,7 +1940,8 @@ bool GetProbes(out NativeList positions) static void GetValidProbeInstanceIds(EntityId[] entityIds, out List validProbeInstanceIds) { validProbeInstanceIds = new List(); - foreach (EntityId probeInstanceId in entityIds)
 { + foreach (EntityId probeInstanceId in entityIds) + { if (AdditionalGIBakeRequestsManager.GetPositionForRequest(probeInstanceId, out Vector3 _)) { validProbeInstanceIds.Add(probeInstanceId); diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/RenderingLayerMask/TraceRenderingLayerMask.urtshader b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/RenderingLayerMask/TraceRenderingLayerMask.urtshader index f8ff98e3171..98d6b31bb14 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/RenderingLayerMask/TraceRenderingLayerMask.urtshader +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/RenderingLayerMask/TraceRenderingLayerMask.urtshader @@ -1,3 +1,4 @@ +#pragma only_renderers d3d11 xboxone xboxseries vulkan metal webgpu #define UNIFIED_RT_GROUP_SIZE_X 64 #define UNIFIED_RT_GROUP_SIZE_Y 1 diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/VirtualOffset/TraceVirtualOffset.urtshader b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/VirtualOffset/TraceVirtualOffset.urtshader index 90e95a176ff..c340f1bb9c6 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/VirtualOffset/TraceVirtualOffset.urtshader +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/VirtualOffset/TraceVirtualOffset.urtshader @@ -1,4 +1,4 @@ -#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal webgpu switch switch2 +#pragma only_renderers d3d11 xboxone xboxseries vulkan metal webgpu #define UNIFIED_RT_GROUP_SIZE_X 64 #define UNIFIED_RT_GROUP_SIZE_Y 1 diff --git a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs index b83ba215aa6..ff5ba7c9097 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/PathTracing/BakeInputToWorldConversion.cs @@ -418,7 +418,6 @@ internal static void ConvertInstancesAndMeshes( else LightmapIntegrationHelpers.ComputeUVBounds(meshes[i].uv2, out uvBoundsSizes[i], out uvBoundsOffsets[i]); } - Debug.Assert(meshes.Length == bakeInput.meshData.Length); // Baking specific settings RenderedGameObjectsFilter filter = RenderedGameObjectsFilter.OnlyStatic; diff --git a/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphEditorRemoteDebugSession.cs b/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphEditorRemoteDebugSession.cs index ed8e790425f..93f44f69518 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphEditorRemoteDebugSession.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphEditorRemoteDebugSession.cs @@ -62,7 +62,7 @@ void OnMessageFromPlayer(DebugMessageHandler.MessageType messageType, DebugMessa void RegisterAndUpdateDebugData(string graphName, EntityId executionId, string executionName, DebugData debugData) { RegisterGraph(graphName); - RegisterExecution(graphName, executionId, debugData.executionName); + RegisterExecution(graphName, executionId, executionName); SetDebugData(graphName, executionId, debugData); } } diff --git a/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.PlayerConnection.cs b/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.PlayerConnection.cs index 1c608b40cf8..800f7294110 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.PlayerConnection.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.PlayerConnection.cs @@ -24,8 +24,6 @@ public PlayerConnection(IConnectionState connectionState, UnityEngine.Events.Uni EditorConnection.instance.Initialize(); EditorConnection.instance.RegisterConnection(m_OnPlayerConnected); EditorConnection.instance.RegisterDisconnection(m_OnPlayerDisconnected); - - EditorApplication.quitting += OnEditorQuitting; } public void Dispose() @@ -35,15 +33,8 @@ public void Dispose() EditorConnection.instance.UnregisterConnection(m_OnPlayerConnected); EditorConnection.instance.UnregisterDisconnection(m_OnPlayerDisconnected); - // NOTE: There is a bug where editor crashes if we call DisconnectAll during shutdown flow. In this case - // it's fine to skip the disconnect as the player will get notified of it anyway. - if (!m_EditorQuitting) - EditorConnection.instance.DisconnectAll(); - m_ConnectionState.Dispose(); m_ConnectionState = null; - - EditorApplication.quitting -= OnEditorQuitting; } } @@ -51,11 +42,6 @@ public void OnConnectionDropdownIMGUI() { PlayerConnectionGUILayout.ConnectionTargetSelectionDropdown(m_ConnectionState, EditorStyles.toolbarDropDown, 250); } - - void OnEditorQuitting() - { - m_EditorQuitting = true; - } } } } diff --git a/Packages/com.unity.render-pipelines.core/Editor/SampleDependencyImportSystem/SampleDependencyImporter.cs b/Packages/com.unity.render-pipelines.core/Editor/SampleDependencyImportSystem/SampleDependencyImporter.cs index 2c2fad2aeb9..fcc9fb36d9a 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/SampleDependencyImportSystem/SampleDependencyImporter.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/SampleDependencyImportSystem/SampleDependencyImporter.cs @@ -48,7 +48,7 @@ VisualElement panelRoot { get { - _panelRoot ??= injectingElement.panel.visualTree; + _panelRoot ??= injectingElement?.panel?.visualTree; return _panelRoot; } } @@ -82,11 +82,11 @@ VisualElement IPackageManagerExtension.CreateExtensionUI() void RefreshSampleButtons() { - if (injectingElement == null || m_PackageInfo == null || m_SampleList == null) + if (injectingElement == null || m_PackageInfo == null || m_SampleList == null || panelRoot == null) return; // Call refresh of samples and button injection when switching to the "Samples" tab. - if (samplesButton == null ) + if (samplesButton == null) { samplesButton = panelRoot.Q