Commit Graph

79 Commits

Author SHA1 Message Date
Christopher Michael a75b3126b2 Evas (gl_x11): Move make current so we only have one if.
SVN revision: 67137
2012-01-12 12:25:21 +00:00
Christopher Michael dd7d556916 Evas (gl_x11): We cannot call eglMakeCurrent if we have already called
eglTerminate prior (eg: eglTerminate was in the wrong place here).



SVN revision: 67119
2012-01-12 06:06:07 +00:00
Carsten Haitzler dbc5afdee2 sorry sungwoo - going to have to back this dlopen/dlsym styuff out.
intel drivers don;'t like it for some odd reason - i'm trying to track
it down but i can't sanely try middlegrounds right now (eg dont
dlopen/dlsym but actually directly assign symbols etc.), so back out
and let's figure this out before it goes back in :(



SVN revision: 66308
2011-12-18 05:03:24 +00:00
Carsten Haitzler 5967841988 I'm attaching a patch for the initial version of the GL Fastpath
addition to evas gl backend.

Working on different mobile devices, we've noticed that the cost of context
switch (MakeCurrent) in GL can be very expensive depending on the driver
implementation.  To minimize the poorly written driver's context switch
overhead, I've implemented a state tracking layer on top of the driver
implemented GL.

Essentially, this layer wraps all the GL/Glue(GLX/EGL) APIs and manages its own
state changes.  Internally, only one real GL context is created and logical
contexts are created every time a user requests context creation.  The logical
contexts keep track of its states and sets only the necessary states
(the ones that are different than the current ones)
when there is a MakeCurrent request.  The real MakeCurrent gets called when
there is a Surface/Window change request.

The GL library is dlopened and all the APIs are dlsym'ed and wrapped
accordingly.  All the GL functions are in evas_gl_core.{h,c}.

Here's a very simply flow of the code.
   - all the APIs are exported as function pointers (*glsym_glBegin),
     (*glsm_eglCreatContext), and etc.
   - all the native GL/Glue(GLX/EGL) APIs are dlsym'ed as _sym_glBegin,
     _sym_eglCreateContext, and etc.
   - all the fastpath APIs are implmemnted as fpgl_glBegin,
     fpgl_eglCreateContext, and etc.
   - if faspath is seletected, the exported APIs are set accordingly
     ie. glsym_glBegin = fpgl_glBegin;
   - default mode is the regular gl symbols are directly set.
     ie. glsym_glBegin = _sym_glBegin;
             
I have an Environment variable where you can set it to three different Modes

EVAS_GL_FASTPATH = 0    // Default mode. Regular GL symbols are directly loaded
EVAS_GL_FASTPATH = 1    // Fastpath mode. Takes the path described above.
EVAS_GL_FASTPATH = 2    // Wrapped mode.  All the regular GL functions are
                           wrapped once.  This can be used for various
purposes

Since all the GL symbols are now loaded in this library, I took out all
the gl symbol loading parts in the evas gl backend as you'll see in the patch.
The changes to the engine and the backend itself is pretty minor.

There are still some known issues to hammer out but I thought we're at a good
place for an initial version so that my source doesn't diverge too much.

Known Issues and To Do's
* Current GL Fastpath version doesn't support multiple threads. Instead of
  having one global real context, I would need to do it for each thread. I'll
  get on this soon.
  
  * Issues running Evas GL on certain conditions.  When running the elementary
  test (with gl engine), if you run ELMGLview test that runs in ON_DEMAND mode,
  everything works fine. BUT, when you run the ELMGLView test in ALWAYS
    mode, the subsequent elm tests shows blank screen. When you destroy the
  GLView window, everything else comes on fine.
  
  * Resource protection code.  This actually applies to Evas GL code in general
  as well. Since all the resources are shared among all the contexts that get
  created, I would like to eventually have a resource protecting mechanism that
  prevents access to resources outside of its context unless specifically
  specified.
  
  I'm attaching three files
     - evas_gl_core.h, evas_gl_core.c, fastpath.patch
     
  To get the code running...
     - copy evas_gl_core.{c,h} to src/modules/engine/gl_common/
     - apply the fastpath.patch
     - compile/install evas
     - to run with fastpath GL (ie. % EVAS_GL_FASTPATH=1 ./evasgl_sample1)



