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

Allow copy texture views to have mismatching multisample state #3152

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

gdkchan
Copy link
Member

@gdkchan gdkchan commented Feb 22, 2022

We have no way to know if textures are multisampled on the 2D engine for copies. Currently, this is handled by allowing the matched texture to be multisampled, even if we are looking for a non-multisample 2D texture for copies. The problem is that right now, this is only allowed for exact matches, which means that if the copy texture is slightly different from the one in the cache (for example, the format is different, such as render target texture being Unorm and copy one being Srgb), exact match will fail and it will try to create a view instead, or new texture if that fails too.

This case is happening on Pinball FX3 with the update. Render target is Unorm, copy is Srgb, exact match fails, view match fails because the target is different (render target is 2DMultisample, copy is just 2D), and then it is forced to create a new texture, and the copy is broken as it doesn't have the render target data.

This change fixes this by also allowing multisample state to not match for views when looking for copy textures. The AdjustSizes method was also changed to propagate the multisample state from the view parent in this case. This fixes the black screen issue on the game, see screenshots below for comparison.

Before:
image
After:
image
image

I recommend reviewing the changes carefully as I don't touch the texture cache in a long time, and it used to be pretty easy to break.

@gdkchan gdkchan added gpu Related to Ryujinx.Graphics fix Fix something labels Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fix something gpu Related to Ryujinx.Graphics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants