Commit Graph

250 Commits

Author SHA1 Message Date
Gregory Hainaut 5d49a6b685 gsdx ogl: replace 4 VS shader variation by an AND mask
Perf will be roughly the same. However there is a single VS for all
the HW emulation.
2016-06-01 09:29:56 +02:00
Gregory Hainaut 959abe64f8 gsdx ogl: implement wildhack on the CPU
Speed impact is likely small and the plan is only to keep a single Vertex Shader
2016-06-01 09:29:56 +02:00
Gregory Hainaut 3d192b7f8d gsdx ogl: separate channel code into a separate function 2016-06-01 09:29:56 +02:00
Gregory Hainaut fb26254fbb gsdx ogl: implement a more generic HLE shader for terminator 3
Hopefully without regression for others games
2016-05-29 10:13:43 +02:00
Gregory Hainaut a9c18c57e4 gsdx option: use the new GetConfig* function
v2:
add PSX stuff
ssakash review
2016-05-28 10:07:27 +02:00
Gregory Hainaut 1f4439a89e gsdx: add some notes of potential optimization 2016-05-23 19:38:44 +02:00
Gregory Hainaut a7ba779ba8 gsdx ogl: another HLE channel effect for terminator 3
Same as before but with a different fbmask value (I don't know why but
I have the feeling that I might need the others value too)
2016-05-20 19:55:39 +02:00
Gregory Hainaut 1c21ea955c gsdx ogl: HLE channel effect for terminator 3
Unfortunately I think the game uses another similar effects
2016-05-20 19:45:20 +02:00
Gregory Hainaut e258f3e2fa gsdx ogl: update accurate DATE behavior
* Fast accurate DATE is always enabled, it was faster than standard DATE

* The less fast version is always enabled too. It is likely barely used
  so perf impact will be small on few game that could hit this path.
  Nice rendering has a higher priority

* The "slow" path will depends on the date option.
Note normally it isn't too slow (-10%) if GL_ARB_shader_image_load_store
is supported but AMD crimson is an epic fail.
2016-05-19 10:03:46 +02:00
Gregory Hainaut e776118de9 gsdx-ogl: implement previous DATE optimization in a single shader pass
Faster :) Reduce further the cost of accurate date

The optimization will clear the stencil to 1. So all pixels will have a
single sample that pass both the depth & stencil test. No primitive
overlaps So the destination alpha test can be done directly in the
shader.
2016-05-15 17:44:40 +02:00
Gregory Hainaut 3ab12cef2f gsdx ogl: accelerate special case of accurate date.
Game often uses date to allow a single pixel pass. If this
use case is detected, stencil buffer will be cleared after first pixels
that pass both depth&stencil test.

It seems to reduce the load on the GPU.

Note: with the help of texture barriere, maybe we could implement the algo
with a single pass.
2016-05-15 17:22:58 +02:00
Gregory Hainaut 025be70c42 gsdx-ogl: allow to fallback to a slow accurate DATE when GL_ARB_shader_image_load_store isn't supported
The best is still to have a DX11 generation GPU
2016-05-15 16:29:29 +02:00
Gregory Hainaut 5b061e062c gsdx ogl: replace ClearRenderTarget_i by glClearTexSubImage
Avoid state change, avoid potential texture buffer reallocation

Note: require GL_ARB_clear_texture
2016-05-15 15:55:31 +02:00
Gregory Hainaut 82060320ef gsdx ogl: use draw list size for sprite instead of vertex number to select date algo
Latest overlap detection allow to draw multiple sprite instead of 1,
so the limit based on vertex number is too conservative.
2016-05-15 15:00:52 +02:00
Gregory Hainaut d47d9e5017 gsdx-ogl: fix a minor gcc warning 2016-05-15 13:10:46 +02:00
Gregory Hainaut 4065730e36 gsdx ogl: merge sprite hack take 2
try to detect paving correctly. Avoid to break effect such as Heat effect in Tekken5
2016-05-14 12:24:56 +02:00
Gregory Hainaut 24a673c482 gsdx ogl: avoid special format on the merge sprite hack 2016-05-13 18:28:21 +02:00
Gregory Hainaut 156b6425d2 gsdx ogl: add UserHacks_merge_pp_sprite option to reduce upscaling glitches
For test purpose, it is higly experimental.

So far it is yield interesting result for tekken5
2016-05-10 08:12:07 +02:00
Gregory Hainaut c019f86529 gsdx ogl: add a performance note for a potential channel optimization 2016-05-10 08:11:28 +02:00
Gregory Hainaut 5b04672ba2 gsdx ogl: separate Tales of Abyss/Urban Chaos effect based on the fbmask
Avoid to rely on CRC
2016-05-08 17:31:13 +02:00
Gregory Hainaut ecbcc566fe gsdx ogl: use GT shader for Tourist Trophy 2016-05-07 22:46:41 +02:00
Gregory Hainaut fc86620327 gsdx ogl: disable channel effect when signature is a bit different
Hack to avoid regression on Blood Will Tell
2016-05-07 22:46:41 +02:00
Gregory Hainaut 30b452543a gsdx ogl: tekken5 uses similar effect as Gran Turismo
So just reuse GT hle shader :) Acid stage is now correct. However it might need
some tuning for others stages.
Still look awful with uspcaled resolution (note internal game framebuffer is around 160x128)
2016-05-07 22:46:41 +02:00
Gregory Hainaut d41613c46a gsdx ogl: add a Tales of Abyss HLE shader
Again fast and efficient but it relies on CRC

v2: forget to update the precompiled shader...
2016-05-07 22:46:41 +02:00
Gregory Hainaut 70ee8c5bc4 gsdx ogl: add an HLE brightness/contrast shader for GT series.
It works and it is very fast. But it relies on CRC

Others effect need to be tested as well
2016-05-07 22:46:41 +02:00
Gregory Hainaut d58b71688b gsdx debug: auto GL_POP
Nicer and exception safe

V2: miss definition of vs/ps
2016-05-05 18:53:32 +02:00
Gregory Hainaut 90af611fdb gsdx ogl: Fix channel effect interaction with accurate blending
* Vertex info must be updated before PrimitiveOverlap
* Fix the vertex number (2 not 4)
* add an uint16 cast to shut up Visual Studio
2016-05-02 19:48:11 +02:00
Gregory Hainaut e190841d67 gsdx ogl: improve blending logging 2016-05-02 18:14:02 +02:00
Gregory Hainaut e0581ee771 gsdx ogl: Finalize the urban chaos workaround
Rendering must be nice now
2016-04-30 14:52:53 +02:00
Gregory Hainaut 14e1ed06df glsl: add an HLE shader for Urban Chaos
Pro:
* Replace 140 draw calls into a single one
* No complex texture conversion/lookup
* smaller solution than a generic solution
2016-04-30 14:52:53 +02:00
Gregory Hainaut 7d191ebf8e gsdx tc: load palette for pseudo 8 bits depth
Rendering is still broken but I'm afraid it will need a dedicated shader
2016-04-30 14:52:43 +02:00
Gregory Hainaut b4c7d32741 gsdx ogl: avoid to wrongly detect a channel shuffle 2016-04-30 14:52:43 +02:00
Gregory Hainaut 7a5e1d4154 gsdx ogl: allow to use a separate texture for the channel effect 2016-04-29 17:34:17 +02:00
Gregory Hainaut cb19451418 gsdx ogl: implement RT channel fetch
Fix blending of Metal Gear Solid/KillZone (and potentially other games)

