Commit Graph

214 Commits

Author SHA1 Message Date
Akash 58ed49f3c9 GSDX: Clean up warnings on MSVC
* Explicitly cast w_pages and h_pages into uint32.
* Prevent signed/unsigned comparison by converting lod into unsigned integer, honestly how coud a mipmapping level be negative?
2016-11-05 10:28:04 +01:00
Gregory Hainaut 3d65312999 gsdx hw: remove old assert
Code is working fine with all formats
2016-11-04 23:02:49 +01:00
Gregory Hainaut 2c0a4ac906 gsdx ogl: add an extra debug log level
Avoid too much log
2016-10-14 20:46:58 +02:00
Gregory Hainaut a4658eac24 gsdx hw: allow overlapping of texture (alpha) and framebuffer (RGB)
Fix HUD on Berserk

v2: use fbmask instead of hacking the target format to 24 bits.
2016-10-14 19:26:27 +02:00
Gregory Hainaut 06055add5c gsdx merge: get a new buffer for the feedback write 2016-10-14 18:13:20 +02:00
Gregory Hainaut 5ced9c1f19 gsdx mipmap:ogl: plug trilinear/mipmap2 option
mipmap option 3. Actually maybe a separate tri-linear option will be better

m_mipmap == 2 => use manual PS2 trilinear/mipmap
Otherwise
m_filter == 3 => always use full automatic trilinear interpolation
m_filter == 4 => use automatic trilinear interpolation when PS2 uses mipmap
m_filter == 5 => like 4 but force bilinear interpolation inside layer
2016-10-13 20:16:38 +02:00
Gregory Hainaut ae441e6a2c gsdx mipmap:HW: Update all valid texture layers 2016-10-13 20:16:38 +02:00
Gregory Hainaut 5d593dd948 gsdx mipmap:HW: save state of both min&max lod values 2016-10-13 20:16:38 +02:00
Gregory Hainaut b695e0065a gsdx mipmap: use a 3 state option 2016-10-13 20:16:38 +02:00
Gregory Hainaut 1cc696ab31 gsdx hw: update TEST.ATE field after ATE optimization
Otherwise DoFirstPass/DoSecondPass will give you result based on pre-ATE optimization

Close #1607
2016-10-05 09:43:24 +02:00
Gregory Hainaut 3be055a366 gsdx hw: remove code to detect an effect
It was a tentative to emulate GTA radiosity but the new hack is more generic
2016-10-02 18:29:23 +02:00
Gregory Hainaut 7f4791fa85 gsdx hw: improve no_ds detection
Support ZTST_NEVER as no depth read => psx mode speed boost
Use zm/fm to reduce further depth lookup
2016-10-02 18:21:52 +02:00
Gregory Hainaut c3ac3ecbe7 gsdx hw: move try alpha test at the beginning
Will allow to use alpha test optimization to better optimize depth lookup

Require to do clut handling before
2016-10-02 18:21:52 +02:00
Gregory Hainaut dc365e066d gsdx tc: remove old plain TEXA hack
It must work fine without it now.

From the google code comments:

It would be nice to test those games
* Ar Tonelico 2 (line in sprite regression?)
* breath of fire dragon quarter (overlayed user interface in the game)

v2: update Dx code to use the good format
2016-10-02 18:21:52 +02:00
Gregory Hainaut c7c6566bca gsdx hw: of course the full Jak series will kill me 2016-10-02 11:57:09 +02:00
Gregory Hainaut b6638d4eec gsdx hw: forgot to comment an unused variable
Keep the code in case, we better solution is found to validate the depth/frame format
2016-10-02 10:18:15 +02:00
Gregory Hainaut 3996fbe365 gsdx hw: reduce conplexity around TryAlphaTest
* As sw renderer, don't bother to bypass it when it is ATST_ALWAYS
* Don't update the ATE register value
=> It is a really bad idea. Next draw call will be wrong if TEST register isn't written.
The TryAlphaTest context could have been updated
2016-10-01 19:20:49 +02:00
Gregory Hainaut 9c84712640 gsdx hw: enable palette read back on Jak2 2016-10-01 18:47:21 +02:00
Gregory Hainaut 5d93a392e4 gsdx hw: xman half screen correction 2016-09-30 22:25:24 +02:00
Gregory Hainaut 34686394a6 gsdx hw: add an hack for Jak3
I'm disappointed...

Read back palette written by the GPU. Avoid strange color on the skin.
2016-09-30 19:22:16 +02:00
Gregory Hainaut df2f8684d6 gsdx: improve TC cache log 2016-09-30 19:18:58 +02:00
Gregory Hainaut 8d24aa2b39 gsdx: GoW2 half screen bug
... Seriously ...
2016-09-30 19:15:25 +02:00
Gregory Hainaut 90ad9cf668 gsdx hw mipmap: tune the rounding + remove previous hack
GS really uses an invalid texture located at 0.

Improve the rounding for R&C. The idea is to avoid the corner case were only
the corner of the triangle touch the 7/16 edge.
2016-09-28 19:41:12 +02:00
Gregory Hainaut adb8be3287 gsdx: add/update comment
Need to investigate why the number of vertex is different in upscaled resolution
2016-09-28 19:41:12 +02:00
Gregory Hainaut 97172f5e51 gsdx debug: count draw call in a different way
* Always do +1 before the draw call
* Prefix texture name with i (as input) to keep them before the FB

Goal is to ensure that all renderers share the same draw call value.
2016-09-28 19:41:11 +02:00
Gregory Hainaut e0961d81a0 gsdx HW: use after free crash
Free bt
3 0xe676d194 in ~Source ../plugins/GSdx/GSTextureCache.cpp:1526
4 0xe676d194 in GSTextureCache::SourceMap::RemoveAt(GSTextureCache::Source*) ../plugins/GSdx/GSTextureCache.cpp:1990
5 0xe676f0fe in GSTextureCache::IncAge() ../plugins/GSdx/GSTextureCache.cpp:1022

Use bt
0 0xe6772a83 in GSTextureCache::LookupSource(GIFRegTEX0 const&, GIFRegTEXA const&, GSVector4i const&) ../plugins/GSdx/GSTextureCache.cpp:204
1 0xe66b0c9f in GSRendererHW::Draw() ../plugins/GSdx/GSRendererHW.cpp:579
2 0xe66fb43e in GSState::FlushPrim() ../plugins/GSdx/GSState.cpp:1509

Hypothesis the m_map array of list contains an invalid pointer
It is populated GSTextureCache::SourceMap::Add based on the coverage. The coverage is based on the offset.
So offset is potentially wrong. As mipmap code hack the offset value. It would be a nice culprit.

This commit avoids a potential bad transition between MIPMAP (which
overwrite the "offset") and the base layer (which wrongly keep an old "offset")

Conclusion, pray for my soul as it is very hard to reproduce
2016-09-26 20:34:38 +02:00
Gregory Hainaut 04d82d8127 gsdx: size doesn't count but 0.625 might change your life :p 2016-09-26 19:42:07 +02:00
Gregory Hainaut be9995bd1e gsdx mipmap: improve robustness to avoid potential crash 2016-09-26 09:27:03 +02:00
Gregory Hainaut ebb2a8ad5a gsdx debug: Add DISABLE_WIP_ASSERTION
To easily disable assertion on codes that only require investigation
2016-09-25 20:00:51 +02:00
Gregory Hainaut ef9a144437 gsdx hw: extra trick for the mipmap
Ratchet & Clank (the third) uses an address of 0 for invalid mipmap.

It would be very awkward to put the middle layer of texture in start of
memory. So let's use this information to correct the lod.

It make the game more robust on the lod rounding
2016-09-25 11:54:00 +02:00
Gregory Hainaut 78b2848622 gsdx: factorize the TEX0 generation for mipmap 2016-09-25 11:51:48 +02:00
Gregory Hainaut ccd9ce1728 gsdx hack: move tales of legendia hack to full move
Also remove the OI hack which is handled by the generic double half clear
2016-09-25 10:17:08 +02:00
Gregory Hainaut ad8a84a532 gsdx hw: reduce hack of Spyro series
Based on the comment, it ought to be fixed with previous commit.
2016-09-25 10:08:55 +02:00
Gregory Hainaut 7f871b0cc6 gsdx hw: remove various CRC hack that ought to be fixed with previous commit
* SpidermanWoS
* TyTasmanianTiger
* TyTasmanianTiger2
* DigimonRumbleArena2
* XmenOriginsWolverine
* CallofDutyFinalFronts
* GoW2 (only in openGL)
2016-09-25 10:08:54 +02:00
Gregory Hainaut 1e343084e2 gsdx hw: group the double half clear with gs mem clear hack
It avoid redundant check of the GS context

You can disable the extra clear with UserHacks_DisableGsMemClear = 1
2016-09-25 10:08:54 +02:00
Gregory Hainaut 6e2bf98d5f gsdx hw: round mipmap lod value
Will avoid some corruption based on distance/angle
2016-09-24 20:05:39 +02:00
Gregory Hainaut 719982e4a3 gsdx hw: forget to update a parameter
OMG, fixes various mipmap issues
2016-09-24 18:57:47 +02:00
Gregory Hainaut 76494e5f9c gsdx hw: add an userhack for hw mipmap 2016-09-24 12:39:31 +02:00
Gregory Hainaut 38b77397e0 gsdx hw: remove custom Ty Tasmanian Tiger / Simposons OI hack
Replaced by the generic OI_DoubleHalfClear. If OI_DoubleHalfClear is fast/safe enough, it
will enabled by default in the future.
2016-09-18 18:50:16 +02:00
Gregory Hainaut 6558317a7e gsdx: s/m_eq.xzyf & 4/m_eq.z/
Much better this way
2016-09-18 18:50:15 +02:00
Gregory Hainaut 5ef2d538a0 gsdx hw: only keep a single half clear implementation 2016-09-18 13:16:59 +02:00
Gregory Hainaut a0c1719695 gsdx hw: DoC takes 3
Add support for 16 bits format too. Fix shadows.
2016-09-17 12:06:43 +02:00
Gregory Hainaut 3546d54e3b gsdx hw: improve the vertical half clear for DoC
Previous assumption that crazyness was used to clear the buffer is wrong.

It was also used to write a constant color to the buffer.
2016-09-17 10:34:35 +02:00
Gregory Hainaut 7b9654f164 gsdx hw: CRC based solution to solve half screen issue on FFVII Dirge Of Cerberus
The trick is that the depth buffer is actually the right of the frame buffer
2016-09-17 00:02:32 +02:00
Gregory Hainaut c638e5ec87 gsdx debug: use a pretty format name when dumping texture
Much faster to read the format on the file name :)

+ remove a couple of useless ifdef
2016-09-07 08:34:24 +02:00
Gregory Hainaut cedc4f241d gsdx hw: add a crc hack for Dragon Quest & Final Fantasy in Itadaki Street
The hack only fix the HW renderer but not the SW renderer. However I'm not sure
the issue is from GSdx.

The hack will disable alpha test that used to generate empty draw call.
2016-09-04 19:41:31 +02:00
Jonathan Li 2b2042e1c2 gsdx: Allow screenshot compression level to be changed
At higher resolutions it takes too much time to save a screenshot at the
maximum compression level. So let's allow the user to set the
compression level.

This re-uses the png_compression_level setting. The default compression
level is 1 for speed, but if the user wishes to increase the compression
level (without using an external tool) and doesn't mind if the
screenshot takes more time to save then they can increase the
compression level up to a maximum of 9 (which can take quite a while).

Fixes #1527.
2016-08-20 14:01:24 +01:00
Gregory Hainaut d6b834e8af gsdx hw: don't execute blit fmv with target
Avoid invalid operation due to depth buffer
2016-08-20 12:56:30 +02:00
Gregory Hainaut 2e7fab7813 gsdx sw: avoid aliasing issue, clear function was wrong anyway
Value must be un-normalized. Function is only used with 0.0 so
API was updated to only use the 0 case.
2016-08-14 21:01:09 +02:00
Gregory Hainaut dc2864ad7a gsdx hw: avoid a null deferenced false-positive in coverity
It is a false positive because it supposes that PRIM->TME is both true and false.

It is the first Schrodinger's variable ;)
2016-08-12 23:02:06 +02:00