Commit Graph

20 Commits

Author SHA1 Message Date
Gregory Hainaut 9ba470fc63 gsdx-ogl: properly handle t_float in GS
f8c442cf76 misses the swap of t_float in GS

Fix regression in Okami

Bonus: factorize VS_WILDHACK in the VS
2016-02-21 11:48:30 +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 bdc8038e7e glsl: set a size to gl_ClipDistance array
The purpose is to avoid issue on MS-Intel driver without
a dedicated hack in the compilation.

Code doesn't use it so I suspect others implement to discard the
statement.
2015-08-25 18:58:39 +02:00
Gregory Hainaut bfadd884c9 glsl: expand tab into space
The mix of the 2 was awful
2015-08-22 13:34:02 +02:00
Gregory Hainaut a46c11b088 gsdx-ogl: delete various leftovers 2015-08-22 13:33:32 +02:00
Gregory Hainaut 7002ff3ec3 gsdx-ogl: move texture scale from vs_cb to fs_cb
It avoid useless update of the vs_cb.
2015-08-22 13:33:04 +02:00
Gregory Hainaut ea9e608288 gsdx-ogl: fix texture palette mask 2015-07-17 21:08:49 +02:00
Gregory Hainaut b4c04ed00a gsdx-ogl: wipeout subroutine code
Code was completey bitrotten
Code was a partial test (and yet 500 lines already)
Shader is more and more complex and multithreading support greatly
reduce the cost of shader switch
2015-07-17 21:08:49 +02:00
Gregory Hainaut 91fbe6f108 gsdx-ogl: add some code to fix black netting on some renderings
Code is not yet enabled because it requires extensive test

The idea is to replace point by a 1 pixels sprite with the help of
a geometry shader. In 4x, point will be replaced by a 4x4 sprite.
2015-07-11 14:35:35 +02:00
Gregory Hainaut 5e7ce63ed1 glsl: add a geometry shader to upscale GS_POINT
The purpose is to avoid upscaling issue on POINT rendering (black netting on some FMVs)
2015-07-11 14:35:34 +02:00
Gregory Hainaut 9023f5f0db glsl: drop useless ifndef
I often mix them with the real value...
.
2015-05-08 19:28:17 +02:00
Gregory Hainaut 530e4ce776 gsdx-ogl: drop hack that rescale primitive (to avoid upscale glitch)
Rendering is bad. It renders sprites at native resolution.
2015-05-06 19:09:13 +02:00
Gregory Hainaut eaa0dae305 glsl: drop invariant qualifier
Fix issue #510 and potentially it allows the compiler to  better optimize the code
2015-04-27 18:52:55 +02:00
Gregory Hainaut 46ff4dc3d3 gsdx-ogl: hardware unit only support normalization of 4 bytes...
(At least on recent AMD GPU)
2015-04-27 18:51:59 +02:00
Gregory Hainaut 301fe869c7 glsl: improve the logz handling
This way only 0 and 1 will conflict
2015-04-26 17:51:33 +02:00
Gregory Hainaut 6a3250cad2 gsdx-ogl: fix logz management (FFXII)
The issue is that z+1 overflow if z is UINT max
log2(z) overflow if z is 0

So let's use an or 1 to avoid both overflow
2015-04-25 20:23:26 +02:00
Gregory Hainaut 36514bd95f glsl: fog is a single byte
Give a chance to the driver to optimize if possible
2015-04-24 21:37:37 +02:00
Gregory Hainaut 62489f42f1 gsdx-ogl: add an optimization note for later
Only 1 byte of fog is useful
2015-04-20 07:18:09 +02:00
Gregory Hainaut 31f8c065db gsdx-ogl: implement a new hack UserHacks_UnscaleSprite for opengl
UserHacks_UnscaleSprite = 1 will unscale flat sprites
UserHacks_UnscaleSprite = 2 will unscale all  sprites (don't work well so far)

The idea of the hack is to redo the interpolation of texture coordinate
based on the non-upscaled pixel position.

It avoids various glitches but sprites aren't upscaled anymore (so no
more anti-aliasing, potentially a coefficient can be added).
2015-04-20 07:18:08 +02:00
Gregory Hainaut 16e6d0d305 glsl: move shader into a separate directory
Only keep glsl_source.h for clarity
2015-04-19 18:49:02 +02:00