Commit Graph

2621 Commits

Author SHA1 Message Date
refraction 4914620178 GSDX: Fix for 6x Native, fixed GH3 in native mode taking up quarter of the screen after the snowblind changes 2015-06-01 19:04:39 +01:00
Gregory Hainaut 2cbde89084 Merge pull request #555 from PCSX2/real-fb-format
GSdx: better framebuffer format
2015-06-01 11:48:07 +02:00
Gregory Hainaut f81cf360bc Merge pull request #545 from PCSX2/gsdx-half-screen-snow-engine
Gsdx half screen (most of) snow engine games
2015-06-01 11:47:40 +02:00
Gregory Hainaut 9fa473a57d gsdx-ogl: glDebugMessageCallback is optional
Not even used in release build
2015-05-31 17:55:34 +02:00
Gregory Hainaut 9d69ff1f91 gsdx-debug: create the savef option
The idea is to easily extract bad frame from gs dump and to compare them
with the sw renderer.

Here the summary of the options:
savet => dump all input textures
save  => dump the render target
savez => dump the depth buffer
savef => dump the frame
2015-05-31 17:38:52 +02:00
Gregory Hainaut d301848848 gsdx-ogl: fix paltex on opengl
RT uses as palette must use the alpha channel

Palette texture uses the red channel
2015-05-30 19:01:09 +02:00
Gregory Hainaut 2f2ae2bc89 gsdx-ogl: enable gl tracing on windows
Trace info is enabled in dbg/dev build for the opengl renderer

Info is stored in GSdx_opengl_debug.txt when debug_opengl option is 1
2015-05-30 09:58:47 +02:00
Gregory Hainaut 009dd103ae gsdx-ogl: protect the trace with if statement
And mark the function as optional
2015-05-30 09:58:46 +02:00
Gregory Hainaut a639634769 gsdx-ogl: actually code use 4.0 GL_ARB_draw_buffers_blend
It is used for glBlendEquationSeparateiARB && gl_BlendFuncSeparateiARB

The 3.0 function could work too. It just need to be added
2015-05-30 09:58:46 +02:00
Gregory Hainaut 92d68b70d3 gsdx-ogl: add a performance note for later
The idea will be to replace StretchRect for standard case with a framebuffer
blit. Potentially it toggles less gl state.

Worth a test on Star Ocean 3 that uses a lots this function for stencil emulation
2015-05-30 09:58:46 +02:00
Gregory Hainaut 01e4a5148d gsdx-ogl: avoid crash in debug/dev build
Don't be silly, don't put gl trace in EE thread.
2015-05-29 16:50:27 +02:00
Gregory Hainaut 0cb6c37f14 gsdx-tc: add an explanation of the magic number 0x140 2015-05-29 12:27:05 +02:00
refraction 97b237712c gsdx: detect RT size based on fb size and gs output configuration
* It is required for snowbling games
* Targets of Texture cache are dropped.
2015-05-29 12:26:44 +02:00
Gregory Hainaut 02274601b3 gsdx-ogl: always copy texture into 0,0 2015-05-29 12:18:54 +02:00
Gregory Hainaut e5326d1bd2 gsdx-tc: allow to reuse the right part of large RT as source 2015-05-29 12:18:54 +02:00
Gregory Hainaut 7ac533a4d1 gsdx-tc: invalidate half-RT src
snow engines uses the RT as 2 half RT.
2015-05-29 12:18:54 +02:00
Gregory Hainaut da0b77e09b gsdx-ogl: new logo
Thanks bmate for the logo.

Close issue #192
2015-05-29 11:05:52 +02:00
refraction 8f54da5fd3 GSDX: Removal of Nvidia hack.
- Hack no longer required as an option as a safe and simple workaround has been discovered which seems to work without modifying any vertices.
2015-05-28 21:41:02 +01:00
refraction 5d00c00826 GSDX: Fixed UserHacks_AutoSkipDrawDepth dialog creation on windows.
- CheckDlgButton was just wrong
- Changed tag to say "Auto-skip depth" as you could only see "Auto-skip draw" which was highly ambiguous on GSDX!
2015-05-28 21:21:19 +01:00
Gregory Hainaut 31ffdd8c53 Merge pull request #559 from ssakash/patch-5
Auto depth skip hack initialization.[GUI]
2015-05-28 19:21:45 +02:00
Gregory Hainaut 8e32d71c07 Merge branch 'patch-3' of git://github.com/ssakash/pcsx2 into ssakash-patch-3 2015-05-28 18:30:49 +02:00
Akash 5f7e09268c change "D3D Internal Resolution" to "Internal Resolution" 2015-05-28 16:33:16 +05:30
Akash bf743fec17 add logo for Opengl renderer. 2015-05-28 01:34:51 +05:30
Gregory Hainaut c43ddaec4f gsdx: add Castlevania hack explanation 2015-05-26 17:03:13 +02:00
Gregory Hainaut 419dfe0544 glsl: redo color/alpha management correction
Please test it!

GS supports 3 formats for the output:

32 bits: normal case
=> no change

24 bits: like 32 bits but without alpha channel
=> mask alpha channel (ie don't write it anymore)
=> Always uses 1.0f as blending coefficient

16 bits: RGB5A1, emulated by a 32 bits openGL texture. I think it will be more correct to use
a real 16 bits GL texture. Unfortunately it would cost several (slow) target conversions.
Anyway as a current solution
=>  apply a mask of 0xF8 on color when SW blending is used (improve Castlevania shadow)
unfortunately normal blending mode still uses the full range of colors!

This commit also corrects a couple of blending factor. 128/255 is equivalent to 1.0f in PS2, whereas GPU uses 1.0f. So the blending factor must be 255/128 instead of 2

Note: disable CRC hack and enable accurate_colclip to see Castlevania shadow ^^
(issue #380).
Note2: SW renderer is darker on Castlevania. I don't know why maybe linked to the 16 bits format poorly emulated
2015-05-26 16:49:43 +02:00
Akash ef3247c233 Update copyright license 2015-05-26 19:15:30 +05:30
Akash 99f9407c24 Auto depth skip hack initialization. 2015-05-26 19:13:56 +05:30
Gregory Hainaut 9ee3a173d0 gsdx-ogl: use a local ALPHA register
It would allow to easy tune the parameter to support 24 bits format
2015-05-26 15:36:48 +02:00
Gregory Hainaut d31bd97d59 gsdx-ogl: add a variable to select FB output
Either 32bits/24bits/16bits
2015-05-26 14:59:07 +02:00
Gregory Hainaut 93c0d5a268 gsdx-ogl: add an error message when a RT is reused with a format cast
For example a 32 bits RT could be used as a 16 bits RT.

It is likely the source of various bug in HW renderer
2015-05-26 11:16:49 +02:00
Gregory Hainaut a3bbe68d56 gsdx: throw an exception when we miss a mandatory gl feature
Gracefully quits when driver is not supported
(like nvidia legacy driver for GTX260)

Please test the impact on windows
2015-05-26 11:03:59 +02:00
Gregory Hainaut 3be5a6036b gsdx-ogl: remove assertion + debug message
opengl use a different object to compute the vertex count
2015-05-26 11:03:59 +02:00
refraction b84a462798 Unreachable code message was annoying me. 2015-05-26 00:30:12 +01:00
Gregory Hainaut 2704a65f57 gsdx: add some info for Star Ocean3/Valkyrie Profile 2/Radiata Stories
Feel free to test those games with CRC disabled on the openGL renderer (native resolution)
2015-05-25 12:37:48 +02:00
Gregory Hainaut 580d177951 gsdx: improve commit 11708486d8
This time linear filtering is disabled only for the bad draw call
(RT used as a palette texture).
2015-05-25 09:46:51 +02:00
Gregory Hainaut 99d7434671 gsdx-ogl: disable SSO on nouveau 2015-05-24 19:24:10 +02:00
Gregory Hainaut 11708486d8 gsdx: allow to control the filtering of texture cache
When the RT is used as an input texture, we need to rescale it.

Previous behavior was to always uses a linear filtering (more smooth).
Unfortunately it broke some games that expected an exact value like Star Ocean 3

This commit will disable the linear filtering in normal filtering mode (filter = 0
or filter = 2)

This way, shadow of Star Ocean 3 will appear correctly in upscaling (not
100% perfect but can't do better)

Note: SO3 only requires a nearest sampling of the alpha channel but
I don't know the behavior for others games.
2015-05-24 18:59:27 +02:00
Gregory Hainaut b0af54d33e gsdx-ogl: better support of palette
The purpose of the code is to support alpha channel
of RT uses as an index for a palette texure.

I'm afraid that code will likely break pure palette texture. Only used
if paltex is enabled

It fixes missing shadow in Star Ocean 3 (issue #374) in Native resolution
with filter = 0  (no filtering) or = 2 (normal fitering)

Rendering explanation:
The game emulates a stencil buffer with the alpha channel

The alpha channel of the RT can contains a palette texture index (format 4HH)
The idea is to have a gradient of value in the palette (16/32/48/...).
This way you can implement a +16/-16 and even wrap the alpha value every time
you hit the pixel.

Bilinear filtering breaks the rendering because it interpolates between counts
so you doesn't have the exact count

Upscaling breaks the rendering because the RT is reused as an input texture. It means
that we need to scale it down which again create some interpolations.
2015-05-24 18:07:16 +02:00
Gregory Hainaut 951a1fed94 gsdx-hack: enable auto skip of depth texture for God of War
Rendering is quite complex to emulate on the GPU due to several limitation.
Until we find a solution let's enable the old solution

You could find a description of the rendering here:
http://forums.pcsx2.net/Thread-God-of-War-Red-line-rendering-explained
2015-05-24 13:43:36 +02:00
Gregory Hainaut a70c3bf5de glsl: correct the alternate implementation of ps_main1
Still not yet enabled by default

Potentially it can be optimized with the dot product but special care
need to be taken to ensure float accuracy.

Bonus: it could work on old GPU (aka DX9)
2015-05-24 13:43:36 +02:00
Gregory Hainaut c82fd94c6c gsdx-debug: use GL_INS instead of printf 2015-05-24 13:43:36 +02:00
Gregory Hainaut c01686d252 gsdx-png: add a fixme message for 16 bits by channel image 2015-05-24 12:51:20 +02:00
Gregory Hainaut 7f614401a6 gsdx-ogl: set accurate_blend as default
Rendering is better and I think speed impact remains small.
2015-05-23 15:10:04 +02:00
Gregory Hainaut c507e816c2 gsdx-ogl: oups forget a break 2015-05-23 13:06:23 +02:00
Gregory Hainaut b884e0c0c0 gsdx-debug: improve debug experience
* Dump context before the increase of s_n
  => aligned with the global call number
* Don't print colclip not supported when it is optimized away
* dettach the input texture when it is useless
  => avoid to show a wrong texture in the debugger
2015-05-23 12:23:05 +02:00
Gregory Hainaut f665180d11 gsdx-debug: use hex number for texture pointer
Easier to grep
2015-05-23 12:20:26 +02:00
Gregory Hainaut 7609fdc576 gsdx: rename too much sr to sRect 2015-05-21 09:48:15 +02:00
Gregory Hainaut b52ee6f1f6 gsdx-linux-gui: add an option for accurate color clipping
Note: it is only for debug purpose

Sotc testcase 187 fps => 125 fps (2x scaling)
2015-05-20 09:42:22 +02:00
Gregory Hainaut 183af4ece6 gsdx-ogl: don't enable SW blending when there is no blending
Mostly to avoid useless message
2015-05-20 09:36:01 +02:00
Gregory Hainaut 3d35e4f8ec gsdx-ogl: implement all blends mode in shader
+ 250 lines !!!
2015-05-20 09:11:36 +02:00