Skip to content

Commit 6feca3f

Browse files
authored
Merge pull request #8157 from Unity-Technologies/internal/master
Internal/master
2 parents d87dba6 + af0ca64 commit 6feca3f

File tree

263 files changed

+23937
-3738
lines changed

Some content is hidden

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

263 files changed

+23937
-3738
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
using System;
2+
using UnityEngine;
3+
using UnityEngine.Analytics;
4+
using UnityEngine.Rendering;
5+
using UnityEngine.Rendering.RenderGraphModule;
6+
7+
namespace UnityEditor.Rendering.Analytics
8+
{
9+
// schema = com.unity3d.data.schemas.editor.analytics.uRenderGraphViewerSessionCreated_v1
10+
// taxonomy = editor.analytics.uRenderGraphViewerSessionCreated.v1
11+
internal class RenderGraphViewerSessionCreatedAnalytic
12+
{
13+
const int k_MaxEventsPerHour = 1000;
14+
const int k_MaxNumberOfElements = 1000;
15+
const string k_VendorKey = "unity.srp";
16+
const string k_EventName = "uRenderGraphViewerSessionCreated";
17+
18+
public enum SessionType
19+
{
20+
Local = 0,
21+
Remote = 1
22+
}
23+
24+
[AnalyticInfo(eventName: k_EventName, vendorKey: k_VendorKey, maxEventsPerHour: k_MaxEventsPerHour, maxNumberOfElements: k_MaxNumberOfElements)]
25+
class Analytic : IAnalytic
26+
{
27+
public Analytic(SessionType sessionType, DebugMessageHandler.AnalyticsPayload payload)
28+
{
29+
using (GenericPool<Data>.Get(out var data))
30+
{
31+
data.session_type = sessionType.ToString();
32+
data.graphics_device_type = payload.graphicsDeviceType.ToString();
33+
data.device_type = payload.deviceType.ToString();
34+
data.device_model = payload.deviceModel;
35+
data.gpu_vendor = payload.gpuVendor;
36+
data.gpu_name = payload.gpuName;
37+
38+
m_Data = data;
39+
}
40+
}
41+
42+
[Serializable]
43+
class Data : IAnalytic.IData
44+
{
45+
// Naming convention for analytics data
46+
public string session_type;
47+
public string graphics_device_type;
48+
public string device_type;
49+
public string device_model;
50+
public string gpu_vendor;
51+
public string gpu_name;
52+
}
53+
54+
public bool TryGatherData(out IAnalytic.IData data, out Exception error)
55+
{
56+
data = m_Data;
57+
error = null;
58+
return true;
59+
}
60+
61+
Data m_Data;
62+
};
63+
64+
public static void Send(SessionType sessionType, DebugMessageHandler.AnalyticsPayload payload)
65+
{
66+
Analytic analytic = new Analytic(sessionType, payload);
67+
AnalyticsUtils.SendData(analytic);
68+
}
69+
}
70+
}

Packages/com.unity.render-pipelines.core/Editor/Analytics/RenderGraphViewerSessionAnalytic.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/com.unity.render-pipelines.core/Editor/CommandBuffers/CommandBufferGenerator/CommandBufferGenerator.cs

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class CommandBufferGenerator
5858

