Conversation
|
Only a handful of new code lines, nice! Alas I'm once again going to tag @BMagnu :D |
BMagnu
left a comment
There was a problem hiding this comment.
While the reasoning here is correct, this is nevertheless a problem.
The reason we switched this in the first place is twofold:
When rendering to window_res, you potentially lose a lot of resolution from window-res to backbuffer in some situations like VR, so screenshots really should read from our custom backbuffer.
Furthermore, and more critically, in newer versions of SDL, reading from GL_FRONT on framebuffer 0 outright does not work.
This'll cause all screenshots to go black on affected platforms, drivers, SDL versions, whatever, which is the reason we've been default-enabling window-res on all platforms these days.
As such, the proper fix would be to, on screenshot input, queue an event that triggers the screenshot logic at the end of a frame rather than at that specific moment.
Ah that makes a lot of sense actually. Ok then this is even more simple. I have reverted the previous changes and reworked the screenshot system to a request -> fulfill setup. Instead of dumping the frame immediately when the key is detected, the request is stored and processed at the end of the frame. This also works in the same set of tests I did before. |
Fixes #7102
I'm not a graphics coder by any stretch so this one took some research. My reasoning is in the code comments. Open to feedback, of course.
I tested and got successful screenshots from the following scenarios in both Windowed and Full-Screen modes:
Retail UI states
ImGui states
Mainhall states
Mission states
Librocket states