Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix antialiasing modes being determined from the wrong graphics adapter #10669

Merged

Conversation

Pokechu22
Copy link
Contributor

This results in the list of available antialiasing modes being updated; before, it would only show the modes available for the adapter that was selected when the graphics window was opened (or the backend was last changed).

The list of available modes is updated by GraphicsWindow::OnBackendChanged's call to VideoBackendBase::PopulateBackendInfoFromUI, and then EnhancementsWidget::LoadSettings updates the UI. Both of these are connected to the GraphicsWindow::BackendChanged signal.

I have a dedicated NVIDIA GeForce GTX 1650 Ti GPU and also an integrated Intel GPU; the NVIDIA one supports up to 8x AA while the Intel one supports 16x (but becomes horrendously slow in that case). The D3D "Microsoft Basic Render Driver" also claims to support 16x AA (but I don't think it actually does anything there). If you have an NVIDIA GPU, the easiest way to reproduce the issue is to set the adapter to the NVIDIA GPU and the backend to D3D 11, then change the backend to D3D 12, then look at the list of AA modes (which should show 8x as the max), then change the adapter to the basic render driver, then look at the list of AA modes again (which should still show 8x as the max), and then switch the backend to D3D 11 and then back to D3D 12 and then look at the list of AA modes (which should now show 16x as the max for the basic render driver).

@Pokechu22 Pokechu22 changed the title Treat changing the graphics adapter the same as changing the backend Fix antialiasing modes being determined from the wrong graphics adapter May 16, 2022
This results in the list of available antialiasing modes being updated; before, it would only show the modes available for the adapter that was selected when the graphics window was opened (or the backend was last changed).

The list of available modes is updated by `GraphicsWindow::OnBackendChanged`'s call to `VideoBackendBase::PopulateBackendInfoFromUI`, and then `EnhancementsWidget::LoadSettings` updates the UI.  Both of these are connected to the `GraphicsWindow::BackendChanged` signal.
... and refresh the config before populating the backend info, as the config (specifically iAdapter) needs to be set to correctly populate the backend info.

Before, the list of valid antialiasing modes was always determined from the first adapter on the list on startup, regardless of the adapter the user selected.
@Pokechu22 Pokechu22 force-pushed the adapter-change-aa-mode-list-reload branch from b719507 to 3949698 Compare May 17, 2022 00:02
Copy link
Contributor

@iwubcode iwubcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. Code LGTM.

@Pokechu22 Pokechu22 merged commit 8baeb75 into dolphin-emu:master May 19, 2022
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants