Commit Graph

81 Commits

Author SHA1 Message Date
Gregory Hainaut a1bfb237e6 Partially Revert "gsdx-ogl: drop support of GL_ARB_clear_texture extension"
This reverts commit 03e72781aa.

Let's add back the clean texture pointer

I want to test it on
1/ DSA
2/ MT driver
2015-05-16 00:31:25 +02:00
Gregory Hainaut 6d31124d3a gsdx-debug: only enabled advance gl debugging on linux
It will avoid some crash on windows for driver that doesn't support
the extension.

Make debug support mandatory for debug build on linux.
2015-05-08 09:54:34 +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 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 335695bd0e purge GLES from GSdx !
mobile will use vulkan (or any new API) anyway
2015-05-01 20:02:17 +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 eb257d9295 gsdx-ogl: add dsa function place holder 2015-04-25 12:50:11 +02:00
Gregory Hainaut b12eb45bb7 gsdx-ogl: try to avoid crash on fglrx windows 2015-04-25 09:50:19 +02:00
Gregory Hainaut f71eb171cf gsdx-ogl: add glTextureBarrier function pointer
Could be useful
2015-04-24 18:35:01 +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 d37cc8e1e7 gsdx-ogl: GL_ARB_shading_language_420pack is now mandatory
All API/drivers support it so time to remove the fallback.
2014-10-02 20:44:22 +02:00
Gregory Hainaut 8833afc2fa gsdx-ogl: drop GL_ARB_multi_bind
It will be replaced by DSA so let's reduce the complexity of opengl
2014-09-28 12:23:44 +02:00
Gregory Hainaut 1e86e3cb08 gsdx-ogl: rework callback debug
* use DebugOutputToFile as a callback of gl error. Add a breakpoint to
  find the culprit GL call
* use string instead of char[n]

Note: CheckDebugLog is potentially useless now
2014-09-28 12:00:34 +02:00
Gregory Hainaut 9d8d702aa6 gsdx-ogl: drop GL_NV_depth_clamp extension
superseeded by GL_ARB_clip_control
2014-09-28 12:00:34 +02:00
Gregory Hainaut d720cc16a6 gsdx-ogl: gl4.5: add plumbering to support direct_state_access and clip_control 2014-09-28 12:00:33 +02:00
gregory.hainaut 30d5135fdd gsdx-ogl: sigh.. this one was hidden :p
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5932 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-23 08:25:54 +00:00
gregory.hainaut 192c5d2c4a gsdx-ogl: one more
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5931 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-22 22:00:46 +00:00
gregory.hainaut 6c87673e57 gsdx-ogl: forget a pointer
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5930 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-22 21:14:57 +00:00
gregory.hainaut ba46b25e2f GSdx-ogl: GL4.1 program shader is optional
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5929 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-22 09:08:37 +00: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 e80b002929 gsdx ogl: Flush various pending work
* try to use more subroutine on VS&PS, unfortunately hit a driver crash!
* Call Attach/DetachContext through GSDevice so I can unmap currently mapped buffer
* Implement glsl part of GL_ARB_bindless texture, again hit another driver crash!
* various fix of GL_ARB_buffer_storage. Basic benchmark show only improvement on 'cold' case, I guess it will improve smoothness
* try to fix GL_clear_texture, no success so far. It seem the extension is limited to basic texture (aka no depth/stencil)



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5752 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-10-24 20:54:27 +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 07605941ef gsdx ogl:
* some preliminary work to test/benchmark bindless texture in the future (glsl was not yet updated)
Bindless texture allow to get a GPU texture pointer and then set it directly
to the shader as a basic uniform.
=> no more texture unit selection/validation
=> no more texture validation neither texture hash lookup

3rdparty: update gl header to the latest gl4.4


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5720 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-08-17 08:57:52 +00:00
gregory.hainaut 0f603a98d5 gsdx ogl: Test the ARB_shader_subroutine GL4.0 extension
The idea was to replace shader program swith by pointer function calls inside
shaders.  At least parameters that are often changed between draw call. So far
I only ported atst and colclip. Unfortunately code is "slower" (on GSdx standalone).
For the moment keep the code but disabled.

If I understand well the validation of program is done in the "driver thread"
but the additional call are done in the overloaded MTGS thread. Apitrace
profiling shows faster GPU draw calls. Another possibility is that the driver still
need to validate the draw call because of others state change.

Here some stats on colin3 (90 frames):
without subroutine: UseProgram 125246
with subroutine: UseProgram 2906, subroutine 125945 => 3605 extra calls overhead (not
all parameters are ported to subroutine)



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5715 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-08-10 19:43:59 +00:00
gregory.hainaut a46b489a24 gsdx ogl: various minor optimization.
* move most of gl states into a separate namespace. Extend it to depth/stencil/blend micro state
=> save 10,000 opengl call by frame for colin mcrae 3
* Only setup blend state of first drawbuffer
* Don't request anymore a debug context on dev/release build



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5713 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-08-05 20:25:25 +00:00
gregory.hainaut 34045eb8f7 gsdx ogl: AMD users upgrade to 13.8 now ;)
* clean extension management and fix compilation of previous gl44 code.
* Use pixel buffer object to upload texture data.
=> avoid crash on AMD driver
=> a bit faster and probably got some margins for the future



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5712 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-08-03 08:29:01 +00:00
gregory.hainaut 64f783410e gsdx ogl:
* preliminary work for GL4.4 extensions (ARB_clear_texture & ARB_multi_bind). Disabled until I got a 4.4 driver
Note: I plan also to use ARB_buffer_storage
* compute texture gl option in the constructor (avoid a couple of swith case)
* redo texture unit management. Unit 0-2 for shaders, Unit 3 for texture operations. MultiBind will allow to bind 
shader input without disturbing texture binding points.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5711 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-08-02 16:38:12 +00:00
gregory.hainaut e394de86dc gsdx ogl:
* add a non-working hack: UserHacks_DateGL4, goal was to replace UserHacks_AlphaStencil
 + Detection of good/bad samples is based on primitive ID variable. However I'm not sure
 the behavior is always the same between draw call...Anyway let's keep a copy of the current
 work
* Dump integer texture into text csv
* add gl4.2 ARB_shader_image_load_store extension (needed by UserHacks_DateGL4)


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5707 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-07-28 14:40:43 +00:00
gregory.hainaut 916a091f8a gsdx ogl: GLes
* use gles header file, disable opengl code (mainly GLX, ARB_sso, geometry shader)
* Define properly the function pointer, GLES use basic linking whereas GL must get the symbol dynamically
* cmake: properly search and set libglesv2.so
* don't use dual source blending => HW renderer work (only miss unimportant FBA)



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5701 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-07-13 11:39:45 +00:00
gregory.hainaut dc036ff59d gsdx: split shader/program/pipeline object management into a separate class
* remove the possibility to compile shader from file. Some people loads older shaders...
  The feature might be readded later


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5697 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-07-06 10:08:52 +00:00
gregory.hainaut 9b037a3813 pcsx2: increase a bit the minimum size of the plugin dialogs (GSdx name is too long)
gsdx:
* move gl function loading into GSwnd. Clean the header and avoid to rely on macro.
* Always require libegl for GSdx. You still need to select the API at compilation.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5670 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-06-16 08:43:50 +00:00
gregory.hainaut d91b28ac32 gsdx-ogl-wnd: forget one file ...
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5501 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-01-04 15:47:11 +00:00
gregory.hainaut f95d9bd989 gsdx-ogl-wnd:
* split GSwnd into GSWndOGL  and GSWndDX
* replace GSwnd static object by a dynamic pointer


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5498 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-01-04 11:41:51 +00:00
gregory.hainaut c4af005f0b gsdx ogl:
* retry compilation when driver failed to compile with a static 'index' constraint. Replace previous AMD hack.
* clean context default attribute value
zzogl 4: clean context default attribute value too.
zzogl 3: backport texture size fix


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5442 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-10-29 21:35:47 +00:00
gregory.hainaut d5b318b990 zzogl:
* move all remaining glx into the dedicated GLwin object
* rework a bit WGL to separate opengl context and window creation (like linux actually)

gsdx: Allow to control vsync. Not sure I used the good extension.

cmake: 
* check that EGL opengl context creation
* Shut up gcc warning when force inline might not work...



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5437 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-10-21 18:10:13 +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 226b2d63b8 gsdx: remove completely the SDL backend. Let's hope I didn't break too much VS
cmake: take the opportunity to drop the support of 3rdparty compilation. Distributions have got a more recent version of zlib/soundtouch anyway.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5376 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-08-15 10:22:19 +00:00
gregory.hainaut 3b22f0fb0c zzogl glsl4:
* properly delete program and vertex array. Avoid a crash on plugin reload
* reset shader state. Avoid to reuse invalid data on plugin reload
gsdx:
* add an hack to unattach/attach the gl context from different thread. Help to solve some crashes. The best will be to move gpu operation out of gsreadfifo but it would need more works
* implement logz for test purpose (don't seem to help)
gsdx replay:
* use default xdg location


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5289 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-06-12 18:14:01 +00:00
gregory.hainaut cfedf41441 gsdx-ogl: linux only
* Fix some issue on wnd management, mix between sdl/ogl render
* create new gsdx option for ogl debug
  + debug_ogl_dump: start frame to dump when not 0
  + debug_ogl_dump_length: length of the dump
  + debug_ogl_shader: print shader debug
  Note current dump option must be fixed to use linux path.


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5067 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-01-12 07:29:31 +00:00
gregory.hainaut 14b0572b61 gsdx-ogl:
* fix bad setup issue for constant blend factor
* Use a read framebuffer to read back the texture (less disruptive)
* cmake separate the loader to the main plugins


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5064 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-01-08 21:59:42 +00:00
gregory.hainaut 21724ddbf8 gsdx-ogl: add a loader to replay gs file. Quite shaky but probably enough for debug :)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5052 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-01-06 21:43:39 +00:00
gregory.hainaut 0e80e0adca gsdx-ogl:
* add some define to enable/disable SDL so we could build gsdx without SDL
* debug: dump data based on frame count rather from draw count


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5044 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-01-04 23:19:17 +00:00
gregory.hainaut 76542f89c9 gsdx-ogl: code seems compatible with an opengl 3.3 context. Only load some shader extensions.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5041 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-01-03 17:17:04 +00:00
gregory.hainaut 6f5ac7b788 gsdx-ogl: LINUX-ONLY
* go back to opengl 4.1 (nvidia driver is buggy with 4.1).
* fix the backbuffer allocation. bad order of parameter
* fix remaining glsl error


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5006 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-12-22 14:12:12 +00:00
gregory.hainaut a9927a6e33 gsdx-ogl: LINUX-ONLY
* rework a little the shader to be hopefully compatible with nvidia
* request a pure 4.2 context (all gpu 4.1 capable support 4.2 anyway)


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5003 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-12-21 23:09:36 +00:00
gregory.hainaut daf3c43681 gsdx-ogl: LINUX-ONLY
* improve vertex management with a vertex array. Decorrelate vertex from strech rec and others func (later for the HW renderer)
* fix the crash on nvidia when closing the window
* clean some texture management code


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4985 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-12-10 19:19:44 +00:00
arcum42 e6057b765f gsdx-ogl: LINUX-ONLY * Fix context creation. Get opengl working with nvidia graphics cards.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4984 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-12-10 11:56:34 +00:00
gregory.hainaut afdb2dadc3 gsdx-ogl: LINUX-ONLY
* add a callback for GLERROR.  Allow to breakpoint on GSDeviceOGL::DebugCallback (gdb is completely lost on amd driver, hope it is better on nvidia)
* Add some empty glsl convert to shutup some useless debugging error
* request an advance opengl context without pre 3.0 feature.


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4983 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-12-08 16:39:14 +00:00
gregory.hainaut 2be037d78f gsdx-ogl: LINUX-ONLY
* flip y-axis in merge stage
* default to xlib window managment (the dynamic switch between sdl and xlib crashi but SDL will probably dropped later)
* improve management of FBO, draw buffer
* try to fix some issue with glClearBuffer but spec is not clear.


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4982 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-12-08 11:17:59 +00:00
gregory.hainaut a835de0af7 gsdx-ogl: LINUX-ONLY
* implement the saving of texture (take bmp SW code)
* fix the missing "enable attribute code" and the typo in glsl. It works now !!!
* rework a little texture to pack texture into a temporay buffer when src pitch != dst pitch
* try to replace sdl with pure xlib (not yet enabled by default but it seems to work)

Note there still a minor issue, coordinate are different between DX and OGL (upper-left vs lower-left) so the image is inversed.


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4981 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-12-07 22:05:46 +00:00