Skip to content

Conversation

@sandy-carter-unity
Copy link
Contributor

Pass: Remove RTI alises of universal renderer targets, these do not work
with RTHandles, you must get the actual references.
Pass: Convert dBufferColorHandles[0-2] and m_DBufferDepth to RTHandles
Pass: Set global textures in execute to use the same cmd.
Feature: Call pass dispose
Feature: Move setup of targets to Pass' Setup Function called from
SetupRenderPasses

Please read the Contributing guide before making a PR.

Checklist for PR maker

  • Have you updated the changelog? Each package has a CHANGELOG.md file.

Purpose of this PR

The intention of this PR is fix breaking test 230 in Foundation.
It also fixes targets that weren't yet converted to RTHandles.


Testing status

Test 230_Decal_Projector from UniversalGraphicsTest_Foundation was run with the -xr-reuse-tests which reliably produced a red test.

The test seemed to also fail more often if run after 120 to 124. This was also tested.


Comments to reviewers

Notes for the reviewers you have assigned.

@github-actions
Copy link

Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed.
Link to Yamato: https://unity-ci.cds.internal.unity3d.com/project/902/
Search for your PR branch using the search bar at the top, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

URP
/jobDefinition/.yamato%252Fall-urp.yml%2523PR_URP_trunk
With changes to URP packages, you should also run
/jobDefinition/.yamato%2Fall-lightmapping.yml%23PR_Lightmapping_trunk

Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure.

Pass: Remove RTI alises of universal renderer targets, these do not work
with RTHandles, you must get the actual references.
Pass: Convert dBufferColorHandles[0-2] and m_DBufferDepth to RTHandles
Pass: Set global textures in execute to use the same cmd.
Feature: Call pass dispose
Feature: Move setup of targets to Pass' Setup Function called from
SetupRenderPasses
@sandy-carter-unity sandy-carter-unity marked this pull request as ready for review November 30, 2021 22:25
@sandy-carter-unity sandy-carter-unity requested review from a team as code owners November 30, 2021 22:25
@sandy-carter-unity
Copy link
Contributor Author

sandy-carter-unity commented Nov 30, 2021

The following red nightly tests are fixed by this PR for 230 Decal Projector:

  1. https://unity-ci.cds.internal.unity3d.com/job/10214336 (Win DX11 Standalone XR mono Linear Foundation)
  2. https://unity-ci.cds.internal.unity3d.com/job/10214337 (Win DX11 Playmode XR Mono Linear Foundation)
  3. https://unity-ci.cds.internal.unity3d.com/job/10214340 (Win DX12 Standalone XR Mono Linear Foundation)
  4. https://unity-ci.cds.internal.unity3d.com/job/10214344 (Win Vulkan Standalone mono Linear Foundation)
  5. https://unity-ci.cds.internal.unity3d.com/job/10214388 (Win Vulkan Standalone mono Linear Terrain)
  6. https://unity-ci.cds.internal.unity3d.com/job/10214390 (Linux Vulkan Standalone mono Linear Terrain)
  7. https://unity-ci.cds.internal.unity3d.com/job/10214394 (Android Vulkan Standalone il2cpp Linear Terrain)
  8. https://unity-ci.cds.internal.unity3d.com/job/10214460 (Win Vulkan playmode mono Linear Terrain)
  9. https://unity-ci.cds.internal.unity3d.com/job/10214461 (Linux Vulkan playmode mono Linear Terrain)

depthHandle = m_CameraDepthAttachment;
}

ConfigureTarget(dBufferColorHandles, depthHandle);
Copy link
Contributor

@lukaschod lukaschod Dec 1, 2021

Choose a reason for hiding this comment

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

I noticed we usually call ConfigureTarget on OnCameraSetup/Configure, wouldn't be issue calling it outside it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure. So far, I don't think so.
The bigger issues I had was getting targets from universal renderer too early.

Copy link
Contributor

Choose a reason for hiding this comment

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

K so if it works it is okay. I think I will split it in my https://github.com/Unity-Technologies/Graphics/pull/6442/files.

@phi-lira
Copy link
Contributor

phi-lira commented Dec 7, 2021

Merged master to rerun tests as there were some failures that were already fixed in master and that was quite hard to compare.

{
UniversalRenderer universalRenderer = (UniversalRenderer)renderer;
if (universalRenderer.renderingMode == RenderingMode.Deferred)
if (universalRenderer.renderingModeRequested == RenderingMode.Deferred)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add info why this needs to be changed?

Copy link
Contributor

Choose a reason for hiding this comment

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

This was to make it more clear to understand. RenderingMode is the rendering mode settings and then there was another RenderingModeActual which was the one that is the actual one used and considered when falling back. The renderinMode was renamed to renderingModeRequested to be more clear this is the requested mode that comes from settings but not necessary the mode that is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I add it to the changelog, maybe?

Copy link
Contributor

Choose a reason for hiding this comment

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

These are internal / private. No reason to mention in changelog.

Copy link
Contributor

@eh-unity eh-unity left a comment

Choose a reason for hiding this comment

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

Please clarify request vs. actual rendering mode usage in the renderer. Otherwise lgtm.

}

if (this.renderingMode == RenderingMode.Deferred)
if (this.renderingModeRequested == RenderingMode.Deferred)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these use renderingModeRequested? Shouldn't these depend on the renderingModeActual?

Copy link
Contributor

Choose a reason for hiding this comment

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

@sandy-carter-unity this is a good point. It seems sensible that the actual rendering mode is figured out very early before all of these settings.

Actually, thinking about it a little bit now, we should expose a property to get the rendering mode that always return the actual one and the requested / setting is private setting, this makes it less confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this what you mean?

private RenderingMode renderingModeRequested => m_RenderingMode;
internal RenderingMode renderingModeActual => ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At that point, we could remove the renderingModeRequested property entirely

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, ok I see the renderingModeRequested is private now, but that feels useless tbh as you can just have m_RenderingMode?

@phi-lira phi-lira changed the base branch from master to universal/staging December 9, 2021 08:33
@phi-lira
Copy link
Contributor

phi-lira commented Dec 9, 2021

This PR introduces some new failures in Android, but given that it fixes several other failures I will take it to improve the overall coverage situation.

@phi-lira phi-lira merged commit 0578ace into universal/staging Dec 9, 2021
@phi-lira phi-lira deleted the universal/dcal-rthandles branch December 9, 2021 08:35
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.

5 participants