HomeWildfire Games

Fix rendering options failures following rP24228
AuditedrP24233

Description

Fix rendering options failures following rP24228

Two issues are fixed:

  • Atlas on non-Mac crashed when started from within the game.
  • MSAA options crashed if enabled on startup.

The underlying issues where improper shutdown, and assuming the renderer was initialised than it might not be (in particular, the post-processor wasn't).

Tested by: Stan

Differential Revision: https://code.wildfiregames.com/D3131

Event Timeline

vladislavbelov added inline comments.
/ps/trunk/source/ps/GameSetup/GameSetup.cpp
599

Why rendering options are created after the renderer? Seems illogically.

/ps/trunk/source/renderer/PostprocManager.cpp
594

Looks like a workaround.

/ps/trunk/source/renderer/RenderingOptions.cpp
230–231

It looks ugly. You don't have to know about the renderer initialization at each place.

I've made a ticket: #5872
I do think this can be cleaned up further a bit, but I don't really want to spend too much time on this right now.

OptimusShepard raised a concern with this commit.Nov 24 2020, 12:41 AM
OptimusShepard added a subscriber: OptimusShepard.

The sharpening and anti-aliasing options fail every time the game starts. To get them work, I have always to turn them off and on.

This commit now has outstanding concerns.Nov 24 2020, 12:41 AM
wraitii added inline comments.Nov 24 2020, 8:59 AM
/ps/trunk/source/ps/GameSetup/GameSetup.cpp
599

Right. I'm moving this to InitGraphics(), before this call.

/ps/trunk/source/renderer/PostprocManager.cpp
594

It is, and it's not. Calling this when the post-processor isn't initialised will show warnings for no good reason. The "defensive programming" decision then is to check here, not at the callers.

Same applies to AA which crashes.

However, I did manage to mess it up in this diff because the Initialize() calls happen before m_IsInitialized.

OptimusShepard accepted this commit.Dec 5 2020, 3:08 PM
All concerns with this commit have now been addressed.Dec 5 2020, 3:08 PM