Project

General

Profile

Emulator Issues #7936

Burnout 2 Snow Effect Causing Massive Slowdown

Added by adiffin502 about 5 years ago. Updated over 2 years ago.

Status:
Working as intended
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
Yes
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Game Name?
Burnout 2: Point of Impact

Game ID?
GB4E51

What's the problem? Describe what went wrong in few words.
The snow effect (which is just little snow sprites falling downwards) is causing huge slowdown (down from full 60FPS to 18FPS in races!) The rain effect doesn't have this issue and what's even more confusing is that there is no slowdown at all when viewing the race in a replay, even with the snow!

What did you expect to happen instead?
Full 60FPS

What steps will reproduce the problem?
[Don't assume we have ever played the game and know any level names. Be as
specific as possible.]
1. Start a race on any of the Crystal Summit tracks
2. Set Conditions to Snow
3. After loading, the frame-rate takes a nose dive.

Dolphin 3.5 and 3.5-367 are old versions of Dolphin that have
known issues and bugs, so don't report issues about them and test the
latest Dolphin version first.
Which versions of Dolphin did you test on?
All D3D11 compatible versions seem to have this problem. D3D9 is unable to render the snow.

Does using an older version of Dolphin solve your issue? If yes, which
versions of Dolphin used to work?
No.

What are your PC specifications? (including, but not limited to: Operating
System, CPU and GPU)
AMD Athlon X4 750K @ 4.1GHz
Windows 8.1 Pro x64
AMD Radeon HD 7770

Is there any other relevant information? (e.g. logs, screenshots,
configuration files)
[Upload big files to a hosting service and post links here!]
http://i.imgur.com/MJOn7lJ.jpg

[Do not attach files to this issue. Upload them to another site and
link here. Use imgur.com for images and pastie.org for logs. Monitor the
email address that was used to create this issue.]

History

#1 Updated by JMC4789 about 5 years ago

  • Status changed from New to Questionable

We do not usually accept performance issues without and underlying cause. The big reason for this is that there are certain things that are just slow to emulate, and less we have a specific cause.

There are a few things you can try: Please try "checking" skip EFB Access to CPU, try changing graphics settings to be lower, trying different graphics backends, etc.

You have a slower computer, so it's to be expected that some things could cause severe slowdown. In this case, it could be rendering tons of triangles in individual objects slowing you down. We can maybe get a graphics person to get a look at why it's slowing down to see if this is a bug in Dolphin, or just something that is slow though.

Thank you for the report!

#2 Updated by adiffin502 about 5 years ago

Checking Skip EFB Access didn't work, but incidentally, the OpenGL backend doesn't seem to render the snow either. I think this is just one of those Hyrule Field-type scenarios. Thanks for the response!

#3 Updated by phire about 5 years ago

Could you please record a single frame fifo log of the snow?

#4 Updated by JMC4789 about 5 years ago

adiffin502: I think OpenGL's lack of line-width is part of the problem. Please record a fifolog for us to examine! Thanks!

#5 Updated by adiffin502 about 5 years ago

Okay, so another strange thing I realized is that the slowdown only seems to occur in the Grand Prixs in which this effect is used! When playing on the same track in, say, Single Race mode, the slowdown is far less pronounced (50-60FPS).

Here's the FIFO log, by the way:
https://docs.google.com/uc?export=download&confirm=Ufws&id=0B3AFeSVGmg9sMGY4TEk0azNybXc

#6 Updated by ZephyrSurfer about 5 years ago

Could I specifically ask for a 5 frame fifolog. Thanks. And do compress again aswell.

#7 Updated by ZephyrSurfer about 5 years ago

I can't download from that link.

#9 Updated by adiffin502 about 5 years ago

Another strange thing I noticed is that there seems to be more falling snow in the Grand Prix appearances of the snow tracks (when it is snowing) than there is in any other mode O_o

Grand Prix: http://i.imgur.com/3uVgfo2.jpg
All other modes: http://i.imgur.com/VNuo5u3.jpg

#10 Updated by degasus about 5 years ago

Yeah, each snow flake is rendered as a point, seperately. Between them, the uniform are changed. Likely because of a changed transformation matrix...

#11 Updated by JMC4789 about 5 years ago

Can we just make this a duplicate of the flanoir issue then?

#12 Updated by degasus about 5 years ago

This one renderes points, in flanoir are lots of triangles. iirc our d3d code has some special overhead if lots of points or lines are drawn.
Maybe you can recheck if the slowdown is still the same on armada's line-width PR. Please both D3D and OGL.

@Armada: Do you think we should add the culling state in the state manager?

#13 Updated by Armada about 5 years ago

@wickmarkus86

The state managers is already used by the Renderer for the culling state.

#14 Updated by Armada about 5 years ago

Also the previous D3D line-width implementation re-uploaded the uniforms every draw call, not just when they're changed. Thus if the uniform upload process is the bottleneck the line-width branch likely fixes it.

Try this build: http://dl.dolphin-emu.org/prs/pr-1706-dolphin-latest-x64.7z

#15 Updated by adiffin502 about 5 years ago

The slowdown is still the same on the line-width PR (I very much appreciate all of your responses, regardless!), but what's strange is that the snow is now invisible (still being "rendered", but cannot be seen), though the RAIN of all things still works as intended. Maybe the rain works differently?

OpenGL does make the snow visible (it was invisible on OGL outside the LW PR), but is actually about twice as slow (~18FPS compared to ~29FPS on D3D, but that's no surprise seeing as AMD cards aren't nearly as good with OGL as the green team.)

#16 Updated by JMC4789 about 5 years ago

Makes sense. Thanks for the responses. If you have Tales of Symphonia + save files; could you see if the City of Flanoir to see if the snow there gives you a similar slowdown? I have a feeling it will; allowing us to merge those two issues. That way, it would be accepted within that issue instead of questionable as a performance issue here.