SVN revision: 65891
2011-12-05 08:54:14 +00:00
Carsten Haitzler 7c7f8803f5 try and make newgl work again... fail! why does glx hate me?
SVN revision: 63885
2011-10-06 15:05:32 +00:00
Carsten Haitzler 837165ed8a no no.. oops. i missed an error!
SVN revision: 63883
2011-10-06 13:46:06 +00:00
Carsten Haitzler bdbfbbd2d3 newgl work.. now.. why?
SVN revision: 63882
2011-10-06 13:45:14 +00:00
Vincent Torri 18d1e68924 whitespaces--------
SVN revision: 60426
2011-06-17 07:47:28 +00:00
Tom Hacohen 80a5464888 Evas: Fixed some annoying Wshadow warnings.
SVN revision: 60305
2011-06-14 14:04:07 +00:00
Sung W. Park bc8af94bfa From: "Sung W. Park" <sungwoo@gmail.com>
Subject: evas_gl_api_get patch.

Here's a patch that simply overrides the GL functions for Evas_GL
except for two functions that I provide on my own.  It may have some symbol
resolving warnings but that'll all go away eventually when we do everything
via dlsym or getProcAddress.
 
You can apply the patch to the latest revision of evas.  (I've just
updated them) I'm also attaching a sample GLES program that uses
evas_gl_api_get. You don't need to link it to -lGL.



SVN revision: 59092
2011-05-02 02:14:00 +00:00
Carsten Haitzler 6b3e820f35 gles warning--
SVN revision: 58514
2011-04-09 04:13:21 +00:00
Carsten Haitzler fe933e7b34 and now REALLY fix that viewport bug...
SVN revision: 58386
2011-04-06 10:11:01 +00:00
Carsten Haitzler 4a982fb26e and handle other make current to "no context" in case.
SVN revision: 58385
2011-04-06 09:40:13 +00:00
Carsten Haitzler dcdd502fd4 fix gles engine bug with > 1 window.. missing viewport transform
fixups on deletion of a window!



SVN revision: 58384
2011-04-06 09:38:39 +00:00
Carsten Haitzler 5c994667c2 fixme notice, fix make current context to force if it was changed.
SVN revision: 58375
2011-04-06 05:56:53 +00:00
Carsten Haitzler f2bf8bbfd9 ok. multi-screen (multihead) support with simultaneous display on 2
screens with the same gl context is more pain than imagined. revert
attempt to handle it. just use xinerama/twinview if u want the
compositor to not suck.



SVN revision: 58050
2011-03-24 01:45:12 +00:00
Carsten Haitzler 3f92c6056c another vendor/renderer example.
SVN revision: 57926
2011-03-21 02:09:09 +00:00
Carsten Haitzler 383f5a91c7 and check extent... FIRST
SVN revision: 57915
2011-03-20 13:25:27 +00:00
Carsten Haitzler 5c45d8fdaf support multiple screens AT the same time... multiple gl contexts -
one is created per screen #. max is 16 screens (0->15). dont know if
this really works yet.



SVN revision: 57912
2011-03-20 08:48:30 +00:00
Carsten Haitzler ac97fb1944 add blacklisting for software gl implementations
SVN revision: 57908
2011-03-20 06:08:53 +00:00
Carsten Haitzler b875f1dda5 turn loose binding off on newer-ish nvidia dreiver versions. this is an
experiment. testing to see if it helps.



SVN revision: 57893
2011-03-19 10:58:34 +00:00
Carsten Haitzler ccfe91cc58 REVERT! hell no. glu is not going to become a dependency. it never
was. you broke gl-es support and didnt link to glu either. it's a
separate lib. no no no no no.



SVN revision: 57558
2011-03-07 19:11:18 +00:00
Mike Blumenkrantz ea5e9b6773 fix weird segv I found when trying opengl mode in comp module on my desktop, waiting for someone to give me the "good job you did it correctly" before I backport since I probably didn't
SVN revision: 57546
2011-03-07 05:41:49 +00:00
Mike Blumenkrantz d46942090d unless I'm going insane, this should return here to avoid an immediate null deref with configs[i]
SVN revision: 56099
2011-01-14 06:35:03 +00:00
Carsten Haitzler d7e8cfba62 egl actually doesnt need a full reset - we CAN get the current context
and draw/read surfaces.



SVN revision: 55977
2011-01-07 10:16:17 +00:00
Carsten Haitzler 4147f2f231 make sure we ensure out gl context is current at each frame start
SVN revision: 55131
2010-12-02 08:01:19 +00:00
Gustavo Sverzut Barbieri 379b546adf better logging.
* log domains in lower-case only please. let's make it a standard so
   we don't have to look at the code everytime to figure out the name...

 * logs do NOT require trailing newline (\n), it's automatic!

 * do NOT add newline inside log messages!

 * add gl_common logging.

