Commit Graph

191 Commits

Author SHA1 Message Date
Jean-Philippe Andre 03ab2e27c8 Evas GL common: Create OpenGL ES 3.x contexts by default
Automatically fallback to OpenGL ES 2.0 if OpenGL ES 3 is not supported.
This is a first step in trying to support GLES 3 for Evas GL.

This commit is also a wild test to see whether using GLES 3 contexts
by default will break anything. The theory says that GLES 3 is
backwards compatible with GLESv2.

So, if anything GL breaks for you... scream loudly!
But before reporting any bugs, please set the env variable:
- export EVAS_GL_DISABLE_GLES3=1

This does not add any requirement for GLESv3 support.
2015-03-05 20:59:53 +09:00
Dongyeon Kim 80b21a7d3f evas/gl_x11: fix duplicated egl error check
Summary:
When egl window surface creation fails, eglGetError() is called twice,
thus removing error state.

Reviewers: cedric, Hermet, jpeg

Reviewed By: jpeg

Subscribers: mer.kim, wonsik, cedric

Differential Revision: https://phab.enlightenment.org/D2064

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-03-02 16:22:12 +09:00
Jean-Philippe Andre ae2061dbe2 Evas GL: Fix support for GLES 1.1 indirect rendering
This requires a special context that matches the configuration
required for GLES 1.1. Otherwise eglMakeCurrent() would fail
miserably with EGL_BAD_MATCH in case of indirect rendering
(at least on some drivers).
2015-02-24 22:12:00 +09:00
Cedric BAIL 93333ede15 evas: refactor shutdown. 2015-02-23 11:35:29 +01:00
Cedric BAIL 552a38cde5 evas: refactor software engine initialisation. 2015-02-20 15:04:52 +01:00
Minkyoung Kim 4aeb8a4e7d evas: fix error checking of eglBindAPI.
Summary: If eglGetError sequencially called, second eglGetError() doesn't give the information of real Error.

@fix

Reviewers: raster, jpeg, cedric, Hermet

Subscribers: cedric, spacegrapher, wonsik

Differential Revision: https://phab.enlightenment.org/D1982

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-17 16:34:41 +01:00
Jean-Philippe Andre 651f0ae241 Evas GL common: Improve code readability (simplify macro)
The exact same ugly macro would appear hundreds of times in the GL
code:
  GLERR(__FUNCTION__, __FILE__, __LINE__, "");

Instead, override the common GL functions iif GL_ERRORS is defined.
This greatly simplifies code and removes tons of useless lines.
Also, this will give better debugging output as the exact code line
is printed, and the function name is also printed.

Also, fix linking to the glerr function.

This is a code cleanup. Hopefully I didn't break anything with this
big operation of find & replace.
2015-02-12 11:23:03 +09:00
Dongyeon Kim 72f3e684d9 evas/gl_x11: introduce tbm native surface type
Summary:
This native surface type is based on the tbm surface used for the tizen platform.
EGL_TIZEN_image_native_surface EGL extension is used to map
tbm surface to an egl image
@feature

Reviewers: raster, cedric, jpeg

Subscribers: cedric, wonsik

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2015-02-10 14:48:22 +09:00
Daniel Juyung Seo 6e2c311f9d Revert "evas/gl_x11: set EGL_PLATFORM environment variable" as cedric wants to change it.
This reverts commit 6fe870de14.
2014-12-29 20:56:14 +09:00
MinJeong Kim 6fe870de14 evas/gl_x11: set EGL_PLATFORM environment variable
Summary:
Without EGL_PLATFORM environment variable, eglInitialize() can be
failed because egl tried to load DRM platform instead of X11 platform and it
tried to handle XDisplay pointer as a gbm_device pointer as well.
The failure seems to be occured especially if the egl was built
with DRM platform as native platform.

This revision can prevent the failure by indicating proper egl platform using
EGL_PLATFORM environment variable.

@fix

Reviewers: gwanglim, jaehwan, seoz

Reviewed By: seoz

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1828
2014-12-29 20:14:07 +09:00
Jean-Philippe Andre af43bc67e4 Evas GL: Try harder to find a matching config for GLESv1
If MSAA was requested, it is very likely that no config was
found (depending on the driver), so we'll try again without
MSAA. Yeah, this might not look very smooth but it should be
better that failing at eglMakeCurrent.
2014-12-22 22:15:12 +09:00
Jean-Philippe Andre 3572b3bf3d Evas GL: Add a warning in gl_x11 about MSAA & RGBA for GLES1
We've discovered some bugs on some drivers related to
MSAA and RGBA blending. Dunno yet if the same problem can affect
GLES2 as well.
2014-12-19 18:14:25 +09:00
Carsten Haitzler 8fcfae57d1 evas - gl - fix warning for unused var in glx build 2014-11-29 12:07:33 +09:00
Jean-Philippe Andre 6d652589ad Evas GL: Print GLSL version with EVAS_GL_INFO 2014-11-27 20:50:40 +09:00
Jean-Philippe Andre 8771c78a90 Evas GL: Fix indirect rendering surfaces for GLES 1.1
Carefully select the requested EGL config and match it with
the available visual from X, including the following options:
- Stencil
- Depth
- MSAA

