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

Fix depthDescriptor.bindMS condition #5039

Merged
merged 5 commits into from Aug 19, 2021
Merged

Conversation

robin-demoor
Copy link
Contributor


Purpose of this PR

Some Scarlet tests have started failing with the exception: "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."

This change fixes the issue.. The BindMS flag was incorrectly disabled on some platforms due to the depthPriming setting.

Copy link
Collaborator

@manuele-bonanno manuele-bonanno left a comment

Choose a reason for hiding this comment

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

this whole line of code was added by the depth priming PR. If you look at the VR only #ifdef above, this is exactly the same code, and used to be VR specific code.

I think we should revert the bindMS setting to what it was before the depth priming PR, which seems to have introduced the issue, so just removing this line completely

Are there any issues with that?

@@ -988,7 +988,7 @@ void CreateCameraRenderTarget(ScriptableRenderContext context, ref RenderTexture
depthDescriptor.bindMS = depthDescriptor.msaaSamples > 1 && !SystemInfo.supportsMultisampleAutoResolve && (SystemInfo.supportsMultisampledTextures != 0);
#endif

depthDescriptor.bindMS |= depthDescriptor.msaaSamples > 1 && primedDepth && !SystemInfo.supportsMultisampleAutoResolve && (SystemInfo.supportsMultisampledTextures != 0);
depthDescriptor.bindMS |= depthDescriptor.msaaSamples > 1 && !SystemInfo.supportsMultisampleAutoResolve && (SystemInfo.supportsMultisampledTextures != 0);

Copy link
Collaborator

Choose a reason for hiding this comment

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

this is the line of code to remove I mentioned in my comment (which I posted in the wrong place ops :) )

Copy link
Collaborator

Choose a reason for hiding this comment

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

for reference, this is the PR that added this line potentially causing the regression:
#3997

Copy link
Collaborator

@manuele-bonanno manuele-bonanno left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the changes!

@NicoLeyman
Copy link
Contributor

@thomas-zeng Any update on this ? This has been causing certain platform tests to fail for a while.
The fix shouldn't have any fallout for XR but should probably get an ok from the XR side.

@thomas-zeng
Copy link
Contributor

Sorry @NicoLeyman for dropping the ball. I have greenlighted the PR.

@NicoLeyman NicoLeyman marked this pull request as ready for review August 4, 2021 07:44
@NicoLeyman NicoLeyman requested review from a team as code owners August 4, 2021 07:44
@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://yamato.cds.internal.unity3d.com/jobs/902-Graphics
Search for your PR branch using the sidebar on the left, 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
/.yamato%252Fall-urp.yml%2523PR_URP_2021.2

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.

Copy link

@ernestasKupciunas ernestasKupciunas left a comment

Choose a reason for hiding this comment

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

Approving without testing. The issue was triggered in Yamato, and it is fixed now.

@ellioman
Copy link
Collaborator

Issues on Yamato were not caused by this PR.

@ellioman ellioman merged commit 1df6b3f into master Aug 19, 2021
@ellioman ellioman deleted the urp/fix-depth-msaa-condition branch August 19, 2021 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants