Commit Graph

1460 Commits

Author SHA1 Message Date
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
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
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
Gregory Hainaut f3c0c1bb88 gsdx-ogl: TexParamami is provided in core 2015-06-25 10:25:57 +02: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 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 7135867119 gsdx: very old typo on option name
Windows uses Renderer with an uppercase R
2015-06-20 16:18:10 +02:00
Gregory Hainaut b44bccec6a gsdx: fix previous commit with a scaling factor 2015-06-18 23:02:40 +02:00
Gregory Hainaut 5bc8f046b2 gsdx: fix snow engine issue in native resolution 2015-06-18 21:21:25 +02:00
Karasuhebi 4d1ca4bb76 Changes in title bar: DX -> D3D
Changed the name of the Direct3D renderers so they would match the way
they are named in GSdx's Plugin Settings window. Also changed a printf
to say OpenCL instead of opencl.
2015-06-18 13:00:29 -04:00
Gregory Hainaut ab6f26ff4d Merge pull request #606 from turtleli/gsdx-title-renderer
GSdx: Add renderer type to title bar
2015-06-18 09:49:26 +02:00
refractionpcsx2 f5e8503fa5 GSdx: Didn't need to change this :P 2015-06-17 22:41:16 +01:00
refractionpcsx2 c31c04d3db GSdx: Fix CRC hacks not re-initialising after option change 2015-06-17 22:25:43 +01:00
refractionpcsx2 0b5e0df35d Epic fail Visual Studio! 2015-06-17 22:11:06 +01:00