TODO: The same thing for GLX. And fix direct rendering as well.
2014-11-26 22:56:06 +09:00
Jean-Philippe Andre f3a53acbf0 Evas GL: Fix bug in evgl_eng_pbuffer_surface_create (EGL)
Thanks Henry Song for the report.

@fix
2014-11-14 11:32:56 +09:00
Carsten Haitzler adc1465049 clean up glx context code to remove legacy and avoid server segv
this cleans oyt a few bits o9f old glx context handling code that are
no longer used as well as avoids  causing server-side to crash on
tryng to set a "none" glxwindow as current. this is what cases the
nvidia server-side crashes.
2014-11-02 11:36:21 +09:00
Chris Michael 9599007a68 evas-gl-x11: Don't call gl_common_error_set if MakeContextCurrent fails
Summary: glsym_evas_gl_common_error_set used here leads to an implicit
declaration in compiler warnings. Remove the call to that function and
just print out an error message. This is a cleanup function anyway.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-29 12:07:48 -04:00
Chris Michael 300d20f47b Revert "evas-gl-x11: Fix copy/paste error from Coverity fix"
This reverts commit fb4ad043f6.

Revert this. This also leads to an implicit declaration of the
error_set function.
2014-10-29 12:07:03 -04:00
Chris Michael fb4ad043f6 evas-gl-x11: Fix copy/paste error from Coverity fix
Summary: In fixing a Coverity issue, I copy/pasted a call to
evas_gl_common_error_set without compiling :( Bad me !! This commit
fixes the issue (data was undefined). Since evas_gl_common_error_set can
take NULL as the data parameter, lets use that.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-29 12:02:26 -04:00
Stefan Schmidt 2f49ec1115 evas/gl_x11: Do not shadow another local variable. 2014-10-29 16:05:42 +01:00
Chris Michael b1bf718f1b evas-gl-x11: Check return value of glXMakeContextCurrent
Summary: Fix Coverity CID1249651 (unchecked return value)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-29 10:28:50 -04:00
Carsten Haitzler e164d14208 evas - fix new issue with segv when switching to alpha win with gl
evas gl window was freed before new one was created getting shared ctx
to 0 refcount thus freeing everything there - BAD. fix. new issue in
git, not from release
2014-10-28 20:10:40 +09:00
Carsten Haitzler 696346c467 evas gl rgba visual/rendering fix try ... again
so this is a re-try at the evas gl destination alpha fix. this is what
cedric tried, but done RIGHT. it required adding an ecore_x call to
create a window with correct visual/colormap. it requires doing
visuals totally correctly all the way from ecore_evas to the evas
gl_x11 core. nvidia drivers are very picky about visuals. i also had
to vid the egl/gles code too to do the same thing. nvidia gles/egl
drivers are also picky, mesa is not. this all requires a lot of code
changes. it's far from trivial

this isn't backported for a few reasons:

1. verify this fix doesn't break for anyone.

i tested:

nvidia glx + egl/gles
intel glx + egl/gles
radeon glx

it needs wider testing. nouveau, fglrx for starters and maybe
some other gles/egl drivers.

2. have some review time
3. time to settle before blasting to stable branches

@fix
2014-10-26 00:34:40 +09:00
Jean-Philippe Andre d4eb07b4bb Evas GL: Don't pass shared context for GLX with 1.1 API
Not sure if this is very relevant, since GLX does not support
GL-ES as such, anyways... We should be using the extension
GLX_EXT_create_context_es_profile to create proper contexts.

Note: GLX + OpenGL-ES 1.1 crashes at any function call on my
machine (binary bloc driver), while EGL + GLES1.1 is fine.
2014-10-22 10:44:06 +09:00
Stefan Schmidt a7ef5bd7da Revert "evas: GL_X11 context need to always be with alpha or it will fail to change."
Need to also revert this in master. Cedric seems busy with other things and this
should not end up in 1.12  alpha1

This reverts commit 4ea75113ca.
2014-10-21 09:23:58 +02:00
Jean-Philippe Andre 904b1c5249 Evas: Fix some debug output formatting
Remove trailing newline.
2014-10-21 15:59:50 +09:00
Jean-Philippe Andre 25aaee99af Evas GL: Fix gl_x11/GLX engine
Forgot to set the TLS value after creating a new context.
No problem would show up in most cases, even in my test app.
But elementary_test GLView would just not work at all, spitting
incomplete FBO errors at me. Damn this one line was hard to find.

But introduced in df66916cd22ec6c4.
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre c17cfbd13e Evas GL: Add support for PBuffer surfaces with GLX
Not fully tested, but allows calling evas_gl_make_current, so
it works for dummy surfaces (eg. 1x1 for a render thread).
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 47ddb889ad Evas GL: Add support for OpenGL-ES 1.1 (part 3)
This introduces XPixmap usage for indirect rendering.
Of course this works only for the gl_x11 engine... and for
now only when using EGL... and only on some drivers...
damn limitations.
Direct rendering should work on more platforms (eg. some desktop
nvidia cards with the EGL drivers).
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 4315537820 Evas GL: Add support for OpenGL-ES 1.1 (part 2)
Add version param to context_create.
Add support for 1.1 contexts in the GL_X11 engine, and checks
for version in all other engines (return NULL).
Add API wrappers for all OpenGL-ES 1.1 APIs (normal and debug
modes).
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 38aa72d139 Evas GL: Fix sigsegv with recent Nvidia EGL driver
Welp, glGetString() crashes if called before eglInit... And this
piece of code is now useless because "safe native" mode is not
used anymore (safe_native is never read).

Remove all safe native-related code.
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre f30f55f9f4 Evas GL: Fix compilation for EGL/GLES
Configure with --with-opengl=es --enable-egl
Fixes runtime link dependencies
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre a0712e25e1 Evas GL: Add support for pbuffer surfaces
Supports only EGL for now :(

These pbuffer surfaces can be used to create dummy surfaces for
make_current and render threads.

@feature
2014-10-20 12:16:08 +09:00
Jean-Philippe Andre 90b07fc42a Evas GL: Fix rotation angle get to check for DR first
direct_enabled() is not visible from the engines... but it is from
evas_gl_core which calls the engine.
2014-10-20 12:16:07 +09:00
Jean-Philippe Andre de7a8a3dab Evas GL: Add API evas_gl_rotation_get
This will be used to increase the chances of having direct
rendering (no fallback to FBO) even if the window is rotated.

The client is then responsible for handling the view rotation.

@feature
2014-10-20 12:16:07 +09:00
Jean-Philippe Andre 28a76266c6 Evas GL: Fix runtime linking issues
There is some mess with gl common functions that need to be
called from the engine itself, eg. error set/get.
2014-10-20 12:16:07 +09:00
Jean-Philippe Andre cb5e88d20f Evas GL: Add APIs to get current surface/context
- evas_gl_current_surface_get
- evas_gl_current_context_get

@feature
2014-10-20 12:16:07 +09:00
Jean-Philippe Andre 68ca82e83f Evas GL: Add more thread safety to gl_x11 2014-10-20 12:16:07 +09:00
Jean-Philippe Andre 6e4d7151b8 Evas GL: Save EGL error codes in gl_x11 engine 2014-10-20 12:16:07 +09:00
Cedric BAIL 4ea75113ca evas: GL_X11 context need to always be with alpha or it will fail to change.
@fix
2014-10-09 12:20:53 +02:00
Cedric BAIL dccbd559d4 evas: GL_X11 - add some more error message. 2014-09-30 18:31:51 +02:00
Cedric BAIL af40a4b4e1 evas: GL_X11 - remove lef over unref. 2014-09-30 18:06:12 +02:00
Cedric BAIL ebaec0dfaf evas: GL_X11 - fix use of deleted memory by pointing to the right data. 2014-09-30 17:23:25 +02:00
Cedric BAIL 59501027c0 evas: fix gl_context to correctly match window description after a change.
This was affecting use of GL backend when having a transparent window. It
is actually a fix for a bug reported by Thanatermesis. It has been inspired
by D1229.

To reproduce the issue just do ELM_ACCEL=gl elementary_test -to "Icon transparent".
2014-09-30 16:25:46 +02:00
Jérémy Zurcher 119134751f evas/engines: avoid redefinition of typedef Outbuf
'typedef struct _Outbuf Outbuf' is in software_generic/Evas_Engine_Software_Generic.h
that is always included
2014-09-23 11:16:47 +02:00
Jean-Philippe Andre 0d9005aa0c Evas GLX: Simplify code
if (A) then B else B
2014-09-19 10:29:58 +09:00
Carsten Haitzler 489404c785 evas gl x11 - fix structurally dead code
fix previous "shut up unused params warnings code bits and use
EINA_UNUSED. fixes CID 1039495
2014-08-22 20:14:59 +09:00
Gwanglim Lee cba164072d evas: Evas_Gl_X11 - add missing eng_window_free
Summary:
add missing eng_window_free before return from eng_setup.
@fix

Test Plan: N/A

Reviewers: cedric, raster, devilhorns, stefan_schmidt

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1345

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-08-21 12:04:53 +02:00
Carsten Haitzler 401d788bd6 evas gl - fix undefined return added from coverity fixing 2014-08-16 12:40:42 +09:00