Commit Graph

2315 Commits

Author SHA1 Message Date
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
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 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 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
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
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
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
Gregory Hainaut b6693c4345 gsdx dx/gl: fix depth optimization
4th bit is the fog value, not the depth
2016-08-27 13:57:39 +02:00
Gregory Hainaut 411a25b610 Merge pull request #1531 from PCSX2/clang-tidy-empty-instead-of-size
pcsx2|common|gsdx: use empty() instead of .size() ==/!= 0 check
2016-08-26 10:05:01 +02:00
Gregory Hainaut 5a1cb00a07 Merge pull request #1517 from FlatOutPS2/DX
Gsdx alpha test improvement DX
2016-08-25 09:25:19 +02:00
Gregory Hainaut 1fb2c66a21 gsdx ogl: Unscale line
Line thickness will be increased to N pixels (N is the upscaling factor).

Code will also be enabled by UserHacks_unscale_point_line = 1
2016-08-22 18:18:12 +02:00
Gregory Hainaut 018895067b gsdx ogl: restore code to unscale point
enabled by UserHacks_unscale_point_line = 1

Point will be transformed into a NxN square sprite. (N is the upscaling factor)
2016-08-22 18:18:12 +02:00
Gregory Hainaut 1a8825b374 pcsx2|common|gsdx: use empty() instead of .size() ==/!= 0 check
Enhance readability reported by clang tidy
2016-08-21 17:20:13 +02:00
Gregory Hainaut 8ee2d3d367 gsdx: use static assert when possible
reported by clang tidy
2016-08-21 15:22:09 +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 fa826b3167 gsdx tc: check compatible bit when wrote in middle of target
All maths are wrong otherwise. Fix half screen issue in WRC
2016-08-20 11:57:15 +02:00
Gregory Hainaut a49b3c9bf6 gsdx tc: log more stuff on texture cache dirty & frame format 2016-08-20 11:52:22 +02:00
FlatOutPS2 87eed3965e GSDx GSRendererDX code improvement
Replace local copies context and env with m_ prefix originals.
2016-08-19 16:02:49 +02:00
FlatOutPS2 c5cd716c20 Gsdx alpha test improvement DX
Port for the DX renderers of the alpha test improvement for OGL created by gregory38.
2016-08-19 15:59:54 +02:00
Gregory Hainaut 765b68458a gsdx: improve logging
Don't enable UpdateValidity print by default (+20~25% on log size)
Only useful in rare cases
2016-08-17 21:23:06 +02:00
Gregory Hainaut 19ceea4f1e Merge branch 'strict-aliasing' 2016-08-17 18:53:08 +02:00
Jonathan Li d36002a02a gsdx:cmake: Use PNG_LIBRARIES instead of PNG_LIBRARY
PNG_LIBRARIES adds both libpng and zlib to the command line.
PNG_LIBRARY only adds libpng to the linker command line, and the cmake
documentation also suggests not to use it.
2016-08-16 20:35:21 +01:00
Gregory Hainaut fa249a3f78 gsdx ogl: don't rely on the Z value in m_vt
Value seems wrongly rounded and you can't distinguish 0xFFFF from 0xFFFE

Instead check that depth is constant for the draw call and the value from the vertex buffer

Fix recent regression on GTA (and likely various games)
2016-08-16 07:30:52 +02:00
Gregory Hainaut 5c7e2432bd gsdx-ogl: improve alpha test for GTA vice city (letters)
I don't understand why but it seems depth is rounded down even in 16 bits.
So uses 0xFFFE to enable ate_all_color_then_depth in 16 bits format too :)
2016-08-15 11:38:07 +02:00