Commit Graph

2842 Commits

Author SHA1 Message Date
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 ad86bb5faa gsdx-tc: clear 32 bits state after vsync
Avoid issue on game that uses only 16 bits RT
2015-07-09 23:03:55 +02:00
Jonathan Li bff1b2a3bf GSdx: Show plugin info in title bar when paused
When GSdx is paused by opening the config panel, GSdx does not pass any
info back to PCSX2. Pass the plugin name and renderer even when paused.
2015-07-09 16:11:26 +01: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
Gregory Hainaut 345efed473 Merge pull request #633 from ssakash/patch-22
Update the variable name and region of the CRC hack used for Superman
2015-07-07 15:27:08 +02:00
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 986754bde7 glsl: don't declare gl_FragDepth
Fix compilation issue on Mesa driver

(hope it doesn't break Catalyst)
2015-07-05 18:12:36 +02:00
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 95e1cd9ea8 gsdx-tc: don't considerer frame as a 32 bits RT
Frame is always 32 bits but game can reuse it later as a 16 bits RT.

Fix half screen issue with Ricky Ponting Cricket

Unfortunately it triggers texture shuffle wrongly. I hope there is no
regression.
2015-07-04 11:00:32 +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 0a07762f6b gsdx-tc: only track 32 bits fmt if the texture is not a palette fmt
Fix a regression on ricky ponting cricket (texture shuffle was triggered without any valid reason)
2015-07-03 23:04:48 +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 621d1d93db gsdx-linux: drop the logz option
logz will only enabled if GL_ARB_clip_control is not found.

Note: logz will likely break depth support. Be sure to use a recent driver
2015-07-03 21:29:49 +02:00
Gregory Hainaut 82ed6eac13 gsdx-linux: remove alpha hack from the GUI
Normally you don't need it anymore on OpenGL :)

You can still use this option from the ini file for debug purpose
2015-07-03 21:24:17 +02:00
Gregory Hainaut abec4bd760 gsdx-ogl: don't enable aout when using accurate fbmask 2015-07-03 21:21:56 +02:00
Gregory Hainaut d71b2c1ded gsdx: update accurate fbmask tooltip 2015-07-03 21:21:08 +02:00
Gregory Hainaut 4dbe71cba8 gsdx-ogl: disable SW blending when running DATE GL42
// GL42 interact very badly with sw blending. GL42 uses the primitiveID to find the primitive
// that write the bad alpha value. Sw blending will force the draw to run primitive by primitive
// (therefore primitiveID will be constant to 1)
2015-07-03 20:34:52 +02:00
Gregory Hainaut 705c88f193 gsdx-ogl: disable blending when cleaning integer texture
Avoid a warning message on Nvidia
2015-07-03 20:26:56 +02:00
Gregory Hainaut c6f026ee68 gsdx-tc: keep 32 bits status when converting from/to depth
Partially fix conan effect
2015-07-03 19:02:44 +02:00
Gregory Hainaut 0c12f232ca gsdx-ogl: don't write depth in first step of DATE 42
Fix shadows in Fifa
2015-07-02 21:08:47 +02:00
refractionpcsx2 193f47ebb1 Merge pull request #616 from ssakash/patch-22
swap value functions for Round sprite hack.
2015-07-02 19:33:03 +01:00
Gregory Hainaut 28815db7cc gsdx: fix depth option 2015-07-02 19:13:38 +02:00
Akash 6f515b220e update the description text 2015-07-02 01:39:55 +05:30
Gregory Hainaut de644c5437 Merge pull request #628 from PCSX2/gsdx-depth-and-16-bits-support
Gsdx 1.0
2015-07-01 20:50:09 +02:00
Gregory Hainaut cd8e31d85f gsdx-ogl: always copy date to offset 0,0
Fix snow engine game on driver that don't support yet GL_ARB_copy_image
(Mesa drivers)
2015-07-01 18:27:20 +02:00
Gregory Hainaut 831c24de51 gsdx-dx: only enable new code when CRC is below FULL level
Code is not ready. It allow to test the new code without a massive
regression
2015-07-01 09:36:54 +02:00
Gregory Hainaut 074881228d gsdx:comment: small explanation of the half offset hack 2015-07-01 09:36:54 +02:00
Gregory Hainaut 76f96ddbb6 gsdx-tooltip: MSAA is not implemented on OpenGL 2015-07-01 09:36:54 +02:00
Gregory Hainaut 50c9988018 gsdx-ogl: disable all accurate options when not supported + No Intel support on windows 2015-07-01 09:36:54 +02:00
Gregory Hainaut a9f49ab9ab glsl: fix rounding error for shadow computation
Better shadow on Castlevania/Nemo (others :) )
2015-07-01 09:36:54 +02:00
Gregory Hainaut d46e41533d gsdx: remove various CRC of the openGL level
It is mostly the texture shuffle effect which is now emulated correctly on openGL

They remain in the Dx level as speedhack in particular for
    * Castlevania;
    * GodOfWar;
    * StarOcean3;
    * ValkyrieProfile2;
    * RadiataStories;

Remove old commented hack: Drakengard2, ArctheLad, ReZ

Separate hacks that are only enabled in aggressive mode
2015-07-01 09:36:54 +02:00
Gregory Hainaut be1403cdc2 gsdx-ogl: support texture shuffling on !FST
Mostly fix "Finding Nemo"

It remains a shadows issue when you enable accurate_fbmask and depth
2015-07-01 09:36:54 +02:00
Gregory Hainaut beafbd9768 gsdx: add a warning for the future 2015-07-01 09:36:54 +02:00
Gregory Hainaut 6121677aa1 gsdx-tc: use a single shader pass to convert texture in 8 bits format
It might save a couple of fps

Add a define to test the perf if we keep only the blue channel. It brokes
the code in Prince Of Persia that use the Red/Green channel... Maybe the
speed hack :( Or find a way to replace all if with a lookup table

Note: it is only supported on OpenGL currently
2015-07-01 09:36:54 +02:00
Gregory Hainaut 2ecca529d1 gsdx-tc: log dirty target 2015-07-01 09:36:54 +02:00
Gregory Hainaut e2727f10ba glsl: fix for AMD
I hope :)
2015-07-01 09:36:54 +02:00
Gregory Hainaut 2af7dcbda2 gsdx-tc: GPU accelerate 8 bits texture when upscaling is enabled
Code unscale the texture to ease the conversion. Quality is awful (same as before)
but I'm not sure we can support an upscaled texture

Maybe the quality loss is due to the reduction without mipmap

Maybe the best solution will be to add an hack to extract the blue channel
(with texture swizzle), and uses a "full page/screen" spirte instead.
(it would be faster too)

Note: won't be compatible with MSAA (but gl doesn't support it anyway)
2015-07-01 09:36:54 +02:00
Gregory Hainaut 6ca7a802bf gsdx-tc: add a big comment to explain the scaling of src in TC 2015-07-01 09:36:54 +02:00
Gregory Hainaut d29e375f72 gsdx-tc: GPU accelerate 8 bits texture conversion
Only native is supported currently
2015-07-01 09:36:54 +02:00
Gregory Hainaut a8bcc760b4 gsdx-tc: only clean RT in openGL
It is a debug feature for myself
2015-07-01 09:36:54 +02:00
Gregory Hainaut 3f6edc39cf gsdx-linux-gui: update option
Add mipmap for SW
Add tc depth for HW

Remove nvidia MT, always on
2015-07-01 09:36:54 +02:00
Gregory Hainaut db5468afcf glsl: fix shadow on Shin Megami Tensei Nocturne 2015-07-01 09:36:54 +02:00
Gregory Hainaut 61a717db14 gsdx-tc: clean the RT in debug build
// In theory new textures contain invalidated data. Still in theory a new target
// must contains the content of the GS memory.
// In practice, TC will wrongly invalidate some RT. For example due to write on the alpha
// channel but colors is still valid. Unfortunately TC doesn't support the upload of data
// in target.
//
// Cleaning the code here will likely break several games. However it might reduce
// the noise in draw call debugging. It is the main reason to enable it on debug build.
//
// From a performance point of view, it might cost a little on big upscaling
// but normally few RT are miss so it must remain reasonable.
2015-07-01 09:36:53 +02:00
Gregory Hainaut 99b03b4632 gsdx-debug: log all write (texture) from the EE
It is verbose but it might help to understand the invalidation of texture
2015-07-01 09:36:53 +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 a751db5f2b gsdx-ogl: merge 2 log (too verbose otherwise) 2015-07-01 09:36:53 +02:00
Gregory Hainaut 85543db094 gsdx-tc: trace the alpha channel update in TC
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
2015-07-01 09:36:53 +02:00
Gregory Hainaut 4a65e5e723 gsdx-tc: don't try to read a 0 pixels texture
"Regression" introduced in 8 bits RT support

The case appears when
1/ address of RT is the same as input texture
2/ input format is 8 bits
3/ previous lookup of RT was miss
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 9802ba6621 gsdx-tc: add support of pseudo 8 bits RT conversion
Code is obviously slow but at least it works.

It fixes the blur effect of VP2
2015-07-01 09:36:53 +02:00
Gregory Hainaut 77e718c61f gsdx: disable linear interpolation when converting texture in texture cache
It avoid various upscaling glitches on GS post-processing effect

// 1/ Palette is used to interpret the alpha channel of the RT as an index.
// Star Ocean 3 uses it to emulate a stencil buffer.
// 2/ Z formats are a bad idea to interpolate (discontinuties).
// 3/ 16 bits buffer is used to move data from a channel to another.
//
// I keep linear filtering for standard color even if I'm not sure that it is
// working correctly.
// Indeed, texture is reduced so you need to read all covered pixels (9 in 3x)
// to correctly interpolate the value. Linear interpolation is likely acceptable
// only in 2x scaling
//
// Src texture will still be bilinear interpolated so I'm really not sure
// that we need to do it here too.
//
// Future note: instead to do
// RT 2048x2048 -> T 1024x1024 -> RT 2048x2048
// We can maybe sample directly a bigger texture
// RT 2048x2048 -> T 2048x2048 -> RT 2048x2048
// Pro: better quality. Copy instead of StretchRect (must be faster)
// Cons: consume more memory
//
// In distant future: investigate to reuse the RT directly without any
// copy. Likely a speed boost and memory usage reduction.
2015-07-01 09:36:53 +02:00
Gregory Hainaut ae3b768de9 bump gsdx version to 1.0.0 2015-07-01 09:36:53 +02:00
Gregory Hainaut 839003467e gsdx-ogl: add support of partial frame buffer masking
It might help to fix a bit the color on a couple of games

accurate_fbmask = 1

Code uses GL4.5 extensions. So far it seems the effect is ony used a couple
of time and often in non-overlapping primitive. Speed impact will likely remain small
2015-07-01 09:36:53 +02:00
Gregory Hainaut 87f54ae0ff gsdx: report error on unsupported case in texture cache
It seems to impacts lots of games that still have issue (VP2, MTG3, PoP)

The PSMT32 format is read a PSMT8. I think we need to convert it as PSMT8H (i.e.
unpack it to have only an alpha channel)
2015-07-01 09:36:53 +02:00
Gregory Hainaut 82818dab3c gsdx-ogl: make some room in AlphaCoefficient variable
The idea will be to use the remaining int to store the FB mask
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 42e911c78f gsdx-ogl: mask alpha channel in depth conversion
Might not work if depth is recasted as a rt (we lost the alpha channel)
2015-07-01 09:30:20 +02:00
Gregory Hainaut 05c72980fc gsdx: avoid to detect PSMT8H as 16 bits 2015-07-01 09:30:20 +02:00
Gregory Hainaut b62a2d6a3c gsdx-debug: dump texture in 32 bits when a shuffing effect is detected
Otherwise it is unreadable
2015-07-01 09:30:20 +02:00
Gregory Hainaut 6b5a3dedd9 gsdx-debug: add the format in texture cache logging 2015-07-01 09:30:20 +02:00
refractionpcsx2 955fc3aa35 GSdx-DX: Mirror round value change from OGL 2015-07-01 09:30:20 +02:00
refractionpcsx2 af09d7e063 GSdx-DX: Modified shader slightly as some bits were incorrect. 2015-07-01 09:30:20 +02:00
Gregory Hainaut 7ee3dbd615 gsdx-tc: use the virtual function to check the state
This ways it will be disabled for dx
2015-07-01 09:30:20 +02:00
refractionpcsx2 de189b67a2 GSdx: Add option to toggle Texture Cache Depth support.
- Forced off for DX currently to save fallover.
2015-07-01 09:30:20 +02:00
refractionpcsx2 2dc4e2a04c GSdx: Gave accurate blend option an extra state, can now do super accurate blending from the GUI 2015-07-01 09:30:20 +02:00
Gregory Hainaut c925b1d135 gsdx-tc: support GS mem to depth buffer transfer
Please test SMT games

(issue #572)
2015-07-01 09:30:20 +02:00
refractionpcsx2 4bc8bfc23e GSdx-DX: Rough port of texture switching from OGL 2015-07-01 09:30:20 +02:00
Gregory Hainaut 58ce7d4bb8 gsdx-ogl: emulate texture shuffle
GS doesn't supports texture shuffle/swizzle so it is emulated in a
complex way.

The idea is to read/write the 32 bits color format as a 16 bit format.
This way, RG (16 lsb bits) or BA (16 msb bits) can be read or written with
square texture that targets pixels 1-8 or pixels 8-16.
However shuffle is limited. For example you can copy the green channel
to either the alpha channel or another green channel.

Note: Partial masking of channel is not yet implemented

V2: improve logging
V3: better support of green channel in shader
V4: improve detection of destination (issue due to rounding)
2015-07-01 09:30:20 +02:00
Gregory Hainaut 2d812deb84 gsdx-tc: Depth and Target are interchangeable on the GS !!!
Extend the texture cache to search Color target in Depth target
2015-07-01 09:30:20 +02:00
Gregory Hainaut 76160505f7 gsdx-tc: add an option to avoid blow up dx :p
texture_cache_depth = 1 (default for openGL)
2015-07-01 09:30:20 +02:00
Gregory Hainaut 74d84aafb5 gsdx-tc: allow to search the depth in the old target list
Yes it is possible on PS2 world
2015-07-01 09:30:20 +02:00
Gregory Hainaut b59a347ad7 gsdx-tc: allow to use depth buffer as input texture 2015-07-01 09:30:20 +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
Jonathan Li b96609cb51 onepad: fix possible dereference of deleted pointer
onepad will dereference conf after it has been deleted if a PADinit,
PADshutdown, PADinit sequence takes place.
2015-06-29 20:53:00 +01:00
refractionpcsx2 c659b1aa18 Merge pull request #617 from ssakash/patch-26
Console log message for current renderer.
2015-06-28 13:24:09 +01:00
bositman 59a66f87c3 Merge pull request #611 from turtleli/fix-toggling
Fix renderer toggling behavior and other related stuff
2015-06-26 16:34:02 +03:00
Gregory Hainaut 0c2dcf26f2 Merge pull request #598 from turtleli/wxwidgets3_prep
Changes to make transition to wxWidgets3.0 on Windows easier
2015-06-26 15:18:13 +02:00
Jonathan Li acc6ad59ba GSdx: Use correct renderer after config change
Rework the renderer selection logic to reload the saved renderer after
it's been changed in the config panel and to properly detect whether a
renderer toggle has been requested.
2015-06-26 00:50:07 +01:00
Akash 4b472bb461 Console log message for current renderer. 2015-06-25 20:15:45 +05:30
Akash 1d4dff9e42 Remove break statement (return already ends the function execution) 2015-06-25 19:48:22 +05:30
Gregory Hainaut f3c0c1bb88 gsdx-ogl: TexParamami is provided in core 2015-06-25 10:25:57 +02:00
refractionpcsx2 42b1f81b8e dev9ghzdrk: I've got a good idea, lets not match the host mac ;) 2015-06-24 23:42:28 +01:00
refractionpcsx2 cc6ebff48e dev9ghzdrk: Update the virtual_mac too (bridged?) Won't hurt either way! 2015-06-24 22:14:50 +01:00
Gregory Hainaut 8393ba56d6 gsdx-ogl: rework palette texture handling
Redirect the red channel to alpha channel for 8 bits texture.

It avoid special management in the shader
2015-06-24 19:50:09 +02:00
Gregory Hainaut cd4c8b5ce4 gsdx-debug: resolve alpha equation in the dump file 2015-06-24 19:42:53 +02:00
refractionpcsx2 819133ee45 dev9ghzdrk: Make the MAC truely unique, fixes issue #552
-Version bump to reflect the awesomeness
-Put most of the mac variables in one place (not that they do much)
2015-06-24 01:36:01 +01:00
refractionpcsx2 ee9b1caaa4 GSdx-hw: Custom res native mixup stuff, best fix this one too. 2015-06-23 19:43:04 +01:00
Akash 85c4184ea5 swap value functions for Round sprite hack. 2015-06-23 20:07:46 +05:30
refractionpcsx2 ad71ca4cc8 GSdx-hw: Make sure custom resolution doesn't affect Native Resolution 2015-06-22 17:23:47 +01:00
bositman eb0f6eb953 Merge pull request #607 from TheLastRar/dev9settings
dev9ghz: Use .ini for saving settings and delete old registry keys
2015-06-22 17:35:37 +03:00
TheLastRar dcd477f2b6 dev9ghz: Look in registry for settings first
If settings found in the registry, create ini, fill with settings and
then delete the settings stored in the registry.

If no settings found in registry, load from ini.
2015-06-22 15:13:18 +01:00
Gregory Hainaut 7135867119 gsdx: very old typo on option name
Windows uses Renderer with an uppercase R
2015-06-20 16:18:10 +02:00
Jonathan Li 283d4fa57c Use wc_str for Windows only code
This fixes the build for wxWidgets 3.0. The paths are Windows specific,
so c_str and WX_STR already evaluate to a wide string in wxWidgets 2.8.
2015-06-19 22:14:47 +01:00
TheLastRar 0be0f13acf dev9ghz: delete leftover registry keys 2015-06-19 15:46:51 +01:00
TheLastRar 0d04ee440d dev9ghz: fix a typo... 2015-06-19 15:39:49 +01:00
Gregory Hainaut b44bccec6a gsdx: fix previous commit with a scaling factor 2015-06-18 23:02:40 +02:00