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.
It often happens the game try to upload the FMV directly which typically
gave a black screen.
Commit fix rules of roses and I hope various black screen FMV
Performance impact must be tested, and I'm afraid of strange texture cache behavior.
V2: check the size of the transfer too
V3: add support of 16 bits format
V4: avoid division by 0
It actually removes the previous hack that read the full target.
Unfortunately snowblind engine game uses big target so the read is very big too (1280x448)
which is killer for the perf. Whereas the game requires only 24x12 texels
Give a 2x speed boost on Champion of Norrath !!!
Games uses very special texture with a lots of repeating.
It is much faster to send the full texture rather than trying to partially invalidate it.
On my gs dump:
FPS: 29 => 68 !
* Greatly reduce the number of clut read (factor 10x)
* Avoid to get wrong TEXA texture in the cache.
* Fix "jump depends on uninitialized variable" Valgrind warning.
Fix#748
I try my best to avoid any breakage of DX but please test it too.
Game can directly uploads a background or the full image in
"CTRC" buffer. Previous code was a full black screen.
It will also avoid various black screen issue in gs dump.
hidden option: preload_frame_with_gs_data
Note: impact on upscaling was not tested and it's likely broken
Improve the rendering in MGS3 (even if the game is still broken
due to others TC issues)
// Typical bug (MGS3 blue cloud):
// 1/ RT used as 32 bits => alpha channel written
// 2/ RT used as 24 bits => no update of alpha channel
// 3/ Lookup of texture that used alpha channel as index, HasSharedBits will return false
// because of the previous draw call format
//
// Solution: consider the RT as 32 bits if the alpha was used in the past
When the RT is used as an input texture, we need to rescale it.
Previous behavior was to always uses a linear filtering (more smooth).
Unfortunately it broke some games that expected an exact value like Star Ocean 3
This commit will disable the linear filtering in normal filtering mode (filter = 0
or filter = 2)
This way, shadow of Star Ocean 3 will appear correctly in upscaling (not
100% perfect but can't do better)
Note: SO3 only requires a nearest sampling of the alpha channel but
I don't know the behavior for others games.
Slight adjustments to positions in the GUI also (OCD'd the spacing a little :P)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5796 96395faa-99c1-11dd-bbfe-3dabce05a288
Another refinement to the Wild Arms hack by KrossX.
The hack now only applies to one kind of geometry (sent using the unpacked UV handler).
This works nicer in Wild Arms as it fixes "jumpy" characters.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5124 96395faa-99c1-11dd-bbfe-3dabce05a288
Adding KrossX's Wild Arms text alignment hack to the new dialog box. This hack is actually very interesting for a number of games. It should work well in cases where game designers adjusted everything pixel perfect for the GS, that usually breaks with upscaling.
It should be generalized and renamed later.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5120 96395faa-99c1-11dd-bbfe-3dabce05a288
Committing a hack KrossX prepared (thanks) ;)
It can be used to fix bad character sprites in Gust games.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5101 96395faa-99c1-11dd-bbfe-3dabce05a288
- Allow filtering setting for native resolution hardware rendering, as it's not tied to the resolution.
- Add ST / UV coordinate tweaking defines to more easily debug small rendering glitches.
- Add a define to bypass the hardware renderer texture cache. With this enabled, speed drops to slower than software rendering.
It fixes nearly all hardware rendering issues though and can be used to see how games *would* look if we had a new cache ;)
Thanks for the help, sudonim :)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4635 96395faa-99c1-11dd-bbfe-3dabce05a288