Commit Graph

5162 Commits

Author SHA1 Message Date
JMC47 6b686be5f1
Merge pull request from TryTwo/PR_Codec
AdvancedWidget: Replace FFV1 codec with Ut Video
2025-01-04 22:26:36 -05:00
mitaclaw 110d32729e Simplify `std::find` with `Common::Contains`
In NandPaths.cpp, the `std::initializer_list<char>` of illegal characters has been turned into a `char[]` (similar to the one in GameList.cpp).

The reverse iteration in ResourcePack.cpp seemed to provide no benefits, and doing without it it seemed to have no ill effects.
2025-01-01 09:52:03 -08:00
TryTwo 3d248d000f Frame Dumping: Change lossless codec from FFV1 to Ut Video.
Ut Video is faster and more compatible with editing programs, but produces larger files.
2024-12-30 14:07:43 -07:00
mitaclaw 2b0cd16c8c Modernize `std::none_of` with ranges
In JitRegCache.cpp, the lambda predicate were replaced by a pointer to member function because ranges algorithms are able to invoke those.

In ConvertDialog.cpp, the `std::mem_fn` helper was removed because ranges algorithms are able to handle pointers to member functions as predicates.

In BoundingBox.cpp, the lambda predicate was returning the bool element unchanged, so `std::identity` was a better fit.
2024-12-15 19:54:17 -08:00
mitaclaw 140252ffc0 Modernize `std::any_of` with ranges
In WiimoteReal.cpp, JitRegCache.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those.

In ConvertDialog.cpp, the `std::mem_fn` helper was removed because ranges algorithms are able to handle pointers to member functions as predicates.
2024-12-15 19:54:16 -08:00
mitaclaw 860e6cf5cb Modernize `std::all_of` with ranges
In DITSpecification.cpp, MaterialAsset.cpp, and ShaderAsset.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those.

In NetPlayClient.cpp, the non-trivial `NetPlay::Player` elements were being passed by value in `NetPlayClient::DoAllPlayersHaveGame()`. This has been fixed.

