Commit Graph

112 Commits

Author SHA1 Message Date
ad3650abfc Merge pull request #13093 from mitaclaw/ranges-modernization-4-projection
Ranges Algorithms Modernization - Projection
2025-03-23 15:56:13 -04:00
6c158ed590 VideoCommon: Create AsyncRequests directly in MMU code to eliminate EFB-related functions in VideoBackendBase. 2025-03-14 01:14:51 -05:00
63b848ca93 VideoCommon: Eliminate EFBAccessType enum. Eliminate union and switch statement handler in AsyncRequests. 2025-03-14 00:59:41 -05:00
0e2785a562 Merge pull request #13387 from jordan-woyak/frame-pacing
CoreTiming: Improve frame pacing
2025-03-13 14:23:18 -04:00
5b36c13bfb VideoCommon: Rename Renderer to EFBInterface. 2025-03-12 21:09:16 -05:00
7222188cde Core/VideoCommon: Push presentation time calculated from CPU thread to GPU thread. 2025-03-10 16:40:46 -05:00
5ed8b7bc9d Merge pull request #13403 from jordan-woyak/backend_info
VideoCommon: Move backend_info out of VideoConfig struct.
2025-03-10 15:06:19 -04:00
62b2b939b5 Simplify std::find_if with std::ranges::find and projections
In LabelMap.cpp, the code is currently unused so I was unable to test it.

In WiiUtils.cpp, the magic value `1u` was replaced by the constant value `DiscIO::PARTITION_UPDATE`.
2025-03-09 13:26:35 -07:00
c18c039089 VideoCommon: Move backend_info out of VideoConfig struct. 2025-03-09 01:42:45 -06:00
7925240107 Core/VideoBackendBase: Call ExitGpuLoop from Core to eliminate Video_ExitLoop. 2025-03-07 17:30:33 -06:00
47a86d920f GeneralWidget: Recommend default video backend in tooltip
Recommend the platform's default video backend in the Backend tooltip
instead of always recommending OpenGL.
2024-11-03 12:28:30 -08:00
7b8610f4ea VideoBackendBase: Clarify function name
Rename GetDefaultBackendName to GetDefaultBackendConfigName to
distinguish it from the display name.
2024-11-03 12:26:57 -08:00
6ca2da53e8 Partially revert "Revert "Audit uses of IsRunning and GetState""
This reverts the revert commit bc67fc97c3,
except for the changes in BaseConfigLoader.cpp, which caused the bug
that made us revert 72cf2bdb87. PR 12917
contains an improved change to BaseConfigLoader.cpp, which can be merged
(or rejected) independently.

A few changes have also been made based on review comments.
2024-10-04 18:35:41 +02:00
dc1b961c09 VideoBackendBase: Only populate backend info when uninitialized
Prevent potential issues when creating the Graphics window (and thus
calling PopulateBackendInfo) while the core state is Stopping, like we
already do while it's Starting or Running.
2024-09-27 12:20:48 -07:00
0a1084fad5 VideoBackendBase: Check Core state in PopulateBackendInfo
Remove the PopulateBackendInfoFromUI function, which had a single caller
(GraphicsWindow::OnBackendChanged) and checked that the core wasn't
running or starting before calling PopulateBackendInfo.

Move the core state check into PopulateBackendInfo and have
OnBackendChanged call that instead. This guarantees the check is
performed by all callers of PopulateBackendInfo, preventing
potential reintroduction of the crash fixed in 3d4ae63f if another call
to PopulateBackendInfo is added.

As of the previous commit the only other caller of PopulateBackendInfo
is Core::Init shortly before s_state is set to Starting, so it will
always pass the check and so maintain its current behavior.
2024-09-26 17:12:26 -07:00
91f7b776ca GraphicsWindow: Fix crash when opening during emulation startup
Fix a crash when opening the Graphics window for the first time during
emulation startup when the backend is Vulkan, D3D11, or D3D12.

Don't call PopulateBackendInfo() from the Host thread when the core is
starting up. First, the function has already been called in Core::Init()
so we don't need to again. More importantly, PopulateBackendInfo() calls
g_video_backend->InitBackendInfo(), and the Vulkan and D3D
implementations of those functions load and then unload libraries (and
their associated function pointers) which are potentially in use by
other threads.

This crash was reliably reproducible with the following steps:
1) Select an affected backend.
2) Enable "Compile Shaders Before Starting"
3) Delete the cached shaders (but not the .uidcache file) for the game
   you're testing.
4) Close and reopen Dolphin.
5) Start the game.
6) While the game is still booting or compiling shaders, open the
   Graphics window for the first time in that Dolphin session.

Fixes https://bugs.dolphin-emu.org/issues/13634.
2024-09-26 17:12:26 -07:00
c3d6d2189a Texture Dumping: Show OSD message on startup and when toggled
If texture dumping is enabled, notify the user on emulation startup
using an On Screen Display message.

Also notify the user when texture dumping is toggled.

Addresses https://bugs.dolphin-emu.org/issues/12445.
2024-09-06 13:00:25 -07:00
0df401b164 Core::IsRunning: Avoid Global System Accessor 2024-05-01 08:54:17 -07:00
3cfa233b63 VideoCommon: Use GetSpanForAddress safely in texture decoding
Now only VertexLoader remains... But that one might be tricky.
2024-04-20 18:31:08 +02:00
ac5c2d9bf2 VideoCommon: Prefer D3D11/12 over OpenGL on Windows. 2024-03-15 19:51:04 -05:00
ac670d99e2 VideoCommon: Only initialize Bounding Box if supported by GPU/driver. 2024-01-20 12:34:24 +01:00
e539dbba4c VideoCommon/PixelEngine: Passthrough system instance in constructor
Simplifies the interface in terms of usage
2023-12-22 14:19:26 -05:00
f97b2d472a VideoCommon/CommandProcessor: Pass system instance through constructor
Makes the use of the interface a little less noisy, especially given
how much of the interface depends on an instance being present.
2023-12-20 09:02:53 -05:00
b0d244b772 VideoCommon/Fifo: Pass system instance through FifoManager constructor
Given how many member functions make use of the system instance,
it's likely just better to pass the system instance in on construction.

Makes the interface a little less noisy to use.
2023-12-18 22:03:25 -05:00
849a0c13b5 VideoCommon: move xf state management to its own class, so changes can be detected in places other than VertexShaderManager 2023-11-26 16:27:26 -06:00
fb852a5062 VideoCommon: Deinit Graphics Mod Manager implicitly 2023-09-03 16:06:08 -04:00
c63f0f37cd VideoCommon: Pass WindowSystemInfo to InitBackendInfo 2023-06-08 22:07:39 -07:00
810eb70f0e DolphinAnalytics: Add READS_BOUNDING_BOX game quirk 2023-05-06 17:18:17 -07:00
cd38ed76e2 Keep Vulkan precedence over OpenGL 2023-02-15 12:22:56 -06:00
546a016dc8 VideoBackend: Make Metal Default on MacOS 2023-02-15 12:05:54 -06:00
e2de281897 Make sure pixel shaders pick up Initial EFB Scale 2023-02-09 18:36:20 +13:00
9b5397abdb Move WidescreenHeuristic to it's own class
It's about the only thing left in renderer
2023-02-09 18:36:20 +13:00
abfc75f362 Cleanup headers 2023-01-31 19:41:24 +13:00
ca5ec13e13 Move GraphicsMod out of RenderBase 2023-01-31 19:41:24 +13:00
99d3e489ea Move BoundingBox out of RenderBase
They were essentially just pass-though methods
2023-01-31 19:41:24 +13:00
8bc8e43dd6 Add virtual Initialize() to PerfQueryBase
Both DX12 and Vulkan already had one.
2023-01-31 19:41:24 +13:00
2a2014af09 Implement AbstractGfx for Vulkan 2023-01-31 19:41:23 +13:00
58b70b2fb2 Don't set common globals from Video Backends 2023-01-31 19:41:23 +13:00
f0336a3129 Implement AbstractGfx for OpenGL
Mostly involves moving contents of OGLRender
to OGLGfx and OGLConfig
2023-01-31 18:46:04 +13:00
8a23629345 Split AbstractGfx out of Renderer
Almost all the virtual functions in Renderer are part of dolphin's
"graphics api abstraction layer", which has slowly formed over the
last decade or two.

Most of the work was done previously with the introduction of the
various "AbstractX" classes, associated with texture cache cleanups
and implementation of newer graphics APIs (Direct3D 12, Vulkan, Metal).
We are simply taking the last step and yeeting these functions out
of Renderer.

This "AbstractGfx" class is now completely agnostic of any details
from the flipper/hollywood GPU we are emulating, though somewhat
specialized.

(Will not build, this commit only contains changes outside VideoBackends)
2023-01-31 18:46:02 +13:00
0d4537d60f Move Presenting, Dumping and ImGui out of Renderer 2023-01-31 18:45:21 +13:00
606c18210d TextureCache: Refactor with smart pointers
The whole ownership model was getting a bit of a mess, with a some
of special cases to deal with. And I'm planning to make it even more
complex in the future.
So here is some upfront work to convert it over to reference counted
pointers.
2023-01-31 18:29:47 +13:00
cb0a603c72 VideoCommon: De-globalize GeometryShaderManager class. 2022-12-29 15:33:19 +01:00
50625728e0 VideoCommon: De-globalize VertexShaderManager class. 2022-12-28 15:52:29 +01:00
725bd64ec2 VideoCommon: De-globalize PixelShaderManager class. 2022-12-27 20:13:24 +01:00
c486baffe6 VideoCommon/PixelEngine: Pass Core::System to methods. 2022-12-11 21:57:30 +01:00
ec8aaf1f30 VideoCommon/PixelEngine: Refactor to class, move to Core::System. 2022-12-11 21:57:19 +01:00
ceae4242fc VideoCommon/Fifo: Pass Core::System to methods. 2022-12-10 17:16:26 +01:00
5624dd6d39 VideoCommon/Fifo: Refactor to class, move to Core::System. 2022-12-10 17:16:19 +01:00
6941d2e7e6 VideoCommon/CommandProcessor: Refactor to class, move to Core::System. 2022-11-29 08:15:01 +01:00