Skip to content
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

Internal/2022.3/staging #8051

Merged
merged 21 commits into from
Mar 25, 2024
Merged

Internal/2022.3/staging #8051

merged 21 commits into from
Mar 25, 2024

Conversation

UnityAljosha
Copy link
Collaborator

Please read the Contributing guide before making a PR.

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. If you do add documentation, make sure to add the relevant Graphics Docs team member as a reviewer of the PR. If you are not sure which person to add, see the Docs team contacts sheet.
  • 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

Why is this PR needed, what hard problem is it solving/fixing?


Testing status

Describe what manual/automated tests were performed for this PR


Comments to reviewers

Notes for the reviewers you have assigned.

cinight and others added 21 commits March 12, 2024 12:42
UUM-65629. Restore random state.
This PR addresses the issue raised here: https://jira.unity3d.com/browse/XR-2400. 

Previously, `SetRenderPassAttachments` was called before enabling foveation, resulting in edge cases where render passes that expect to have foveation data may be initialized without it. 

This PR makes it so foveation is properly set before the `SetRenderPassAttachments` call is made. This aligns the behavior of the ScriptableRenderer with what is on trunk (Unity 2023). 

https://github.cds.internal.unity3d.com/unity/unity/blob/trunk/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs#L1667-L1669

There's no specific PR to backport as the state of trunk was a result of several unrelated changes.

This change is needed because Unity 2022 is the current stable developer ecosystem for VisionOS
…der targets

This is a backport of https://github.cds.internal.unity3d.com/unity/unity/pull/45253

With depth priming enabled, cameras with depth only render targets were getting no depth information rendered.

https://jira.unity3d.com/browse/UUM-65523
Fix Motion Vector render pass render order. Motion Vector pass depends on the Copy Depth pass. Copy Depth pass is moveable (from UniversalRenderer). Motion Vector pass order now correctly follows the Copy Depth pass. 
Motion Vectors can now be rendered after Opaques, instead of always rendering after Transparents.
…der parameters

Fixes UUM-66813.
This is a partial backport of the changes done in #37298
Jira ticket: GFXRPF-209 - https://jira.unity3d.com/browse/GFXRPF-209
Create performance test project for LTS 2022. Port current Universal_PerformanceTests to execute the same performance metrics in 2022.
The tests creates an artifact with the output images too.
This is not a graphics tests, so the results between iterations will not be checked
This fix solves shader compilation issues  in the 2022.3 stream, related to misuse of the ternary operator. 

https://jira.unity3d.com/browse/UUM-66199
Fix https://jira.unity3d.com/browse/UUM-65457

