Skip to content

Commit f13c240

Browse files
committed
[editor] fixed an issue where not all render resolution would be listed in the renderer options for NVIDIA GPUs
1 parent 3a50ff7 commit f13c240

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

source/editor/Widgets/RenderOptions.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,11 @@ void RenderOptions::OnVisible()
207207
{
208208
display_modes.clear();
209209
display_modes_string.clear();
210-
211210
for (const DisplayMode& display_mode : Display::GetDisplayModes())
212211
{
213-
if (display_mode.hz == Display::GetRefreshRate())
212+
// only include resolutions that match the monitor's current refresh rate (with tolerance for floating-point quirks like 240 vs 239.8 Hz)
213+
// quirks like that can exist for NVIDIA for example, but not for AMD, so it's important to be safe like that
214+
if (fabs(display_mode.hz - Display::GetRefreshRate()) < 0.1f)
214215
{
215216
display_modes.emplace_back(display_mode);
216217
display_modes_string.emplace_back(to_string(display_mode.width) + "x" + to_string(display_mode.height));

0 commit comments

Comments
 (0)