Skip to content

[9.x.x backport] Merge Hdrp/staging [Skip CI] (#582) #586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ MonoBehaviour:
m_AdvancedMode: 0
mode:
m_OverrideState: 1
m_Value: 1
m_Value: 0
meteringMode:
m_OverrideState: 0
m_Value: 2
luminanceSource:
m_OverrideState: 0
m_Value: 1
fixedExposure:
m_OverrideState: 0
m_Value: 0
m_OverrideState: 1
m_Value: 7
compensation:
m_OverrideState: 0
m_Value: 0
Expand Down Expand Up @@ -86,3 +86,14 @@ MonoBehaviour:
m_OverrideState: 0
m_Value: 1
min: 0.001
weightTextureMask:
m_OverrideState: 0
m_Value: {fileID: 0}
histogramPercentages:
m_OverrideState: 0
m_Value: {x: 40, y: 90}
min: 0
max: 100
histogramUseCurveRemapping:
m_OverrideState: 0
m_Value: 0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion TestProjects/VisualEffectGraph/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"com.unity.timeline": "1.2.9",
"com.unity.ugui": "1.0.0",
"com.unity.visualeffectgraph": "file:../../../com.unity.visualeffectgraph",
"com.unity.xr.legacyinputhelpers": "2.1.2",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
Expand Down
80 changes: 42 additions & 38 deletions com.unity.render-pipelines.core/Runtime/Debugging/ProfilingScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,42 @@ public ProfilingSampler(string name)
#endif
}

/// <summary>
/// Begin the profiling block.
/// </summary>
/// <param name="cmd">Command buffer used by the profiling block.</param>
public void Begin(CommandBuffer cmd)
{
if (cmd != null)
#if UNITY_USE_RECORDER
if (sampler != null)
cmd.BeginSample(sampler);
else
cmd.BeginSample(name);
#else
cmd.BeginSample(name);
#endif
inlineSampler?.Begin();
}

/// <summary>
/// End the profiling block.
/// </summary>
/// <param name="cmd">Command buffer used by the profiling block.</param>
public void End(CommandBuffer cmd)
{
if (cmd != null)
#if UNITY_USE_RECORDER
if (sampler != null)
cmd.EndSample(sampler);
else
cmd.EndSample(name);
#else
m_Cmd.EndSample(name);
#endif
inlineSampler?.End();
}

internal bool IsValid() { return (sampler != null && inlineSampler != null); }

internal CustomSampler sampler { get; private set; }
Expand Down Expand Up @@ -187,11 +223,9 @@ public bool enableRecording
/// </summary>
public struct ProfilingScope : IDisposable
{
string m_Name;
CommandBuffer m_Cmd;
bool m_Disposed;
CustomSampler m_Sampler;
CustomSampler m_InlineSampler;
CommandBuffer m_Cmd;
bool m_Disposed;
ProfilingSampler m_Sampler;

/// <summary>
/// Profiling Scope constructor
Expand All @@ -202,29 +236,8 @@ public ProfilingScope(CommandBuffer cmd, ProfilingSampler sampler)
{
m_Cmd = cmd;
m_Disposed = false;
if (sampler != null)
{
m_Name = sampler.name; // Don't use CustomSampler.name because it causes garbage
m_Sampler = sampler.sampler;
m_InlineSampler = sampler.inlineSampler;
}
else
{
m_Name = "NullProfilingSampler"; // Don't use CustomSampler.name because it causes garbage
m_Sampler = null;
m_InlineSampler = null;
}

if (cmd != null)
#if UNITY_USE_RECORDER
if (m_Sampler != null)
cmd.BeginSample(m_Sampler);
else
cmd.BeginSample(m_Name);
#else
cmd.BeginSample(m_Name);
#endif
m_InlineSampler?.Begin();
m_Sampler = sampler;
m_Sampler?.Begin(m_Cmd);
}

/// <summary>
Expand All @@ -246,16 +259,7 @@ void Dispose(bool disposing)
// this but will generate garbage on every frame (and this struct is used quite a lot).
if (disposing)
{
if (m_Cmd != null)
#if UNITY_USE_RECORDER
if (m_Sampler != null)
m_Cmd.EndSample(m_Sampler);
else
m_Cmd.EndSample(m_Name);
#else
m_Cmd.EndSample(m_Name);
#endif
m_InlineSampler?.End();
m_Sampler?.End(m_Cmd);
}

m_Disposed = true;
Expand Down
Loading