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

Abysmal performance in "San Franciso Rush 2049" due to smoke effect #1862

Open
vanfanel opened this issue Mar 3, 2025 · 5 comments
Open
Labels
graphics Rendering issues

Comments

@vanfanel
Copy link

vanfanel commented Mar 3, 2025

Please Note: This form is the minimum required information for submitting bugs.
Removing this form may lead to your issue being closed until it is completed.

Platform / OS / Hardware: GNU/Linux Debian Testing, kernel 6.12.12, latest MESA stable (25.0.0)

Flycast version: Latest GIT code

Hardware: AMD Ryzen 8700G with Radeon 780M graphics, 32GB (2x16) DDR5 6400 RAM.
Also happens on Intel XE graphics.

Description of the Issue

In "San Francisco Rush 2049", when breaking strongly and creating a lot of smoke/dust, performance is severely impacted by the smoke effect, going as low as 1 frame per second with Alpha Sorting set to Per Pixel.
Happens both on the Vulkan and OpenGL renderer.
CPU usage is always very low (~5% of one core), so I suspect some renderer bug triggering this.

Debugging Steps Tested

Tried different renderers (OpenGL, Vulkan), tried altering all the emulator video options (pixel buffer size, transparent layers, etc).
I can't see what's triggering this.
Maybe the smoke/dust effect is made of individual pixels? How is the effect done?

Screenshots

Image

@vanfanel vanfanel added the bug Something isn't working label Mar 3, 2025
@vanfanel vanfanel changed the title Abysmal performance drop with "San Franciso Rush 2049" smoke effect Abysmal performance in "San Franciso Rush 2049" due to smoke effect Mar 3, 2025
@flyinghead
Copy link
Owner

This is likely a consequence of 308d9fc: this game uses lots of transparent layers, which is very demanding on the GPU. You can create a specific setting for this game to reduce the number of transparent layers, at the expense of graphical glitches.

See #1610

@flyinghead flyinghead added graphics Rendering issues and removed bug Something isn't working labels Mar 4, 2025
@vanfanel
Copy link
Author

vanfanel commented Mar 4, 2025

So this is not a bug then, I see!

You mean this particular section, right?

else if (prod_id == "T-9707N"		// San Francisco Rush 2049 (US)



				|| prod_id == "T-9709D-50"	// San Francisco Rush 2049 (EU)


				|| prod_id == "T17721N"		// Conflict Zone (US)


				|| prod_id == "T46604D")	// Conflict Zone (EU)


			layers = 152;

...so if I'm correct, this game uses 152 transparent layers, is that correct?
The number of transparent layers seems to be limited to 128 on the emulator options, so I guess enabling 152 is a "hack". Isn't that out of the Dreamcast system specs?

Then, how the Dreamcast do that if a modern day GPU like mine struggles to do so? (Genuinely curious!)

@vanfanel
Copy link
Author

vanfanel commented Mar 4, 2025

I was doing some research and it seems that modern GPUs should be up to the task.
Maybe using Weighted Blended OIT or Per-Pixel Linked Lists would help?

@flyinghead
Copy link
Owner

if I'm correct, this game uses 152 transparent layers, is that correct?

Yes

Isn't that out of the Dreamcast system specs?

There's no Dreamcast specification as to the max number of transparent layers. 128 is enough for 99% of games but there are exceptions.

how the Dreamcast do that if a modern day GPU like mine struggles to do so?

I have the same question. I guess it's using some optimization to eliminate some layers. But note that my GPU (Nvidia GTX 1080) has no issue with this game. Also keep in mind that the Dreamcast renders at 640x480. Upscaling by 2 will dradruple the work needed to render a frame.

Maybe using Weighted Blended OIT or Per-Pixel Linked Lists would help?

Weighted Blended only works for the basic blending method (source alpha, 1 - source alpha) iirc. Per-pixel linked lists is what flycast is using.

@vanfanel
Copy link
Author

vanfanel commented Mar 4, 2025

Well, your Nvidia GTX 1080 is apparently a 110% faster than my Radeon 780M (which equals an RTX 2050M), so of course you don't get to see the massive slowdown with Alpha Sorting = Per Pixel, I guess...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
graphics Rendering issues
Projects
None yet
Development

No branches or pull requests

2 participants