summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
AgeCommit message (Collapse)Author
2022-12-27VideoCommon: De-globalize PixelShaderManager class.Admiral H. Curtiss
2022-12-09Core: Add option to force linear texture filtering.Admiral H. Curtiss
2022-12-03HW/Memmap: Refactor Memory to class, move to Core::System.Admiral H. Curtiss
2022-11-07VideoCommon: Add an option to disable mipmapsTellowKrinkle
Needed by M1 fifoci to work around a minor non-determinism bug
2022-10-28VideoCommon: call texture load graphics mod hook when Dolphin loads a textureiwubcode
2022-10-09VideoCommon: add structures to graphics mods to allow for future adding or ↵iwubcode
removing parameters with less code overhead
2022-10-06Common/PointerWrap: Remove DoPODPokechu22
This was added in 385d8e2b15c8accce3b4e4b4f3dc90f63e3fbee4, but became somewhat redundant with Do in 4c7bbd96e435a7516b05d3e8c791ab41505e2e0f, and completely redundant now that std::is_trivially_copyable_v is well-supported.
2022-08-01Common/Hash: use zlib-ng for adler32. small cleanups.Shawn Hoffman
2022-07-21VideoBackends: Add Metal rendererTellowKrinkle
2022-07-16Restructure parameters to TetxureConverterShaderGen/TextureConversionShaderPokechu22
This will be used for later refactoring for increased accuracy.
2022-07-15Remove casts to integers for texture and EFB formatsPokechu22
The only remaining casts for these types that I know of are in TextureInfo (where format_name is set to the int version of the format, and since that affects filenames and probably would break resource packs, I'm not changing it) and in TextureDecoder_Common's TexDecoder_DrawOverlay, which will be handled separately.
2022-06-27VideoCommon: dump EFB with size and texture format details and dump XFB with ↵iwubcode
size details. Finally move count to front of image for XFB/EFB dumps so as to make it easier to see them in order. Change the count value prefix to 'n'
2022-06-27VideoCommon: support dynamically updating game mods at runtimeiwubcode
2022-06-27VideoCommon: trigger mod calls in TextureCacheBase (efb/xfb calls), ↵iwubcode
VertexManagerBase (draw calls), and VertexShaderManager (projection calls)
2022-06-27VideoCommon: add UninitializeEFBMemory to mirror XFB functioniwubcode
2022-06-16VideoCommon: Reduce duplicates of non-palette-requiring texture decode shadersTellowKrinkle
2022-05-25Common: Refactor PointerWrapDentomologist
2022-04-26TextureCacheBase: Don't log error while measuring state size.Admiral H. Curtiss
2022-04-18Common/PointerWrap: Prevent reads/writes past the end of the buffer.Admiral H. Curtiss
2022-01-29Fix copy filter clamping when EFB VRAM copies are disabledPokechu22
2022-01-25Fix incorrect copy filter clampingPokechu22
We need to clamp to the center of pixels, or else things end up working out incorrectly. This also fixes an off-by-1 for the bottom line.
2022-01-01VideoCommon: Add names for textures and shadersPokechu22
2021-12-18TextureCacheBase: Re-wrap GetTexture commentPokechu22
2021-11-18Merge pull request #10222 from phire/fix-copy-filter-clampingJMC47
Fix copy filter clamping
2021-11-17VideoCommon: Expose SamplerState to shadersPokechu22
The benefit to exposing this over the raw BP state is that adjustments Dolphin makes, such as LOD biases from arbitrary mipmap detection, will work properly.
2021-11-17Eliminate SamplerCommonPokechu22
2021-11-17Eliminate SamplerCommon::AreBpTexMode0MipmapsEnabledPokechu22
This was added in 0b9a72a62d38481ff08f742b2318d07f29ff5dff but became irrelevant in 70f9fc4e7526fc9cfc008a43cd33229f62be99b6 as the check is now self-explanatory due to a rejiggering of the bitfields.
2021-11-17Fix copy filter clamping regression in SpyroScott Mansell
This fixes horizontal lines in the bloom effect of Spyro: A Hero's Tail, which is a regression caused by PR #10204 Screenshot of regression: https://user-images.githubusercontent.com/138484/142030503-90fcd8d5-63d3-4820-874a-72e9be0c4768.png Fixed: https://user-images.githubusercontent.com/138484/142031598-b85ff55c-1302-4e4d-bcb2-57848974056b.png Spyro uses an 640x80 pixel sub-buffer within the EFB to calculate it's bloom effects, which it places below the main 640x448 buffer. EFB layout: https://user-images.githubusercontent.com/138484/142030573-e933b6ae-c37e-4be6-86d4-0bc779b92535.png Note: Colors are wrong because the main color buffer uses RGBA6, while the bloom is calculated in RGB8 This allows it to do bloom without backing up part of the EFB to main memory, as most games do. But, since some of the sub-buffers used in the bloom effect are taller than 80 pixels, they need to be sliced up into smaller sub, sub buffers which get combined later when copied to main memory. At one point, a 320x224 buffer is broken up into 320x80, 320x64 and 320x80 slices. These are copied out with the copy filter set to a vertical blur. Because there was an off-by-one errror in the clamping coordinates, the bottom line of the color buffer would be blurred into the top of each slice. Final combined EFB copy: https://user-images.githubusercontent.com/138484/142031360-2c076839-7c96-4b3b-a093-d899d0a2c7ae.png Fixed version: https://user-images.githubusercontent.com/138484/142031370-72e41a35-3b3e-4662-a483-79203e357ecc.png Before #10204 the copy filter wasn't enabled for efb copies, and most other games don't do this type of slicing. FIFO CI shows that a few other games are effected, it's always just a minor difference to the top line where there was previously a slight hint of garbage.
2021-10-12TextureCache: Remove deleted textures from bound_texturesScott Mansell
Fixes issue where vulkan might crash trying to bind a deleted texture.
2021-10-12Extend TMEM cache implementationScott Mansell
Now works with games that deliberately avoid invalidating TMEM because they know textures are too large to fit: * Sonic Riders * Metal Arms: Glitch in the System * Godzilla: Destroy All Monsters Melee * NHL Slapshot * Tak and the Power of Juju * Night at the Museum: Battle of the Smithsonian * 428: Fūsa Sareta Shibuya de
2021-10-10BPMemory: Refactor/consolidate TexUnit AddressingScott Mansell
Currently the logic for addressing the individual TexUnits is splattered all across dolphin's codebase, this commit attempts to consolidate it all into a single place and formalise it using our new TexUnitAddress struct.
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-05-13Merge pull request #9681 from iwubcode/texture-infoMat M
VideoCommon: move all texture calculations to a "TextureInfo" class
2021-05-11VideoCommon: move all texture calculations to a "TextureInfo" class. This ↵iwubcode
ever so slightly improves readability and allows for the full texture name to be generated outside of the hires texture cache
2021-05-09Merge pull request #9694 from iwubcode/xfb-tcache-hashJMC47
VideoCommon: update TextureCache logic for finding oversized XFBs
2021-05-08VideoCommon: simplify TextureCacheBase by comparing a xfb's hash against a ↵iwubcode
newly calculated one. This fixes games like Teenage Mutant Ninja Turtles (Wii) which use oversized textures where the stride doesn't match the BytesPerRow and that resulted in a different hash algorithm being used. By not hashing the texture before, we improve performance by hashing at most once in all direct XFB lookup scenarios.
2021-04-18optimize TextureCacheBase::SerializeTexture, ::DeserializeTextureash!!
texture serialization and deserialization used to involve many memory allocations and deallocations, along with many copies to and from those allocations. avoid those by reserving a memory region inside the output and writing there directly, skipping the allocation and copy to an intermediate buffer entirely.
2021-03-06Convert BPMemory to BitField and enum classPokechu22
Additional changes: - For TevStageCombiner's ColorCombiner and AlphaCombiner, op/comparison and scale/compare_mode have been split as there are different meanings and enums if bias is set to compare. (Shift has also been renamed to scale) - In TexMode0, min_filter has been split into min_mip and min_filter. - In TexImage1, image_type is now cache_manually_managed. - The unused bit in GenMode is now exposed. - LPSize's lineaspect is now named adjust_for_aspect_ratio.
2020-11-17VideoCommon: Migrate over to fmtLioncash
Migrates off the printf-based formatting where applicable.
2020-10-03InputCommon: Introducing the "Dynamic Input Texture". Configuration links ↵iwubcode
an emulated input action to an image based on what host key is defined for that emulated input. Specific regions are called out in configuration that mark where to replace an input button with a host key image.
2020-07-22DolphinQt / VideoCommon: Add additional texture dumping options. ↵iwubcode
Specifically, this enables users to choose whether to dump mip maps, base level textures, or both.
2020-03-24Cleanup warnings of -Wunused-lambda-captureJun Su
Remove unused lambda captures.
2019-12-05VideoCommon/OpcodeDecoding: Move g_bRecordFifoData into namespaceLioncash
Keeps the global localized with the code that it's primarily related to. Now it's obvious from a glance what the global variable is affecting.
2019-11-23VideoCommon: Make use of fmt outside of shader generatorsLioncash
Migrates most of VideoCommon over to using fmt, with the exception being the shader generator code. The shader generators are quite large and have more corner cases to deal with in terms of conversion (shaders have braces in them, so we need to make sure to escape them). Because of the large amount of code that would need to be converted, the conversion of VideoCommon will be in two parts: - This change (which converts over the general case string formatting), - A follow up change that will specifically deal with converting over the shader generators.
2019-08-08Merge pull request #8293 from lioncash/refConnor McLaughlin
VideoCommon/TextureCacheBase: Make OnConfigChanged's parameter a const reference
2019-08-04VideoCommon/TextureCacheBase: Collapse for loop into a fill() in Invalidate()Lioncash
Same thing, less code.
2019-08-04VideoCommon/TextureCacheBase: Use emplace_back where applicableLioncash
Same thing, less code.
2019-08-04VideoCommon/TextureCacheBase: Remove use of the texture cache globalLioncash
We can just call the functions that are part of the interface instead of using the global in order to execute those functions.
2019-08-04VideoCommon/TextureCacheBase: Remove dependence on global variables from ↵Lioncash
OnConfigChanged() The active config will always be passed as the reference parameter, we can make use of the parameter instead of accessing the global variable.
2019-08-04VideoCommon/TextureCacheBase: Make OnConfigChanged's parameter a const referenceLioncash
This reference isn't actually modified within this function