summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
AgeCommit message (Collapse)Author
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-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
2026-01-19VideoCommon: Move TextureInfo getters to headerJosJuice
This improves my PC's performance on RS2 Hoth by... 0.1% or so, which I think is within the margin of error. But this change also cuts down on boilerplate.
2026-01-18VideoCommon: Defer creating TextureInfoJosJuice
TextureCacheBase::LoadImpl has a hot path where the passed-in TextureInfo never gets used. Instead of passing in a TextureInfo, let's pass in the stage and create the TextureInfo from the stage if needed. This unlocks somewhere above an additional 4% performance boost in the Hoth level of Rogue Squadron 2 on my PC. Performance varies, making it difficult for me to measure, so treat this as a very approximate number.
2026-01-17Merge pull request #14289 from Sintendo/typosJMC47
Fix various typos and spelling mistakes
2026-01-17Merge pull request #14268 from JoshuaVandaele/std-tounderlyingiwubcode
c++23: Replace Common::ToUnderlying with std::to_underlying
2026-01-17Fix various typos and spelling mistakesSintendo
2026-01-17VideoCommon: Don't create mipmap vector in TextureInfoJosJuice
The TextureInfo constructor creates a vector of MipLevels. This could be good for performance if MipLevels are accessed very often for each TextureInfo, but that's not the case. Dolphin creates thousands of TextureInfos per second that it never accesses the mipmap levels of because there's a hit in the texture cache, and in the uncommon case of a texture cache miss, the mipmap levels only get looped through once. To make the common case of texture cache hits as fast as possible, let's not create a vector in the TextureInfo constructor. This commit implements a custom iterator for MipLevels instead. In my testing on the Death Star level of Rogue Squadron 2, this speeds up TextureInfo::FromStage by 200%, giving an overall emulation speedup of a bit over 1%. Results on the Hoth level are even better, with TextureInfo::FromStage being close to 300% faster and overall emulation being over 4% faster. (Single core, no GPU texture decoding.)
2026-01-09c++23: Replace Common::ToUnderlying with std::to_underlyingJoshua Vandaële
Requires at least GCC 11, Clang 13, MSVC 19.30 (VS2022 17.0), or AppleClang 13.1.6 (XCode 13.3).
2025-12-29ShaderAsset: Fix shadowed variableJoshua Vandaële
`samplers` is a member defined in ShaderAsset.h
2025-12-27Merge pull request #14228 from iwubcode/clear_compiler_work_resource_mgriwubcode
VideoCommon: clear all compiler work when resource manager shuts down
2025-12-27Merge pull request #14234 from JoshuaVandaele/wunused-cpipelineJosJuice
CustomPipeline: Remove unused functions
2025-12-27Merge pull request #14233 from Sintendo/fix-shader-resource-warningJosJuice
VideoCommon: Fix ShaderResource init order warning
2025-12-27CustomPipeline: Remove unused functionsJoshua Vandaële
2025-12-26VideoCommon: Fix ShaderResource init order warningSintendo
2025-12-24VideoCommon: initialize stored viewport to 0, fixes a crash in debug mode ↵iwubcode
for d3d
2025-12-24VideoCommon: clear all compiler work when resource manager shuts downiwubcode
2025-12-22Merge pull request #14043 from iwubcode/custom_resourceJMC47
VideoCommon: separate the concept of a 'resource' from an 'asset', add Material/Shader loading
2025-12-22Merge pull request #14206 from cscd98/send-messageJMC47
mingw: replace usages of SendMessage due to clash with existing function
2025-12-22Merge pull request #14166 from jordan-woyak/immediate-xfb-limitJMC47
VideoCommon: Add setting to limit immediate swaps to one per VI.
2025-12-22Merge pull request #14151 from iwubcode/material_asset_booleanJMC47
VideoCommon: fix MaterialAsset so that boolean parameters are written properly
2025-12-22Merge pull request #14150 from iwubcode/clear_async_compiler_work_itemsJMC47
VideoCommon: add method to async shader compiler to clear pending/completed work, use on shutdown
2025-12-22Merge pull request #14117 from iwubcode/end_utility_drawingJMC47
VideoCommon: avoid assuming global state exists for 'EndUtilityDrawing'
2025-12-22Merge pull request #14114 from jordan-woyak/freelook-config-cleanupJMC47
Core: Eliminate FreeLookConfig by putting the "active config" within FreeLookCamera.
2025-12-10mingw: replace SendMessage usage as clashes with existing functionCraig Carnell
2025-12-10Update Comments Based On Hardware TestNuh Uh
Checked on hardware that this bias was not added because I had assumed the other way around would be true, forgot to ask about making a PR for this when I initially had done so
2025-11-25VideoCommon: Add a hidden setting to cap immediate XFB swaps to one per VI.Jordan Woyak
2025-11-23VideoCommon: move resource state processing to the resource base classiwubcode
2025-11-23VideoCommon: update resource manager with a material/shader/and ↵iwubcode
texture(+sampler) resource to show the complexities that warrant the resource manager system
2025-11-23VideoCommon: add custom includer to custom shaders, this will allow us to ↵iwubcode
ship built-in custom shaders in the future
2025-11-23VideoCommon: add some helper functions for resource logic that generates ↵iwubcode
invalid textures for when a texture isn't provided for a custom asset
2025-11-23VideoCommon: move ApplyDriverBugs for the normal pipeline out into a utility ↵iwubcode
function, add a way to hash the pipeline (using the vertex declaration instead of the native vertex format)
2025-11-23VideoCommon: add a texture pool for resource managementiwubcode
2025-11-23VideoCommon: separate the concept of a 'resource' from an 'asset'. A ↵iwubcode
resource is potentially multiple assets that are chained together but represent one type of data to the rest of the system. An example is a 'material'. A 'material' is a collection of textures, a custom shader, and some metadata that all comes together to form what the concept of the material is. There will be a 'material' resource. For now, start small by introducing the interface and change our texture loading which used assets from the old resource manager, to an actual resource.
2025-11-23VideoCommon: rename 'IsAnisostropicEnhancementSafe' to ↵iwubcode
'IsAnisotropicEnhancementSafe' in TextureCacheBase
2025-11-23Merge pull request #14149 from iwubcode/shader_asset_vector_propertiesJMC47
VideoCommon: update ShaderAsset to use a vector of properties
2025-11-22Merge pull request #14037 from jordan-woyak/presentation-timingJMC47
Add "Rush Frame Presentation" and "Smooth Early Presentation" settings.
2025-11-21VideoCommon: update ShaderAsset to use a vector of properties, this way we ↵iwubcode
ensure the order of these properties match the order of the material
2025-11-21VideoCommon: update ShaderAsset to remove requirement of the code name being ↵iwubcode
in the shader source, this just makes it more difficult to iteratively test changes, assume shader devs know what they are doing
2025-11-21VideoCommon: remove template parameter from lock guards in ↵iwubcode
AsyncShaderCompiler, let type deduction do its thing and improve readability
2025-11-21VideoCommon: add method to async shader compiler to clear pending/completed ↵iwubcode
work (used on shutdown), this will in turn clear up any resources that the worker items may have held onto
2025-11-20VideoCommon: fix MaterialAsset so that boolean parameters are written to ↵iwubcode
memory as integers, matching the format internally expected by shaders
2025-11-20VideoCommon: avoid assuming global state exists for 'EndUtilityDrawing', use ↵iwubcode
last stored viewport/scissor rect instead
2025-11-19Merge pull request #14121 from jordan-woyak/warn-silenceJordan Woyak
Common and VideoCommon: Silence a few warnings.