Will use integral coordinate to avoid any rescaling.
Bilinear interpolation isn't supported. I don't think it is allowed to
filter a depth texture anyway.
The hypothesis is that game will use a depth (aka Z32/Z24/Z16/Z16S)
format when sampling depth texture as color. Technically one could use
a standard color format but block/pixel order won't be the same.
(otherwise I'm screwed)
=> Hypothesis invalid on GoW. They just do a scrambled rendering...
Lookup info:
* The first searched list is the depth pool as we search a depth
texture.
* 2nd one is the render target pool (if a depth was converted to a
render target already)
To avoid any CPU overhead, the source will be a pointer to the real texture
* Conversion (if float texture) will be done on the fly by the shader (GPU).
* Relative rescaling won't be supported. Texture must be fetched with
integral coordinate
Cache page coverage of texture into a hash map
Test done on Champion of Norrath (paltex + DisablePartialInvalidation)
Profiler:
Self of GSTextureCache::SourceMap::Add 5.39% => 0.23%
Self of GSTextureCache::LookupSource 15.27% => 10.82%
Hard to measure on CoN as it depends on memory transfer. Seem to be 5-10 fps faster.
This reverts commit 53690cf9d0.
Quoting user:
For aliasing, the option allow of reduce a little but always very
visible compared with DX11 even with anisotropic OFF, , furthermore
many textures bug added with option activated (predictable but not see
on DX11 with anisotropic ON).
TL;DR doesn't worth it.
Note: it seem to work on DX because DX uses HW texturing in clamp region
mode (and others invalid case). OpenGL uses SW texturing to ensure accuracy
* keep a reference of program/pipeline created to ease the deletion
* extend a bit the API to support multiple pipeline
Final goal will be to use a pre link pipeline for SW shaders. And uses
the default pipeline for HW shaders.
By default, anisotropic filtering was disabled when textures aren't countinuous.
This hack allows to force it. It can help to reduce aliasing but it would create
unexpected effect on texture boundaries.
Again, someone ought to add the option on Windows too
Someone ought to add the Windows option too (and DisablePartialInvalidation too)
It might break a couple of games but most of them run better with depth enabled.