Commit Graph

32 Commits

Author SHA1 Message Date
Derek Foreman c11b66434f evas engines: Stop using arrays of 1 member for egl context and surface
There's actually an array of 2 in gl_x11, but it appears we only use the
first 1, except in an #if 0 block.

I gather this is legacy for some reason - it sure doesn't seem to make
any sense now, so I'm chopping off all the extra array indexes.

Note: I've not changed gl_sdl - it looks like it doesn't use the context
or surface at all and they could just be removed, but I don't build that
one here and don't want to touch it.
2016-12-16 09:48:15 -06:00
Cedric BAIL 73b308fb66 evas: refactor setup stage and reduce complexity for engine. 2016-12-07 15:47:56 -08:00
Derek Foreman 1809b3b959 gl_x11: Do KHR Partial Damage properly
KHR partial damage must be set once at the beginning of rendering with
buffer damage for the entire scene to be rendered.  Doing otherwise can
result in graphical anomalies on some GL implementations.
2016-10-20 14:30:00 -05:00
Derek Foreman 7a978fe58c evas_engines: Send both surface and buffer damage to outbuf_flush callback
Some engines should using sending surface damage, until now we'd only ever
provided them with buffer damage.

The difference is that surface damage is the damage to the surface the
compositor is displaying, and the buffer damage is the damage to the
buffer the client has rendered.  These are different when the client
is using multiple buffers of different ages to render into.

Anything that calls eglSwapBuffersWithDamage, wl_surface_damage() or
wl_surface_damage_buffer() should be using surface damage, and not
buffer damage.

This patch is intended to make no functional change - any flush cb that
used buffer damage before still should.  Actual fixes to follow.

Apologies if I broke any engines - it's a bit of a copy and wasteland
out here.
2016-10-19 16:29:05 -05:00
Jean-Philippe Andre d5da8d31ce gl: Fix usage of GLX/EGL/GL extensions
This is reverts:
e4c641ed1e
  build fix
19eb7b727fbf35620a13fb65b50d3056a484360e:
  glx: Fix black windows in E on nvidia

For all extension functions, we need to match with the extension itself
since GetProcAddress() can return a non-NULL value even when the function
does not exist. Drivers can do a runtime mapping depending on the
context. So, we only trust the return value of GetProcAddress() when
we know for sure that the extension exists.

Thus, if a symbol exists we will always prefer it rather than relying
on GetProcAddress().

Also, glGetString(GL_EXTENSIONS) is now deprecated so we're lucky
it still works most of the time. glGetStringi() should be used
instead. This patch changes some of the use cases, but not all.

Fixes T3030 (again)
Fixes T4288

@fix
2016-08-16 16:14:21 +09:00
Carsten Haitzler 40250fda22 evas gl x11 engine - fix buffer age symbol find and use
it serems some changes broke our buffer age querying - we were using
the wrong symbol... the EXT or ARGB onenot the core one which does
work. use that first. then we get buffer age.

@fix
2016-08-16 15:19:21 +09:00
Jean-Philippe Andre 19eb7b727f glx: Fix black windows in E on nvidia
This fixes calls to glXCreatePixmap that would consistently
fail on nvidia >= 360.

It seems glXCreatePixmapEXT was used instead of glXCreatePixmap,
and that function always returned 0.

One could assume always using the non-EXT version of the
function should be preferred. Unfortunately, doing so for all
the other functions brings back the black windows.

I'm taking a very careful approach by doing this only for drivers
>= 360.

Fixes T3030

@fix
2016-08-03 17:32:14 +09:00
Jean-Philippe Andre c55c7c0a0d Evas GL: Optimize out calls to eglGetCurrent from the main loop
This is an optimization for EGL only and for the main loop only.