Potentially impact issue #905, #594, #914, #896
2016-04-28 22:56:38 +02:00
Gregory Hainaut eaa4fd41e2 gsdx ogl: improve logging of special effect 2016-04-28 22:56:38 +02:00
Gregory Hainaut f63e38a59e gsdx ogl: as always some games do bad stuff
Let's keep a comment for the moment. I don't know if we need to fix it, neither how.
2016-04-28 19:42:00 +02:00
Gregory Hainaut aeb92592e7 gsdx ogl: use GSUtil::GetClassVertexCount 2016-04-26 19:29:04 +02:00
Gregory Hainaut ad08701cb1 gsdx tc: trick the texture cache to use a depth format for depth texture
This way we avoid the rescaling of the depth buffer and texture allocation.
2016-04-24 22:18:26 +02:00
Gregory Hainaut de38963904 gsdx ogl: plug the new depth sampling in the renderer
Note:
When source format is depth, integral texture coordinate must be used => depth_fmt 1/2/3
2016-04-24 22:18:26 +02:00
refractionpcsx2 dcb676765e GSdx: Clean up some warning under windows (#1289) 2016-04-14 11:00:58 +01:00
Gregory Hainaut 847b57907e Revert "gsdx-ogl: add a new hack to force anisotropic filtering"
This reverts commit 53690cf9d0.

Quoting user:

 For aliasing, the option allow of reduce a little but always very
 visible compared with DX11 even with anisotropic OFF, , furthermore
 many textures bug added with option activated (predictable but not see
 on DX11 with anisotropic ON).

TL;DR doesn't worth it.

Note: it seem to work on DX because DX uses HW texturing in clamp region
mode (and others invalid case). OpenGL uses SW texturing to ensure accuracy
2016-04-10 17:30:49 +02:00
Gregory Hainaut 3f404c8edb gsdx-ogl: update shader pipeline intertace to use vs/gs/ps triplet
Better to have 1 function calls with 3 parameters rather 3 functions call with 1 parameter.
2016-04-10 14:14:30 +02:00
Gregory Hainaut 53690cf9d0 gsdx-ogl: add a new hack to force anisotropic filtering
By default, anisotropic filtering was disabled when textures aren't countinuous.
This hack allows to force it. It can help to reduce aliasing but it would create
unexpected effect on texture boundaries.

Again, someone ought to add the option on Windows too
2016-04-10 13:53:17 +02:00
Gregory Hainaut dfb4b5a339 gsdx-ogl: GL_ARB_texture_barrier is now mandatory
(GL4.5 extension)
2016-04-07 21:51:37 +02:00
Gregory Hainaut 856a12f94f gsdx-ogl: init Render object
CID 147002
2016-03-30 19:56:19 +02:00
Gregory Hainaut bc73195193 gsdx-ogl: pack more tightly the FS UBO
Merge TA vec2 + Af vec1 into a single vec4
2016-03-10 18:29:05 +01:00
Gregory Hainaut bef8447447 Merge pull request #1186 from PCSX2/gsdx-unoptimize-vs
gsdx-ogl: make VS more generic
2016-02-20 10:39:19 +01:00
Gregory Hainaut f8c442cf76 gsdx-ogl: make VS more generic
Texture coordinate could be dummy/float/int integral/int normalized.

Old behavior:
* VS was in charge to select the texture coordinate
* int integral format wasn't supported

New behavior:
* Always compute all formats
* FS will be in charge to select the good format

Impact:
* VS will be slightly slower but it reduces shaders permutation from
   little to 0 (won't be bad for CPU)
* FS speed isn't impacted as 2 separate code paths were already required
  to support both format
* Rasterizer will be 33% slower but unlikely to be the limited factor of
  the GPU
* In future we could directly use the integral format in the FS.

V2: remove useless PSin_t
2016-02-18 19:02:05 +01:00
Gregory Hainaut 0dadc124d3 gsdx-ogl: invert behavior of unsafe user hack
It would be on by default. Unsafe & fast path.

The hack is a security if someone encounters any issue

v2: update Windows gui file
v3: fix typo in tooltip and linux gui
2016-02-18 18:48:13 +01:00
Gregory Hainaut 3f3141c186 GSdx-ogl: limit accurate sprite blending to smaller draw call
Completely restore speed in Zone of Ender

Fix #1093
2016-01-22 09:07:35 +01:00