Commit Graph

118 Commits

Author SHA1 Message Date
Gregory Hainaut cc1756b8e5 gsdx: disable dump in release build 2016-04-02 00:56:41 +02:00
Gregory Hainaut f6ee94589f gsdx hw: OI_GSMemClear supports various frame formats
Could help #1267
2016-03-28 10:47:42 +02:00
Gregory Hainaut a99750ae87 gsdx hw: only enable OI_GsMemClear when both depth/alpha test are disabled
Fix #1262
2016-03-26 11:28:28 +01:00
Gregory Hainaut 8e5e770fd1 gsdx hw: Ensure GS memory is always cleared properly
It will fix some issues on FMV

Previous behavior can be restored with the hack "UserHacks_DisableGsMemClear"

Fix #768
And maybe #855
2016-03-21 18:26:22 +01:00
Gregory Hainaut a3788c4e98 Merge pull request #1225 from PCSX2-Alpha/scaling_fix
GSDX: set a safe limit to Framebuffer width
2016-03-12 15:42:18 +01:00
Akash 997f0535f5 GSDX: Set a safe limit to Framebuffer width
There are likely few games (RE4) which constantly change the FBW register value causing the framebuffer width to be updated at every interval. Adding a safe limit (512) similar to frame buffer height would prevent such constant changes of the framebuffer width when FBW changes once again to an even lower value.
2016-03-11 07:28:05 +05:30
Gregory Hainaut ec57f1305a gsdx: detect rendering outside of the framebuffer
Could help to detect rendering issue (for example missing fmv)
2016-03-10 19:03:39 +01:00
Jonathan Li 6b950d0408 gsdx: Allow dump and capture PNG compression to be changed
Valid values for png_compression_level are from 0 (no compression) to 9
(max compression). The default is 1.

v2: Use zlib Z_BEST_SPEED (1) and Z_BEST_COMPRESSION (9) defines.
2016-03-02 22:58:45 +00:00
Gregory Hainaut edef3ad8c3 Merge pull request #1170 from PCSX2-Alpha/TC_Scaling
GSDX: Detect RT size based on display and frame registers.
2016-03-02 13:51:28 +01:00
Akash b07b06a9fb GSDX-Texture Cache: Rework scaling function
The following patch uses the height value of the display rectangle rather than make an estimation of the Frame buffer height when the game uses a non-referenceable height (or) width.
2016-02-24 09:14:01 +05:30
Gregory Hainaut 1853d0d16d gsdx: no depth lookup optimization
Don't lookup a depth buffer if depth test is always pass without write

Boost performance on Tekken5 when depth emulation is enabled in openGL
(Tekken5 sets same address for both the RT and the depth but depth is disabled)

v2:
Keep ds if DATE is enabled (some implementation uses a stencil buffer)
Be more aggressive to avoid an useless depth lookup
2016-02-18 20:35:50 +01:00
Gregory Hainaut 78b73ba585 gsdx: avoid null pointer deferencement 2015-09-25 20:59:36 +02:00
Gregory Hainaut 5fb8c7e65c gsdx: initialize members in constructor of objects
A couple of useless members were removed too.

Also fix wnd initialization

