-
-
Notifications
You must be signed in to change notification settings - Fork 337
nv2a: Download overlapping VGA framebuffer surfaces #2190
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
base: master
Are you sure you want to change the base?
nv2a: Download overlapping VGA framebuffer surfaces #2190
Conversation
Draft as it still needs testing on Vulkan. Edit: Also seems like it deadlocks during the regression suite. Hey @Triticum0 can you check the other black menu games to see if any are fixed? I believe you thought #584 might be a similar issue, not sure if there were any others. |
55df9bc
to
4eb68c2
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
Thanks for testing! I have some performance improvements for the typical path that I'll push after I figure out the freezing issue I'm seeing with the pgraph regression tests. I suspect there's something wrong with my dev machine, since it's also freezing without this change. Edit: Looks like the freezing may be related to an nxdk update in the pgraph tester and not my machine or this PR. I'll roll it back and merge in my performance updates soon-ish. |
4eb68c2
to
7612514
Compare
Performance improvements are applied. It's slightly better on my machine, but still pretty bad. I see about 5 host frame updates per CRTC register modification. Also the offset surface draws continue into gameplay; I had hoped that they would just be during the menu sequence. This means that this particular title has many times as many GL surface downloads as typical titles. We may need to consider some alternative approach (e.g., creating a border surface in GPU memory and merging the GL surface created for the guest draws into it to avoid the round trip to RAM and back). I'm also seeing very rare texture corruption and crashes when testing this game; unclear if they're related to this change or just a separate issue with this title. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Generally a momentary glitch across the entire screen, often with a fairly strong green component to it. It's not aligned to the rendered geometry, which makes me suspect it's related to grabbing the framebuffer rather than any issue with the guest-side rendering or the game itself. My guess is that the locking I'm doing when downloading the texture is somehow incorrect and the host-side framebuffer texture ends up containing some uninitialized data due to a race condition. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Interesting, it is something like that, but on macOS/M3 it manifests as more distinct uninitialized-looking corruption, often over just part of the window.
I did not notice that in my testing, but I do have other weird behavior (will note below)
I see this on macOS as well. With my continued changes trying to find a solution I was able to get some new weird behavior when spinning the camera around where there is sometimes a tiling effect with quadrants of the frame retaining old data while others are updated. It seems to happen most frequently when the water starts to come into frame; as you pointed out previously the framerate dips noticeably when the water is rendered. Seen on both macOS/M3 and Linux/GTX1070 Watch the lower left corner: test.mp4I also get very weird occasional updates to the ~64 lines at the top of the screen that necessitated this fix in the first place. I would've expected that data to always remain black, but perhaps we're ending up with multiple GL surfaces within the guest framebuffer. I'll look into it. I also see a bunch (~27 per frame) of |
Also fixes #1121 |
Thanks. The yellow water is probably not related to the issue this PR addresses and will need to be investigated/fixed separately. The screen mirroring is more concerning. What are your machine specs (GPU, OS, upscale factor in particular)? I'm surprised to see such a problem manifest horizontally. I've heard that it's possible to get into the game without this PR; if that's the case I'd be very interested in whether these issues show up without this change or if they're somehow artifacts of the surface downloading I'm introducing. |
Ok, I tested it with the latest master release and it does have the mirroring issue as well. I tried 1x upscaled and it doesn't fix it. One thing interesting is that the yellow color doesn't appear on master, but it has other issues like the UI elements don't render at all. CPU: AMD Ryzen 9 6900HX with Radeon Graphics |
Thanks for checking! That top image looks similar to the way signed textures are misrendered, but I'm surprised that master behaves differently. I've never actually played the game before, is the second image supposed to be looking at water? Does water look generally correct on master or is it just broken in another way?
Excellent; I'm wondering if the mirroring is an AMD-specific issue or if it's just something that only happens on certain levels. It also looks like you do not have the corruption I see at the top of the screen on M3, which is interesting. If you spin the camera around quickly, do portions of the screen lag? If you look at the video I posted above it captures what I see on M3 and Nvidia GPUs. I never bothered to go beyond the waterfall on the first level, so I'm not sure if some of these problems just go away, or if they don't appear w/ an AMD card. |
Now that I double check, the water in master is less waving than this PR. Like more calm if it makes sense. Maybe is not rendering some extra layer of waves?
It's all the time present. It looks kind of similar to your issue on the top of the screen except mine is on the right side and larger.
Nope, it doesn't. 2025-05-28.21-15-09.mp4 |
4bdec58
to
482a062
Compare
75e3876
to
baab9e4
Compare
baab9e4
to
887da83
Compare
Fixes #1120