f74dbc794c
EFB2RAM: Apply copy filter as a float coefficient after sampling
...
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-22 12:24:08 +10:00
17e65a7167
VideoCommon: Replace SOIL with libpng for hires textures
2018-05-20 13:44:38 +02:00
b30d56ccc0
Texture AverageDiff: Do more in int space and avoid excessive float conversion
...
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-17 09:39:39 -07:00
c485efdfe1
Merge pull request #6743 from stenzek/faster-disabled-copy-filter
...
TextureConversionShader: Don't sample from adjacent rows when not needed
2018-05-17 10:45:50 +02:00
61a81795e5
Change the arbitrary mipmap detection to use the square of the error
...
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-16 17:51:50 -07:00
8be5cdfcad
Make the arbitrary mipmap detection threshold configureable
...
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-16 17:49:19 -07:00
29b7e33c14
Make arbitrary mipmap detection a config option
...
Under GFX::Enhancements::ArbitraryMipmapDetection - default enabled
2018-05-16 17:15:38 -07:00
011ee110bc
Common/Hash: Namespace code under the Common namespace
...
Brings more common code under the Common namespace.
2018-05-16 15:39:23 -04:00
0152f63655
TextureCacheBase: Make "disable vram copies" part of the active config
2018-05-03 14:24:44 +10:00
4faac3a627
TextureConversionShader: Don't sample from adjacent rows when not needed
2018-05-03 14:09:32 +10:00
9e798eec94
Implement EFB copy filter and gamma in hardware backends
...
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-29 19:05:20 +10:00
40bb9974f2
Reformat all the things!
2018-04-12 21:28:39 +02:00
50a476c371
Assert: Uppercase assertion macros
...
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-14 22:03:12 -04:00
6cbb716f60
SSE-optimize UninitializeXFBMemory
...
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-03-13 11:55:28 +01:00
93fb0e1e1c
TextureCache: Add an option to disable EFB copies to VRAM
...
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-11 15:48:46 +10:00
84b990faa0
VideoConfig: Remove bForceCopyToRam field
...
It's the inverse of supports-copy-to-vram.
2018-02-11 15:29:37 +10:00
38e0b6e2ab
AbstractTexture: Move Bind() method to Renderer
...
This makes state tracking simpler, and enables easier porting to command
lists later on.
2018-01-22 13:22:09 +10:00
c25fffc9a0
Treat custom textures with "_arb" suffix as having arbitrary mipmaps
...
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-10 17:51:45 +01:00
56d153f548
VideoCommon: Apply the yscale as upscaling of the XFB.
2018-01-06 10:36:33 +01:00
e1332b1d7e
Texture Cache Base: Move PAL vertical scaling to be baked into the texture 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-21 21:19:26 -06:00
a3355a3e4a
Only use the "Scaled EFB Copy" setting for EFB, not XFB
...
The hybrid XFB PR made it apply to both EFB copies and XFB copies.
2017-12-19 12:59:36 +01:00
2579f8eaa5
TextureCache: Don't dump custom textures
...
They don't have a basename, therefore were being saved to empty files, and potentially can be compressed.
2017-12-10 15:31:46 +10:00
02dd062518
VideoCommon: Drop now unused efb2tex matrix generation.
2017-12-06 09:30:03 +01:00
491c10ec96
VideoBackends: Use VideoCommon shader generators for efb2tex copies.
...
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-12-02 15:17:39 +01:00
193763ca3a
TextureCacheBase: Don't crop last row/column of XFB copies
...
Unsure why this was happening in the first place.
2017-11-22 18:49:33 +10:00
56afebeb44
AbstractTexture: Seperate CopyRectangleFromTexture to two methods
...
ScaleRectangleFromTexture, which does a draw, and
CopyRectangleFromTexture, which where possible, does a bit-for-bit copy.
2017-11-22 18:47:04 +10:00
49a9c33bd7
VideoCommon: Move abstract texture creation function to Renderer
2017-11-22 18:47:04 +10:00
80bcc0d58d
Merge pull request #6186 from lioncash/enum-class
...
VideoConfig: Make AspectMode and StereoMode enum classes
2017-11-19 15:08:16 +01:00
518f6a3624
VideoCommon: Resolve -Wmissing-brace warnings
...
Resolves around 5 -Wmissing-brace warnings on macOS.
2017-11-19 01:49:39 -05:00
5337e58284
VideoConfig: Make StereoMode an enum class
...
Makes for more strongly-typed identifiers (and doesn't pollute
surrounding namespaces)
2017-11-18 23:19:53 -05:00
dd54617a08
TextureCacheBase: Set uninitialized XFB memory to fuchsia color
2017-11-17 22:11:34 -06:00
8d1cbeb25e
Hybrid XFB: Fix lint errors
2017-11-17 22:11:34 -06:00
61541ab243
Enhance xfb dumping to distinguish between the xfbs created from memory and the xfbs created from overlapping copies
2017-11-17 22:11:34 -06:00
8678e8ddd3
Texture Cache Base: Optimization to allow stitched or memory xfb textures to be looked up from cache directly if they were defined previously and their hash hasn't changed
2017-11-17 22:11:33 -06:00
332af8aa49
TextureCacheBase: Fix issue in Rogue Squadron 2 where overlapping textures caused a hash change which would cause us to do a lookup from memory that gave us an incorrect result in XFB2Ram
2017-11-17 22:11:33 -06:00
ada37ec642
TextureCacheBase: Remove vertical scaling from EFB path and have copy checks only check EFBs
2017-11-17 22:11:33 -06:00
7248dd47d5
Hybrid XFB: Fix lint errors
2017-11-17 22:11:32 -06:00
2c87a53f11
TextureCacheBase: make sure stitching rectangle bounds don't exceed the
...
texture size they are meant to represent
2017-11-17 22:11:32 -06:00
74610646ce
TextureCacheBase: Add XFB specific functions
2017-11-17 22:11:32 -06:00
53684701fa
HybridXFB: Fix lint errors
2017-11-17 22:11:31 -06:00
1090549552
Software Backend: Force EFB/XFB to copy to ram
2017-11-17 22:11:31 -06:00
e6d85b0915
Video Common: Avoid 'presenting' duplicate frames by detecting when swap
...
hasn't changed since the last frame
2017-11-17 22:11:31 -06:00
2295d60fdc
VideoCommon: Output gamma now comes from the xfb copy
2017-11-17 22:11:30 -06:00
b285188de1
Video Backends: Implement vertical scaling for xfb copies. This fixes the
...
display of PAL games that run in 50hz mode.
2017-11-17 22:11:29 -06:00
2cd9565b18
Add an additional flag fo 'XFB Copy'
2017-11-17 22:11:29 -06:00
65cd085f9b
Add new GUI option to skip XFBToRam and remove old XFB options
2017-11-17 22:11:28 -06:00
198d3b69b4
Add ability to dump xfb copies to texture for debugging purposes
2017-11-17 22:11:28 -06:00
79387dddb2
Add support for hybrid XFB
2017-11-17 19:47:56 -06:00
aa23684d66
Improved detection: it doesn't desaturate the input anymore (woops) also it makes its own whole chain! This way it "notices" much better gradual divergences. Fixes Mario Sunshine, moss on the window in Zelda TP
2017-11-06 21:49:48 -08:00
5fb6ceac45
Fixed fog, lava, water in Mario Galaxy (and possibly other games) in higher IRs by detecting & fixing the mipmaps that aren't just used for downscaling, but are handmade to create a gradient.
2017-10-27 00:45:20 -07:00