As reported by the user, the runtime DebugUI.Button OnAction callback was not connected to the OnClick event. Conneted the event in the prefab to fix the issue.
Backport fix for case [UUM-64593](https://jira.unity3d.com/browse/UUM-64593)

Don't bind UnityPerMaterial cbuffer directly if the Renderer uses custom properties that can override some of the properties from UnityPerMaterial cbuffer. The code will use the slow path that sets uniforms from UnityPerMaterial one by one taking into account any override.

Added new graphics test in HDRP_DXR_Tests suite - 4000_MaterialPropertyOverride
This PR addresses [UUM-66079](https://jira.unity3d.com/browse/UUM-66079), and partially reverts some changes made in #43938, since @MINGWAI found a use-case where the Culling Mask is still useful in Forward+.

This change
1. edits the tooltip of the culling mask.
2. makes the Culling Mask always editable, regardless of Deferred, Forward, Forward+ etc.
3. If the culling mask is set to a non-default value, adds this info box to alleviate the source of lots of user confusion.

<img width="600" alt="image" src="https://media.github.cds.internal.unity3d.com/user/2726/files/04898627-06ec-4271-b411-10f1006707ee">
This change updates URP's main Render() function to ensure that the RTHandle system's hardware dynamic resolution state remains consistent with URP's dynamic resolution logic. This prevents external code from creating mismatches between what URP expects to use from the useDynamicScale flag on RenderTextures, and what the RTHandle code actually uses.

Prior to this change, a mismatch between these two values could occur which caused URP to re-create the RTHandles inside its color buffer system every frame (since the RenderTexture created by the RTHandle won't match URP's expected RenderTargetDescriptor).
Fix NaN issue in volumetric fog reprojection
…or Apple Vision Pro.

Currently on the Apple Vision Pro if you enable MSAA in URP with Depth Texture Mode set to 'After Transaprents' you will get the following error on device:

```
A non-multisampled texture being bound to a multisampled sampler. Disabling in order to avoid undefined behavior. Please enable the bindMS flag on the texture.
UnityEngine.Rendering.ScriptableRenderContext:Submit_Internal()
UnityEngine.Rendering.ScriptableRenderContext:Submit() (at /Users/bokken/build/output/unity/unity/Runtime/Export/RenderPipeline/ScriptableRenderContext.cs:117)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderSingleCamera(ScriptableRenderContext, CameraData&) (at ./Library/PackageCache/[email protected]/Runtime/UniversalRenderPipeline.cs:667)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderCameraStack(ScriptableRenderContext, Camera) (at ./Library/PackageCache/[email protected]/Runtime/UniversalRenderPipeline.cs:836)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:Render(ScriptableRenderContext, List`1) (at ./Library/PackageCache/[email protected]/Runtime/UniversalRenderPipeline.cs:364)
UnityEngine.Rendering.RenderPipeline:InternalRender(ScriptableRenderContext, List`1) (at /Users/bokken/build/output/unity/unity/Runtime/Export/RenderPipeline/RenderPipeline.cs:52)
UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal(RenderPipelineAsset, IntPtr, Object) (at /Users/bokken/build/output/unity/unity/Runtime/Export/RenderPipeline/RenderPipelineManager.cs:132)
Unity.PolySpatial.Extensions.PolySpatialStereoFramebuffer:Update() (at /Users/ryan.goodrich/Developer/quantum/Packages/com.unity.polyspatial.extensions/Runtime/StereoRenderer/PolySpatialStereoFramebuffer.cs:65)

[./Runtime/Shaders/ShaderImpl/ShaderTextureProperty.cpp line 1798298936]

-[MTLDebugRenderCommandEncoder validateCommonDrawErrors:]:5775: failed assertion `Draw Errors Validation
Fragment Function(xlatMtlMain): incorrect type of texture (MTLTextureType2DArray) bound at texture binding at index 0 (expect MTLTextureType2DMultisampleArray) for _CameraDepthAttachment[0].
```

The root issue is the 'BindMS' flag is not getting set true on the depth buffer when it should be.

After lots of digging, I believe this PR fixes the root issue. There are a few places that were setting BindMS to false on the depth buffer based on the condition of `RenderingUtils.MultisampleDepthResolveSupported` which returns true on the avp because it does support it, but the avp is not actually resolving the depth textures automatically. Which the current logic assumes if `RenderingUtils.MultisampleDepthResolveSupported` returns true then the device is also automatically resolving the depth textures, but on the avp this is not true. 

This PR add an additional check to `SystemInfo.supportsMultisampleAutoResolve` to ensure the device is auto resolving as well before setting the bindMS flag to false and assuming it will auto resolve.
…nd Game windows are open. (UUM-63267)

Fixes UUM-63267.
In non-RenderGraph, the main and additional light shadow passes didn't have the correct data in the WorldToCamera matrix. This is due to it being set after they've been run. This PR fixes that.
Jira: UUM-8907

This PR adds tooltips wherever it was relevant to he `Control Panel` in VFX Graph.

ℹ I took this opportunity to cleanup a bit the code and the UI to
- Reduce the number of UI elements
- Better align some controls
- Use built-in controls instead of custom implementation (dropdown for instance)
- Move the user events into the same section as the built-in events
- Increase font size to 12 like everywhere else in the graph
Fixes UUM-66727.
For 2022.3 this parameter needs to be moved to the SSAO.hlsl file as custom shaders might declare it without being able to detect patch versions in shader code. That has been fixed in 2023.3 and later versions.
Fix flickering for 2D Renderer on macOS silicon
Fix a scaling issue with the recorder.
@UnityAljosha UnityAljosha requested review from a team as code owners March 25, 2024 15:12
Copy link

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page).
See the PR template for more information.
Thank you!

@UnityAljosha UnityAljosha merged commit 69c1558 into 2022.3/staging Mar 25, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.