Skip to content

Commit 0b48b12

Browse files
authored
Merge pull request #8248 from Unity-Technologies/internal/master
Mirror Internal/master
2 parents e3ba536 + 0b52e4f commit 0b48b12

File tree

1,067 files changed

+11269
-1142502
lines changed

Some content is hidden

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

1,067 files changed

+11269
-1142502
lines changed

.gitattributes

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,15 @@ Editor/Resources/unity[[:space:]]editor[[:space:]]resources filter=lfs diff=lfs
375375
# memoryprofiler test snapshots
376376
**/com.unity.memoryprofiler.tests/**/*.[sS][nN][aA][pP] filter=lfs diff=lfs merge=lfs -text
377377

378-
379378
# buginfo tools
380379
/Tools/Unity.BugInfo.Coverage/bin/* filter=lfs diff=lfs merge=lfs -text
381380

382381
# search test cases
383382
/Modules/QuickSearch/Tests/QuickSearch/Assets/Cases/UUM-113048/uum-113048.index filter=lfs diff=lfs merge=lfs -text
384383

384+
#SRP Templates
385+
/Templates/**/LightingData.asset binary
386+
/Templates/**/*.[pP][nN][gG] filter=lfs diff=lfs merge=lfs -text
387+
/Templates/**/*.[tT][gG][aA] filter=lfs diff=lfs merge=lfs -text
388+
/Templates/**/*.[tT][iI][fF] filter=lfs diff=lfs merge=lfs -text
389+
/Templates/**/*.[fF][bB][xX] filter=lfs diff=lfs merge=lfs -text

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Status Convert(IRenderPipelineConverterItem item, out string message)
5252

5353
if (obj == null)
5454
{
55-
message = $"Failed to load {assetItem.name} Global ID {assetItem.guid} Asset Path {assetItem.assetPath}";
55+
message = $"Failed to load {assetItem.name} Global ID {assetItem.GlobalObjectId} Asset Path {assetItem.assetPath}";
5656
return Status.Error;
5757
}
5858

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

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,30 @@ namespace UnityEditor.Rendering.Converter
77
[Serializable]
88
internal class RenderPipelineConverterAssetItem : IRenderPipelineConverterItem
99
{
10-
public string assetPath { get; }
11-
public string guid { get; }
10+
[SerializeField]
11+
private string m_AssetPath;
1212

13-
public string name
13+
public string assetPath
1414
{
15-
get
16-
{
17-
var obj = LoadObject();
18-
if (obj != null)
19-
return obj.name;
20-
21-
// Fallback to asset path name
22-
return System.IO.Path.GetFileNameWithoutExtension(assetPath);
23-
}
15+
get => m_AssetPath;
16+
protected set => m_AssetPath = value;
2417
}
2518

26-
[field:SerializeField]
27-
public string info {get; set; }
19+
[SerializeField]
20+
private string m_GlobalObjectId;
21+
22+
public string GlobalObjectId => m_GlobalObjectId;
23+
24+
public string name => System.IO.Path.GetFileNameWithoutExtension(assetPath);
25+
26+
[SerializeField]
27+
private string m_Info;
28+
29+
public string info
30+
{
31+
get => m_Info;
32+
set => m_Info = value;
33+
}
2834

2935
public bool isEnabled { get; set; } = true;
3036
public string isDisabledMessage { get; set; } = string.Empty;
@@ -33,50 +39,47 @@ public Texture2D icon
3339
{
3440
get
3541
{
36-
var obj = LoadObject();
37-
if (obj == null)
38-
return null;
39-
40-
// Try the object's thumbnail/icon
41-
var icon = AssetPreview.GetMiniThumbnail(obj);
42-
if (icon != null) return icon;
43-
44-
// Fallback to type icon
45-
var type = obj.GetType();
46-
icon = EditorGUIUtility.ObjectContent(null, type).image as Texture2D;
47-
return icon;
42+
if (!string.IsNullOrEmpty(assetPath))
43+
{
44+
// Get the cached icon without loading the asset
45+
var icon = AssetDatabase.GetCachedIcon(assetPath);
46+
if (icon != null)
47+
return icon as Texture2D;
48+
}
49+
50+
return null;
4851
}
4952
}
5053

5154
public RenderPipelineConverterAssetItem(string id)
5255
{
53-
if (!GlobalObjectId.TryParse(id, out var gid))
56+
if (!UnityEditor.GlobalObjectId.TryParse(id, out var gid))
5457
throw new ArgumentException(nameof(id), $"Unable to perform GlobalObjectId.TryParse with the given id {id}");
5558

56-
assetPath = AssetDatabase.GUIDToAssetPath(gid.assetGUID);
57-
guid = gid.ToString();
59+
m_AssetPath = AssetDatabase.GUIDToAssetPath(gid.assetGUID);
60+
m_GlobalObjectId = gid.ToString();
5861
}
5962

6063
public RenderPipelineConverterAssetItem(GlobalObjectId gid, string assetPath)
6164
{
6265
if (!AssetDatabase.AssetPathExists(assetPath))
6366
throw new ArgumentException(nameof(assetPath), $"{assetPath} does not exist");
6467

65-
this.assetPath = assetPath;
66-
guid = gid.ToString();
68+
m_AssetPath = assetPath;
69+
m_GlobalObjectId = gid.ToString();
6770
}
6871

6972
public UnityEngine.Object LoadObject()
7073
{
7174
UnityEngine.Object obj = null;
7275

73-
if (GlobalObjectId.TryParse(guid, out var globalId))
76+
if (UnityEditor.GlobalObjectId.TryParse(GlobalObjectId, out var globalId))
7477
{
7578
// Try loading the object
7679
// TODO: Upcoming changes to GlobalObjectIdentifierToObjectSlow will allow it
7780
// to return direct references to prefabs and their children.
7881
// Once that change happens there are several items which should be adjusted.
79-
obj = GlobalObjectId.GlobalObjectIdentifierToObjectSlow(globalId);
82+
obj = UnityEditor.GlobalObjectId.GlobalObjectIdentifierToObjectSlow(globalId);
8083

8184
// If the object was not loaded, it is probably part of an unopened scene or prefab;
8285
// if so, then the solution is to first load the scene here.
@@ -100,7 +103,7 @@ public UnityEngine.Object LoadObject()
100103
// Reload object if it is still null (because it's in a previously unopened scene)
101104
if (!obj)
102105
{
103-
obj = GlobalObjectId.GlobalObjectIdentifierToObjectSlow(globalId);
106+
obj = UnityEditor.GlobalObjectId.GlobalObjectIdentifierToObjectSlow(globalId);
104107
}
105108
}
106109
}

Packages/com.unity.render-pipelines.core/Editor-PrivateShared/Tools/Converter/Window/RenderPipelineConvertersEditor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ void OnConverterScanFinished()
353353
{
354354
Debug.LogError($"An exception occurred while initializing converter {current.displayName}. See console for more details.");
355355
Debug.LogException(ex);
356+
InitializationFinish();
356357
}
357358
}
358359

