Commit Graph

35 Commits

Author SHA1 Message Date
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 4ef0572ceb gsdx-ogl: disable copy constructor
'class GSVertexBufferStateOGL' does not have a copy constructor which is recommended since the class contains a pointer to allocated memory.
2015-11-06 23:01:59 +01:00
Gregory Hainaut 0958b9db8e gsdx-ogl: use the standard openGL name
Function pointer was mangled to avoid any collision. Nowadays all symbols
are hidden so no risk of collision.

Syntax is nicer beside it would allow to put back GLES3.2. I think it
supports most of the used extension.

glActiveTexture & glBlendColor are provided without symbol query.
2015-10-17 17:05:15 +02:00
Gregory Hainaut 5fb8c7e65c gsdx: initialize members in constructor of objects
A couple of useless members were removed too.

Also fix wnd initialization

Coverity:
CID 146955 (#1 of 1): Uninitialized pointer read (UNINIT)
18. uninit_use: Using uninitialized value wnd[i].
2015-09-23 09:46:53 +02:00
Gregory Hainaut e972f4f4dd gsdx-ogl: extend device to support an offset for normal draw 2015-08-02 21:30:19 +02:00
Gregory Hainaut 85266abd71 gsdx-ogl: use a 8MB vbo/ibo
Dirge of Cerberus draw 143,360 vertices in a single draw!

It is likely to emulate a particle effects

Hopefully improve issue #573
2015-06-04 08:28:40 +02:00
Gregory Hainaut 6166c95325 gsdx-ogl: protect PBO with fence
Safer and doesn't impact perf too much.
2015-05-15 18:32:47 +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 a0c17ae0a4 gsdx: use vertex storage by default
It is faster on games that draw lots of primitives and in low upscaling.
2015-05-01 14:05:45 +02:00
Gregory Hainaut f96a653d05 gsdx-ogl: GSVertexArrayOGL uses ASSERT with condition
Remove useless indentation too
2015-05-01 12:16:26 +02:00
Gregory Hainaut 768ae342c3 gsdx: move buffer check after allocation 2015-04-26 17:51:06 +02:00
Gregory Hainaut 346ef1eec2 gsdx-ogl: ouch! Properly check the creation of vertex buffers 2015-04-26 11:01:55 +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 f2f59544d2 gsdx-ogl: early bind vertex array object
Creation of buffer will generate a bind in BufferStorage mode. It is just to be safe.
2015-04-25 12:50:12 +02:00
Gregory Hainaut 7b0775d887 gsdx-ogl: add some fences to protect the upload of vbo buffer
This way ogl_vertex_storage must be safer to activate

And it brings a nice performance boost (game with lots of primitives and
reasonable upscaling)

SotC testcase 4x: 61fps => 78fps
2015-04-24 23:15:19 +02:00
Gregory Hainaut 258b73409c gsdx-ogl: update flags for buffer storage
Fix issue with Mesa driver
2015-04-23 21:10:43 +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 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 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 b020bd76c6 gsdx-ogl: restore gles build
Add the --gles build option to the linux main script
Ifdef all gl code not supported on gles3 (note some will be reenabled for gles3.1)

Note: it probably doesn't run anymore. My Nvidia driver doesn't support
yet egl/gles so I can't test it. Feel free to contribute.
2014-03-29 11:55:02 +01:00
Gregory Hainaut 8b78551b92 gsdx-ogl: improve debugging capabilities
allow to print memory transfer usage
Check gl call in dev build
2014-03-25 16:36:29 +01:00
Gregory Hainaut c85ba4c259 gsdx ogl: add buffer_storage for vertex upload
A bit slower. Maybe because SubData does the copy in the driver thread. My memcpy is done on
the main thread. I'm not sure it would worth an extra thread to copy vertex data to the GPU

Note: testers are welcome. You need to edit the ini file.
"ogl_vertex_storage=1" <= enable the extension
"ogl_vertex_storage=0" <= disable the extension

Again you need the support of GL_arb_buffer_storage (i.e. not catalyst)
2014-03-25 16:36:29 +01:00
gregory.hainaut 84895eadd9 gsdx ogl: correct most of Z-depth issue
Best setting if you driver support GL_NV_depth_buffer_float => GL_NV_Depth = 1 & logz = 0
Otherwise => GL_NV_Depth = 0 & logz = 1

Explanation of the bug:
Dx z position ranges from 0.0f to 1.0f (FS ranges 0.0f to 1.0f)
GL z Position ranges from -1.0f to 1.0f (FS ranges 0.0f to 1.0f)

Why it sucks:
GS small depth value will be "mapped" to -1.0f. In others all small values will be 1.0f! Terrible lost
of accuraccy.

The GL_NV_depth_buffer_float extension allow to set the near plane as -1.0f.
So
"GL z Position ranges from -1.0f to 1.0f (FS ranges 0.0f to 1.0f)"
will become
"GL z Position ranges from -1.0f to 1.0f (FS ranges -1.0f to 1.0f)"
and therefore
"z posision [0.0f;1.0f] will map to FS [0.0f;1.0f]" as DX

Yes we just get back all precision lost previously :)
However you need hardware (intel?) and driver support (free driver?/gles?) :(





git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5860 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-01-31 21:30:54 +00:00
gregory.hainaut 690432de30 gsdx ogl:
* redo most of the texture upload (PBO): colin3 benchmark: 32 fps now (vs 26 fps 2 weeks ago)
* use the cross vendor vsync extension on linux (previous wasn't supported by nvidia)


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5721 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-08-17 09:05:41 +00:00
gregory.hainaut bd5f379044 gsdx ogl:
* uniform was wrongly set before the activation of the program (free driver only)
* Always use only 1 drawbuffer. Easier besides previous setup was wrong for convert:ps_main1

GLES trial (v3):
* add the cmake option GLES_API. Note library (libgles) are hardcoded for the moment
* Disable opengl check
* Disable gl_GetDebugMessageLogARB not supported!
* Emulate gl_DrawElementsBaseVertex, add manually the index offset (surely slow but work)
* Fix hundred of shader error (no implicit cast of integer to float...)
Unfortunately GLES doesn't support dual blending so no blend in hardware renderer. Otherwise it is fine




git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5700 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-07-12 21:12:34 +00:00
gabest11 ddaa892726 Removed ATL/MFC dependencies from every project, the free version of visual studio does not have those. It compiles with vs2012 express now, will fix others later, in case they are broken.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5692 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-07-01 21:28:58 +00:00
gregory.hainaut ca1edbf2cb gsdx ogl:
* Separate state and shader compilation into separate function
* replace various hash_map by basic array
* Compact VertexScale and offset into a single vec4
* add the new option "ogl_vertex_subdata": subdata is faster on FGLRX, test are welcome on Nvidia drivers
    0 => use map/unmap
    1 => use subdata

replay: add "linux_replay" option and compute some nice stat (mean, standard deviation)

cmake: recreate shader header at build time


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5682 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-06-26 20:09:07 +00:00
gregory.hainaut 9376b26537 gsdx-ogl-wnd:
* load extension as gl_Function instead of glFunction


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5635 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-05-19 09:19:20 +00:00
gregory.hainaut 58cc2ddd1f gsdx-ogl-wnd:
* Remove bad redefinition of glActiveTexture and glBlendColor pointer
* Remove glew dependency on linux
* s/OGL_DEBUG/ENABLE_OGL_DEBUG/ and enable it on debug


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5512 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-01-16 18:25:53 +00:00
gregory.hainaut f9ddd639b8 gsdx-ogl-wnd: Try to compile OGL backend on VS
* Update project files
* basic compilation fix: include stdafx, s/uint/uint32/
* add selection of the opengl renderer/device in gsopen

Remain to fix opengl function declaration/initialization


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5505 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-01-10 13:13:59 +00:00
gregory.hainaut e06484adb8 gsdx: update the copyrigh address thank to sed
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5412 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-09-09 18:16:11 +00:00
gregory.hainaut 7d7ca41187 gsdx, zzogl: avoid nested class inside GSVertexArrayOGL.h
zzogl: rework the shader interface to use struct like CG. Shader are still broken because some variables (gl_color & gl_secondary_color) are not supported in vertex shader...


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5209 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-05-13 17:22:36 +00:00
gregory.hainaut b665499a6b gsdx ogl:
* split GSDeviceOGl header. Will allow easy sharing with zzogl.
* fix some gcc warning
zzogl:
* import Uniform buffer and Vertex array from GSdx



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5207 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-05-13 17:09:18 +00:00