@@ -27,19 +27,7 @@ RayTracer::RayTracer(const UserSettings& userSettings, const Vulkan::WindowConfi
27
27
Application(windowConfig, vsync, EnableValidationLayers),
28
28
userSettings_(userSettings)
29
29
{
30
- // Check the framebuffer size when requesting a fullscreen window, as it's not guaranteed to match.
31
- const auto fbSize = Window ().FramebufferSize ();
32
-
33
- if (windowConfig.Fullscreen && (fbSize.width != windowConfig.Width || fbSize.height != windowConfig.Height ))
34
- {
35
- std::ostringstream out;
36
- out << " framebuffer fullscreen size mismatch (requested: " ;
37
- out << windowConfig.Width << " x" << windowConfig.Height ;
38
- out << " , got: " ;
39
- out << fbSize.width << " x" << fbSize.height << " )" ;
40
-
41
- Throw (std::runtime_error (out.str ()));
42
- }
30
+ CheckFramebufferSize ();
43
31
}
44
32
45
33
RayTracer::~RayTracer ()
@@ -90,6 +78,8 @@ void RayTracer::CreateSwapChain()
90
78
91
79
userInterface_.reset (new UserInterface (CommandPool (), SwapChain (), DepthBuffer (), userSettings_));
92
80
resetAccumulation_ = true ;
81
+
82
+ CheckFramebufferSize ();
93
83
}
94
84
95
85
void RayTracer::DeleteSwapChain ()
@@ -318,3 +308,21 @@ void RayTracer::CheckAndUpdateBenchmarkState(double prevTime)
318
308
}
319
309
}
320
310
}
311
+
312
+ void RayTracer::CheckFramebufferSize () const
313
+ {
314
+ // Check the framebuffer size when requesting a fullscreen window, as it's not guaranteed to match.
315
+ const auto & cfg = Window ().Config ();
316
+ const auto fbSize = Window ().FramebufferSize ();
317
+
318
+ if (userSettings_.Benchmark && cfg.Fullscreen && (fbSize.width != cfg.Width || fbSize.height != cfg.Height ))
319
+ {
320
+ std::ostringstream out;
321
+ out << " framebuffer fullscreen size mismatch (requested: " ;
322
+ out << cfg.Width << " x" << cfg.Height ;
323
+ out << " , got: " ;
324
+ out << fbSize.width << " x" << fbSize.height << " )" ;
325
+
326
+ Throw (std::runtime_error (out.str ()));
327
+ }
328
+ }
0 commit comments