Packages/com.unity.render-pipelines.core/Editor/HeaderFoldout.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Runtime.Serialization.Configuration;
32
using UnityEngine;
43
using UnityEngine.UIElements;
54

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ public void Setup()
144144

145145
// Getting the RG from the custom asset pipeline
146146
m_RenderGraph = m_RenderGraphTestPipeline.renderGraph;
147-
m_RenderGraph.nativeRenderPassesEnabled = true;
148147

149148
// Necessary to disable it for the Unit Tests, as the caller is not the same.
150149
RenderGraph.RenderGraphExceptionMessages.enableCaller = false;

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ public partial class RenderGraphViewer
1212
{
1313
static readonly string[] k_PassTypeNames =
1414
{
15-
"Legacy Render Pass",
1615
"Unsafe Render Pass",
1716
"Raster Render Pass",
1817
"Compute Pass"
1918
};
2019

2120
static readonly string[] k_PassTypeNamesNotMergedMessage =
2221
{
23-
"This is a Legacy Render Pass. Only Raster Render Passes can be merged.",
2422
"This is an Unsafe Render Pass. Only Raster Render Passes can be merged.",
2523
"Pass merging was disabled.",
2624
"This is a Compute Pass. Only Raster Render Passes can be merged."
@@ -292,8 +290,7 @@ void PopulateResourceList()
292290
resourceItem.Add(new Label($"Clear: {resourceData.textureData.clearBuffer}"));
293291
resourceItem.Add(new Label($"BindMS: {resourceData.textureData.bindMS}"));
294292
resourceItem.Add(new Label($"Samples: {resourceData.textureData.samples}"));
295-
if (m_CurrentDebugData.isNRPCompiler)
296-
resourceItem.Add(new Label($"Memoryless: {resourceData.memoryless}"));
293+
resourceItem.Add(new Label($"Memoryless: {resourceData.memoryless}"));
297294
}
298295
else if (type == RenderGraphResourceType.Buffer && resourceData.bufferData != null)
299296
{
@@ -315,11 +312,6 @@ void PopulateResourceList()
315312
void PopulatePassList()
316313
{
317314
HeaderFoldout headerFoldout = rootVisualElement.Q<HeaderFoldout>(Names.kPassListFoldout);
318-
if (!m_CurrentDebugData.isNRPCompiler)
319-
{
320-
headerFoldout.style.display = DisplayStyle.None;
321-
return;
322-
}
323315
headerFoldout.style.display = DisplayStyle.Flex;
324316

325317
ScrollView content = headerFoldout.Q<ScrollView>();
@@ -501,7 +493,7 @@ void SaveSplitViewFixedPaneHeight()
501493

502494
void UpdatePanelHeights()
503495
{
504-
bool passListExpanded = m_PassListExpanded && HasValidDebugData && m_CurrentDebugData.isNRPCompiler;
496+
bool passListExpanded = m_PassListExpanded && HasValidDebugData;
505497
const int kFoldoutHeaderHeightPx = 18;
506498
const int kFoldoutHeaderExpandedMinHeightPx = 50;
507499
const int kWindowExtraMarginPx = 6;

0 commit comments

Comments
 (0)