forked from Unity-Technologies/Graphics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Unity-Technologies#7660 from Unity-Technologies/in…
…ternal/master Internal/master
- Loading branch information
Showing
526 changed files
with
29,989 additions
and
2,722 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
area: RP Workflow |
8 changes: 8 additions & 0 deletions
8
Packages/com.unity.render-pipelines.core/Editor/Analytics.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
Packages/com.unity.render-pipelines.core/Editor/Analytics/BuildTargetAnalytic.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using JetBrains.Annotations; | ||
using System.Diagnostics.CodeAnalysis; | ||
using UnityEditor.Build; | ||
using UnityEditor.Build.Reporting; | ||
using UnityEngine; | ||
using UnityEngine.Analytics; | ||
using UnityEngine.Rendering; | ||
|
||
namespace UnityEditor.Rendering.Analytics | ||
{ | ||
internal class BuildTargetAnalytic : IPostprocessBuildWithReport | ||
{ | ||
public int callbackOrder => int.MaxValue; | ||
|
||
const int k_MaxEventsPerHour = 10; | ||
const int k_MaxNumberOfElements = 1000; | ||
const string k_VendorKey = "unity.srp"; | ||
|
||
[System.Diagnostics.DebuggerDisplay("{render_pipeline_asset_type} - {quality_levels}/{total_quality_levels_on_project}")] | ||
internal struct BuildTargetAnalyticData | ||
{ | ||
internal const string k_EventName = "uBuildTargetAnalytic"; | ||
|
||
// Naming convention for analytics data | ||
public string build_target; | ||
public string render_pipeline_asset_type; | ||
public int quality_levels; | ||
public int total_quality_levels_on_project; | ||
}; | ||
|
||
void IPostprocessBuildWithReport.OnPostprocessBuild(BuildReport _) | ||
{ | ||
if (!EditorAnalytics.enabled || EditorAnalytics.RegisterEventWithLimit(BuildTargetAnalyticData.k_EventName, k_MaxEventsPerHour, k_MaxNumberOfElements, k_VendorKey) != AnalyticsResult.Ok) | ||
return; | ||
|
||
if (!TryGatherData(out var data, out var warning)) | ||
Debug.Log(warning); | ||
|
||
EditorAnalytics.SendEventWithLimit(BuildTargetAnalyticData.k_EventName, data); | ||
} | ||
|
||
[MustUseReturnValue] | ||
static bool TryGatherData([NotNullWhen(true)] out BuildTargetAnalyticData data, [NotNullWhen(false)] out string warning) | ||
{ | ||
var activeBuildTarget = EditorUserBuildSettings.activeBuildTarget; | ||
var activeBuildTargetGroup = BuildPipeline.GetBuildTargetGroup(activeBuildTarget); | ||
var activeBuildTargetGroupName = activeBuildTargetGroup.ToString(); | ||
|
||
warning = string.Empty; | ||
|
||
var assetType = GraphicsSettings.currentRenderPipeline == null ? "Built-In Render Pipeline" : GraphicsSettings.currentRenderPipeline.GetType().ToString(); | ||
|
||
data = new BuildTargetAnalyticData() | ||
{ | ||
build_target = activeBuildTarget.ToString(), | ||
quality_levels = QualitySettings.GetActiveQualityLevelsForPlatformCount(activeBuildTargetGroupName), | ||
render_pipeline_asset_type = assetType, | ||
total_quality_levels_on_project = QualitySettings.count | ||
}; | ||
|
||
return true; | ||
} | ||
|
||
[MenuItem("internal:Edit/Rendering/Analytics/Send BuildTargetAnalytic ", priority = 0)] | ||
static void SendAnalyitic() | ||
{ | ||
if (!TryGatherData(out var data, out var warning)) | ||
Debug.Log(warning); | ||
} | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
Packages/com.unity.render-pipelines.core/Editor/Analytics/BuildTargetAnalytic.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
Packages/com.unity.render-pipelines.core/Editor/CustomRenderTexture/.buginfo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
area: HD RP |
1 change: 1 addition & 0 deletions
1
Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/.buginfo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
area: HD RP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.