dolphin/Source/Core/VideoCommon
JosJuice f7b4d2738b VideoCommon: Don't create mipmap vector in TextureInfo
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-17 17:57:07 +01:00
..
Assets ShaderAsset: Fix shadowed variable 2025-12-29 11:12:07 +01:00
GraphicsModSystem CustomPipeline: Remove unused functions 2025-12-27 09:07:42 +01:00
Resources Merge pull request #14228 from iwubcode/clear_compiler_work_resource_mgr 2025-12-27 13:09:21 -06:00
AbstractFramebuffer.cpp
AbstractFramebuffer.h
AbstractGfx.cpp VideoCommon: avoid assuming global state exists for 'EndUtilityDrawing', use last stored viewport/scissor rect instead 2025-11-20 00:35:01 -06:00
AbstractGfx.h VideoCommon: initialize stored viewport to 0, fixes a crash in debug mode for d3d 2025-12-24 15:23:25 -06:00
AbstractPipeline.h
AbstractShader.h VideoBackends / VideoCommon: add support for specifying include files in shader code 2025-10-26 22:47:23 -05:00
AbstractStagingTexture.cpp Replace 'reinterpret_cast' with 'static_cast' 2024-11-08 07:26:47 +01:00
AbstractStagingTexture.h
AbstractTexture.cpp Update code to work with new version of ImGui. 2025-08-18 05:38:14 -07:00
AbstractTexture.h Update code to work with new version of ImGui. 2025-08-18 05:38:14 -07:00
AsyncRequests.cpp VideoCommon: Clean up and eliminate the mutex in AsyncRequests using WaitableSPSCQueue. 2025-10-28 17:22:04 -05:00
AsyncRequests.h VideoCommon: Clean up and eliminate the mutex in AsyncRequests using WaitableSPSCQueue. 2025-10-28 17:22:04 -05:00
AsyncShaderCompiler.cpp VideoCommon: remove template parameter from lock guards in AsyncShaderCompiler, let type deduction do its thing and improve readability 2025-11-21 01:18:35 -06:00
AsyncShaderCompiler.h VideoCommon: add method to async shader compiler to clear pending/completed work (used on shutdown), this will in turn clear up any resources that the worker items may have held onto 2025-11-21 01:17:45 -06:00
BoundingBox.cpp VideoCommon: Move backend_info out of VideoConfig struct. 2025-03-09 01:42:45 -06:00
BoundingBox.h
BPFunctions.cpp VideoCommon: avoid assuming global state exists for 'EndUtilityDrawing', use last stored viewport/scissor rect instead 2025-11-20 00:35:01 -06:00
BPFunctions.h VideoCommon: rename ScissorResult 'm_result' to 'rectangles' to better reflect what the member is 2025-10-31 13:28:14 -05:00
BPMemory.cpp VideoBackends / VideoCommon: rename member variables in RenderState to be consistent 2025-08-23 13:50:22 -05:00
BPMemory.h VideoBackends / VideoCommon: rename member variables in RenderState to be consistent 2025-08-23 13:50:22 -05:00
BPStructs.cpp VideoCommon: Make Presenter aware of the next swap time to eliminate unsafe usage of GetTicks() with ImmediateXFB + DualCore. 2025-11-11 20:01:52 -06:00
BPStructs.h
CMakeLists.txt VideoCommon: update resource manager with a material/shader/and texture(+sampler) resource to show the complexities that warrant the resource manager system 2025-11-23 11:08:50 -06:00
CommandProcessor.cpp VideoCommon: reset some CP registers during PI_FIFO_RESET 2025-05-05 21:18:37 +01:00
CommandProcessor.h VideoCommon: remove unused struct fields 2025-06-24 19:38:45 +01:00
ConstantManager.h
Constants.h
CPMemory.cpp DolphinAnalytics: Use Pascal case for GameQuirk enum 2025-08-14 13:54:23 -07:00
CPMemory.h
CPUCull.cpp VideoBackends / VideoCommon: rename member variables in RenderState to be consistent 2025-08-23 13:50:22 -05:00
CPUCull.h
CPUCullImpl.h
DataReader.h
DriverDetails.cpp VKPipeline: Don't include depth clamp control struct when not supported 2025-07-29 08:42:22 +09:00
DriverDetails.h VKPipeline: Don't include depth clamp control struct when not supported 2025-07-29 08:42:22 +09:00
EFBInterface.cpp VideoCommon: Fix out-of-bounds and disabled EFB access. 2025-03-26 01:23:16 -05:00
EFBInterface.h VideoCommon: Fix out-of-bounds and disabled EFB access. 2025-03-26 01:23:16 -05:00
Fifo.cpp Merge pull request #14035 from Dentomologist/pauseandlock_refactoring 2025-11-01 10:06:08 +01:00
Fifo.h FifoManager: Remove redundant PauseAndLock parameters 2025-10-26 18:01:51 -07:00
FramebufferManager.cpp Merge pull request #14071 from iwubcode/avoid_config_framebuffer_manager 2025-11-11 20:58:35 -05:00
FramebufferManager.h VideoCommon/FramebufferManager: Silence warning: 2025-11-15 20:32:10 -06:00
FramebufferShaderGen.cpp VideoCommon: Move backend_info out of VideoConfig struct. 2025-03-09 01:42:45 -06:00
FramebufferShaderGen.h
FrameDumper.cpp Common: Remove the string parameters from the HookableEvent interface. 2025-11-06 22:34:40 -06:00
FrameDumper.h
FrameDumpFFMpeg.cpp VideoCommon: Make Presenter aware of the next swap time to eliminate unsafe usage of GetTicks() with ImmediateXFB + DualCore. 2025-11-11 20:01:52 -06:00
FrameDumpFFMpeg.h VideoCommon: Limit maximum denominator for MPEG4 2025-05-12 18:54:42 +02:00
FreeLookCamera.cpp Core: Eliminate FreeLookConfig by putting the "active config" within FreeLookCamera. 2025-11-12 18:01:53 -06:00
FreeLookCamera.h Core: Eliminate FreeLookConfig by putting the "active config" within FreeLookCamera. 2025-11-12 18:01:53 -06:00
GeometryShaderGen.cpp VideoCommon: Move backend_info out of VideoConfig struct. 2025-03-09 01:42:45 -06:00
GeometryShaderGen.h
GeometryShaderManager.cpp Improved stereoscopic 3D settings 2025-11-12 12:29:03 +03:00
GeometryShaderManager.h
GXPipelineTypes.h
HiresTextures.cpp VideoCommon: separate the concept of a 'resource' from an 'asset'. A 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-23 11:04:24 -06:00
HiresTextures.h VideoCommon: separate the concept of a 'resource' from an 'asset'. A 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-23 11:04:24 -06:00
IndexGenerator.cpp VideoCommon: Move backend_info out of VideoConfig struct. 2025-03-09 01:42:45 -06:00
IndexGenerator.h
LightingShaderGen.cpp VideoCommon: move to a 'process_fragment()' function to simplify custom shaders and provide a direct override of the tev stage logic 2025-03-22 15:22:00 -05:00
LightingShaderGen.h VideoCommon: move to a 'process_fragment()' function to simplify custom shaders and provide a direct override of the tev stage logic 2025-03-22 15:22:00 -05:00
LookUpTables.h
NativeVertexFormat.h
NetPlayChatUI.cpp mingw: replace SendMessage usage as clashes with existing function 2025-12-10 21:07:33 +00:00
NetPlayChatUI.h mingw: replace SendMessage usage as clashes with existing function 2025-12-10 21:07:33 +00:00
NetPlayGolfUI.cpp
NetPlayGolfUI.h
OnScreenDisplay.cpp Externals / VideoCommon: update imgui to 1.91.7 and implot to v0.16; imgui changed types for ImTextureId, which was addressed by using an implicit cast 2025-01-20 14:47:14 -06:00
OnScreenDisplay.h
OnScreenUI.cpp Merge pull request #13922 from TryTwo/imgui_add_default_font 2025-11-16 13:58:18 +01:00
OnScreenUI.h VideoCommon: fix -Wmismatched-tags warning 2025-08-23 03:05:04 +01:00
OnScreenUIKeyMap.h
OpcodeDecoding.cpp
OpcodeDecoding.h VideoCommon/OpcodeDecoding: Replace enable_if with concepts. 2025-09-13 19:05:33 -05:00
PerformanceMetrics.cpp VideoCommon/PerformanceMetrics: Display current offset between the latest frame presentation time and the intended presentation time in the "Show Frame Times" box. 2025-11-11 20:01:52 -06:00
PerformanceMetrics.h VideoCommon/PerformanceMetrics: Display current offset between the latest frame presentation time and the intended presentation time in the "Show Frame Times" box. 2025-11-11 20:01:52 -06:00
PerformanceTracker.cpp Core, VideoCommon: Fix crash at shutdown due to destructor ordering 2025-04-28 07:11:53 +03:00
PerformanceTracker.h Core, VideoCommon: Fix crash at shutdown due to destructor ordering 2025-04-28 07:11:53 +03:00
PerfQueryBase.cpp
PerfQueryBase.h
PipelineUtils.cpp VideoCommon: move ApplyDriverBugs for the normal pipeline out into a utility function, add a way to hash the pipeline (using the vertex declaration instead of the native vertex format) 2025-11-23 11:04:24 -06:00
PipelineUtils.h VideoCommon: move ApplyDriverBugs for the normal pipeline out into a utility function, add a way to hash the pipeline (using the vertex declaration instead of the native vertex format) 2025-11-23 11:04:24 -06:00
PixelEngine.cpp
PixelEngine.h
PixelShaderGen.cpp VideoBackends / VideoCommon: rename member variables in RenderState to be consistent 2025-08-23 13:50:22 -05:00
PixelShaderGen.h VideoCommon: move to a 'process_fragment()' function to simplify custom shaders and provide a direct override of the tev stage logic 2025-03-22 15:22:00 -05:00
PixelShaderManager.cpp VideoBackends / VideoCommon: rename member variables in RenderState to be consistent 2025-08-23 13:50:22 -05:00
PixelShaderManager.h
PostProcessing.cpp VideoBackends / VideoCommon: add support for specifying include files in shader code 2025-10-26 22:47:23 -05:00
PostProcessing.h VideoBackends / VideoCommon: add support for specifying include files in shader code 2025-10-26 22:47:23 -05:00
Present.cpp VideoCommon: Add a hidden setting to cap immediate XFB swaps to one per VI. 2025-11-25 00:15:32 -06:00
Present.h VideoCommon: Add a hidden setting to cap immediate XFB swaps to one per VI. 2025-11-25 00:15:32 -06:00
RenderState.cpp VideoBackends / VideoCommon: rename member variables in RenderState to be consistent 2025-08-23 13:50:22 -05:00
RenderState.h VideoBackends / VideoCommon: rename member variables in RenderState to be consistent 2025-08-23 13:50:22 -05:00
sfont.inc
ShaderCache.cpp Merge pull request #14043 from iwubcode/custom_resource 2025-12-22 17:08:02 -05:00
ShaderCache.h
ShaderCompileUtils.cpp VideoBackends / VideoCommon: add support for specifying include files in shader code 2025-10-26 22:47:23 -05:00
ShaderCompileUtils.h VideoCommon: fix wrong path to glslang include 2025-11-02 14:29:14 -06:00
ShaderGenCommon.cpp VideoCommon: move to a 'process_fragment()' function to simplify custom shaders and provide a direct override of the tev stage logic 2025-03-22 15:22:00 -05:00
ShaderGenCommon.h VideoCommon: move to a 'process_fragment()' function to simplify custom shaders and provide a direct override of the tev stage logic 2025-03-22 15:22:00 -05:00
Spirv.cpp Merge pull request #13975 from iwubcode/shader_includes 2025-11-02 13:17:28 -05:00
Spirv.h Merge pull request #13975 from iwubcode/shader_includes 2025-11-02 13:17:28 -05:00
Statistics.cpp Common: Remove the string parameters from the HookableEvent interface. 2025-11-06 22:34:40 -06:00
Statistics.h Common: Make HookableEvent use non-static data. 2025-11-02 17:30:43 -06:00
TextureCacheBase.cpp VideoCommon: Don't create mipmap vector in TextureInfo 2026-01-17 17:57:07 +01:00
TextureCacheBase.h Common: Remove the string parameters from the HookableEvent interface. 2025-11-06 22:34:40 -06:00
TextureConfig.cpp
TextureConfig.h VideoCommon: add formatter for AbstractTextureType 2025-01-20 14:24:54 -06:00
TextureConversionShader.cpp VideoCommon: Move backend_info out of VideoConfig struct. 2025-03-09 01:42:45 -06:00
TextureConversionShader.h
TextureConverterShaderGen.cpp VideoCommon: Move backend_info out of VideoConfig struct. 2025-03-09 01:42:45 -06:00
TextureConverterShaderGen.h
TextureDecoder_Common.cpp linter: Apply clang-format 19.1 formatting 2025-04-23 11:19:20 +02:00
TextureDecoder_Generic.cpp linter: Apply clang-format 19.1 formatting 2025-04-23 11:19:20 +02:00
TextureDecoder_Util.h
TextureDecoder_x64.cpp linter: Apply clang-format 19.1 formatting 2025-04-23 11:19:20 +02:00
TextureDecoder.h
TextureInfo.cpp VideoCommon: Don't create mipmap vector in TextureInfo 2026-01-17 17:57:07 +01:00
TextureInfo.h VideoCommon: Don't create mipmap vector in TextureInfo 2026-01-17 17:57:07 +01:00
TextureUtils.cpp
TextureUtils.h
TMEM.cpp
TMEM.h
UberShaderCommon.cpp
UberShaderCommon.h
UberShaderPixel.cpp VideoBackends / VideoCommon: rename member variables in RenderState to be consistent 2025-08-23 13:50:22 -05:00
UberShaderPixel.h VideoCommon: move to a 'process_fragment()' function to simplify custom shaders and provide a direct override of the tev stage logic 2025-03-22 15:22:00 -05:00
UberShaderVertex.cpp
UberShaderVertex.h
VertexLoader_Color.cpp
VertexLoader_Color.h linter: Apply clang-format 19.1 formatting 2025-04-23 11:19:20 +02:00
VertexLoader_Normal.cpp
VertexLoader_Normal.h linter: Apply clang-format 19.1 formatting 2025-04-23 11:19:20 +02:00
VertexLoader_Position.cpp
VertexLoader_Position.h linter: Apply clang-format 19.1 formatting 2025-04-23 11:19:20 +02:00
VertexLoader_TextCoord.cpp
VertexLoader_TextCoord.h linter: Apply clang-format 19.1 formatting 2025-04-23 11:19:20 +02:00
VertexLoader.cpp
VertexLoader.h
VertexLoaderARM64.cpp
VertexLoaderARM64.h
VertexLoaderBase.cpp VertexLoaderBase: Allow the vertex loader type to be set via config 2025-01-24 18:31:42 -05:00
VertexLoaderBase.h linter: Apply clang-format 19.1 formatting 2025-04-23 11:19:20 +02:00
VertexLoaderManager.cpp VideoBackends / VideoCommon: rename member variables in RenderState to be consistent 2025-08-23 13:50:22 -05:00
VertexLoaderManager.h
VertexLoaderUtils.h
VertexLoaderX64.cpp Source: Remove redundant lambda parameter lists 2025-06-14 10:19:31 +02:00
VertexLoaderX64.h
VertexManagerBase.cpp Common: Remove the string parameters from the HookableEvent interface. 2025-11-06 22:34:40 -06:00
VertexManagerBase.h
VertexShaderGen.cpp VideoCommon: fix regression where scenes with expanded lines or points would cause issues if doing per-vertex transformations in the vertex shader 2025-06-09 19:08:21 -05:00
VertexShaderGen.h VideoCommon: move vertex shader gen logic to a 'process_vertex()' function, to eventually allow for custom shaders to override vertex logic 2025-05-24 01:27:58 -05:00
VertexShaderManager.cpp VideoCommon: move global variables out of BPFunctions 2025-10-31 13:27:50 -05:00
VertexShaderManager.h VertexShaderManager: Eliminate unnecessary m_viewport_correction member. 2025-03-11 03:55:57 -05:00
VideoBackendBase.cpp VideoCommon: separate the concept of a 'resource' from an 'asset'. A 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-23 11:04:24 -06:00
VideoBackendBase.h VideoBackend: Rename GetName to GetConfigName 2025-10-13 17:38:20 -07:00
VideoCommon.h Vulkan: Add support for unrestricted depth range. 2025-07-21 14:07:26 +09:00
VideoConfig.cpp Core: Eliminate FreeLookConfig by putting the "active config" within FreeLookCamera. 2025-11-12 18:01:53 -06:00
VideoConfig.h Improved stereoscopic 3D settings 2025-11-12 12:29:03 +03:00
VideoEvents.h VideoCommon: Add "Smooth Early Presentation" setting to improve frame pacing with ImmediateXFB and/or RushFramePresentation. 2025-11-11 20:01:52 -06:00
VideoState.cpp
VideoState.h
Widescreen.cpp Common: Remove the string parameters from the HookableEvent interface. 2025-11-06 22:34:40 -06:00
Widescreen.h
XFMemory.cpp
XFMemory.h VideoCommon: drop unused XF enumerators 2025-07-30 19:56:30 +01:00
XFStateManager.cpp
XFStateManager.h
XFStructs.cpp DolphinAnalytics: Use Pascal case for GameQuirk enum 2025-08-14 13:54:23 -07:00
XFStructs.h