Skip to content

Fix profiling marker mismatches by removing named CommandBuffers. - #1250

Merged
phi-lira merged 5 commits into
masterfrom
universal/profiling/fix-urp-marker-errors
Jul 15, 2020
Merged

Fix profiling marker mismatches by removing named CommandBuffers.#1250
phi-lira merged 5 commits into
masterfrom
universal/profiling/fix-urp-marker-errors

Conversation

@eh-unity

@eh-unity eh-unity commented Jul 10, 2020

Copy link
Copy Markdown
Contributor
  • Modified the default .Get() for CommandBufferPool to give an actually nameless CommandBuffer
  • Remove named CommandBuffers when also using ProfilingScopes.

Please read;

PR Workflow for the Graphics repository:

  • All PRs must be opened as draft initially
  • Reviewers can be added while the PR is still in draft
  • The PR can be marked as “Ready for Review” once the reviewers have confirmed that no more changes are needed
  • Tests will start automatically after the PR is marked as “Ready for Review”
  • Do not use [skip ci] - this can break some of our tooling
  • Read the Graphics repository & Yamato FAQ.

Checklist for PR maker

  • Have you added a backport label (if needed)? For example, the need-backport-* label. After you backport the PR, the label changes to backported-*.
  • Have you updated the changelog? Each package has a CHANGELOG.md file.
  • Have you updated or added the documentation for your PR? When you add a new feature, change a property name, or change the behavior of a feature, it's best practice to include related documentation changes in the same PR.
  • Have you added a graphic test for your PR (if needed)? When you add a new feature, or discover a bug that tests don't cover, please add a graphic test.

Purpose of this PR

Fix profiler marker error spam. Currently this only fixes the incorrect use cases. Minimal changes in that sense.

Backports:

[9.x.x.] #1329


Testing status

Manual Tests: What did you do?

  • Opened test project + Run graphic tests locally
  • Built a player
  • Checked new UI names with UX convention
  • Tested UI multi-edition + Undo/Redo + Prefab overrides + Alignment in Preset
  • C# and shader warnings (supress shader cache to see them)
  • Checked new resources path for the reloader (in developer mode, you have a button at end of resources that check the paths)
  • Other:

Automated Tests: What did you setup? (Add a screenshot or the reference image of the test please)

Yamato: (Select your branch):
https://yamato.prd.cds.internal.unity3d.com/jobs/902-Graphics

Any test projects to go with this to help reviewers?


Comments to reviewers

Notes for the reviewers you have assigned.

* Modified the default .Get() for CommandBufferPool to give an actually nameless CommandBuffer
* Remove named CommandBuffers when also using ProfilingScopes.
@realek
realek self-requested a review July 10, 2020 18:04

@ellioman ellioman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need to fix this in all the places where this is happening? For example:

  • ScreenSpaceAmbientOcclusion.Execute()
  • PostProcessPass.Execute()
  • SceneViewDepthCopy.Execute()
  • TransparentSettingsPass.Execute()
  • XROcclusionMeshPass.Execute()
  • ScriptableRenderer.Execute()
  • MainLightShadowCasterPass.RenderMainLightCascadeShadowmap()
  • GBufferPass.Execute()
  • FinalBlitPass.Execute()
  • CopyDepthPass.Execute()
  • CopyColorPass.Execute()
  • ColorGradingLutPass.Execute()
  • CapturePass.Execute()
  • DeferredLights.ExecuteDeferredPass()
  • DeferredLights.ExecuteDownsampleBitmaskPass()
  • DeferredLights.ExecuteTileDepthInfoPass()
  • Render2DLightingPass.Execute()
  • OutputColorsToMRTsRenderPass.Execute()
  • CopyToViewportRenderPass.Execute()
  • CameraCallbackTests.Execute()
  • ScreenSpaceShadowResolvePass.Execute() (Not used but still smart to fix it as well)

@eh-unity

Copy link
Copy Markdown
Contributor Author

This change now removes all use of named command buffers from URP.
I added ProfilingScopes instead which also means some whitespace changes as indentation changed and editor auto-formatted according to our rules.

@phi-lira phi-lira left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

public static CommandBuffer Get()
{
var cmd = s_BufferPool.Get();
cmd.name = "Unnamed Command Buffer";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we leave this unchanged? I suppose this is to make default nameless command buffers appear on profiler?
@JulienIgnace-Unity any concern with changing?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think the goal was to have a marker by default. But since we now know that it can cause issues implicitly in some case it's probably better to have it unnamed by default.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that ^, I guess for now this should suffice but probably in the future we can work together to find out what kind of construct would best suit both srps in terms of gathering profiling data :)

Comment thread com.unity.render-pipelines.universal/Runtime/Passes/ColorGradingLutPass.cs Outdated
@eh-unity
eh-unity marked this pull request as ready for review July 15, 2020 08:03
@eh-unity
eh-unity requested review from a team as code owners July 15, 2020 08:03
# Conflicts:
#	com.unity.render-pipelines.universal/CHANGELOG.md
#	com.unity.render-pipelines.universal/Runtime/DeferredLights.cs
#	com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs
@eh-unity

eh-unity commented Jul 15, 2020

Copy link
Copy Markdown
Contributor Author

Merged master. I had to redo couple files, but change should be the same.

@phi-lira
phi-lira merged commit 448ce11 into master Jul 15, 2020
@phi-lira
phi-lira deleted the universal/profiling/fix-urp-marker-errors branch July 15, 2020 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants