Commit Graph

4134 Commits

Author SHA1 Message Date
Gregory Hainaut b1f2d27ddf gsdx: move Haunting Ground CRC to dx level 2016-10-19 21:10:44 +02:00
Gregory Hainaut 264b764d6e gsdx tc: improve haunting ground hack to remove the bloom effect
Just clear the buffer. The generic solution will be a copy from buffer A
to buffer B But it requires
1/ a big buffer A (otherwise it would overflow)
2/ a line width rescaling (+ the upscaling mess support)
2016-10-19 19:31:32 +02:00
Gregory Hainaut c2cf8e528c gsdx ogl: tekken5: only trigger channel effect shader when frame buffer is a single page
Fix missing model regression.
2016-10-17 19:34:55 +02:00
Clang Format 604d3bac3c clang format: set SpacesBeforeTrailingComments to 1 2016-10-16 21:42:31 +02:00
Akash 8945ace3f7 GSDX-UI: Remove Trilinear options at some cases
Currently the Trilinear option only works on OpenGL. Remove it from combobox when other renderers are used.
2016-10-16 17:36:30 +01:00
Akash 45be4626f6 GSDX: Add an enum for texture filtering
Also re-order the combobox to make it look consistent with the tooltip description.
2016-10-16 17:36:30 +01:00
Gregory Hainaut cc4cc342c2 gsdx hw: add a special sub target invalidation for haunting ground
Fix a wrong blending/blooming

Based on CRC to reduce impact on others games (speed)
2016-10-16 17:32:57 +02:00
Gregory Hainaut 31248da3d1 gsdx sw: Fix 16 bits date test on SSE build
AVX Builds were fixed in this commit a1a842b07f
2016-10-16 16:48:23 +02:00
Gregory Hainaut defdd27987 gsdx: set m_nativeres to true in replayer
Otherwise you can't compare draw call between native and upscaled
2016-10-16 16:48:23 +02:00
Robert Neumann f5e096a66f spu2x: indicate pitch modulation and noise enabled status in the visual debugger 2016-10-16 14:15:12 +02:00
Gregory Hainaut c284459382 gsdx tc: allow to search old depth/color in texture cache
But give higher priority to recent buffer.

Fix cut scene issue in Jak II (and potentially various game when EE/VU hacks are used)
2016-10-15 18:08:00 +02:00
Gregory Hainaut 7bb201a1d2 gsdx tc: move code to allow to lookup an older target if none was found
Next step is to enable it by uncommenting line 452
2016-10-14 22:03:29 +02:00
Gregory Hainaut 24684033ca gsdx: enable clut_load_before_draw option on Harley Davidson (CRC hack)
At least the game is good until we find how the HW really behave
2016-10-14 20:47:18 +02: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 3c30db965d gsdx gui: add a combo box on linux (below Interlace)
3 states are off/half/full. I'm too lazy to create a better combo box.

The hack option will be removed when Windows GUI is ready
2016-10-14 19:26:58 +02:00
Gregory Hainaut 37a1230c01 gsdx: reduce code duplication for key event 2016-10-14 19:26: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 25e76d0564 gsdx ogl: use an invalid value for stencil state
Fix shadow in WWE Smackdown Vs Raw 2006
2016-10-14 19:01:18 +02:00
Gregory Hainaut 51c64fcbe6 gsdx sw: trick GetFeedbackOutput to handle basic merge loopback
It is enough for Xenosaga.
2016-10-14 18:13:20 +02:00
Gregory Hainaut deb2ed3d09 gsdx ogl: reimplement merge circuit to support feedback write 2016-10-14 18:13:20 +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 317a464278 gsdx shader: RGB => YUV conversion
Required for write feedback emulation
2016-10-14 18:13:20 +02:00
Jason Brown 6ef5607d99 gsdx shader: add a shader to render text for OSD
Gregory: code extracted from the OSD PR to reduce conflict
2016-10-14 18:13:20 +02:00
Jason Brown d84d30fe87 gsdx: Add color component to OGL shaders 2016-10-14 18:13:20 +02:00
Gregory Hainaut 7ca9ca9465 gsdx: new parameter for merge virtual function
* Add full PMODE register to replace slbg/mmod
* Add full EXTBUF register (will allow to emulate write feedback)
* Add a third source (which will actually be the destination of the
  write feedback)
2016-10-14 18:13:20 +02:00
FlatOutPS2 357dcdb55e GSdx: Move alpha stencil hack back to original location
Avoids skipping the alpha stencil hack.
2016-10-14 16:36:17 +02:00
Gregory Hainaut fbf7ccbdda gsdx: by default new will throw std::bad_alloc
So catch/use it and don't bother with GSDXErrorOOM
2016-10-13 20:44:59 +02:00
Gregory Hainaut c440c7c93a gsdx gui: update the filter combox box with new trilinear options
OpenGL only

v2: update setting tooltip based on turtleli feedback
2016-10-13 20:16:38 +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 c2777ff989 gsdx state: split IsMipmapActive in 2 pieces
This way we can test if a draw call requires a triliner filtering.
It will be used in next commit to implement automatic trilinear
2016-10-13 20:16:38 +02:00
Gregory Hainaut 1b9b47dd6a gsdx mipmap:ogl: add capabilities to automatically generate mipmap layer 2016-10-13 20:16:38 +02:00
Gregory Hainaut 510eccd471 gsdx mipmap: enable fully tri-linear filtering
(when mipmap > 1)
2016-10-13 20:16:38 +02:00
Gregory Hainaut a8a2db8eb1 gsdx mipmap:ogl: extend HW sampler with tri-linear filtering
v2:
* use nice enum
* use bilinear info when there is no mipmap (more accurate)
2016-10-13 20:16:38 +02:00
Gregory Hainaut 335d7f3ae5 gsdx: add a nice enum for min filter 2016-10-13 20:16:38 +02:00
Gregory Hainaut 7ea0e90678 gsdx mipmap:ogl: extend shader to support trilinear filtering 2016-10-13 20:16:38 +02:00
Gregory Hainaut d185a85a07 gsdx ogl: replace simple_sample variable by the opposite shader_emulated_sampler
It feels easier to read this way
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 15b1d8d3f0 gsdx mipmap:tc: add code to update a single layer of a mipmap 2016-10-13 20:16:38 +02:00
Gregory Hainaut dbb4bdf59f gsdx mipmap:ogl: add GL_TEXTURE mipmap support
* Allocate more memory for extra layers
* Allow to upload data in any layers
2016-10-13 20:16:38 +02:00
Gregory Hainaut 76bd968c59 gsdx mipmap: extend texture/cache to support a layer parameter 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
Jonathan Li 679f3347bb cdvdgigaherz: Read raw CD sectors one by one (#1590)
A multi sector raw disk sector read that reads data from two tracks of
different types will not complete successfully. Reading the sectors one
at a time should fix the issue.
2016-10-10 22:33:15 +01:00
Clang Format 039573b133 clang-format spu2x
Note: it doesn't play well with define around forceinline (might need to fix the inline btw)
And a single macro in RegTable.cpp
2016-10-10 20:41:24 +02:00
Robert 36631f2270 remove a useless define
cosmetics

more cosmetics

some more cosmetics? sure!

whitespaces

whiterspaces
2016-10-09 20:10:53 +02:00
Robert 95fe77a594 bad merge fix 2016-10-09 16:15:19 +02:00
Robert Neumann 19a8ed8b25 psxmode: Spu2x: more native SPU2 reghandlers. first "working" reverb! (everything before was just random data) 2016-10-09 15:52:47 +02:00
Robert Neumann ee05137415 psxmode: Spu2x: add reverb register handling, fix a problem with the address translation, re-enable "VMIXEL" writing (which should just be named Echo/Effect ON or EON really) 2016-10-09 15:52:47 +02:00
Robert Neumann 1ec70f1df3 psxmode: Spu2x now working correctly. Kudos to pseudonym. Took him 30 minutes to fix this! 2016-10-09 15:52:46 +02:00
Robert Neumann 08b6edae80 psxmode: further spu2x work 2016-10-09 15:52:45 +02:00
Robert 3aabc1adbf spu2x work 1 2016-10-09 15:52:05 +02:00
Gregory Hainaut 9af34cc611 gsdx tc: miss a set scaling call
Likely impact issue #83/#694
2016-10-09 13:07:08 +02:00
Gregory Hainaut 3b733930fe gsdx: UserHacks_TextureInsideRt must be disabled by default
Likely a bad copy/past
2016-10-09 12:13:37 +02:00
Gregory Hainaut 344636d88e gsdx ogl: attach input texture before copy
Help to ensure with copy the good texture in debugger
2016-10-08 23:42:39 +02:00
Gregory Hainaut 22ebdcf1cf gsdx debug: create a nice dump function for kernel gs registers
Add missing register
2016-10-08 23:42:39 +02:00
Andreas ab228c8484 Added missing CRC for Grand Theft Auto San Andreas. 2016-10-08 18:38:50 +03:00
FlatOutPS2 db853b4462 GSdx: Add Jak 2 US CRC to GSCrc list.
Fixes issue: https://github.com/PCSX2/pcsx2/issues/1603
2016-10-07 13:14:15 +03:00
Gregory Hainaut 574a807678 gsdx tc: new hack to extract texture from rt
UserHacks_TextureInsideRt = 1 (don't look at Jak)
2016-10-07 01:43:04 +02:00
Gregory Hainaut 8873b27eb8 gsdx: let's keep the new clut option off
There are still issue with virtua fighter (albeit my dump is better...)
2016-10-06 22:05:03 +02:00
Gregory Hainaut 79666b26c0 gsdx sw: restore the const reference
It was removed for PSX hack which was removed a couple of commits ago
2016-10-06 20:02:22 +02:00
Gregory Hainaut c66004bbb2 gsdx: hidden option to better support dual context clut
Option is on by default. Just a safety net in case of regression

Fix clut issue on virtua fighter (SW) and harley davidson (SW/HW).
2016-10-06 19:08:21 +02:00
Gregory Hainaut 9cd4984f7c gsdx debug: more log 2016-10-06 18:56:31 +02:00
Gregory Hainaut d827497403 gsdx: let's handle illegal 4 bits format too
In doubt if some games use them.
2016-10-05 22:07:49 +02:00
Gregory Hainaut 9b93c07339 gsdx: Handle illegal 8 bits format. Found the most silly GS dev trick
Fix Berserk #1526 Well done guys but we're more clever than you ;)

So instead to mask the color channels as any guy that RTFM, they decided to use the illegal 8H frame format
2016-10-05 22:07:43 +02:00
Gregory Hainaut 6fd46eb36a gsdx: move the validation of the texture format before the draw call
Avoid false positive when game write dummy stuff
2016-10-05 22:07:23 +02:00
Pseudonym a0629587be gsdx memory: implement read texture of PS GPU24
convert the swizzled block as tightly packed 24 bits RGB

Then convert scanline to standard 32 bits RGBA

The HW renderer requires the preload data hack
2016-10-05 21:59:42 +02:00
Gregory Hainaut 1c900e780a gsdx memory: add a PS GPU 24 bits format
Same swizzle as 16 bits. But contains tightly packed RGB pixels.
2016-10-05 21:06: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 3653a7746a gsdx psxmode: small hack to "see" video until we found a better solution 2016-10-05 09:43:24 +02:00
Gregory Hainaut 677f890c5c gsdx debug: static GSState::s_n
This way you can access the current draw call anywhere. Very useful for debug.
2016-10-05 09:43:24 +02:00
Gregory Hainaut 61333ecb40 gsdx debug: trace register access
I didn't include high frequency register such as vertex stuff

main goal is to give the possibility to trace the texture/clut update
2016-10-05 09:43:24 +02:00
Gregory Hainaut 1b8d6a38e7 Merge pull request #1586 from PCSX2/gsdx-refresh-gui-options
Gsdx refresh gui options
2016-10-04 18:30:48 +02:00
Gregory Hainaut 354aa6831b gsdx ogl: brain hang in the middle of the line
Only impact if bilinear is forced
2016-10-03 18:52:02 +02:00
Gregory Hainaut 5b72fab2e4 gsdx ogl: depth regression from 866173a481
Only mask depth if the min value is too big

Issue #1602
2016-10-03 18:32:54 +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 49c44db635 gsdx:dx: make filtering right
WMS/WMT 2 is the region clamping mode.

Hw unit can't emulate it right so it can give you bad filtering (Fix #1025)

Note: I only did the fix because I wanted to remove the TEXA hack. Otherwise
it is still recommended to use openGL
2016-10-02 18:21:52 +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 cf13cccb1e gsdx: avoid useless spamming of INVALID PSM in release build 2016-10-02 18:21:41 +02:00
Gregory Hainaut 955a69b16e gsdx ogl: fix GT4 regression (wrong texture on timing) 2016-10-02 12:16:48 +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 c5f086b385 gsdx ate: separate the code that depends on TEST.AFAIL
Easier to read and allow a switch optimization

Add a shortcut for the common ATST_ALWAYS case
2016-10-01 19:20:38 +02:00
Gregory Hainaut 4612b79575 gsdx: add a warning on vertex trace
Due to a division by 2, depth lsb bit is always 0

I'm not sure it is critical but let's keep a note for the future
2016-10-01 19:16:44 +02:00
Gregory Hainaut d1e07295e7 gsdx linux: add the missing gui option for unscale point/line primitive 2016-10-01 19:16:44 +02:00
Gregory Hainaut 5e1064da55 gsdx: remove the safe accurate blending hack
V2: Integrate Flatout patch to do the Window side
2016-10-01 19:15:52 +02:00
Gregory Hainaut f77c1900fa gsdx tc: always clear a new depth buffer
Random data isn't a good idea for a depth buffer. It can cause flickering. (Jak2 FMV)

Hopefully it won't impact too much the speed.
2016-10-01 19:00:17 +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 29c25bc375 gsdx clut: disable some assertions often fired 2016-09-30 22:24:38 +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 fc32b749dd onepad: fix a pad regression on odin sphere 2016-09-30 10:25:14 +02:00
Gregory Hainaut 8d4fadb3c8 Revert "gsdx state: TEX0 write behavior might depends on the context"
This reverts commit b34243fa7b.

Unfortunately we have a regression on GT4. I'm doomed
2016-09-28 20:00:56 +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 749037346c gsdx: report an error if PSM is invalid 2016-09-28 19:41:12 +02:00
Gregory Hainaut fea31f7422 gsdx: don't use virtual when it is useless 2016-09-28 19:41:11 +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 b34243fa7b gsdx state: TEX0 write behavior might depends on the context
Game: harley davidson
* write tex0 ctx0
* write tex0 ctx1
* draw  ctx 0

Previous GSdx behavior will load the clut every write of TEX0. In the
above case the draw will take the wrong clut.

To be honest, it could be a wrong emulation on the EE core emulation.
The hardware likely got a single clut (1KB cache is quite expensive)
So clut loading must be skipped if the context is wrong.

Next draw will use the ctx1 clut so I apply TEX0 when the context is switched

Please test harley davidson :)

v2: detect context switch from UpdateContext function
V3: always set m_env.CTXT[i].offset.tex, avoid crash (Thanks to FlatOutPS2 that spot the issue)
V4: move bad psm correction code (rebase put it in the wrong place)
2016-09-27 10:04:09 +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 ca4f265ce6 gsdx debug: dump mipmap register could be useful now :) 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 e229dc1549 gsdx hack: move Resident Evil 4 to full level
The CRC hack removes the fog, without the hack the screen turns green with D3D,, but the fog emulates correctly on OGL with hardware depth.
2016-09-25 10:13:21 +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 6c6ed5f443 gsdx ogl: trigger the special RW framebuffer shader when only Alpha is written (#1588)
* gsdx ogl: trigger the special RW framebuffer shader when only Alpha is written

It will work for both Jak and Ratchet&Clank and without CRC
2016-09-25 10:05:44 +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 e38aba0dff gsdx: rename SW texture dump filename
* Use texraw for the unconverted texture (keep index fmt)
  => avoid bad filename order with the multiple texture layers
* add the real mipmap address
* Use a nice string format
2016-09-24 09:15:40 +02:00
Gregory Hainaut d89b09427f gsdx: gl logging is only available in MTGS thread
Fix crash in debug build
2016-09-22 17:54:44 +02:00
Gregory Hainaut b00ae974d2 gsdx ogl: fix bad interaction between accurate blending and geometry shader
Recent optimization allow to use triangle to render sprite even when gs is supported

close #1574
2016-09-20 09:30:24 +02:00
Jonathan Li c64e8f944e cdvdgigaherz: Fix printf sign mismatch warnings
Fixes warning C6340: printf sign mismatch

Only remaining warnings for cdvdGigaherz (using level 4 warning
settings) are:
C6258: TerminateThread does not allow proper thread clean up
C4201: nonstandard extension used: nameless struct/union (from the
lo/hi u128 struct in common/include/Pcsx2Types.h)
2016-09-20 01:24:23 +01:00
Jonathan Li 57d029f34a cdvdgigaherz: Use INT_PTR for dialog handler return type
BOOL is not the correct return type (though it works for 32-bit).
2016-09-20 01:23:47 +01:00
Jonathan Li 0ca36e8943 cdvdgigaherz: Fix value truncation warnings
Fixes warning C4244: conversion to smaller data type, possible loss of
data.
2016-09-20 00:47:15 +01:00
Jonathan Li a61aa8ff0b cdvdgigaherz: Remove unreachable return
Fixes warning C4702: unreachable code
2016-09-20 00:46:33 +01:00
Clang Format 2967d5d3f1 cdvdgigaherz: Reformat with clang-format 2016-09-19 19:53:00 +01:00
Jonathan Li 60da39712c cdvdgigaherz: Remove unused code/macros/variables/etc
The SPTI code is unused, and it's simpler to just use the Windows
ioctls/API if they work (only raw disk sector reading is an issue and
the SPTI workaround is already in place).
2016-09-19 19:50:55 +01:00
Gregory Hainaut b91bd3ea01 gsdx dx/gl: fix potential bug in alpha test handling
Depth test must remain disabled if write were masked.

Bug was detected on ICO (sea/sky) but the previous commit removes
the wrong ATE draw call.
2016-09-19 08:56:49 +02:00
Gregory Hainaut 6966e08306 gsdx: move alpha test optimization in base class
One code for all renderers :)
2016-09-19 08:48:32 +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 7a40b27931 gsdx CRC: move GTA hack to full level
You can now emulate the radiosity effect with the UserHacks_AutoFlush hack.
2016-09-18 18:50:15 +02:00
Gregory Hainaut 0f387a8e3c Merge pull request #1535 from PCSX2/clang-tidy-macro-parenthesis
clang-tidy: use parenthesis around macro parameters
2016-09-18 18:48:04 +02:00
Jonathan Li 15fbd6fbf4 cdvdgigaherz: Remove ISO file reader (#1569)
It doesn't support dual layer ISO images, and the ini has to be edited
manually so it loads an ISO image ("$" has to be prepended to the ISO
path as well). The PCSX2 internal ISO file reader is probably better in
most/all aspects and I don't think it's worth copying the logic from
PCSX2 into the plugin.
2016-09-18 18:38:21 +02:00
Gregory Hainaut 310f13a2f7 gsdx ogl: only use geometry shader to convert big enough draw call (#1554)
gsdx ogl: only use geometry shader to convert big enough draw call

The purpose of geometry shader is to reduce bandwidth (72 bytes by sprite)
and CPU load.

Unfortunately it increases CPU load due to extra shader validations.

So geometry shader will only be enabled for draw call with more than
16 sprites (arbitrarily, smallest number before shadow hearts plummet)

v2: don't disable geometry shader in replayer.
It is easier to spot sprite rendering and to manually read vertex info.
2016-09-18 16:58:02 +02:00
Gregory Hainaut 2a60264e40 gsdx replayer: improve error message when file is corrupted 2016-09-18 16:52:35 +02:00
Gregory Hainaut 6e6eae7844 pcsx2:gsdx:spu2x: use parenthesis around macro parameters
For safety reasons.
2016-09-18 16:13:55 +02:00
Gregory Hainaut 64d499af6e pcsx2|spu2x: remove unused macro 2016-09-18 16:13:29 +02:00
Gregory Hainaut b1d446895b GSdx: replace IsTopLeftAligned macro with a function 2016-09-18 16:13:28 +02:00
Gregory Hainaut f0a54bf6e3 spu2x: replace EMITC macro with a function 2016-09-18 16:13:28 +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 ebdf54a60b gsdx sw: don't enable auto flush hack in replayer
Otherwise we don't have same number of draw call in HW/SW which is
awful to compare
2016-09-17 12:05:05 +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
Jonathan Li 4d5e051387 gsdx: Fix missing "\n" in rc file
It stops Visual Studio from asking to normalise the line endings
everytime the resource editor is used.
2016-09-16 23:42:54 +01:00
Jonathan Li 91b2e5bdbb Merge pull request #1564 from FlatOutPS2/master
GSdx: Add Windows UI options for HW hacks
2016-09-16 23:35:45 +01: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
FlatOutPS2 55b0be36cd GSdx: Add cancel button to Hacks dialog
Add a cancel button to the Hacks dialog to make it easier for the user
to exit the window without making changes.
2016-09-16 23:22:13 +02:00
FlatOutPS2 5420fcaf3a GSdx: Add Windows UI options for HW hacks
Add UI options for Auto Flush and Unscale Point Line HW hacks.
2016-09-16 23:19:05 +02:00
Gregory Hainaut 3994141d40 gsdx sw: always enable the auto flush hack on the SW renderer
There are enough option. Will remove it if too slow.

Positively impact Jak, GTA, Battlefield 2
2016-09-15 17:24:40 +02:00
Gregory Hainaut 1a1d6ab478 gsdx: handle the invalid format 0x3
International Super Star Soccer seems to use it.

It could be a core bug, in doubt uses the likely expected standard 0x13
2016-09-14 19:22:45 +02:00
Gregory Hainaut 4796803c33 pcsx2: Remove == true/false for boolean logic (#1556)
As discussed in #1553

Clang Tidy reports goes from 156 to 9.

Remain some macro in spu2x + a deadcode line
2016-09-10 20:08:14 +02:00
Jonathan Li 77e128aa11 Merge pull request #1557 from turtleli/freetype
3rdparty: Add Freetype and link to GSdx
2016-09-10 14:04:26 +01:00
Jonathan Li 72d3e4e03f windows: Add freetype to solution and link to GSdx 2016-09-10 12:36:56 +01:00
Gregory Hainaut 4ebe739b44 pcsx2: remove various unused variable
Warning can be reenabled on GCC

A warning isn't fixed as potentially the code is wrong
../pcsx2/gui/MemoryCardFolder.cpp: In member function ‘void FolderMemoryCard::FlushFileEntries(u32, u32, const wxString&, MemoryCardFileMetadataReference*)’:
../pcsx2/gui/MemoryCardFolder.cpp:1027:10: warning: unused variable ‘filenameCleaned’ [-Wunused-variable]
     bool filenameCleaned = FileAccessHelper::CleanMemcardFilename( cleanName );
2016-09-10 00:09:05 +02:00
Gregory Hainaut ccf198a80b gsdx ogl: fix a regression on Okami
Strangely the game uses large texture to handle texture buffer.

I think it plays with WMS/WMT. I'm not sure texture shuffling is 100%
correct here. But without it, it's completely broken.
2016-09-09 21:51:23 +02:00
Gregory Hainaut 8c1722faa2 gsdx: add a note that Jak shadows can be handled with HW GL without auto flush hack 2016-09-09 21:08:15 +02:00
Gregory Hainaut 64a97483fb gsdx: add Jak3 US too 2016-09-09 21:05:00 +02:00
Gregory Hainaut de480ec0f5 gsdx: add crc hack for Jak
* 0x9C712FF0, Jak1, EU
* 0x472E7699, Jak1, US
* 0x2479F4A9, Jak2, EU
* 0x12804727, Jak3, EU
* 0xDF659E77, JakX, EU

Please report me the CRC of the US version too so I can add them.

Please test the shadows rendering (openGL HW + accurate blending at least basic)
2016-09-09 19:44:04 +02:00
Jonathan Li d540dbec79 cdvdgigaherz: Fix event handle memory leak
Also bump the version to 0.10.0.
2016-09-08 23:46:05 +01:00
Jonathan Li 303996818c cdvdgigaherz: Delete duplicate PlainIso file 2016-09-08 23:14:26 +01:00
Gregory Hainaut d27d2dd520 fix compilation issue 2016-09-09 00:11:02 +02:00
Gregory Hainaut c2b67ccb78 gsdx ogl: implement an alternate shader for Jak Shadows
The game sets the framebuffer as an input texture. So I did the same for
openGL. Code is protected with a CRC. It is working because the game want to sample
pixels.

For the record, I tested it GTA too, it doesn't work as expected because
the game will resize the framebuffer to a smaller one. So you don't have
the guarantee that pixel will be read before a data write.

Note: it requires at least accurate blending set on basic

Note: I need CRC of all Jak games that suffers of this issue. Thanks you :)
2016-09-08 23:58:13 +02:00
Gregory Hainaut c03b388786 Merge pull request #1551 from PCSX2/clang-format-v2
Clang format v2
2016-09-08 22:53:21 +02:00
Clang Format e503534ff4 reformat CDVDiso 2016-09-08 21:54:50 +02:00
Clang Format d6ae5bfafa reformat lilypad
Note: I'm worried on the EXPORT/CALLBACK behavior on multiple OS
2016-09-08 21:54:49 +02:00
Clang Format f06f44c30a reformat onepad 2016-09-08 21:52:49 +02:00
Clang Format 0abf686406 pre-fomat onepad
Clang doesn't move back the '{' if there is a comment on the if line
2016-09-08 21:52:49 +02:00
Clang Format 1f8a0db290 reformat null plugin with pointer symbol on the right 2016-09-08 21:52:49 +02:00
Gregory Hainaut f9d8cb97c0 Merge pull request #1508 from PCSX2/gsdx-allow-sso-amd
Finally AMD delivered the fix to support separate shader object !!!
2016-09-08 21:47:32 +02:00
Gregory Hainaut 6ee841319f gsdx: help stupid compiler to allow 32 byte move
Default copy-constructor is eight 32 bits move

GSRendererOGL::Lines2Sprites code shrinks from 510B to 398B
(loop of the function 296B => 181B). Hopefully it will reduce the cost
to convert line to sprite on the CPU (i.e. when geometry shader is disabled)
2016-09-08 20:01:05 +02:00
Gregory Hainaut aba0c733cd gsdx linux: add a gui check box to control previous hack 2016-09-08 17:34:28 +02:00
Gregory Hainaut 029d74f855 gsdx: add an auto flush hack to implement a Read Write GS effect.
It impacts all renderers. It ought to fix issue in GTA radiosity,
Shadows in Jak series. (note shadows will suck in upscaling)

Implementation is really brutal. Expect a massive slow down, but at least we can test the effect
easily.

Normally perf impact will remain reasonable if the game doesn't use a Read-Write effect

Performances number are welcomes (my guess is really awful in HW mode, slow in SW mode).
You can enable it with "UserHacks_AutoFlush = 1"
2016-09-08 17:25:59 +02:00
Gregory Hainaut bcb951077d gsdx: c_str() is useless when parameter is a string
Reported by clang tidy
2016-09-07 22:10:50 +02:00
Gregory Hainaut 145d6e29c2 gsdx: increase the allocation of the GS memory
GS memory is only 4MB but rendering is allowed to be 2048x2048
with 32 bits format (so 16MB). Technically the frame/depth buffer can start
at the end of the GS memory. Let's not waste too much memory.

Fix crash with BASARAX

(game draws a 2048x1664 32 bits area)
2016-09-07 08:34:24 +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 6abd806539 gsdx perf: print frame time distribution 2016-09-07 08:34:24 +02:00
Gregory Hainaut 244bb555f9 Merge pull request #1532 from ssakash/Coverity
PCSX2: Fix a bunch of coverity defects
2016-09-05 20:16:13 +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
Gregory Hainaut bb50b3419e Merge pull request #1542 from PCSX2/gsdx-texture-transfer-motocross
gsdx: save the blit buffer register when a transfer is started
2016-09-04 16:55:08 +02:00
Akash dc874a99cd LilyPad: Remove useless self assignment
CID 146888 (#1 of 1): Self assignment (NO_EFFECT)self_assign: Assignment
operation (this->devices[i]->virtualControls + j).uid =
(this->devices[i]->virtualControls + j).uid has no effect.
2016-09-03 20:29:46 +05:30
Gregory Hainaut 52a2bb5524 gsdx ogl: disable texture shuffle when a render a basic sprite
Fix shadow issue on "Shadow of Memories"
2016-09-03 12:18:52 +02:00
Gregory Hainaut 79209c31bf gsdx ogl: avoid bad logging of framebuffer/texture overlap 2016-09-03 12:18:51 +02:00
Jonathan Li 4d10eda308 Merge pull request #1545 from turtleli/cdvd-spti
cdvdgigaherz: Use SPTI to read raw CD sectors
2016-09-02 23:56:05 +01:00
Gregory Hainaut a123e65185 gsdx sw: handle the invalidation of the palette when written by the GS
Manual gives all setup to upload a palette from the host. But nothing forbid to render
directly in the palette buffer. (GS rule nb 1, there is no rule ^^)

Fix Virtua Fighter 2 dark colors

However I'm not sure we can fix HW renderer. Rendering is done on the GPU but palette
handling is done on the CPU... So we need to read back data (ouch, and slow). A quick
test didn't get the expected results. Potentially there are others bugs (aka not gonna
happen on the HW renderer)
2016-09-03 00:21:56 +02:00
Gregory Hainaut d01194da0b gsdx sw: help debug
* quick way to disable verbose fixed tex0
* use palette address/format when the palette is dumped :)
2016-09-03 00:10:23 +02:00
Gregory Hainaut 6323268f40 gsdx tc: reset dirty alpha flag when we lookup a frame
Fix black skin regression for haunting ground (at least on my gs dump)
2016-09-02 21:31:13 +02:00
Jonathan Li 3d8be787a2 cdvdgigaherz: Use SPTI to read raw CD sectors
IOCTL_CDROM_RAW_READ apparently does not work for some read modes on
some optical drives, which makes some CD-ROM games unplayable from the
disc.

Work around the issue by using SPTI to retrieve the raw sector data. The
old reading method has been retained in case SPTI cannot be used (if the
device could not be opened with write access).
2016-09-02 00:58:38 +01:00
Gregory Hainaut c9a1558c60 gsdx: save the blit buffer register when a transfer is started
Fix motocross mania missing texture. Close #1319

As far as I understand, transfer is initialized in DIR. But the real
write only occured later so the blit buffer could have been overwritten
by a new value.

BLIT 0 13700
TREG 40 40
DIR 0 0
BLIT 0 13f00 <=== the bad guy
Write! ...  => 0x3f00 W:1 F:C_32 (DIR 00), dPos(0 0) size(64 64)

v2: set a value in m_tr.m_blit for load state
2016-09-01 09:59:38 +02:00
Gregory Hainaut b546d096bd Finally AMD delivered the fix to support separate shader object !!!
v2: blacklist AMD driver from the start of 2016
Please note that it is highly recommended to upgrade to a stable&working driver
2016-09-01 09:47:57 +02:00
Gregory Hainaut 448fee76c1 gsdx ogl: move GS setup in SetupIA
Fix regression when geometry shader is disabled
2016-09-01 09:47:46 +02:00
Gregory Hainaut 165bcf5662 Merge pull request #1539 from FlatOutPS2/DX
GSdx DX: extend ATE to better support additional corner case DX port
2016-08-29 11:39:22 +02:00
Gregory Hainaut 19a9d639b1 Merge pull request #1538 from PCSX2/gsdx-improved-ate
gsdx ogl: extend ATE to better support additional corner case (issue …
2016-08-29 11:38:57 +02:00
Gregory Hainaut da688114f4 Merge pull request #1522 from PCSX2/gsdx-issue-1438
gsdx tc: don't partially invalidate small target
2016-08-28 16:51:25 +02:00
Gregory Hainaut e4337b6631 glsl2h: add input files in the header
Close #1404
2016-08-28 16:31:35 +02:00
Gregory Hainaut a1cdf7189a gsdx tc: don't partially invalidate small target
It creates a regression on game that uses a small temporary target to
upload textures of various sizes. Inital code was done to handle direct
frame write (background, FMV) so big target
2016-08-28 16:24:02 +02:00
FlatOutPS2 e5c6b2e952 GSdx DX: extend ATE to better support additional corner case DX port
Port for Direct3D renderers of PR #1538.
2016-08-28 15:13:15 +02:00
Gregory Hainaut 7103707aeb gsdx: new linux option linear_present
Purpose is to control the filtering when final image is displayed on the screen

Could improve the sharpness of the output in some games (ofc, it will be pixelated)
2016-08-27 19:23:12 +02:00
Gregory Hainaut 2b925e0103 gsdx ogl: extend ATE to better support additional corner case (issue #1499)
When depth primitive is constant and depth test is greater or equal, we can
execute the depth write after color (depth status will only depends on the initial
value)

New case for RGB_ONLY ate:
If the blending equation uses a fixed alpha or a source alpha. We can postpone the alpha write
in a 2nd pass.
If depth can also be postponed, we can guarantee the order of correctness of the value.
1st pass => do RGB
2nd pass => do Alpha & Depth

It fixed Stuntman letter rendering :) Remaining of the game is still broken :(
2016-08-27 14:46:10 +02:00