Coverity:
CID 146955 (#1 of 1): Uninitialized pointer read (UNINIT)
18. uninit_use: Using uninitialized value wnd[i].
2015-09-23 09:46:53 +02:00
Avi Halachmi (:avih) 4474d4391b GSdx: capture - print recomended resolution and DAR to the console
This is the internal resolution which GSdx uses and recording at this resolution
is optimal, i.e. without any dumb scaling, with all relevant pixels and without
redundant pixels.

The resulting clip still doesn't have the correct aspect ratio set, but that's
just a property which can be set to the clip afterwards, which is where the DAR
becomes useful. Since it's usually anamorphic, when muxing later with the audio
use the DAR to set the playback aspect ratio.
2015-09-22 01:11:13 +03:00
Avi Halachmi (:avih) 3f81fc98dd gsdx: custom resolution - use 0 instead of 9 2015-09-22 01:00:53 +03:00
Jonathan Li 69d27dfb4b Merge pull request #829 from ssakash/rework_internalres
gsdx changes:
Remove native resolution checkbox from GUI and rework associated code
Small changes to Windows and Linux GUI
Support 8x native resolution
Fix custom resolution width less than native width use case
2015-09-21 20:12:47 +01:00
Gregory Hainaut b60dd9d1fe Merge pull request #814 from PCSX2/coverity-qa-high
Fix a bunches of coverity warning/errors.
2015-09-20 22:18:03 +02:00
Jonathan Li d4f6894e1b gsdx: Fix custom resolution and minor cleanup
This fixes the following issues when custom resolution is selected.
 - When the width is smaller than the native resolution width, the
   texture cache targets are removed on every Vsync signal, causing a
   black screen issue.
 - The texture cache code needs a 1 returned for the custom resolution
   upscale multiplier or there'll be some really funny graphical issues.

It also removes unnecessary GetConfig (which I think unconditionally
does a a file read on Windows) calls if the width was increased - the
upscale multiplier is already stored, and the custom resolution width
and height calls are now unnecessary.

Also fix some whitespace issues.
2015-09-20 07:49:46 +05:30
Akash b97018932d GSDX: Rework Internal Resolution function
upscale_multiplier function values have been changed to allocate native resolution and also move custom resolution to 9.
Remove the old native checkbox value and include Native in the combo box.
Internal GSDX functions have also been updated with this new update to the upscale_multiplier variable.
2015-09-14 10:26:27 +05:30
Gregory Hainaut cee0fde940 gsdx-tc: improve support of TEXA register
* 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.
2015-09-11 14:16:11 +02:00
Gregory Hainaut 2430abed33 gsdx: potential division by zero
CID 146833 (#2-1 of 2): Division or modulo by zero (DIVIDE_BY_ZERO)
divide_by_zero: In expression this->m_width / this->m_upscale_multiplier, division by expression this->m_upscale_multiplier which may be zero has undefined behavior.
2015-09-11 08:54:29 +02:00
Gregory Hainaut ac8f4e69d6 pcsx2|gsdx: avoid potential null deferencement 2015-09-11 08:54:29 +02:00
Gregory Hainaut 98c74879bf Merge pull request #718 from PCSX2/depth-color-direct-write
Depth color direct write
2015-08-10 15:50:48 +02:00
gabest11 49b3acea72 gsdx: texture size reduction in sw mode, fixes Stolen, less memory usage in general. 2015-08-05 19:11:41 +02:00
Gregory Hainaut 6cb0443227 gsdx: disable depth rendering if rt == depth
I used to disable the RT but it doesn't work well with 50cents. It seems
texture writes weren't propagated correctly to the depth buffer. Besides
the game write an alpha value whereas depth is 24 bits only...
2015-08-04 19:39:29 +02:00
Gregory Hainaut 8c8fe633a5 gsdx-ogl: merge 3 accurate* option into a nice combobox
It is much easier to configure this way
2015-07-30 18:21:00 +02:00
Gregory Hainaut f4e881ad30 gsdx: always set texture shuffle flag
Avoid bad effects in 16 bits RT games
2015-07-30 09:15:04 +02:00
Gregory Hainaut f6f28042bd gsdx: texture shuffle detection
Don't check rt 32 bits state, it give false positive on suikoden
2015-07-12 15:21:04 +02:00
Gregory Hainaut 5ed45b6806 Merge pull request #644 from PCSX2/improve-texshuffle-detection
Improve texshuffle detection
2015-07-11 09:34:33 +02:00
Gregory Hainaut 6f9a89dcf2 gsdx-debug: print memory usage of all textures pools
It is a bit crude but it allow to see the impact of code and options.
2015-07-10 22:35:26 +02:00
Gregory Hainaut 350db223d3 gsdx: only propagate texture shuffle detection if tex shuffle is detected 2015-07-10 14:06:39 +02:00
Gregory Hainaut 22f11958e9 gsdx: better detection of texture shuffle
Some effects were missed on Wallace & Gromit
2015-07-09 23:05:07 +02:00
Gregory Hainaut 4fcf460447 gsdx: fix DoC black screen video
The game also set both depth and rt buffer at the same location
but disable the depth test (ZTE is 0)
2015-07-09 16:20:43 +02:00
Akash a02a9aac8f Fix a Function name typo. 2015-07-07 21:26:04 +05:30
Akash f39aa181cc Update the variable name to suit the game's original name and change to accurate region of the game. 2015-07-06 00:59:35 +05:30
Gregory Hainaut edc9d23566 gsdx: fix a crash with UserHacks_ColorDepthClearOverlap 2015-07-05 14:13:24 +02:00
Gregory Hainaut e1144d7a18 gsdx:hack: add a CRC for SuperMan
Extracted from the GS dump
2015-07-05 14:11:35 +02:00
Gregory Hainaut 8640b44e02 gsdx-hack: implement a hack for SuperMan (need CRC to enable it)
Fix depth issue.

First issue: RT and Depth are located at the same address.
=> solution, just lookup the depth (done for any games)

Second issue: Instead to draw a X,Y rectangle, they draw a 32 pix, 4096 pix
rectangle with a FBW of 1.
=> solution, don't bother just write the depth directly

Please someone add some CRC to enable the code
2015-07-04 10:59:21 +02:00
Gregory Hainaut b9bc5b5c60 gsdx: add UserHacks_ColorDepthClearOverlap to test some new code
debug only
2015-07-03 22:13:35 +02:00
Gregory Hainaut e66aac8ab7 gsdx-hw: add an hidden option to preload the final frame with GS mem data
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
2015-07-01 09:36:53 +02:00
Gregory Hainaut a588f61a8a gsdx: add an assert for unsupported case 2015-07-01 09:36:53 +02:00
Gregory Hainaut 3b127f663b gsdx-tc: trace the texture format to detect texture shuffling
It fixes games that uses 16 bits RT (like snow engine games)
2015-07-01 09:36:53 +02:00
Gregory Hainaut 33c9e9da0a gsdx: new generic OI hack
To clear a (W, H) RT/Depth, GS can only send a (W , H/2) primitive with
a Z (or RT) pointer in the middle of the buffer

Top-half will be cleared by the color (or the depth).
Bottom-half will be cleared by the depth (or the color).

Code isn't enabled yet but it was tested with success on GoW2.
2015-07-01 09:36:35 +02:00
Gregory Hainaut 49516cbbca gsdx-tc: allow to invalidate the depth/target if it is used as target/depth
It is requires when game will uses sometimes an address as a RT sometimes as a depth
2015-07-01 09:30:20 +02:00
Gregory Hainaut 35081f922a gsdx: GS kinds of support draw without framebuffer
Gow uses 24 bits buffer, so only color is updated but blending is configured as Cd
so it is a NOP

In this case, we don't lookup the target in the texture cache. It reduces the complexity
to handle depth which can be located at same address as RT

Note: please test DX renderer
2015-07-01 09:30:20 +02:00
refractionpcsx2 ee9b1caaa4 GSdx-hw: Custom res native mixup stuff, best fix this one too. 2015-06-23 19:43:04 +01:00
refractionpcsx2 ad71ca4cc8 GSdx-hw: Make sure custom resolution doesn't affect Native Resolution 2015-06-22 17:23:47 +01:00
Gregory Hainaut f765a195e2 gsdx: Don't set CRC function pointer when disabled
Less costly than an extra check for each draw calls
2015-06-14 10:27:02 +02:00
Gregory Hainaut 1be8d07f85 gsdx: auto CRC management
Old way various check boxes to configure the plugin

New way an unified drop down list

* Level 0 (dev only) => disable (mostly) all hacks and auto skip depth.
* Level 1 (dev only ) => enable oi/oo/cu hacks, others remains disabled
* Level 2 (GL) => enable most hacks except a couple of one that were fixed on openGL (speed impact)
* Level 3 (DX) => enable all hacks
* Level 4 => enable also aggresive CRC

Note: windows gui must be updated, and it will be nice to create a global tooltip
2015-06-14 10:27:02 +02:00
Gregory Hainaut c6220bf836 gsdx-debug: print an error on unsupported draw call
Typically GTA
2015-06-14 10:27:02 +02:00