5959
// Functions for compute only
6060
static List<FunctionInfo> computeFunctions = new List<FunctionInfo> {
61+
"SetComputeParamsFromMaterial",
6162
"SetComputeFloatParam",
6263
"SetComputeIntParam",
6364
"SetComputeVectorArrayParam",
@@ -68,11 +69,7 @@ class CommandBufferGenerator
6869
new FunctionInfo("SetComputeTextureParam", textureArg: "rt"),
6970
"SetComputeBufferParam",
7071
"SetComputeConstantBufferParam",
71-
"SetComputeFloatParam",
72-
"SetComputeIntParam",
7372
"SetComputeVectorParam",
74-
"SetComputeVectorArrayParam",
75-
"SetComputeMatrixParam",
7673
"DispatchCompute",
7774
"BuildRayTracingAccelerationStructure",
7875
"SetRayTracingAccelerationStructure",
@@ -87,6 +84,7 @@ class CommandBufferGenerator
8784
"SetRayTracingVectorArrayParam",
8885
"SetRayTracingMatrixParam",
8986
"SetRayTracingMatrixArrayParam",
87+
"SetRayTracingShaderPass",
9088
"DispatchRays",
9189
"SetBufferData",
9290
"SetBufferCounterValue",
@@ -119,6 +117,17 @@ class CommandBufferGenerator
119117
"SetRenderTarget",
120118
"Clear",
121119
"RequestAsyncReadbackIntoNativeArray",
120+
"RequestAsyncReadback",
121+
"ClearRandomWriteTargets",
122+
"SetRandomWriteTarget",
123+
"CopyTexture",
124+
"GenerateMips",
125+
// Next APIs are already available in UnsafeCommandBuffer through compute or base functions lists,
126+
// but the added overloads below relax safety rules to support texture parameters without texture handle usage.
127+
new FunctionInfo("SetGlobalTexture", textureArg: "", modifiesGlobalState: true),
128+
"SetRayTracingTextureParam",
129+
"SetComputeTextureParam",
130+
// End of added unsafe overloads
122131
};
123132
// Generated file header
124133
static string preamble =
@@ -129,6 +138,7 @@ class CommandBufferGenerator
129138
using UnityEngine.Profiling;
130139
using Unity.Profiling;
131140
using UnityEngine.Rendering.RenderGraphModule;
141+
using UnityEngine.Experimental.Rendering;
132142
133143
// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
134144
//
@@ -255,28 +265,31 @@ static void GenerateCommandBufferType(string className, string docString, string
255265
BindingFlags flags = BindingFlags.Public | BindingFlags.Instance;
256266
var methods = commandBufferType.GetMethods(flags);
257267

268+
var allowedFuncInfoMethodList = new List<Tuple<FunctionInfo, MethodInfo>>();
269+
270+
// Filtering function list to only keep the ones existing in CommandBuffer
258271
foreach (var method in methods)
259272
{
260-
bool allowed = false;
261-
FunctionInfo info = new FunctionInfo();
262273
foreach (var fn in functionList)
263274
{
264275
if (fn.name == method.Name)
265-
{
266-
allowed = true;
267-
info = fn;
268-
break;
269-
}
276+
allowedFuncInfoMethodList.Add(new Tuple<FunctionInfo, MethodInfo>(fn, method));
270277
}
271-
if (!allowed) continue;
278+
}
272279

280+
// Generating function list, we can have duplicates due to overloads in methods and different support in the different functionLists (TextureHandle overload or not)
281+
foreach (var allowedFuncInfoMethod in allowedFuncInfoMethodList)
282+
{
273283
StringBuilder argList = new StringBuilder();
274284
StringBuilder typedArgList = new StringBuilder();
275285
StringBuilder argDocList = new StringBuilder();
276286
StringBuilder validationCode = new StringBuilder();
277287
StringBuilder genericArgList = new StringBuilder();
278288
StringBuilder genericConstraints = new StringBuilder();
279289

290+
var info = allowedFuncInfoMethod.Item1;
291+
var method = allowedFuncInfoMethod.Item2;
292+
280293
if (info.modifiesGlobalState)
281294
{
282295
validationCode.Append("ThrowIfGlobalStateNotAllowed(); ");
@@ -326,7 +339,7 @@ static void GenerateCommandBufferType(string className, string docString, string
326339

327340
if (method.ContainsGenericParameters)
328341
{
329-
// Hack: The current command buffer only inclues very simple single generic functions. We just hard code these but in the future we might need reflection on the generic arguments if needed.
342+
// Hack: The current command buffer only includes very simple single generic functions. We just hard code these but in the future we might need reflection on the generic arguments if needed.
330343
genericArgList.Append("<T>");
331344
genericConstraints.Append("where T : struct");
332345
argDocList.Append("\n");

Packages/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ void OnGUI()
537537
if (dragging)
538538
{
539539
splitterPos += Event.current.delta.x;
540-
splitterPos = Mathf.Clamp(splitterPos, minSideBarWidth, Screen.width - minContentWidth);
540+
splitterPos = Mathf.Clamp(splitterPos, minSideBarWidth, position.width - minContentWidth);
541541
Repaint();
542542
}
543543
break;

Packages/com.unity.render-pipelines.core/Editor/Icons/RenderGraphViewer/[email protected]

Lines changed: 0 additions & 166 deletions
This file was deleted.

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,12 @@ public void Dispose()
647647

648648
static bool m_IsInit = false;
649649
static BakingBatch m_BakingBatch;
650-
static ProbeVolumeBakingSet m_BakingSet = null;
650+
static ProbeVolumeBakingSetWeakReference m_BakingSetReference = new();
651+
static ProbeVolumeBakingSet m_BakingSet
652+
{
653+
get => m_BakingSetReference.Get();
654+
set => m_BakingSetReference.Set(value);
655+
}
651656
static TouchupVolumeWithBoundsList s_AdjustmentVolumes;
652657

653658
static Bounds globalBounds = new Bounds();

0 commit comments

Comments
 (0)