From b080d7cac8374e0e2a32b70f0394c7a9313eaac3 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Thu, 9 Oct 2025 17:58:52 +0200 Subject: [PATCH] Auto-sync from SVN revision 66397 --- .../ProbeGIBaking.LightTransport.cs | 44 ++++++---- .../ProbeVolume/ProbeGIBaking.Placement.cs | 38 +++++++-- .../ProbeGIBaking.Serialization.cs | 81 ++++++++++++++++--- .../ProbeGIBaking.VirtualOffset.cs | 15 +++- .../Lighting/ProbeVolume/ProbeGIBaking.cs | 38 +++++++-- .../ProbeVolume/ProbeVolumeBuildProcessor.cs | 15 +++- .../Editor/MaterialUpgrader.cs | 10 ++- .../StyleSheets/RenderGraphViewerLight.uss | 2 +- .../Components/DisallowGPUDrivenRendering.cs | 3 +- .../Lighting/ProbeVolume/ProbeVolume.hlsl | 16 ++-- .../ProbeVolumeBlendStates.compute | 16 ++-- .../ProbeVolume/ProbeVolumeUploadData.compute | 6 +- .../ProbeVolumeUploadDataL2.compute | 8 +- .../Compiler/NativePassCompiler.Debug.cs | 5 +- .../RenderGraph/Compiler/PassesData.cs | 20 +++++ .../NativePassCompilerRenderGraphTests.cs | 60 +++++++++++++- .../package.json | 2 +- .../Material/Decal/DecalProjectorEditor.cs | 1 + .../Editor/Tools/ColorCheckerToolEditor.cs | 23 ++++-- .../HDRenderPipeline.RenderGraph.cs | 2 + .../Material/DefaultHDParticleMaterial.mat | 23 +++--- .../Tests/Runtime/RuntimeExampleTest.cs | 1 + .../package.json | 2 +- Packages/com.unity.shadergraph/package.json | 2 +- .../Runtime/TMP/TMP_InputField.cs | 4 +- .../com.unity.ugui/Runtime/TMP/TMP_Text.cs | 54 ++++++++----- .../com.unity.ugui/Runtime/TMP/TextMeshPro.cs | 73 ++++++++++------- .../Runtime/TMP/TextMeshProUGUI.cs | 73 ++++++++++------- .../InputModules/StandaloneInputModule.cs | 45 ++++++++--- .../UGUI/UI/Core/Layout/CanvasScaler.cs | 2 +- .../UGUI/UI/Core/Layout/LayoutGroup.cs | 10 +++ .../AssertionFailureOnOutputVertexCount.cs | 2 +- ...ValidPositionsWhenCameraOrthoSizeIsZero.cs | 2 +- ...vasWidthAssertionErrorWithRectTransform.cs | 2 +- .../Editor/UGUI/Canvas/RootCanvasTests.cs | 2 +- ...ilerAddMarkerWithNullObjectDoesNotCrash.cs | 2 +- .../ChangingHierarchyOfCanvasRenderer.cs | 2 +- .../UGUI/CanvasRenderer/ParentCanvasIsSane.cs | 2 +- .../Dropdown/DropdownOptionsListDrawer.cs | 4 +- .../EventTriggerRemoveDuringExecution.cs | 2 +- .../UGUI/EventSystem/InputModuleTests.cs | 4 +- .../InterceptedEventsPreviewTests.cs | 2 +- .../InputField/CharacterLimitValidation.cs | 2 +- .../UGUI/InputField/ContentValidation.cs | 2 +- .../UGUI/RectMask2D/RectMask2DCulling.cs | 2 +- .../UGUI/RectMask2D/RectTransformPosition.cs | 2 +- .../UGUI/Slider/SliderRectReferences.cs | 2 +- .../Tests/Editor/UGUI/TestBehaviourBase.cs | 2 +- .../Editor/UGUI/Text/FontCreatedByScript.cs | 2 +- .../UI/PropertyDrawers/PropertyDrawerTests.cs | 2 +- .../UGUI/UnityEvent/UnityEventInvoke.cs | 2 +- .../Tests/Editor/UGUI/WrapperWindowFixture.cs | 4 +- .../Tests/Runtime/UGUI/Button/ButtonTests.cs | 2 +- .../Canvas/BridgeScriptForRetainingObjects.cs | 2 +- .../UGUI/Canvas/CanvasGroupInheritedAlpha.cs | 2 +- .../CanvasResizeCorrectlyForRenderTexture.cs | 2 +- ...asScalerWithChildTextObjectDoesNotCrash.cs | 2 +- .../CanvasSizeCorrectInAwakeAndStart.cs | 2 +- .../CanvasSizeCorrectInAwakeAndStartScript.cs | 2 +- .../Canvas/CheckMeshColorsAndColors32Match.cs | 2 +- .../CoroutineWorksIfUIObjectIsAttached.cs | 6 +- .../Tests/Runtime/UGUI/Canvas/NestedCanvas.cs | 2 +- .../NestedCanvasMaintainsCorrectSize.cs | 2 +- ...NoActiveCameraInSceneDoesNotCrashEditor.cs | 2 +- .../RectMask2DReparentedToDifferentCanvas.cs | 2 +- ...NestedCanvasCullsUsingCorrectCanvasRect.cs | 2 +- .../Canvas/RectTransformValidAfterEnable.cs | 2 +- .../RectangleContainsScreenPointTest.cs | 2 +- .../UGUI/Canvas/SiblingOrderChangesLayout.cs | 2 +- .../CanvasRenderer/CanvasRendererTests.cs | 2 +- .../Runtime/UGUI/Dropdown/DropdownTests.cs | 2 +- .../UGUI/EventSystem/GraphicRaycasterTests.cs | 2 +- .../GraphicRaycasterWorldSpaceCanvasTests.cs | 2 +- .../UGUI/EventSystem/InputModuleTests.cs | 58 ++++++++++++- .../InputModuleTests/DragCallbackCheck.cs | 15 +++- .../InputModuleTests/FakeBaseInput.cs | 2 +- .../InputModuleTests/MouseUpdate.cs | 2 +- .../PointerClickCallbackCheck.cs | 2 +- .../PointerEnterCallbackCheck.cs | 2 +- .../PointerExitCallbackCheck.cs | 2 +- .../EventSystem/Physics2DRaycasterTests.cs | 2 +- .../UGUI/EventSystem/PhysicsRaycasterTests.cs | 2 +- .../UGUI/EventSystem/RaycastSortingTests.cs | 2 +- .../Tests/Runtime/UGUI/Graphic/ImageTests.cs | 2 +- .../Runtime/UGUI/Graphic/RawImageTest.cs | 2 +- .../Runtime/UGUI/Graphic/RawImageTestHook.cs | 2 +- .../UGUI/Graphic/ToggleTestImageHook.cs | 2 +- .../UGUI/Image/ImageFilledGenerateWork.cs | 2 +- .../Tests/Runtime/UGUI/Image/ImageTests.cs | 16 +++- .../Tests/Runtime/UGUI/Image/TestableImage.cs | 2 +- .../UGUI/InputField/DesktopInputFieldTests.cs | 2 +- .../UGUI/InputField/FakeInputModule.cs | 2 +- .../UGUI/InputField/GenericInputFieldTests.cs | 2 +- .../UGUI/InputField/InputFieldTests.cs | 2 +- .../UGUI/InputField/TouchInputFieldTests.cs | 2 +- .../UGUI/Layout/HorizonalLayoutGroupTests.cs | 2 +- .../Runtime/UGUI/Layout/LayoutGroupScaling.cs | 2 +- .../Runtime/UGUI/Layout/LayoutGroupTests.cs | 75 +++++++++++++++++ .../UGUI/Layout/LayoutGroupTests.cs.meta | 2 + .../UGUI/Layout/VerticalLayoutGroupTests.cs | 2 +- .../LayoutGroup/LayoutGroupArrangement.cs | 2 +- .../UGUI/MaskClipping/RectMask2DClipping.cs | 2 +- ...SceneWithNestedLayoutElementsLoadScript.cs | 2 +- .../SceneWithNestedLayoutElementsLoads.cs | 2 +- .../Runtime/UGUI/ScrollBar/ScrollBarClamp.cs | 2 +- .../Runtime/UGUI/ScrollBar/ScrollBarTests.cs | 2 +- .../UGUI/ScrollRect/ScrollRectClamp.cs | 2 +- .../UGUI/ScrollRect/ScrollRectScale.cs | 2 +- .../UGUI/ScrollRect/ScrollRectStableLayout.cs | 2 +- .../UGUI/ScrollRect/ScrollRectTests.cs | 2 +- .../Tests/Runtime/UGUI/Slider/SliderTests.cs | 2 +- .../TextEditor/TextEditorBackspaceDelete.cs | 2 +- .../UGUI/TextEditor/TextEditorTests.cs | 2 +- .../Runtime/UGUI/Util/ConcreteGraphic.cs | 2 +- .../Tests/Runtime/UGUI/Util/ImageHook.cs | 2 +- .../UGUI/Util/UIBehaviourExtensions.cs | 10 +-- Packages/com.unity.ugui/package.json | 2 +- .../GraphView/Blackboard/VFXBlackboard.cs | 3 +- .../Blackboard/VFXBlackboardCategory.cs | 5 ++ .../GraphView/Profiling/VFXProfilingBoard.cs | 4 +- .../Editor/GraphView/VFXComponentBoard.cs | 11 --- .../Views/Properties/NumericPropertiesRM.cs | 2 +- .../Editor/GraphView/Views/VFXView.cs | 33 +++++++- .../Editor/Inspector/VFXAssetEditor.cs | 34 ++++---- .../Editor/Inspector/VisualEffectEditor.cs | 5 +- .../Implementations/VFXComposedTopology.cs | 2 + .../CreateFromTemplateDropDownButton.cs | 4 +- .../Editor/UIResources/uss/VFXContext.uss | 1 - .../Editor/UIResources/uss/VFXControls.uss | 4 + .../uxml/VFXCompileDropdownPanel.uxml | 2 +- .../com.unity.visualeffectgraph/package.json | 2 +- 131 files changed, 826 insertions(+), 326 deletions(-) create mode 100644 Packages/com.unity.ugui/Tests/Runtime/UGUI/Layout/LayoutGroupTests.cs create mode 100644 Packages/com.unity.ugui/Tests/Runtime/UGUI/Layout/LayoutGroupTests.cs.meta diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.LightTransport.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.LightTransport.cs index 46df8365..d0511b70 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.LightTransport.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.LightTransport.cs @@ -1005,27 +1005,36 @@ namespace UnityEngine.Rendering if (!failed) { - for (int c = 0; c < bakingCells.Length; c++) + // Validate baking cells size before any global state modifications + var chunkSizeInProbes = ProbeBrickPool.GetChunkSizeInProbeCount(); + var hasVirtualOffsets = m_BakingSet.settings.virtualOffsetSettings.useVirtualOffset; + var hasRenderingLayers = m_BakingSet.useRenderingLayers; + + if (ValidateBakingCellsSize(bakingCells, chunkSizeInProbes, hasVirtualOffsets, hasRenderingLayers)) { - ref var cell = ref bakingCells[c]; - ComputeValidityMasks(cell); - } - - // Write result to disk - WriteBakingCells(bakingCells); + for (int c = 0; c < bakingCells.Length; c++) + { + ref var cell = ref bakingCells[c]; + ComputeValidityMasks(cell); + } - // Reload everything - AssetDatabase.SaveAssets(); - AssetDatabase.Refresh(); + // Attempt to write the result to disk + if (WriteBakingCells(bakingCells)) + { + // Reload everything + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); - if (m_BakingSet.hasDilation) - { - // Force reloading of data - foreach (var data in prv.perSceneDataList) - data.Initialize(); + if (m_BakingSet.hasDilation) + { + // Force reloading of data + foreach (var data in prv.perSceneDataList) + data.Initialize(); - InitDilationShaders(); - PerformDilation(); + InitDilationShaders(); + PerformDilation(); + } + } } } } @@ -1045,6 +1054,7 @@ namespace UnityEngine.Rendering bakingSet.settings.virtualOffsetSettings.useVirtualOffset = savedVirtualOffset; bakingSet.useRenderingLayers = savedRenderingLayers; + m_BakingBatch?.Dispose(); m_BakingBatch = null; m_BakingSet = null; } diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Placement.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Placement.cs index 112732aa..5e6692a0 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Placement.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Placement.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using Unity.Collections; using UnityEngine.SceneManagement; using UnityEditor; - +using System.Runtime.InteropServices; using Brick = UnityEngine.Rendering.ProbeBrickIndex.Brick; namespace UnityEngine.Rendering @@ -187,7 +187,8 @@ namespace UnityEngine.Rendering int positionStart = positions.Length; ConvertBricksToPositions(bricks, out var probePositions, out var brickSubdivLevels); - DeduplicateProbePositions(in probePositions, in brickSubdivLevels, m_BakingBatch, positions, out var probeIndices); + if (!DeduplicateProbePositions(in probePositions, in brickSubdivLevels, m_BakingBatch, positions, out var probeIndices)) + return new NativeList(Allocator.Persistent); BakingCell cell = new BakingCell() { @@ -206,9 +207,22 @@ namespace UnityEngine.Rendering return positions; } - private static void DeduplicateProbePositions(in Vector3[] probePositions, in int[] brickSubdivLevel, BakingBatch batch, + // We know that the current limitation on native containers is this. When an integer overflow bug (https://jira.unity3d.com/browse/UUM-113721) has been fixed, we can raise the limit + // This and related work is tracked by https://jira.unity3d.com/browse/GFXLIGHT-1738 + static readonly long k_MaxNumberOfPositions = 67180350; + + static bool DeduplicateProbePositions(in Vector3[] probePositions, in int[] brickSubdivLevel, BakingBatch batch, NativeList uniquePositions, out int[] indices) { + long numberOfPositions = (long)probePositions.Length + batch.positionToIndex.Count; + if (numberOfPositions > k_MaxNumberOfPositions) + { + Debug.LogError($"The number of Adaptive Probe Volume (APV) probes Unity generated exceeds the current system limit of {k_MaxNumberOfPositions} probes per Baking Set. Reduce density either by adjusting the general Probe Spacing in the Lighting window, or by modifying the Adaptive Probe Volumes in the scene to limit where the denser subdivision levels are used."); + indices = null; + + return false; + } + indices = new int[probePositions.Length]; int uniqueIndex = batch.positionToIndex.Count; @@ -234,6 +248,8 @@ namespace UnityEngine.Rendering uniqueIndex++; } } + + return true; } static ProbeSubdivisionResult GetBricksFromLoaded() @@ -241,6 +257,13 @@ namespace UnityEngine.Rendering var dataList = GetPerSceneDataList(); var result = new ProbeSubdivisionResult(); + // We read bricks from the asset rather than using the currently loaded cells. + // This is because not all bricks from the previous bake are guaranteed to be currently loaded, + // we may for example have hit the max brick count given the selected memory budget. + ProbeVolumeStreamableAsset bricksDataAsset = m_BakingSet.cellBricksDataAsset; + bricksDataAsset.EnsureAssetLoaded(); + using NativeArray previousBricks = bricksDataAsset.asset.GetData(); + foreach (var data in dataList) { var cellSize = m_ProfileInfo.minDistanceBetweenProbes * 3.0f * m_ProfileInfo.cellSizeInBricks; @@ -252,7 +275,6 @@ namespace UnityEngine.Rendering foreach (var cellIndex in cells) { var cellDesc = m_BakingSet.GetCellDesc(cellIndex); - var cellData = m_BakingSet.GetCellData(cellIndex); var cellPos = cellDesc.position; if (!result.scenesPerCells.ContainsKey(cellPos)) @@ -260,7 +282,13 @@ namespace UnityEngine.Rendering result.scenesPerCells[cellPos] = new HashSet(); var center = new Vector3((cellPos.x + 0.5f) * cellSize, (cellPos.y + 0.5f) * cellSize, (cellPos.z + 0.5f) * cellSize); - result.cells.Add((cellPos, new Bounds(center, cellDimensions), cellData.bricks.ToArray())); + + var cellStreamingDesc = bricksDataAsset.streamableCellDescs[cellIndex]; + int bricksOffset = cellStreamingDesc.offset / bricksDataAsset.elementSize; + int bricksCount = Mathf.Min(cellStreamingDesc.elementCount, cellDesc.bricksCount); + Brick[] bricks = previousBricks.GetSubArray(bricksOffset, bricksCount).ToArray(); + + result.cells.Add((cellPos, new Bounds(center, cellDimensions), bricks)); } result.scenesPerCells[cellPos].Add(data.sceneGUID); } diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Serialization.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Serialization.cs index e44748d4..150525ae 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Serialization.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Serialization.cs @@ -726,6 +726,63 @@ namespace UnityEngine.Rendering static long AlignRemainder16(long count) => count % 16L; + /// + /// Calculates support data chunk size based on provided configuration. + /// + /// Number of probes per chunk + /// Whether virtual offsets are enabled + /// Whether rendering layers are enabled + /// The size in bytes of a single support data chunk + static int CalculateSupportDataChunkSize(int chunkSizeInProbes, bool hasVirtualOffsets, bool hasRenderingLayers) + { + int supportPositionChunkSize = UnsafeUtility.SizeOf() * chunkSizeInProbes; + int supportValidityChunkSize = UnsafeUtility.SizeOf() * chunkSizeInProbes; + int supportTouchupChunkSize = UnsafeUtility.SizeOf() * chunkSizeInProbes; + int supportLayerMaskChunkSize = hasRenderingLayers ? UnsafeUtility.SizeOf() * chunkSizeInProbes : 0; + int supportOffsetsChunkSize = hasVirtualOffsets ? UnsafeUtility.SizeOf() * chunkSizeInProbes : 0; + + return supportPositionChunkSize + supportValidityChunkSize + + supportOffsetsChunkSize + supportLayerMaskChunkSize + supportTouchupChunkSize; + } + + /// + /// Validates that the baking cells can be written without exceeding system limits. + /// This method performs size calculations without accessing any global state. + /// + /// Array of baking cells to validate + /// Number of probes per chunk + /// Whether virtual offsets are enabled + /// Whether rendering layers are enabled + /// True if cells can be written safely, false if they exceed limits + static bool ValidateBakingCellsSize(BakingCell[] bakingCells, int chunkSizeInProbes, bool hasVirtualOffsets, bool hasRenderingLayers) + { + if (bakingCells == null || bakingCells.Length == 0) + return true; + + int supportDataChunkSize = CalculateSupportDataChunkSize(chunkSizeInProbes, hasVirtualOffsets, hasRenderingLayers); + + // Calculate total chunks count - need to call AnalyzeBrickForIndirectionEntries to get shChunkCount + // Create a copy to avoid modifying the original cells during validation + var tempCells = new BakingCell[bakingCells.Length]; + int totalChunksCount = 0; + for (var i = 0; i < bakingCells.Length; ++i) + { + tempCells[i] = bakingCells[i]; // Shallow copy is sufficient for this validation + AnalyzeBrickForIndirectionEntries(ref tempCells[i]); + totalChunksCount += tempCells[i].shChunkCount; + } + + // Perform the critical size check + long supportDataTotalSize = (long)totalChunksCount * supportDataChunkSize; + if (supportDataTotalSize > int.MaxValue) + { + Debug.LogError($"The size of the Adaptive Probe Volume (APV) baking set chunks exceed the current system limit of {int.MaxValue}, unable to save the baked cell assets. Reduce density either by adjusting the general Probe Spacing in the Lighting window, or by modifying the Adaptive Probe Volumes in the scene to limit where the denser subdivision levels are used."); + return false; + } + + return true; + } + static void WriteNativeArray(System.IO.FileStream fs, NativeArray array) where T : struct { unsafe @@ -736,7 +793,7 @@ namespace UnityEngine.Rendering } /// - /// This method converts a list of baking cells into 5 separate assets: + /// This method attempts to convert a list of baking cells into 5 separate assets: /// 2 assets per baking state: /// CellData: a binary flat file containing L0L1 probes data /// CellOptionalData: a binary flat file containing L2 probe data (when present) @@ -745,7 +802,7 @@ namespace UnityEngine.Rendering /// CellSharedData: a binary flat file containing bricks data /// CellSupportData: a binary flat file containing debug data (stripped from player builds if building without debug shaders) /// - unsafe static void WriteBakingCells(BakingCell[] bakingCells) + static unsafe bool WriteBakingCells(BakingCell[] bakingCells) { m_BakingSet.GetBlobFileNames(m_BakingSet.lightingScenario, out var cellDataFilename, out var cellBricksDataFilename, out var cellOptionalDataFilename, out var cellProbeOcclusionDataFilename, out var cellSharedDataFilename, out var cellSupportDataFilename); @@ -846,16 +903,16 @@ namespace UnityEngine.Rendering // Brick data using var bricks = new NativeArray(m_TotalCellCounts.bricksCount, Allocator.Persistent, NativeArrayOptions.UninitializedMemory); - // CellSupportData - m_BakingSet.supportPositionChunkSize = sizeof(Vector3) * chunkSizeInProbes; - m_BakingSet.supportValidityChunkSize = sizeof(float) * chunkSizeInProbes; - m_BakingSet.supportOffsetsChunkSize = hasVirtualOffsets ? sizeof(Vector3) * chunkSizeInProbes : 0; - m_BakingSet.supportTouchupChunkSize = sizeof(float) * chunkSizeInProbes; - m_BakingSet.supportLayerMaskChunkSize = hasRenderingLayers ? sizeof(byte) * chunkSizeInProbes : 0; + // CellSupportData - use pure helper function for calculation + m_BakingSet.supportPositionChunkSize = UnsafeUtility.SizeOf() * chunkSizeInProbes; + m_BakingSet.supportValidityChunkSize = UnsafeUtility.SizeOf() * chunkSizeInProbes; + m_BakingSet.supportOffsetsChunkSize = hasVirtualOffsets ? UnsafeUtility.SizeOf() * chunkSizeInProbes : 0; + m_BakingSet.supportTouchupChunkSize = UnsafeUtility.SizeOf() * chunkSizeInProbes; + m_BakingSet.supportLayerMaskChunkSize = hasRenderingLayers ? UnsafeUtility.SizeOf() * chunkSizeInProbes : 0; - m_BakingSet.supportDataChunkSize = m_BakingSet.supportPositionChunkSize + m_BakingSet.supportValidityChunkSize + m_BakingSet.supportOffsetsChunkSize + m_BakingSet.supportLayerMaskChunkSize + m_BakingSet.supportTouchupChunkSize; - var supportDataTotalSize = m_TotalCellCounts.chunksCount * m_BakingSet.supportDataChunkSize; - using var supportData = new NativeArray(supportDataTotalSize, Allocator.Persistent, NativeArrayOptions.UninitializedMemory); + m_BakingSet.supportDataChunkSize = CalculateSupportDataChunkSize(chunkSizeInProbes, hasVirtualOffsets, hasRenderingLayers); + long supportDataTotalSize = (long)m_TotalCellCounts.chunksCount * m_BakingSet.supportDataChunkSize; + using var supportData = new NativeArray((int)supportDataTotalSize, Allocator.Persistent, NativeArrayOptions.UninitializedMemory); var sceneStateHash = m_BakingSet.GetBakingHashCode(); var startCounts = new CellCounts(); @@ -1093,6 +1150,8 @@ namespace UnityEngine.Rendering m_BakingSet.cellSupportDataAsset = new ProbeVolumeStreamableAsset(kAPVStreamingAssetsPath, cellSupportDescs, m_BakingSet.supportDataChunkSize, bakingSetGUID, AssetDatabase.AssetPathToGUID(cellSupportDataFilename)); EditorUtility.SetDirty(m_BakingSet); + + return true; } unsafe static void WriteDilatedCells(List cells) diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.VirtualOffset.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.VirtualOffset.cs index 9f9204c4..821eccab 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.VirtualOffset.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.VirtualOffset.cs @@ -340,8 +340,19 @@ namespace UnityEngine.Rendering // Make sure unloading happens. prv.PerformPendingOperations(); - // Write back the assets. - WriteBakingCells(m_BakingBatch.cells.ToArray()); + // Validate baking cells size before writing + var bakingCellsArray = m_BakingBatch.cells.ToArray(); + var chunkSizeInProbes = ProbeBrickPool.GetChunkSizeInProbeCount(); + var hasVirtualOffsets = m_BakingSet.settings.virtualOffsetSettings.useVirtualOffset; + var hasRenderingLayers = m_BakingSet.useRenderingLayers; + + if (ValidateBakingCellsSize(bakingCellsArray, chunkSizeInProbes, hasVirtualOffsets, hasRenderingLayers)) + { + // Write back the assets. + WriteBakingCells(bakingCellsArray); + } + + m_BakingBatch?.Dispose(); m_BakingBatch = null; foreach (var data in prv.perSceneDataList) 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 de20efb7..feb9cc5e 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 @@ -268,15 +268,15 @@ namespace UnityEngine.Rendering } } - class BakingBatch + class BakingBatch : IDisposable { public Dictionary> cellIndex2SceneReferences = new (); public List cells = new (); // Used to retrieve probe data from it's position in order to fix seams - public Dictionary positionToIndex = new (); + public NativeHashMap positionToIndex; // Allow to get a mapping to subdiv level with the unique positions. It stores the minimum subdiv level found for a given position. // Can be probably done cleaner. - public Dictionary uniqueBrickSubdiv = new (); + public NativeHashMap uniqueBrickSubdiv; // Mapping for explicit invalidation, whether it comes from the auto finding of occluders or from the touch up volumes // TODO: This is not used yet. Will soon. public Dictionary invalidatedPositions = new (); @@ -306,6 +306,19 @@ namespace UnityEngine.Rendering maxBrickCount = cellCount * ProbeReferenceVolume.CellSize(ProbeReferenceVolume.instance.GetMaxSubdivision()); inverseScale = ProbeBrickPool.kBrickCellCount / ProbeReferenceVolume.instance.MinBrickSize(); offset = ProbeReferenceVolume.instance.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) + positionToIndex.Dispose(); + if (uniqueBrickSubdiv.IsCreated) + uniqueBrickSubdiv.Dispose(); } public int GetProbePositionHash(Vector3 position) @@ -1202,6 +1215,7 @@ namespace UnityEngine.Rendering static void CleanBakeData() { s_BakeData.Dispose(); + m_BakingBatch?.Dispose(); m_BakingBatch = null; s_AdjustmentVolumes = null; @@ -1478,6 +1492,15 @@ namespace UnityEngine.Rendering // Use the globalBounds we just computed, as the one in probeRefVolume doesn't include scenes that have never been baked probeRefVolume.globalBounds = globalBounds; + // Validate baking cells size before any state modifications + var bakingCellsArray = m_BakedCells.Values.ToArray(); + 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 + PrepareCellsForWriting(isBakingSceneSubset); m_BakingSet.chunkSizeInBricks = ProbeBrickPool.GetChunkSizeInBrickCount(); @@ -1488,9 +1511,13 @@ namespace UnityEngine.Rendering m_BakingSet.scenarios.TryAdd(m_BakingSet.lightingScenario, new ProbeVolumeBakingSet.PerScenarioDataInfo()); - // Convert baking cells to runtime cells + // Attempt to convert baking cells to runtime cells + bool succeededWritingBakingCells; using (new BakingCompleteProfiling(BakingCompleteProfiling.Stages.WriteBakedData)) - WriteBakingCells(m_BakedCells.Values.ToArray()); + succeededWritingBakingCells = WriteBakingCells(m_BakedCells.Values.ToArray()); + + if (!succeededWritingBakingCells) + return; // Reset internal structures depending on current bake. Debug.Assert(probeRefVolume.EnsureCurrentBakingSet(m_BakingSet)); @@ -1534,6 +1561,7 @@ namespace UnityEngine.Rendering } // Mark stuff as up to date + m_BakingBatch?.Dispose(); m_BakingBatch = null; foreach (var probeVolume in GetProbeVolumeList()) probeVolume.OnBakeCompleted(); diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeBuildProcessor.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeBuildProcessor.cs index 65552dc6..67fcbca0 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeBuildProcessor.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeBuildProcessor.cs @@ -1,3 +1,4 @@ +using System; using System.IO; using System.Collections.Generic; using UnityEditor.Build; @@ -120,10 +121,16 @@ namespace UnityEditor.Rendering // APV doesn't work with WebGL, so let's warn the user. if (buildPlayerContext.BuildPlayerOptions.target == BuildTarget.WebGL) { - Debug.LogError( - $"The scene '{scene}' contains baked Adaptive Probe Volumes, but the build target is WebGL. " + - "Adaptive Probe Volumes are not supported when targeting WebGL."); - continue; + // WebGPU does support APV so only warn if WebGPU is not enabled. + GraphicsDeviceType[] apis = PlayerSettings.GetGraphicsAPIs(BuildTarget.WebGL); + var index = Array.FindIndex(apis, x => x == GraphicsDeviceType.WebGPU); + if (index == -1) + { + Debug.LogError( + $"The scene '{scene}' contains baked Adaptive Probe Volumes, but the build target is WebGL. " + + "Adaptive Probe Volumes are not supported when targeting WebGL."); + continue; + } } var bakingSetGUID = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(bakingSet)); diff --git a/Packages/com.unity.render-pipelines.core/Editor/MaterialUpgrader.cs b/Packages/com.unity.render-pipelines.core/Editor/MaterialUpgrader.cs index de184176..ec52b772 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/MaterialUpgrader.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/MaterialUpgrader.cs @@ -49,10 +49,12 @@ namespace UnityEditor.Rendering /// /// Retrieves path to new shader. /// - public string NewShaderPath - { - get => m_NewShader; - } + public string NewShaderPath => m_NewShader; + + /// + /// Retrieves path to old shader. + /// + public string OldShaderPath => m_OldShader; MaterialFinalizer m_Finalizer; diff --git a/Packages/com.unity.render-pipelines.core/Editor/StyleSheets/RenderGraphViewerLight.uss b/Packages/com.unity.render-pipelines.core/Editor/StyleSheets/RenderGraphViewerLight.uss index cd4c9aa0..b63d6c3f 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/StyleSheets/RenderGraphViewerLight.uss +++ b/Packages/com.unity.render-pipelines.core/Editor/StyleSheets/RenderGraphViewerLight.uss @@ -10,7 +10,7 @@ --pass-block-color--highlight: white; --pass-block-text-color--highlight: var(--unity-colors-default-text-hover); --pass-block-color--culled: rgb(30, 30, 30); - --grid-line-color: var(--unity-colors-app_toolbar_button-background-hover); + --grid-line-color: #d6d6d6; --grid-line-color--hover: white; --resource-helper-line-color: #b0b0b0; --resource-helper-line-color--hover: white; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/Components/DisallowGPUDrivenRendering.cs b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/Components/DisallowGPUDrivenRendering.cs index 8c0b3d9a..af9a92dd 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/Components/DisallowGPUDrivenRendering.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/Components/DisallowGPUDrivenRendering.cs @@ -62,7 +62,8 @@ namespace UnityEngine.Rendering private void OnValidate() { OnDisable(); - OnEnable(); + if (enabled) + OnEnable(); } } } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl index 73e63fd8..0724e138 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl @@ -77,14 +77,14 @@ struct APVResources struct APVResourcesRW { - RWTexture3D L0_L1Rx; - RWTexture3D L1G_L1Ry; - RWTexture3D L1B_L1Rz; - RWTexture3D L2_0; - RWTexture3D L2_1; - RWTexture3D L2_2; - RWTexture3D L2_3; - RWTexture3D ProbeOcclusion; + RWTexture3D L0_L1Rx; + RWTexture3D L1G_L1Ry; + RWTexture3D L1B_L1Rz; + RWTexture3D L2_0; + RWTexture3D L2_1; + RWTexture3D L2_2; + RWTexture3D L2_3; + RWTexture3D ProbeOcclusion; }; #ifndef USE_APV_PROBE_OCCLUSION diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBlendStates.compute b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBlendStates.compute index 20b28b21..30f8252f 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBlendStates.compute +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBlendStates.compute @@ -15,9 +15,9 @@ Texture3D _State1_L0_L1Rx; Texture3D _State1_L1G_L1Ry; Texture3D _State1_L1B_L1Rz; -RWTexture3D _Out_L0_L1Rx; -RWTexture3D _Out_L1G_L1Ry; -RWTexture3D _Out_L1B_L1Rz; +RWTexture3D _Out_L0_L1Rx; +RWTexture3D _Out_L1G_L1Ry; +RWTexture3D _Out_L1B_L1Rz; #ifdef PROBE_VOLUMES_L2 Texture3D _State0_L2_0; @@ -30,16 +30,16 @@ Texture3D _State1_L2_1; Texture3D _State1_L2_2; Texture3D _State1_L2_3; -RWTexture3D _Out_L2_0; -RWTexture3D _Out_L2_1; -RWTexture3D _Out_L2_2; -RWTexture3D _Out_L2_3; +RWTexture3D _Out_L2_0; +RWTexture3D _Out_L2_1; +RWTexture3D _Out_L2_2; +RWTexture3D _Out_L2_3; #endif #ifdef USE_APV_PROBE_OCCLUSION Texture3D _State0_ProbeOcclusion; Texture3D _State1_ProbeOcclusion; -RWTexture3D _Out_ProbeOcclusion; +RWTexture3D _Out_ProbeOcclusion; #endif float4 _ChunkList[1000]; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeUploadData.compute b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeUploadData.compute index d80bf698..33418a71 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeUploadData.compute +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeUploadData.compute @@ -9,9 +9,9 @@ #pragma multi_compile_local _ PROBE_VOLUMES_SKY_SHADING_DIRECTION #pragma multi_compile_local _ PROBE_VOLUMES_PROBE_OCCLUSION -RWTexture3D _Out_L0_L1Rx; -RWTexture3D _Out_L1G_L1Ry; -RWTexture3D _Out_L1B_L1Rz; +RWTexture3D _Out_L0_L1Rx; +RWTexture3D _Out_L1G_L1Ry; +RWTexture3D _Out_L1B_L1Rz; #ifdef PROBE_VOLUMES_SHARED_DATA diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeUploadDataL2.compute b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeUploadDataL2.compute index 5fbf608d..6c821c22 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeUploadDataL2.compute +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeUploadDataL2.compute @@ -4,10 +4,10 @@ #pragma kernel UploadDataL2 -RWTexture3D _Out_L2_0; -RWTexture3D _Out_L2_1; -RWTexture3D _Out_L2_2; -RWTexture3D _Out_L2_3; +RWTexture3D _Out_L2_0; +RWTexture3D _Out_L2_1; +RWTexture3D _Out_L2_2; +RWTexture3D _Out_L2_3; [numthreads(64, 1, 1)] diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.Debug.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.Debug.cs index a563ae62..5335c3fc 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.Debug.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.Debug.cs @@ -76,7 +76,10 @@ namespace UnityEngine.Rendering.RenderGraphModule.NativeRenderPassCompiler $"- {passName}: {pass.fragmentInfoWidth}x{pass.fragmentInfoHeight}, {pass.fragmentInfoSamples} sample(s)."; break; case PassBreakReason.NextPassReadsTexture: - message += "The next pass reads one of the outputs as a regular texture, the pass needs to break."; + message += $"{prevPassName} output is sampled by {passName} as a regular texture, the pass needs to break."; + break; + case PassBreakReason.NextPassTargetsTexture: + message += $"{prevPassName} reads a texture that {passName} targets to, the pass needs to break."; break; case PassBreakReason.NonRasterPass: message += $"{prevPassName} is type {prevPass.type}. Only Raster passes can be merged."; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/PassesData.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/PassesData.cs index 2d727c66..8499a5bb 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/PassesData.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/PassesData.cs @@ -526,6 +526,7 @@ namespace UnityEngine.Rendering.RenderGraphModule.NativeRenderPassCompiler NotOptimized, // Optimize never ran on this pass TargetSizeMismatch, // Target Sizes or msaa samples don't match NextPassReadsTexture, // The next pass reads data written by this pass as a texture + NextPassTargetsTexture, // The next pass targets the texture that this pass is reading NonRasterPass, // The next pass is a non-raster pass DifferentDepthTextures, // The next pass uses a different depth texture (and we only allow one in a whole NRP) AttachmentLimitReached, // Adding the next pass would have used more attachments than allowed @@ -561,6 +562,7 @@ namespace UnityEngine.Rendering.RenderGraphModule.NativeRenderPassCompiler "The native render pass optimizer never ran on this pass. Pass is standalone and not merged.", "The render target sizes of the next pass do not match.", "The next pass reads data output by this pass as a regular texture.", + "The next pass uses a texture sampled in this pass as a render target.", "The next pass is not a raster render pass.", "The next pass uses a different depth buffer. All passes in the native render pass need to use the same depth buffer.", $"The limit of {FixedAttachmentArray.MaxAttachments} native pass attachments would be exceeded when merging with the next pass.", @@ -868,6 +870,24 @@ namespace UnityEngine.Rendering.RenderGraphModule.NativeRenderPassCompiler currAvailableAttachmentSlots--; } } + + // Check if this fragment is already sampled in the native renderpass not as a fragment but as an input + for (int i = nativePass.firstGraphPass; i <= nativePass.lastGraphPass; ++i) + { + ref var earlierPassData = ref contextData.passData.ElementAt(i); + foreach (ref readonly var earlierInput in earlierPassData.Inputs(contextData)) + { + // If this fragment is already used in current native render pass + if (earlierInput.resource.index == fragment.resource.index) + { + // If it's not used as a fragment, it's used as some sort of texture read of load so we need to sync it out + if (!earlierPassData.IsUsedAsFragment(earlierInput.resource, contextData)) + { + return new PassBreakAudit(PassBreakReason.NextPassTargetsTexture, passIdToMerge); + } + } + } + } } diff --git a/Packages/com.unity.render-pipelines.core/Tests/Editor/NativePassCompilerRenderGraphTests.cs b/Packages/com.unity.render-pipelines.core/Tests/Editor/NativePassCompilerRenderGraphTests.cs index fc3cba2e..3937c997 100644 --- a/Packages/com.unity.render-pipelines.core/Tests/Editor/NativePassCompilerRenderGraphTests.cs +++ b/Packages/com.unity.render-pipelines.core/Tests/Editor/NativePassCompilerRenderGraphTests.cs @@ -527,7 +527,7 @@ namespace UnityEngine.Rendering.Tests } [Test] - public void NonFragmentUseBreaksPass() + public void NonFragmentSamplingBreaksPass() { var g = AllocateRenderGraph(); var buffers = ImportAndCreateBuffers(g); @@ -554,6 +554,64 @@ namespace UnityEngine.Rendering.Tests Assert.AreEqual(Rendering.RenderGraphModule.NativeRenderPassCompiler.PassBreakReason.NextPassReadsTexture, passes[0].breakAudit.reason); } + [Test] + public void FragmentAfterSamplingWithInputAttachmentBreaksPass() + { + var g = AllocateRenderGraph(); + var buffers = ImportAndCreateBuffers(g); + + using (var builder = g.AddRasterRenderPass("TestPass0", out var passData)) + { + builder.SetRenderAttachmentDepth(buffers.depthBuffer, AccessFlags.Write); + builder.UseTexture(buffers.extraBuffers[0], AccessFlags.Read); + builder.SetRenderAttachment(buffers.extraBuffers[1], 0, AccessFlags.Write); + builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { }); + } + + using (var builder = g.AddRasterRenderPass("TestPass1", out var passData)) + { + builder.SetRenderAttachmentDepth(buffers.depthBuffer, AccessFlags.Write); + builder.SetInputAttachment(buffers.extraBuffers[1], 1, AccessFlags.Read); + builder.SetRenderAttachment(buffers.extraBuffers[0], 2, AccessFlags.Write); + builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { }); + } + + var result = g.CompileNativeRenderGraph(g.ComputeGraphHash()); + var passes = result.contextData.GetNativePasses(); + + Assert.AreEqual(2, passes.Count); + Assert.AreEqual(Rendering.RenderGraphModule.NativeRenderPassCompiler.PassBreakReason.NextPassTargetsTexture, passes[0].breakAudit.reason); + } + + [Test] + public void FragmentAfterSamplingBreaksPass() + { + var g = AllocateRenderGraph(); + var buffers = ImportAndCreateBuffers(g); + + using (var builder = g.AddRasterRenderPass("TestPass0", out var passData)) + { + builder.SetRenderAttachmentDepth(buffers.depthBuffer, AccessFlags.Write); + builder.UseTexture(buffers.extraBuffers[0], AccessFlags.Read); + builder.SetRenderAttachment(buffers.extraBuffers[1], 0, AccessFlags.Write); + builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { }); + } + + using (var builder = g.AddRasterRenderPass("TestPass1", out var passData)) + { + builder.SetRenderAttachmentDepth(buffers.depthBuffer, AccessFlags.Write); + builder.SetRenderAttachment(buffers.extraBuffers[2], 1, AccessFlags.Read); + builder.SetRenderAttachment(buffers.extraBuffers[0], 2, AccessFlags.Write); + builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { }); + } + + var result = g.CompileNativeRenderGraph(g.ComputeGraphHash()); + var passes = result.contextData.GetNativePasses(); + + Assert.AreEqual(2, passes.Count); + Assert.AreEqual(Rendering.RenderGraphModule.NativeRenderPassCompiler.PassBreakReason.NextPassTargetsTexture, passes[0].breakAudit.reason); + } + [Test] public void NonRasterBreaksPass() { diff --git a/Packages/com.unity.render-pipelines.core/package.json b/Packages/com.unity.render-pipelines.core/package.json index eaa812d2..d32e4d31 100644 --- a/Packages/com.unity.render-pipelines.core/package.json +++ b/Packages/com.unity.render-pipelines.core/package.json @@ -14,5 +14,5 @@ "com.unity.modules.jsonserialize": "1.0.0", "com.unity.rendering.light-transport": "1.0.1" }, - "_fingerprint": "609b19816fd255e06290637a743a23085dbde6de" + "_fingerprint": "317e801bb3aaa64596e4ec903cb788a0dfb07788" } diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs index 62f10b21..5cd5ee58 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs @@ -919,6 +919,7 @@ namespace UnityEditor.Rendering.HighDefinition } ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, action, materialName, materialIcon, null); + EditorUtility.SetDirty(action.decalProjector); } [Shortcut("HDRP/Decal: Handle changing size stretching UV", typeof(SceneView), KeyCode.Keypad1, ShortcutModifiers.Action)] diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Tools/ColorCheckerToolEditor.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Tools/ColorCheckerToolEditor.cs index 14e4a5a8..befc21fa 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Tools/ColorCheckerToolEditor.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Tools/ColorCheckerToolEditor.cs @@ -72,7 +72,8 @@ public class ColorCheckerToolEditor : Editor //Prepare metallic toggles for material mode for(int i=0; i<12;i++) { - Toggle metallicToggle = new Toggle() { name ="metallic" + i, label = "is Metallic", tabIndex = i}; + Toggle metallicToggle = new Toggle() { name ="metallic" + i, label = "Metallic", tabIndex = i}; + metallicToggle.Q