Commit Graph

179 Commits

Author SHA1 Message Date
Gregory Hainaut 8e1db43431 gsdx-debug: debug stuff 2015-05-08 19:28:17 +02:00
Gregory Hainaut 1addae1993 gsdx-ogl: don't use extra shader for sprite hack
Atst == 2 && sprite_hack is equivalent to Atst == 1

It frees a bit in the shader selector, and reduces shader combinations.
2015-05-08 19:28:16 +02:00
Gregory Hainaut e87d129b09 gsdx-ogl: more verbose debug 2015-05-08 01:01:01 +02:00
Gregory Hainaut d6448183d7 gsdx-ogl-debug: insert error message in GL stream
This way, you can see your message in the GL debugger
2015-05-08 00:16:31 +02:00
Gregory Hainaut 51a67029cf gsdx-ogl: add an option to print gl error messages 2015-05-07 23:54:22 +02:00
Gregory Hainaut 7518b2ef21 gsdx-gui-linux: add debug option in the gui
* Only for debug/dev build
* look awful (expand/fill) but otherwise it is nice for the debug ;)
2015-05-07 23:54:22 +02:00
Gregory Hainaut ba21879059 gsdx-ogl: 1x aniso <=> off 2015-05-07 22:13:49 +02:00
Gregory Hainaut 6095f40baf gsdx-ogl: add the number of free bit in selector structs 2015-05-07 18:41:10 +02:00
Gregory Hainaut cc4713d379 gsdx-debug: extend ogl debug capabilities
Group opengl calls into a nice name.

Apitrace shows them in a tree format that support folding. Previously it
was a long flat list (10K-40K of lines by frame)

I align the call number with the internal s_n variable. This way it is
easy to map GSdx dump output with the GL debugger :)
2015-05-06 19:09:13 +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 6d65867b26 gsdx-ogl: comment point_sampler
It is not enabled on the shader so I will reuse the bit
2015-05-06 19:09:12 +02:00
Gregory Hainaut 5f5b901bca gsdx-ogl: alpha bending equation/function are constant
Drop useless variables/state checking
2015-05-05 11:20:25 +02:00
Gregory Hainaut 8032e2c369 gsdx-ogl: separate color mask state from the blending state
Unlike DX they're uncorrelated.
2015-05-05 10:26:01 +02:00
Gregory Hainaut 14a1925de0 gsdx ogl: date texture is signed to use i variant 2015-05-02 16:53:34 +02:00
Gregory Hainaut f37ef105c5 gsdx-ogl: add support for anisotropy
Close feature request #447
2015-05-02 10:54:58 +02:00
Gregory Hainaut 73d04e33e9 gsdx ogl: clean various comment and old code 2015-05-01 20:04:23 +02:00
Gregory Hainaut 335695bd0e purge GLES from GSdx !
mobile will use vulkan (or any new API) anyway
2015-05-01 20:02:17 +02:00
Gregory Hainaut 7367b22e03 gsdx-ogl: reduce toggling of scissor state for DATE 2015-05-01 00:59:49 +02:00
Gregory Hainaut b65a62096f gsdx-ogl: drop support of ENABLE_OGL_DEBUG
Stencil can be read by GL debugger due to correct mask configuration
2015-04-30 20:02:51 +02:00
Gregory Hainaut ee19a2789c gsdx: move invalidation from GSDevice to GSTexture
Much cleaner this way
2015-04-30 19:55:57 +02:00
Gregory Hainaut 2bd9043657 gsdx-ogl: improve debug of stencil
Note: ENABLE_OGL_STENCIL_DEBUG could be dropped now that I can read the stencil properly
2015-04-30 19:55:57 +02:00
Gregory Hainaut f0181d98fd gsdx-ogl: save the texture state 2015-04-30 09:57:30 +02:00
Gregory Hainaut 0ab0c6cfba gsdx: verbose debug option
Print opengl error message on stderr

Rename Debug.txt into GSdx_opengl_debug.txt
2015-04-27 19:30:03 +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 ee244071fa gsdx-ogl: use 64 bits counter + fix division factor
I also added a counter of the real size of the texture.

I have a bad overhead for pbo transfer
2015-04-25 14:18:21 +02:00
Gregory Hainaut 47a0026b60 gsdx-ogl: print the bandwidth of uniform 2015-04-25 13:00:03 +02:00
Gregory Hainaut 757726bb91 gsdx-ogl: allow to invalidate the texture
It just a hint to the driver to avoid any useless transfer

I don't expect any change but it is free so why not ;)
2015-04-25 12:50:12 +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 c207632e49 gsdx-ogl: improve date performance for GL45
If there is no overlap, it is allowed to directly read from the render target.

On SotC testcase with 6x scaling: 30fps -> 40fps

Note: it requires GL_ARB_texture_barrier extension so be sure to have a recent driver

Note2: it requires a lots of testing too

Open question: in case of complex date (written alpha)
Will it be faster to split the draw call into multiple call with no
primitive overlap
2015-04-24 21:12:33 +02:00
Gregory Hainaut 795ae50ecd gsdx-ogl: fix the recently broken advance date feature
Now it is really working with a 2 stages shaders but it is still slow.
2015-04-24 20:13:38 +02:00
Gregory Hainaut 672e3f9533 gsdx-ogl: use DSA for texture management
Yeah code is much nicer :)
2015-04-24 19:34:17 +02:00
Gregory Hainaut 6e386df535 gsdx-ogl: avoid to clean fully texture in DATE
Is is useless and it has a small impact on performance for big upscale
2015-04-24 18:32:08 +02:00
Gregory Hainaut 03e72781aa gsdx-ogl: drop support of GL_ARB_clear_texture extension
Extension is a bit slower.

We use it to clear the RT but we generally use it right away so
we don't avoid the FB attachment.
2015-04-24 18:15:58 +02:00
Gregory Hainaut 19eb1f00d1 gsdx ogl: flush vbo range instead of barrier
For testing purpose. I don't know which one is better.

It seems flushing have less fps fluctuation than barrier.
2015-04-21 21:44:50 +02:00
Gregory Hainaut ce98276322 gsdx-ogl: improve speed of vertex streaming
Note yet enabled because I'm afraid of data corruption but feel free to test it

The option:
ogl_vertex_storage = 1

Performance note (warm cache+gs replay on colin3)
60 fps -> 76 fps
2015-04-20 09:38:03 +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 6124eb844e gsdx-ogl: only compile useful VS
logz is a constant
wildhack is only compatbile with TME/FST

Compilation goes down from 64 to 20 vertex shaders.
2015-04-20 07:17:58 +02:00
Gregory Hainaut 15264c6c63 glsl: split the main shader
* separate VS/GS and FS
* separate subroutine part of the FS

It already complex enough without subroutine stuff. Besides I'm not sure
we will keep subroutine on the future.
2015-04-19 18:49:02 +02:00
Gregory Hainaut 418f2e69a8 gsdx-ogl: implement the wildhack on the GPU
Likely much faster for opengl and much easier to implement

Note: hopefully UserHacks_round_sprite_offset will replace it
2015-04-13 22:14:36 +02:00
Gregory Hainaut 8c90e7cafc gsdx-ogl: support latest fxaa version
Only tested on Nvidia, please report any issue with your driver

Note: requires GL4 GPU
2014-11-10 10:39:55 +01:00
Gregory Hainaut ff39dffe23 gsdx-ogl: add a gui option (linux) to select external shader
Note: of course it requires a glsl shader ;)

On windows, you can set the path on the ini file. Here an example with linux path:
shaderfx_conf = /home/gregory/playstation/emulateur/pcsx2_merge/bin/GSdx_FX_Settings.ini
shaderfx_glsl = /home/gregory/playstation/emulateur/pcsx2_merge/bin/shader.fx
2014-11-10 10:38:52 +01:00
Gregory Hainaut 920ac6695f gsdx-ogl: add preliminary support of external shader fx 2014-11-10 10:37:58 +01:00
Gregory Hainaut e62af05496 gsdx-ogl: reduce complexity of clear texture
Null is equivalent to a clear to 0.

Note: Code is not yet used because both stencil and depth are cleared.
Future note: stencil can potentially be replaced by load_store_image
2014-11-08 21:30:14 +01:00
Tom Burnett 1f734a69a0 Small VS2013 fixes 2014-10-12 01:40:40 -07:00
Gregory Hainaut ccc1137e12 gsdx-ogl: merge the two vertex buffer format
* Only a single VAO
    => Format is set once
    => Only a single bind at startup
    => GSVertexBufferStateOGL is nearly useless
    => barely faster but better than nothing :)
2014-10-02 20:44:22 +02:00
Gregory Hainaut 10c7be8c50 gsdx-ogl: Use 32B strides for all VBO 2014-10-02 20:44:22 +02:00
Gregory Hainaut 79e8a912cd gsdx-ogl: keep the draw buffer enabled by default
Note: Only DATE requires to disable the draw buffer
2014-09-30 22:18:20 +02:00
Gregory Hainaut f46e8cc6ac gsdx-ogl: bump base requirement to 3.3
A couple of fallbacks were introduced for the Mesa driver that only support 3.0
DSA will require a recent Mesa which already support GL3.3

Require at least SandyBridge for Intel GPU
2014-09-30 22:18:20 +02:00
Gregory Hainaut 594f6c33a2 gsdx-ogl-ES: require GL_EXT_shader_io_blocks + GLES3.1
Allow to use same shader interface for all API

Note: on the GL API it will require GL3.3 (see next commit)
2014-09-30 22:18:01 +02:00