In WIABlob.cpp, the second example's predicate was returning the `std::optional` by value instead of implicitly converting it to a bool. This has been fixed.
2024-12-15 19:50:34 -08:00
Dentomologist 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
Dentomologist 7b8610f4ea VideoBackendBase: Clarify function name
Rename GetDefaultBackendName to GetDefaultBackendConfigName to
distinguish it from the display name.
2024-11-03 12:26:57 -08:00
TellowKrinkle 5ef4fcb005 VideoCommon: Implement primitive breaking for primitive lists 2024-10-29 22:38:22 -05:00
JMC47 05e3a52de0
Merge pull request from Tilka/warning
VideoCommon: fix -Wshadow-uncaptured-local warning and simplify
2024-10-19 15:12:25 -04:00
Tilka fed8220c39
Merge pull request from Dentomologist/remove_defined_out_code
Remove defined-out code
2024-10-19 19:36:19 +01:00
JMC47 21f4319302
Merge pull request from mitaclaw/ranges-modernization-3-spaceship
Ranges Algorithms Modernization - Compare
2024-10-17 13:37:16 -04:00
Tillmann Karras 0e41adb7b7 VideoCommon: fix -Wshadow-uncaptured-local warning and simplify 2024-10-16 18:36:00 +01:00
JosJuice 07605bf67c
Merge pull request from mitaclaw/ranges-modernization-1-trivial
Ranges Algorithms Modernization - Trivial
2024-10-15 17:08:55 +02:00
JMC47 ef8b753cd7
Merge pull request from Tilka/syncfifo
VideoCommon: fix common opcode decoding errors
2024-10-14 21:26:08 -04:00
Pokechu22 937bb2aa2e Cache normals in addition to binormals and tangents
Fixes LIT (https://bugs.dolphin-emu.org/issues/13635). The text does not include normals, but has lighting enabled. With the previous default of (0, 0, 0), lighting was always black (as dot(X, (0, 0, 0)) is always 0). It seems like the normal from the map in the background (0, 0, 1) is re-used.

LIT also has the vertex color enabled while vertex color is not specified, the same as SMS's debug cubes; the default MissingColorValue GameINI value of solid white seems to work correctly in this case.
2024-10-12 10:32:41 -07:00
Tilka c1832d17f6
Merge pull request from mitaclaw/ranges-modernization-9-trivial-find
Ranges Algorithms Modernization - Find
2024-10-11 20:27:18 +01:00
mitaclaw 8b1975ab18 GraphicsMod: Simplify `std::sort` using ranges and projections 2024-10-11 12:08:22 -07:00
mitaclaw e8d5fb89e4 C++20: Synthesize `operator!=` From `operator==`
The inequality operator is automatically generated by the compiler if `operator==` is defined.
2024-10-10 20:23:55 -07:00
mitaclaw e4fb837f4b Modernize `std::find_if` with ranges
In BTEmu.cpp, `std::mem_fn` was not necessary for the predicate to compile.
2024-10-10 15:28:11 -07:00
mitaclaw 6ca7e2856b Modernize `std::find` with ranges 2024-10-10 15:28:11 -07:00
mitaclaw 728663bdc0 Modernize `std::binary_search` with ranges
In VolumeVerifier.cpp, constructing a `std::string_view` of the volume's GameID is unnecessary, as `std::`(`ranges::`)`binary_search` supports heterogeneous lookup. The usage in GameFile.cpp is a perfect example.
2024-10-10 00:53:48 -07:00
mitaclaw ebf7cebc32 Modernize `std::sort` with ranges 2024-10-10 00:53:48 -07:00
mitaclaw 9bd1dae41d Modernize `std::fill` with ranges
In DSPCore.cpp, there were two `std::fill` uses that could be simplified using `std::fill_n`. Due to their proximity with other `std::fill` algorithms being modernized with ranges, I chose to make these examples into the rare `std::ranges::fill_n`.
2024-10-10 00:53:48 -07:00
Tillmann Karras e96960e2a6 VideoCommon: fix common opcode decoding errors
Many games call GXSetGPFifo() without first waiting for the GP to finish
consuming outstanding commands in the previous GP fifo. Normally,
Dolphin runs OpcodeDecoding in 1000-cycle time slices. In that time
frame, GXSetGPFifo() has probably completed and the GP read pointer now
points to entirely new memory. If the last GP fifo copy ended in an
incomplete command, the new GP fifo would most likely desync for a
while. To avoid all this, give the GP a time slice right now to copy the
remaining data from the previous GP fifo.
2024-10-10 04:07:44 +01:00
Pokechu22 929bcbdde9 Fifo analyzer: Fix indexed XF loads showing "bytes" instead of "words"
Indexed XF loads specify the number of 32-bit words (generally floats, but light data has some integers) to load, not the number of bytes. This was only a mistake in the fifo analyzer text; the actual implementation already loaded words.
2024-10-06 21:56:48 -07:00
JMC47 339f9311fb
Merge pull request from JosJuice/revert-revert-audit-get-state
Partially revert "Revert "Audit uses of IsRunning and GetState""
2024-10-06 11:26:06 -04:00
Jules Blok b191c0f7d8
Merge pull request from PatrickFerry/add-vertex-depth-range-case
Use Vertex Depth Range when zRange Exceeds farZ
2024-10-05 14:14:11 +02:00
JosJuice 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
JosJuice 2da3e49b1e
Merge pull request from Dentomologist/videobackendbase_only_populate_backend_info_when_uninitialized
VideoBackendBase: Only populate backend info when uninitialized
2024-10-04 18:31:06 +02:00
JMC47 e259831bcf
Merge pull request from TellowKrinkle/PresentSkip
VideoBackends:Vulkan: Prevent freezes during window resize on Linux
2024-10-02 21:09:25 -04:00
TellowKrinkle 7e1a9490c0 VideoBackends:Vulkan: Don't try to present if swapchain acquire failed 2024-10-02 19:22:16 -05:00
TellowKrinkle fd94ff252d VideoCommon: Dirty pixel shader manager on efb scale changes 2024-09-30 01:12:55 -05:00
Dentomologist 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
Dentomologist 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
Dentomologist 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
Dentomologist 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
Admiral H. Curtiss e1b1e4b4cf
Merge pull request from parona-source/libfmt-11
Add support for libfmt-11
2024-08-31 15:34:48 +02:00
Alfred Wingate d7c93d87be
Add support for libfmt-11
fmt::join was moved into fmt/ranges.h

Signed-off-by: Alfred Wingate <parona@protonmail.com>
2024-08-22 16:54:35 +03:00
Bryan Jacobs 7ec6d116e8 Graphics: Adapt aspect ratio when SBS/TAB 3D is used
Adds support for choosing to present the full resolution
independently to each eye when using side-by-side or
top-and-bottom 3D.
2024-08-22 07:11:43 +10:00
Dr. Dystopia 9602f36248 Remove redundant semicolons 2024-08-20 14:59:54 +02:00
Tillmann Karras 20f4643c74 VideoCommon: force 32-byte alignment for display list address and size 2024-08-18 05:00:38 +01:00
mitaclaw 9fa4eb9aab Use 'contains' method 2024-08-15 14:20:16 -07:00
Dr. Dystopia 618b41a459 Use 'contains' method 2024-08-14 22:18:28 +02:00
Dentomologist d627b78c46 Adjust order and spacing of various #includes
Move some #includes around to match the Contributing guidelines.
2024-07-26 14:28:34 -07:00
TellowKrinkle cab6e7c12e Properly link against xxhash
Things using dolphin_find_optional_system_library need to link against the name used there or they won't work with both the system and bundled cases
2024-07-06 16:56:44 -05:00
iwubcode 36ccbbc06e VideoCommon: add ability to serialize a texture asset metadata to json 2024-06-29 14:50:40 -05:00
iwubcode 1c3402502b VideoCommon: set individual texture asset filter/wrap values when loading from json 2024-06-29 14:50:40 -05:00
iwubcode 75a0a1ed67 VideoCommon: update texture asset to properly set near sampler state value 2024-06-29 14:50:40 -05:00
Admiral H. Curtiss ce2f4101f3
Core/VideoCommon: Revert change from
This causes Dual Core to lock up during the boot sequence, because it tries to wait for a not-yet-running GPU thread.

Fixes https://bugs.dolphin-emu.org/issues/13559
2024-06-23 03:44:05 +02:00