Commit Graph

324 Commits

Author SHA1 Message Date
Gregory Hainaut 3234c8241b gsdx ogl: massively extend glsl self test
* Support Mesa Nouveau IR (free driver for Nvidia's GPU)
  => Print intermediate representation + final shader
  => Dump GPR usage
* Move dumped shader in /tmp/GSdx_Shader/<sub_dir>
  =>  Avoid the landing of 3 thousands of files in $PWD ^^
* Use function instead of macro
2016-06-11 13:34:37 +02:00
Gregory Hainaut 1c8de02c8d gsdx ogl: trace shader permutation
Too much permutation is bad for driver performances
2016-06-11 13:34:23 +02:00
Gregory Hainaut fca2661e05 gsdx ogl: add a pretty name to various opengl opengl 2016-06-09 18:27:58 +02:00
Gregory Hainaut 7202cac7d0 gsdx ogl: remove the dual source blending workaround 2016-06-01 21:00:29 +02:00
Gregory Hainaut 08a8bfa76c gsdx ogl: plug new program compilation for bad driver 2016-06-01 21:00:29 +02:00
Gregory Hainaut 405f312fe8 gsdx ogl: format GSShader code
Move the Geometry Shader to the call of the function
2016-06-01 21:00:29 +02:00
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 f7ddd488e1 gsdx ogl: Extend uniform buffer with channel parameter
Instead to use the standard ps ubo which is used every draw call.
I reused a barely used buffer to reduce the extra cost of the upload
2016-05-29 10:13:43 +02:00
Gregory Hainaut 6f19d928f6 gsdx ogl: use the new uniform cache upload method 2016-05-29 10:13:43 +02:00
Gregory Hainaut 179681ef18 gsdx ogl: enable AMD driver blending workaround only on latest legacy driver
Legacy GPU:
Older driver will be broken.

Still supported GPU:
Please upgrade to the latest AMD driver 16.5.2 or 16.5.3 (and prey that future driver will still work)
2016-05-28 18:43:55 +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 99476f4b13 gsdx ogl: explain better previous clear vs framebuffer comment 2016-05-16 16:49:18 +02:00
Gregory Hainaut 1522cba5b0 gsdx ogl: performance note of texture clear vs framebuffer clear
In case of render target. FB clear is better
2016-05-16 10:38:47 +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 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 c054b097e9 gsdx ogl: fix wrong depth clear
If a color buffer is still attached and is smaller than depth buffer,
the latter won't be fully cleared.

As a faster alternative, use GL4.4 clear texture function. Avoid to fiddle with
framebuffer and pixel tests.

Fix #1362x Ar Tolenico 2 map clip
2016-05-15 14:57:37 +02:00
Gregory Hainaut 913e3d65d2 gsdx ogl: use glViewportIndexedf and glScissorIndexed 2016-05-14 17:18:16 +02:00
Gregory Hainaut cd9ee3c468 gsdx ogl: emulate GL_ARB_draw_buffers_blend and GL_ARB_viewport_array
New functions only set the parameter to a single buffer whereas old function
set all buffers
2016-05-14 17:15:30 +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 e890ce989c gsdx: throw oom exception + error
Texture can't be NULL anymore, so we can remove a couples of check
2016-05-05 18:53:51 +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 5948c2d8cd gsdx AMD: broken for broken
Until AMD release the driver with a fix, I can't use 2nd blending source with SSO.

So let's use the first source. Blending/Alpha will be wrong. But it is likely better
than an uninitialized alpha value.
2016-05-05 12:24:55 +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 c445a14c46 gsdx ogl: extend shader to lookup a single channel 2016-04-28 22:56:38 +02:00
Gregory Hainaut fda511a949 gsdx glsl: extend hw shader to sample depth texture
Will use integral coordinate to avoid any rescaling.

Bilinear interpolation isn't supported. I don't think it is allowed to
filter a depth texture anyway.
2016-04-24 22:18:26 +02:00
Gregory Hainaut b4b878ac24 gsdx-ogl: add a note for a future small optimization 2016-04-24 22:14:51 +02:00
Gregory Hainaut 4281b8630b gsdx ogl: remove the useless shadeboost Constant Buffer 2016-04-24 11:08:14 +02:00
Gregory Hainaut d027ed2092 gsdx ogl: merge GSTextureFXOGL to GSDeviceOGL
First file is rather small in openGL. And it is linked to the latter.
2016-04-24 10:55:22 +02:00
Gregory Hainaut 821e3ff294 gsdx-ogl: reduce length of debug message 2016-04-21 09:28:44 +02:00
Gregory Hainaut 8217c717f6 gsdx-ogl: require GL_KHR_debug
Will reduce the slowdown on debug build
2016-04-21 09:28:44 +02:00
Gregory Hainaut 9598417f42 gsdx-ogl: GL_ARB_copy_image is now mandatory 2016-04-21 09:28:44 +02:00
refractionpcsx2 dcb676765e GSdx: Clean up some warning under windows (#1289) 2016-04-14 11:00:58 +01:00
Gregory Hainaut 22a40b65ae gsdx-ogl: always use 1 for GL_UNPACK_ALIGNMENT
Avoid a gl function call for each texture uploads
2016-04-11 12:45:11 +02:00
Gregory Hainaut 2941adf364 gsdx ogl: use the new pipeline API
Pre build all SW shader into pipeline.

Directly bind the pipeline instead of all pipeline stages. (less work for the driver)
2016-04-10 17:28:05 +02:00
Gregory Hainaut 95e3dcb448 gsdx-ogl: improve the shader program management
* keep a reference of program/pipeline created to ease the deletion
* extend a bit the API to support multiple pipeline

Final goal will be to use a pre link pipeline for SW shaders. And uses
the default pipeline for HW shaders.
2016-04-10 17:05:33 +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 7cc13ce99c gsdx-ogl: only bind the FB to the draw FB 2016-04-10 11:31:40 +02:00
Gregory Hainaut d533c393b2 gsdx ogl: rely on DSA API 2016-04-10 11:31:40 +02:00
Gregory Hainaut 52e3c3516d gsdx-ogl: GL_ARB_separate_shader_objects is now mandatory 2016-04-07 22:11:35 +02:00
Gregory Hainaut f751f70b1e gsdx ogl: GL_ARB_clip_control is now mandatory 2016-04-07 21:57:54 +02:00
Gregory Hainaut cb279ef321 gsdx ogl: help compiler to devirtualize 2016-04-04 23:12:31 +02:00
Gregory Hainaut 771583c559 gsdx-ogl: help the compiler to propagate stride constant
Optimize various multiplication

Note: potentially we can do it with constexpr but I'm not sure of compiler support
2016-04-04 22:46:31 +02: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 3451f7e760 gsdx-ogl: handle invalid gl_lengh in debug message
Mesa intel sets it to -1.

Close #1089
2016-01-07 21:49:17 +01:00
Gregory Hainaut ef3aa17025 gsdx-ogl: disable useless Nvidia driver message 2015-11-12 17:04:54 +01:00
Gregory Hainaut 5cbd0cf42a gsdx-debug: add more push/pop debug group on the init 2015-10-24 14:14:37 +02:00
Gregory Hainaut 9ba949c2d9 gsdx-debug: support correct logging on mesa
By default low severity message were disabled. (thanks to be open source)
2015-10-24 14:14:37 +02:00
Gregory Hainaut 92553add8e gsdx-ogl: accurate date regression. Bad interaction between depth & DATE
In the DATE42 algo, first pass must find the primitive that write the
bad alpha value. If depth test is fail, alpha value won't be written therefore
you mustn't keep the primitive id.

In theory to ensure 100% correctness, depth would need to be fully executed
(currently depth write is disabled). However it requires to copy the depth buffer.
It is likely bad for the perf.

Issue reported on DBZInfWorld
2015-10-22 12:31:51 +02:00
Gregory Hainaut 6561fbc831 gsdx-ogl: only enable aniso when sampling from the HW texture unit
Potentially help issue #884
2015-10-22 12:21:43 +02:00