#17 Updated by magumagu9 about 5 years ago

We shouldn't merge this with 6587 unless someone actually proves it's the same issue... the fact that both slowdowns involve drawing snow doesn't make them related in any meaningful way.

#18 Updated by ZephyrSurfer about 5 years ago

This one looks like it's not points but 2 triangles together for every snowflake.

#19 Updated by JMC4789 about 5 years ago

I think based on what I remember it's something to do with all the primitives causing pipeline flushes all the time? I think both may be causing the same problem.

#20 Updated by ZephyrSurfer about 5 years ago

This just got a lot worse on OpenGL.
I had 75 FPS on 4.0-4674 but now its a mere 43 on the newly merged 4.0-4699.
That sucks.

#21 Updated by JMC4789 about 5 years ago

Because now OpenGL actually renders the snow properly?

#22 Updated by ZephyrSurfer about 5 years ago

You could do that if you enabled Texture Format Overlay.

And I'm now realizing some of OpenGls advanced options like Wireframe are broken. I'll bisect later.

#23 Updated by JMC4789 about 5 years ago

Nah, we know Wireframe is broken. It'll get fixed soon.

#24 Updated by ZephyrSurfer about 5 years ago

Oh OK well tell whoevers gonna fix it do also fix show statistics when used with that option since I can't remember when that worked.

#25 Updated by JMC4789 about 5 years ago

That never worked with OpenGL's wireframe.

#26 Updated by magumagu9 about 5 years ago

Just did a brief investigation; it looks like the game draws a bunch of points, and changes the point size (bpmem.lineptwidth.pointsize) after every point, forcing a flush each time. Commenting out the line "dirty = true" in GeometryShaderManager::SetLinePtWidthChanged gives approximately a 50% speed increase for the given FIFO.

This is a similar issue to the Flanior slowdown, but the details are different enough that fixing one might not fix the other.

#27 Updated by JMC4789 about 5 years ago

Is there any side effect to the dirty = true change? Or does that make it so it doesn't update it, I guess?

A slowdown that makes the effect work properly would be permissable, though.

#28 Updated by JMC4789 about 5 years ago

Tested this on my NVIDIA card, I get 160 - 250 fps in the snow levels with the snow on in latest master. Flanoir snow is a lot slower than this.

#29 Updated by magumagu9 about 5 years ago

Yeah, commenting out dirty = true breaks the rendering; I just mentioned it to demonstrate the point. Although, thinking about it a bit more, commenting out that line shouldn't have quite that large an impact. I wonder if we can optimize our constant buffer usage somehow.

#30 Updated by Armada about 5 years ago

What we could do is check whether the point size has changed, maybe it sets the field to the same size?

#31 Updated by NeoBrainX about 5 years ago

You could queue those pointsize changes in a buffer (iff they really happen consecutively without any other state change) and store them as vertex attributes, couldn't you? That way, the geometry shader can take care of applying the proper size per-vertex dynamically. (I'm usually not too happy about things like this, but here it seems reasonably sensible)

#32 Updated by degasus about 5 years ago

neobrain: I don't think so. I guess it's more because the game also changes some other constands between each point. Likely the transformation matrix.

#33 Updated by adiffin502 about 5 years ago

Just to be clear, the "crazy slowdown" snow is only present in certain snow levels in the Championship modes. For a good example of one of these instances, go to Custom Series Championship > Point of Impact Grand Prix (restart the GP if you aren't on the first race) and start it. I should probably have been more clear about that :/

Oh, and I've just noticed that "Show EFB Copy Regions" doesn't work on D3D.

#34 Updated by guitaristocrat3 over 4 years ago

This slowdown has been repeatable for me in over two thousand revisions on the Crystal Summit Lake stage set to snow conditions, this one particular track is plagued with huge fps hits and makes the emulation stop and start horribly. You have to go out of your way to select snow conditions so most players would only play this track in the story mode I'd imagine. However it's not the snow that's causing the problems I don't think, since the slowdown only occurs halfway through the track and other parts of the track or other tracks entirely are fine that also have snow effects. So to make it repeatable, go to single race, choose a car, on stage select scroll over to Crystal Summit Lake, scroll down to conditions, select snow, then start the race and race about a minute or two into the track where you reach hairpin downhill turns, immediately after the game will freak out and become virtually unplayable.

This is on linux so using OGL, I can usually get stable framerates everywhere else but recent revisions have caused more issues with this game, I'll make another report for that.

#35 Updated by Disorderly over 4 years ago

Sorry for the issue resurrection, here. What is actually happening is that there are two separate snow effects in the game - regular snow and "snow showers."

As the name implies, the snow shower is much heavier than the normal snow effect, meaning there are more snowflakes on screen at once, hence the larger slowdown. Rain also has a "shower" counterpart (just called "showers") that is also slower than the normal rain effect.

This AR code will disable all particle-based weather effects for the NTSC version, thus removing the slowdown:

$Disable Rain and Snow
042206E0 00000000

#36 Updated by JMC4789 over 2 years ago

  • Status changed from Questionable to Working as intended

The snow effect abuses the geometry shader for point-size/line-width causing the slowdown. There's not much that can be done about it.

#37 Updated by JosJuice over 2 years ago

  • Relates to performance changed from No to Yes

#38 Updated by phire over 2 years ago

I'm not sure it's the geometry shader that is at fault.

I think dolphin is shoving every single snow particle into a separate draw call, because XFmem has been updated between each snow particle.

If this is the cause of the slow down, it is theoretically possible to fix this slow down by improving dolphin to pack multiple XFmem updates into a single draw call. Would improve performance all over the place.

Also available in: Atom PDF