summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
AgeCommit message (Collapse)Author
25 hoursVideoCommon: Fix custom texture count in OSD messageJosJuice
83dc468 broke the OSD message that shows the number of custom textures. If Prefetch Custom Textures was disabled, the number would always be 0.
5 daysReplace zero constants with `nullptr`Dr. Dystopia
2026-07-15waterfall loading of textures via id to prefer elfid-gameid when launched ↵cbartondock
via elf; fallback to gameid if no match
2026-07-13PerformanceMetrics: Fix compiling using clang&libstdc++Joshua Vandaële
When using clang and libstdc++, compiling fails with these errors: ``` FAILED: [code=1] Source/Core/VideoCommon/CMakeFiles/videocommon.dir/PerformanceMetrics.cpp.o /usr/sbin/ccache /usr/sbin/clang++ -DAUTOUPDATE=1 -DDATA_DIR=\"/usr/local/share/dolphin-emu/\" -DHAS_OPENGL -DHAS_VULKAN -DHAVE_CPPIPC -DHAVE_LIBSYSTEMD -DIMGUI_USER_CONFIG=\"imgui_user_config.h\" -DLZMA_API_STATIC -DOFF -DPUGIXML_NO_EXCEPTIONS -DRC_CLIENT_SUPPORTS_HASH -DSFML_STATIC -DSPNG_STATIC -DTINYGLTF_NOEXCEPTION -DTINYGLTF_NO_EXTERNAL_IMAGE -DTINYGLTF_USE_CPP14 -DUSE_ANALYTICS=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -DUSE_RETRO_ACHIEVEMENTS -DZSTD_MULTITHREAD -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86_64=1 -D__LIBUSB__ -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/dolphin-local/Source/Core -I/dolphin-local/Externals/picojson -I/dolphin-local/build/release/x64/Source/Core -I/dolphin-local/Externals/enet/enet/include -I/dolphin-local/Externals/fmt/fmt/include -I/dolphin-local/Externals/mbedtls/include -I/dolphin-local/Externals/minizip-ng/minizip-ng -I/dolphin-local/Externals/liblzma/api -I/dolphin-local/Externals/zstd/zstd/build/cmake/../../lib -I/dolphin-local/Externals/libiconv/include -I/dolphin-local/build/release/x64/Externals/libiconv/lib -I/dolphin-local/Externals/libiconv/libcharset/include -I/dolphin-local/build/release/x64/Externals/libiconv/libcharset -I/dolphin-local/Externals/SFML/SFML/include -I/dolphin-local/Externals/bzip2/bzip2 -I/dolphin-local/Externals/expr/include -I/dolphin-local/Externals/hidapi/hidapi-src/hidapi -I/dolphin-local/Externals/pugixml/pugixml/src -I/dolphin-local/Externals/glslang/glslang/glslang/.. -I/dolphin-local/build/release/x64/include -I/dolphin-local/Externals/rcheevos -I/dolphin-local/Externals/libspng/libspng/spng -I/dolphin-local/Externals/xxhash/xxHash -I/dolphin-local/Externals/imgui -I/dolphin-local/Externals/imgui/imgui -I/dolphin-local/Externals/implot/implot -I/dolphin-local/Externals/glslang/glslang/SPIRV/.. -I/dolphin-local/Externals/tinygltf -isystem /dolphin-local/Externals/libusb/libusb/libusb -isystem /dolphin-local/Externals/glslang/glslang -isystem /dolphin-local/Externals/glslang/glslang/Public -isystem /dolphin-local/Externals/glslang -Qunused-arguments -fcolor-diagnostics -O3 -DNDEBUG -std=c++23 -msse2 -fdiagnostics-color -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wshadow -Wshadow-field-in-constructor -Winit-self -Wmissing-declarations-Wmissing-variable-declarations -Werror=format -Wno-trigraphs -MD -MT Source/Core/VideoCommon/CMakeFiles/videocommon.dir/PerformanceMetrics.cpp.o -MF Source/Core/VideoCommon/CMakeFiles/videocommon.dir/PerformanceMetrics.cpp.o.d -o Source/Core/VideoCommon/CMakeFiles/videocommon.dir/PerformanceMetrics.cpp.o -c /dolphin-local/Source/Core/VideoCommon/PerformanceMetrics.cpp In file included from /dolphin-local/Source/Core/VideoCommon/PerformanceMetrics.cpp:4: /dolphin-local/Source/Core/VideoCommon/PerformanceMetrics.h:69:51: error: no matching constructor for initialization of 'std::atomic<FrameBufferSize>' 69 | std::atomic<FrameBufferSize> m_frame_buffer_size{}; | ^~ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/16/../../../../include/c++/16/atomic:237:17: note: candidate constructor not viable: constraints not satisfied 237 | constexpr atomic() noexcept(is_nothrow_default_constructible_v<_Tp>) | ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/16/../../../../include/c++/16/atomic:238:11: note: because 'is_default_constructible_v<PerformanceMetrics::FrameBufferSize>' evaluated to false 238 | requires is_default_constructible_v<_Tp> | ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/16/../../../../include/c++/16/atomic:246:7: note: candidate constructor not viable: requires 1 argument, but 0 were provided 246 | atomic(const atomic&) = delete; | ^ ~~~~~~~~~~~~~ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/16/../../../../include/c++/16/atomic:252:17: note: candidate constructor not viable: requires single argument '__i', but no arguments were provided 252 | constexpr atomic(_Tp __i) noexcept : _M_i(__i) | ^ ~~~~~~~ 1 error generated. ``` This was tested and occurs on both Arch and Alpine Linux.
2026-07-05Move the code for the show internal resolution settingJosJuice
fb4ff3e put all the code for the show internal resolution setting right next to the code for the show FPS setting, presumably because an earlier version of that commit had them next to each other in the GUI. It makes more conceptual sense to put the code next to the code for the show statistics settings, matching what the GUI looks like now.
2026-07-05VideoCommon: Show internal resolution stats below VPSJosJuice
It looked a bit out of place wedged in between the FPS and VPS.
2026-07-05VideoCommon: Use XFB for internal resolution statsJosJuice
fb4ff3e added a statistics option to show the internal resolution, but it just showed the total size of the EFB (which is always 640x528) times the IR scale, so it didn't convey any useful information. This commit instead makes the option use the size of the last XFB copy (not multiplied by the IR scale), which changes based on the game's rendering resolution.
2026-07-05VideoCommon: Reduce padding in PresentInfoJosJuice
This makes the struct 8 bytes smaller.
2026-05-25Merge pull request #14607 from elyashue/internal-resolution-displayDentomologist
VideoCommon: Added option for showcasing internal resolution
2026-05-24Reimplement custom cropping by adjusting the source aspect ratioAdmiral H. Curtiss
2026-05-24Revert the Presenter logic changes from #14506Admiral H. Curtiss
2026-05-23Merge pull request #14506 from adamscott/crop-that-screenAdmiral H. Curtiss
Add screen crop feature
2026-05-23Address minor nits in new cropping logicAdmiral H. Curtiss
2026-05-03Replace some [[maybe_unused]] annotations with commented namesDentomologist
Remove the [[maybe_unused]] annotation from various parameters that are unconditionally unused and comment out their names instead. This makes it unambiguous that the variables are unused, while making the remaining [[maybe_unused]] annotations more reliable indicators that those variables are in fact used in some contexts. These parameters are mostly in overridden functions where the override doesn't need that particular variable.
2026-04-24VideoConfig: Rename StereoMode::TAB to StereoMode::TopAndBottomDentomologist
2026-04-23VideoConfig: Rename StereoMode::SBS to StereoMode::SideBySideDentomologist
2026-04-19VideoCommon: Added an option to showcase internal resolution, EFB width x ↵Elyas Hue
height as screen overlay. Option to turn it on is a checkbox in screen on the OSD settings, in debug. This supports enhancements.
2026-04-18Merge pull request #14565 from SuperSamus/cpp-argument-move-referenceJosJuice
Improve usage of std::move and const references parameters
2026-04-18Add screen crop featureAdam Scott
2026-04-18Core: Address `-Wrange-loop-construct` warning.cristian64
The warning can be seen since 1f72403ec7ac026ff when GCC 13.3.0 is used: ```counterexample [1540/1898] Building CXX object Source/Core/VideoCommon/CMakeFiles/videocommon.dir/TextureCacheBase.cpp.o /w/dolphin/Source/Core/VideoCommon/TextureCacheBase.cpp: In member function 'void TextureCacheBase::ApplyMaterialToCacheEntry(const VideoCommon::MaterialResource&, TCacheEntry*)': /w/dolphin/Source/Core/VideoCommon/TextureCacheBase.cpp:3136:19: warning: loop variable 'texture' creates a copy from type 'const VideoCommon::MaterialResource::TextureLikeReference' [-Wrange-loop-construct] 3136 | for (const auto texture : material_data->GetTextures()) | ^~~~~~~ /w/dolphin/Source/Core/VideoCommon/TextureCacheBase.cpp:3136:19: note: use reference type to prevent copying 3136 | for (const auto texture : material_data->GetTextures()) | ^~~~~~~ | & ```
2026-04-17Improve usage of std::move and const references parametersMartino Fontana
Accomplished using `run-clang-tidy` with `performance-move-const-arg,performance-unnecessary-value-param,modernize-pass-by-value`. Changed arguments to const references, removed them where inappropriate (e.g. sink parameters). Same with std::move. Manually reviewed each change to make sure that it makes sense, and do something more appropriate if possible.
2026-04-12Merge pull request #14336 from SuperSamus/arbitrary-mipmap-disables-gpu-decodingJordan Woyak
VideoCommon: Invert interaction between Arbitrary Mipmap Detection and GPU Texture Decoding (the former disables the latter)
2026-04-11Merge pull request #14500 from Sintendo/span2Jordan Woyak
Replace `const std::vector&` arguments with `std::span`
2026-04-03Merge pull request #14140 from iwubcode/blurry_bloomJMC47
VideoCommon: add a graphics mod feature to modify EFBs with a custom material, enhance bloom
2026-04-02Merge pull request #14492 from OatmealDome/apple-discard-bug-fixed-3OatmealDome
VideoBackends/Vulkan: Drop BUG_BROKEN_DISCARD_WITH_EARLY_Z workaround
2026-03-28VideoCommon: ignore zero-stride EFB/XFB copiesTillmann Karras
just clear if requested
2026-03-26VideoCommon: allow graphics mods to be added to sub foldersiwubcode
2026-03-26VideoCommon: watch the user and system graphics mods directories for ↵iwubcode
modified assets
2026-03-26VideoCommon: optionally apply materials to EFBsiwubcode
After an EFB operation is turned into a texture, if there is a graphics mod action that provides a custom material, update the EFB texture with the material
2026-03-26VideoCommon: update CustomPipelineAction to get a Material when an EFB is ↵iwubcode
received
2026-03-26VideoCommon: enhance 'CustomResourceManager' for post processingiwubcode
This expands the interface of 'CustomResourceManager' to get a Material for post processing a frame buffer (currently EFB). The flow is similar to the normal draw material but distinguishes itself by not needing a UID. The full shader is much simpler than the draw shader and is currently put inline with the shader resource.
2026-03-26VideoCommon: update graphics mod action interfaceiwubcode
* Add a 'AfterEFB' function to graphics mod action that can return a Material * Rename previous EFB graphics mod function to 'BeforeEFB' to differentiate from 'AfterEFB' * Rename previous XFB graphics mod function to 'BeforeXFB' to mirror EFB
2026-03-25Merge pull request #14499 from JosJuice/gpu-desync-no-reportJMC47
Remove "please report it to the developers" from unknown opcode message
2026-03-23Use more std::span argumentsSintendo
2026-03-22Remove "please report it to the developers" from unknown opcode messageJosJuice
I think we've gotten all the useful reports we can get from this now. Nowadays we're just getting repeated reports of issues we already know about, like https://bugs.dolphin-emu.org/issues/12321.
2026-03-21UberShaderPixel: Fix missing check for framebuffer fetch for ↵OatmealDome
BUG_BROKEN_DISCARD_WITH_EARLY_Z workaround
2026-03-21DriverDetails: Mark BUG_BROKEN_DISCARD_WITH_EARLY_Z as fixed in macOS 14.0+OatmealDome
2026-03-21DriverDetails: Use macOS version as the driver versionOatmealDome
2026-03-21VideoCommon: Fix no mips hackTellowKrinkle
2026-03-14Move PerformanceMetrics from global variable to SystemMihai Brodschi
This avoids the static initialization order fiasco between Core and VideoCommon Co-authored-by: Jordan Woyak <jordan.woyak@gmail.com>
2026-03-07PerformanceMetrics: Use HookableEvent for state changed callbackDentomologist
Use the normal state changed `HookableEvent` instead of having `Core::NotifyStateChanged` call `g_perf_metrics.OnEmulationStateChanged` directly. The direct call was added in bad78cfed416d89ceb6b0acf6c134d3691b3d624 to avoid a crash. At the time state changed callbacks were stored in a vector, and the crash was caused by `g_perf_metric`'s destructor trying to remove the callback from the already-destroyed vector. Later a97627e736ff352e031123519c799e65cc98b32c switched state changed callbacks to use `HookableEvent`, which is specifically designed to handle the case where a hook outlives its associated event. Since the workaround is no longer necessary replace it with a standard `EventHook`.
2026-03-02VertexLoaderManager: Fix crash caused by invalid array baseDentomologist
Don't set cached array bases to invalid pointers. If a game tries to set an invalid base just keep the old one, which might cause game problems but won't crash the emulator.
2026-02-13VideoCommon: Invert interaction between Arbitrary Mipmap Detection and GPU ↵Martino Fontana
Texture Decoding (the former disables the latter) Split from #14293. It makes sense for a setting that changes visual output to have priority over a setting that barely makes any difference.
2026-02-06PerformanceMetrics: Clamp graph minimum auto sizeDentomologist
Add a minimum value for the automatic size of the performance metrics graph. The graph can still be manually resized smaller than this limit. This prevents the graph from automatically resizing itself to be too small to contain the full graph and legend, which happened when using native resolution with `Auto-Adjust Window Size` enabled.
2026-02-06PerformanceMetrics: Fix automatic graph resizingDentomologist
Fix a bug causing the performance graph to not resize when the render window changed size: * When changing the render window size during emulation the performance graph wouldn't update its size until the next emulation session. * When changing the render window size with no emulation active (by changing the Internal Resolution with Auto-Adjust Window Size enabled) the performance graph wouldn't update its size until the second emulation session after the change. Before explaining why the bug happened, here are some details about Dear ImGui (henceforth ImGui) for context: * In order to allow programs to specify initial ImGui window sizes while also allowing the user to resize them, `SetNextWindowSize` takes a flag from the `ImGuiCond_` enum specifying under what circumstances that function should actually have any effect. * ImGuiCond_FirstUseEver causes ImGui to only apply the command when the window doesn't have any saved size information for that session or in the ini file specified by `ImGui::GetIO().IniFilename`. Since we set that filename to `nullptr`, in practice the resize command is applied on the first frame of each ImGui/emulation session. * Qt saves the most recent size of the render window across emulation (and even Dolphin) sessions, which is then used to set the initial value of `ImGui::GetIO().DisplaySize` in the next emulation session. * It takes multiple frames for the size of the render window to update when changed by setting the internal resolution. This means that `ImGui::GetIO().DisplaySize` will have a stale value in the intervening frames, and specifically for the first few frames of emulation if the resolution was changed beforehand. When changing the resolution during emulation the call to `SetNextWindowSize` had no effect because of the `ImGuiCond_FirstUseEver` flag. `DisplaySize` would be updated several frames later, and then the next emulation session would update the graph size on its first frame. When changing the resolution outside emulation and then starting a game, the call to SetNextWindowSize on the first frame took effect but used the stale value of `DisplaySize`. `DisplaySize` would be updated a few frames later, but the graph wouldn't be resized until the first frame of the second emulation session. This commit fixes the issue by using the `ImGuiCond_Always` flag in the performance graph's call to `SetNextWindowSize` when the render window size changes.
2026-02-06PerformanceMetrics: Add padding below graphDentomologist
Add vertical padding between the performance graph (when it's enabled) and the FPS/VPS/Speed overlays.
2026-01-31Merge pull request #14204 from Geotale/update-commentDentomologist
Update Comments Based On Hardware Test
2026-01-25Remove unused importsMartino Fontana
Yellow squiggly lines begone! Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes. If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed. The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports. Not everything is removed, but the cleanup should be substantial enough. Because this done on Linux, code that isn't used on it is mostly untouched. (Hopefully no open PR is depending on these imports...)
2026-01-24Clean includesSintendo
2026-01-24Common/FileSearch: Refactor DoFileSearchSintendo