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.
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.)
Fix some common anti-patterns with these data structures.
- You can dereference the iterator returned by `find` to access the
underlying value directly, without an extra `operator[]`/`at`.
- Rather than checking for an element before insertion/deletion, you can
just do the operation and if needed check the return value to
determine if the insertion/deletion succeeded.
In PPCTables.cpp, the code is currently unused so I was unable to test it.
In CustomPipeline.cpp, a pointer to member function cannot be used due to 16.4.5.2.1 of the C++ Standard regarding "addressable functions". https://eel.is/c++draft/namespace.std#6
In Fs.cpp and DirectoryBlob.cpp, these examples used projections in a previous iteration of this commit, but no longer do. Still, they remain in this commit because the PR they would actually belong to is already merged.
Resolves duplicate OSD messages for Loading and Found custom textures.
VideoBackend initialization results in HiresTexture::Init being called.
We already call HiresTexture::Update when OnNewTitleLoad is called.
Thus we can remove HiresTextures::Init completely as it is redundant.
This fourth part of my series of patches to get rid of unsafe uses of
GetPointer takes care of the "easy" cases in VideoCommon. Three uses of
GetPointer now remain in Dolphin: VertexLoaderManager, TextureInfo, and
the software renderer's TextureSampler.
Enable through command line options:
-C Graphics.Settings.TexturePNGCompressionLevel=[0-9]
Or from GFX.ini:
[Settings]
TexturePNGCompressionLevel=[0-9]
@see #10792