Skip to content

Commit f342925

Browse files
authored
Always enable window_res (#6767)
1 parent 2ec1553 commit f342925

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

code/graphics/2d.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1844,14 +1844,16 @@ bool gr_init(std::unique_ptr<os::GraphicsOperations>&& graphicsOps, int d_mode,
18441844
}
18451845
}
18461846

1847-
if (!gr_is_viewport_window() && !Cmdline_window_res.has_value()) {
1847+
if (!Cmdline_window_res.has_value()) {
18481848
// For whatever reason, it seems that a combination of Win 11 and presumably NVidia GPU's causes weird artifacts.
18491849
// These artifacts do not appear in windowed mode, or with an attached renderdoc / nvidia nsight.
18501850
// Similarly using the -window_res command line parameter prevents this.
18511851
// To the best of our knowledge, this is because all of the aforementioned methods route the rendering through another buffer
18521852
// (be that a window, a render overlay from nsight, or an FSO-internal buffer) instead of directly rendering to the OS-provided direct screen backbuffer.
18531853
// As the cost of -window_res is one single blit of a fullscreen buffer, it's probably an acceptable compromise to get rid of render artifacts.
18541854
// As such, forcibly enable -window_res at the screen resolution here, if we're in fullscreen.
1855+
1856+
// Additionally, SDL3+ doesn't work when reading from the GL_FRONT buffers, so we need our own intermediate buffers.
18551857
Cmdline_window_res.emplace(static_cast<uint16_t>(width), static_cast<uint16_t>(height));
18561858
}
18571859

0 commit comments

Comments
 (0)