NOTE: I tried to compile all modules, but there are clear broken
      modules such as cairo and qtopia. Other modules like gl_sdl are
      broken as they were not updated to new gl_common api (resize
      method AFAIR).



SVN revision: 53174
2010-10-07 23:46:42 +00:00
Carsten Haitzler ae6922fbd0 make sure that at any point if gl barfs... abort then.
SVN revision: 52838
2010-09-28 04:13:28 +00:00
Carsten Haitzler c54bd4052c warning--
SVN revision: 52448
2010-09-19 02:33:19 +00:00
Gustavo Sverzut Barbieri 19f0eebd27 cleanup: simple clean of "comparison between signed and unsigned errors"
not much to see here, please review but these are simple changes.



SVN revision: 52426
2010-09-18 23:07:31 +00:00
Carsten Haitzler 428e35e5d3 make it an env var to enable/disable window unsurface/resurfacing.
SVN revision: 51742
2010-08-30 06:46:29 +00:00
Carsten Haitzler 1874321e33 and actually fix un/resurf. done.
SVN revision: 51675
2010-08-27 10:45:06 +00:00
Carsten Haitzler f713366e7d fix un/resurf for dump.
SVN revision: 51674
2010-08-27 10:38:41 +00:00
Carsten Haitzler 09d9dcc715 some minor cleanliness in the unsurf/resurf stuff.
SVN revision: 51668
2010-08-27 01:14:03 +00:00
Carsten Haitzler efb72afbc1 be able to free and alloc gl surface when asked to dump
SVN revision: 51654
2010-08-26 09:40:48 +00:00
Carsten Haitzler 7ccee2cfe9 aagh fix fix! works again.
SVN revision: 51652
2010-08-26 04:37:43 +00:00
Carsten Haitzler 9d7a3a2bfc silence gl enging output unless you set EVAS_GL_INFO in env. move some
fixed numbers into env vars for tuning purposes and debugging ... and
importantly - fix a smooth vs non-smooth texture mode thing.



SVN revision: 51651
2010-08-26 01:41:48 +00:00
Carsten Haitzler 2d3ea36109 more work on egl image direct access.
SVN revision: 51070
2010-08-13 10:34:51 +00:00
Carsten Haitzler 83f2ef6142 working on new gl engine feature. inactive right now.
SVN revision: 51027
2010-08-12 06:02:15 +00:00
Carsten Haitzler 04df26bef5 aaah yes. get the ref -1 as free will dec it.
SVN revision: 50662
2010-07-29 23:32:56 +00:00
Carsten Haitzler f20b010d41 now work?
SVN revision: 50635
2010-07-29 06:21:51 +00:00
Carsten Haitzler 166dc4c594 try no surf/context etc. on free in egl.
SVN revision: 49790
2010-06-22 00:06:40 +00:00
Carsten Haitzler 7f99f93744 use before freeing to make sure context is right
SVN revision: 49781
2010-06-21 07:59:46 +00:00
Carsten Haitzler 4fefcad954 if shader compile fails - peroclate error back up to engine info_set so we
know gl engine is useless.



SVN revision: 48956
2010-05-18 03:49:59 +00:00
Carsten Haitzler fa6a067737 gl engine now does rotates (0, 90, 180, 270), like software engines
SVN revision: 48704
2010-05-09 05:15:20 +00:00
Carsten Haitzler 3cf6e2fde7 1. clean up egl better on context shutdown
2. clean up pprograms/shaders on shared shutdown



SVN revision: 47386
2010-03-23 09:55:02 +00:00
Carsten Haitzler eb4c4a29b3 actuallyu free gl context//terminate on last gl window gone.
SVN revision: 47361
2010-03-22 05:33:20 +00:00
Carsten Haitzler a67d080b06 some internalling of symbols and formatting
SVN revision: 46702
2010-03-01 16:17:11 +00:00
Carsten Haitzler 8bac55ed06 ok cant get this info until a context is made current. aaagh. tat means i
cant decide on the config attrs to pass based on vendor. :(



SVN revision: 46690
2010-03-01 13:08:07 +00:00
Carsten Haitzler 2f8e37e654 disabel the rgb select for now until nokia fix their bugs.
SVN revision: 46687
2010-03-01 12:45:47 +00:00