eglGetCurrent{Display,Context,Surface} are expensive calls (they
shouldn't be, but they are). eglMakeCurrent is also very expensive,
so we want as much as possible to avoid calling those functions.
Store the pointers for the main loop as static variables.

Valgrind stats for a quick scrolling session in elm_test:

Before this patch:
 - eglGetCurrentContext ~ 0.4%
 - eglGetCurrentDisplay ~ 0.4%

After this patch:
 - evas_eglGetCurrentContext ~ 0.02%
 - evas_eglGetCurrentDisplay ~ 0.02%
2015-11-10 16:12:21 +09:00
Jean-Philippe Andre b80d7fa302 Evas GL: Fix linking to 'context_restore_set'
There was a terribly complex mechanism to call this function
from the gl_x11 engine to gl_common (evas gl core)... and it
simply didn't work because the function pointer would be NULL.
2015-11-10 16:12:20 +09:00
Dongyeon Kim bea42e6a00 Evas GL: Restore current context to evas gl context when the backend has taken over
Summary:
When Evas GL apis are called outside of on pixels callback,
evas gl backend context may have been made current, and Evas GL will
render into a wrong context.
So here we provide context restore mechanism of keeping track of
currently bound context and calling make current when needed.
@feature

Test Plan: Run Evas GL test cases

Reviewers: jpeg, cedric

Subscribers: mythri, mer.kim, wonsik, cedric

Differential Revision: https://phab.enlightenment.org/D2956
2015-08-18 18:31:40 +09:00
mythri.venugopal d9ee48b013 evas gl: add support for new partial update extension.
Summary:
If EGL_KHR_partial_update extension is implemented by the driver,
set the damage region. This is done before the draw calls.

@feature

Reviewers: wonsik, spacegrapher, jpeg

Reviewed By: spacegrapher

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-08-04 17:34:30 +02:00
Dongyeon Kim 69fa047048 evas/gl_x11: Separate gl symbols check
Summary:
There is a restriction for some gpu drivers that
eglGetProcAddress must be called after eglMakeCurrent.
So separate egl/glx extensions check from gl_symbols
to be called inside eng_window_new.

Test Plan: egl and glx backend tests

Reviewers: cedric, jpeg

Subscribers: cedric, mer.kim, wonsik

Differential Revision: https://phab.enlightenment.org/D2193
2015-03-23 17:17:37 -07:00
Jean-Philippe ANDRE 5bc4b89115 Revert "evas/gl_x11: Optimize out calls to make current"
This reverts commit 0585540bb3.

This broke Evas 3d examples. I also suspected some weird things and
wasn't 100% confident with this patch.

Closes T2215.
Thanks for the report.
2015-03-24 06:27:20 +09:00
Minkyoung Kim 0585540bb3 evas/gl_x11: Optimize out calls to make current
Summary: Reducing the number of calling eglMakeCurrent.

Reviewers: jpeg

Subscribers: wonsik, cedric, spacegrapher

Differential Revision: https://phab.enlightenment.org/D2094
2015-03-17 11:47:35 +09:00
Wonsik Jung 25502e37f8 evas_gl: Add feature to set depth/stencil/msaa bit to window surface.
Summary:
When Evas GL runs with direct rendering, it can not set depth, stencil and msaa to Window surface.
This patch is possible to use "option" input paramater of ecore_evas_gl_x11_options_new.
So, new API is not needed.

The other patch is in elementary. The elementary patch will be used this patch.

Test Plan: Test elm gl veiw in elementary_test and JP's test app.

Reviewers: spacegrapher, cedric, raster, jpeg

Reviewed By: jpeg

Subscribers: cedric, mer.kim

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

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
Note: jpeg changed the original patch a bit (fix style and depth value)
2015-03-16 14:50:56 +09:00
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
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
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
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
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
Cedric BAIL cec904cd03 evas: make gl_x11 rely on gl_generic.
Note that we can't access gl_common directly as it is not possible to link it
2 times. I also didn't want to force evas to be linked with GL/EGL. So I rely
now on dlsym on about 20 symbols to get that backend going.
2014-07-11 15:32:51 +02:00
Cedric BAIL 235caec745 evas: remove multiple definition of glsym_eglSwapBuffersWithDamage. 2014-07-06 18:18:29 +02:00
Cedric BAIL 87bcb1da23 evas: missing shared declaration. 2014-07-05 21:03:36 +02:00
Cedric BAIL 914b529e38 evas: make partial update extention compile for every one in gl_x11 backend. 2014-07-05 12:50:56 +02:00
Cedric BAIL 14d22c5a08 evas: migrate GL_X11 to use more infrastructure of software_generic. 2014-07-04 15:11:22 +02:00
Cedric BAIL 4be4991315 evas: rename Evas_GL_X11_Window to Outbuf. 2014-07-04 15:11:22 +02:00
Taekyun Kim 8fda631730 Evas: 3D: Introducing 3D scene rendering features
Enable 3D features using --enable-evas-3d=yes when configuring.
APIs are exposed through Evas_3D.h.
Currently, evas-3d is being supported only on gl_x11 engine.

Conflicts:

	src/lib/evas/Evas_Eo.h
2014-04-25 16:15:41 +09:00
Daniel Juyung Seo 76d8532b54 efl: Unified eina critical manro to CRI.
Being annoyed by different types of eina critical macros - CRI, CRIT,
 CRITICAL -, I concluded to unify them to one. Discussed on IRC and
 finally, CRI was chosen to meet the consistency with other macros -
 ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
2013-12-26 12:27:13 +09:00
Sebastian Dransfeld 51023d2d4f evas: Keep sane name for public header
Evas_Common.h should be used for the public header, and rather rename
evas_common.h internal header to another name.

Sa:
Evas_Common_Header.h -> Evas_Common.h
evas_common.h -> evas_common_private.h

Shouldn't have both Evas_Common.h and evas_common.h because of case
insensitive filesystems.
2013-06-20 12:53:29 +02:00
Gustavo Sverzut Barbieri ceaab9d37f efl/evas/gl_x11: fix warning due type change.
SVN revision: 82425
2013-01-08 22:47:40 +00:00
Carsten Haitzler 463614021a and this fixes compositing on newest intel+mesa drivers... wrong fb
config wasa being chosen as it was done by hand not accounting for
multisample buffers. now using glxchoosefbconfig instead and it works.



SVN revision: 79232
2012-11-13 14:07:39 +00:00
Vincent Torri c15e9c6575 merge: and now Evas
I've tested make -j 3 install and it works nicely

I've tested expedite with software and opengl xlib,
and it works. Not tested other engines, so please
report any problems (engines or other) on the ML.

TODO: examples and tests, I'll add them later

ISSUE: Eina_Unicode size check. It indirectly depends on
       eina_config.h, which is created at the end of the
       configure script. So its size is always 0. I don't
       know how that size is used, so I can't do a lot,
       for now.


SVN revision: 78895
2012-11-04 11:51:42 +00:00