summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
AgeCommit message (Collapse)Author
2018-10-14Merge pull request #7412 from AdmiralCurtiss/xfb-stitch-in-orderTilka
Stitch together overlapping XFB regions in order of XFB copy creation.
2018-09-15Do not consider XFB copies for invalidating textures when loading a new texture.Admiral H. Curtiss
This fixes severe image flickering in some cutscenes of Twin Snakes. The game appears to sometimes load a previously made XFB copy as a texture before it is actually rendered to the screen, which we took as an invitation to invalidate the XFB copy.
2018-09-14Stitch together overlapping XFB regions in order of XFB copy creation.Admiral H. Curtiss
2018-07-06VideoCommon/TextureCacheBase: Resolve a -Wmissing-braces warning in ↵Lioncash
GetRAMCopyFilterCoefficients()
2018-07-03Make arbitrary mipmap detection toggle invalidate the texture cacheTechjar
We want this setting to invalidate the cache because it may affect the appearance of textures in the rendered scene, therefore one would expect changing it while the game is running to have the expected effect immediately.
2018-07-02Remove unused sRGB conversion functionsJonathan Hamilton
Now the arbitrary mipmap reference downsampling is just done in linear space, these are no longer used.
2018-07-02Do all arbitrary mipmap detection in integer spaceJonathan Hamilton
This no longer converts from sRGB to linear for the reference mip downsample - even if the original mipmap creation tool used an sRGB colorspace (which isn't really guaranteed, and may even change per game), this is a "fast" heuristic that's only an estimate anyway. The average diff is also now stored in a u64, avoiding floating point calculations in the per-pixel hot loop. This should speed up the detection significantly, hopefully fixing jank when loading in new textures.
2018-06-21Merge pull request #6875 from JonnyH/WIP/mipmap-heuristic-tweaksMarkus Wick
Make arbitrary mipmap detection a config option
2018-05-22EFB2RAM: Apply copy filter as a float coefficient after samplingStenzek
Using 8-bit integer math here lead to precision loss for depth copies, which broke various effects in games, e.g. lens flare in MK:DD. It's unlikely the console implements this as a floating-point multiply (fixed-point perhaps), but since we have the float round trip in our EFB2RAM shaders anyway, it's not going to make things any worse. If we do rewrite our shaders to use integer math completely, then it might be worth switching this conversion back to integers. However, the range of the values (format) should be known, or we should expand all values out to 24-bits first.
2018-05-20VideoCommon: Replace SOIL with libpng for hires texturesEmmanuel Gil Peyrot
2018-05-17Texture AverageDiff: Do more in int space and avoid excessive float conversionJonathan Hamilton
Multiplying 2x 8bit values is guaranteed to fit in 16bits, 4 channels then in 18bits, which means an 'int' shouild be sufficient to avoid overflows
2018-05-17Merge pull request #6743 from stenzek/faster-disabled-copy-filterMarkus Wick
TextureConversionShader: Don't sample from adjacent rows when not needed
2018-05-16Change the arbitrary mipmap detection to use the square of the errorJonathan Hamilton
Hopefully this better matches the user's view of a texture - as large changes in colour should be weighted higher than lots of very small changes Note: This likely invalidates the current heuristic threshold default
2018-05-16Make the arbitrary mipmap detection threshold configureableJonathan Hamilton
This is likely a "superuser" option at best, but I want to be able to play with it without rebuilding if I want to tweak the heuristics
2018-05-16Make arbitrary mipmap detection a config optionJonathan Hamilton
Under GFX::Enhancements::ArbitraryMipmapDetection - default enabled
2018-05-16Common/Hash: Namespace code under the Common namespaceLioncash
Brings more common code under the Common namespace.
2018-05-03TextureCacheBase: Make "disable vram copies" part of the active configStenzek
2018-05-03TextureConversionShader: Don't sample from adjacent rows when not neededStenzek
2018-04-29Implement EFB copy filter and gamma in hardware backendsStenzek
Also makes y_scale a dynamic parameter for EFB copies, as it doesn't make sense to keep it as part of the uid, otherwise we're generating redundant shaders.
2018-04-12Reformat all the things!spycrab
2018-03-14Assert: Uppercase assertion macrosLioncash
Macros should be all upper-cased. This is also kind of a wart that's been sticking out for quite a while now (we avoid prefixing underscores).
2018-03-13SSE-optimize UninitializeXFBMemoryHenrik Rydgård
Lowest hanging fruit I could find with a profiler. Not sure this stuff actually needs to be done, but assuming it is, why not do it quickly? 10x faster, goes from 1% CPU to 0.09%.
2018-02-11TextureCache: Add an option to disable EFB copies to VRAMStenzek
The option is named DisableCopyToVRAM under the Hacks section in GFX.ini. It is intentionally not exposed to the GUI, as users should not need to use it under normal circumstances. The main use is debugging issues in the EFB-to-RAM shaders.
2018-02-11VideoConfig: Remove bForceCopyToRam fieldStenzek
It's the inverse of supports-copy-to-vram.
2018-01-22AbstractTexture: Move Bind() method to RendererStenzek
This makes state tracking simpler, and enables easier porting to command lists later on.
2018-01-10Treat custom textures with "_arb" suffix as having arbitrary mipmapsJosJuice
This is adapted from Bighead's code that was posted at https://forums.dolphin-emu.org/Thread-dolphin-custom-texture-mipmaps?pid=460867#pid460867 In master, custom textures are never treated as having arbitrary mipmaps, so we need either a change like this or a change that makes us apply the arbitrary mipmap heuristic even when a custom texture is used.
2018-01-06VideoCommon: Apply the yscale as upscaling of the XFB.Markus Wick
2017-12-21Texture Cache Base: Move PAL vertical scaling to be baked into the texture ↵iwubcode
size. This saves on a number of multiplications and fixes an issue where we were multiplying the y-scaling factor by the srcRectangle's height + 1 which was causing a crash in some GC titles
2017-12-19Only use the "Scaled EFB Copy" setting for EFB, not XFBJosJuice
The hybrid XFB PR made it apply to both EFB copies and XFB copies.
2017-12-10TextureCache: Don't dump custom texturesStenzek
They don't have a basename, therefore were being saved to empty files, and potentially can be compressed.
2017-12-06VideoCommon: Drop now unused efb2tex matrix generation.degasus
2017-12-02VideoBackends: Use VideoCommon shader generators for efb2tex copies.Markus Wick
This will generate one shader per copy format. For now, it is the same shader with the colmat hard coded. So it should already improve the GPU performance a bit, but a rewrite of the shader generator is suggested. Half of the patch is done by linkmauve1: VideoCommon: Reorganise the shader writes.
2017-11-22TextureCacheBase: Don't crop last row/column of XFB copiesStenzek
Unsure why this was happening in the first place.
2017-11-22AbstractTexture: Seperate CopyRectangleFromTexture to two methodsStenzek
ScaleRectangleFromTexture, which does a draw, and CopyRectangleFromTexture, which where possible, does a bit-for-bit copy.
2017-11-22VideoCommon: Move abstract texture creation function to RendererStenzek
2017-11-19Merge pull request #6186 from lioncash/enum-classLeo Lam
VideoConfig: Make AspectMode and StereoMode enum classes
2017-11-19VideoCommon: Resolve -Wmissing-brace warningsLioncash
Resolves around 5 -Wmissing-brace warnings on macOS.
2017-11-18VideoConfig: Make StereoMode an enum classLioncash
Makes for more strongly-typed identifiers (and doesn't pollute surrounding namespaces)
2017-11-17TextureCacheBase: Set uninitialized XFB memory to fuchsia coloriwubcode
2017-11-17Hybrid XFB: Fix lint errorsiwubcode
2017-11-17Enhance xfb dumping to distinguish between the xfbs created from memory and ↵iwubcode
the xfbs created from overlapping copies
2017-11-17Texture Cache Base: Optimization to allow stitched or memory xfb textures to ↵iwubcode
be looked up from cache directly if they were defined previously and their hash hasn't changed
2017-11-17TextureCacheBase: Fix issue in Rogue Squadron 2 where overlapping textures ↵iwubcode
caused a hash change which would cause us to do a lookup from memory that gave us an incorrect result in XFB2Ram
2017-11-17TextureCacheBase: Remove vertical scaling from EFB path and have copy checks ↵iwubcode
only check EFBs
2017-11-17Hybrid XFB: Fix lint errorsiwubcode
2017-11-17TextureCacheBase: make sure stitching rectangle bounds don't exceed theiwubcode
texture size they are meant to represent
2017-11-17TextureCacheBase: Add XFB specific functionsiwubcode
2017-11-17HybridXFB: Fix lint errorsiwubcode
2017-11-17Software Backend: Force EFB/XFB to copy to ramiwubcode
2017-11-17Video Common: Avoid 'presenting' duplicate frames by detecting when swapiwubcode
hasn't changed since the last frame