Commit Graph

141 Commits

Author SHA1 Message Date
Christopher Michael 805d333284 Evas_GL: Fix kakaroto's breakage in evas_gl. GL_WRITE_ONLY is only
defined in GL/glext.h (which is not included if we are building for
SGX). A build for SGX uses EGL which defines GL_WRITE_ONLY_OES instead.

NB: I am not entirely sure that this is the 'proper' fix, but it
allows evas to build again.



SVN revision: 76540
2012-09-12 16:05:02 +00:00
Youness Alaoui 49e4b498a2 Evas : Use server based buffers for vertices instead of client buffers
Implement a auto-free system of the allocated buffers to avoid using
resources that we may not need anymore.

SVN revision: 76490
2012-09-12 06:19:50 +00:00
Carsten Haitzler 54650e7e56 fix font glyph issue when gl enignes shut down leaving font glyph data
for textures in the font core.



SVN revision: 75243
2012-08-14 08:31:59 +00:00
Youness Alaoui 60800876c3 Evas: Use proper variable (gc->shared is set later on)
SVN revision: 75022
2012-08-08 23:35:58 +00:00
ChunEon Park a7f8d70ef1 evas/gl - fixed Evas_Map NightMare.
Trvial mistake but I wasted much time to find out it.




SVN revision: 73331
2012-07-05 08:41:59 +00:00
ChunEon Park 9fbe6288df evas/gl - indentation fix
SVN revision: 73330
2012-07-05 08:37:16 +00:00
Carsten Haitzler bbf95e48b7 i don't believe that we forgot that desktopgl has an unload for shader
compiler... use it. minor minor minor.



SVN revision: 70374
2012-04-21 01:51:58 +00:00
Carsten Haitzler 67f7f6a2ae formatting fixup.
SVN revision: 70124
2012-04-12 07:57:50 +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 c75637b6bf remove warnings!
SVN revision: 65896
2011-12-05 09:26:04 +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
Youness Alaoui 93d79aa509 Evas: Check for dlsym and disable gl engines if not found
SVN revision: 64091
2011-10-15 09:31:04 +00:00
Youness Alaoui 74c3fe766e Evas: Remove a useless ifdef that was causing dead code.
You can't compile a gl_common .c file based on whether or not the SDL
header was included. The .c file will result in only one .o and since
the Evas_Engine_Sdl.h is not included by evas_gl_context.c itself, then
that ifdef will never be true.
gl_common should request a callback function pointer from the evas engine
for doing symbol resolution. This needs a refactor.

SVN revision: 64086
2011-10-15 09:30:33 +00:00
Carsten Haitzler ab7d9bdd84 fix use of invalid program id IF viewport changed - also disable
GLERR. this can really hurt performance.



SVN revision: 64027
2011-10-12 23:22:26 +00:00
Carsten Haitzler 4d5b4b2f24 fix gl pipeline problem with textures and map and the wrong program id
being set/restored.



SVN revision: 64014
2011-10-12 10:27:17 +00:00
Carsten Haitzler 7597814df2 adapt to SEC direct texture access changes for the last time.
SVN revision: 63959
2011-10-10 10:08:29 +00:00
Carsten Haitzler 6fd17b839d Commit Neil's patch reported here:
http://trac.enlightenment.org/e/ticket/880



SVN revision: 63920
2011-10-08 04:58:57 +00:00
Carsten Haitzler f054f04d08 bad cedric! broke gl engine!
SVN revision: 63729
2011-09-30 16:18:41 +00:00
Cedric BAIL cc71e34616 evas: zero swizzeling code for Samsung platform.
SVN revision: 63727
2011-09-30 15:51:32 +00:00
Carsten Haitzler 9522d5b359 warning--
SVN revision: 63477
2011-09-19 10:48:11 +00:00
Cedric BAIL 20300dfedc evas: and now MT12 gain Open GL support.
SVN revision: 63174
2011-09-04 21:15:04 +00:00
Cedric BAIL 26ee52dd61 evas: add NV12 and MT12 colorspace.
MT12 is has documented in Linux videodev documentation
a 64 * 32 macro block tiled colorspace format used on
Samsung hardware.


SVN revision: 62967
2011-08-29 20:56:48 +00:00
Cedric BAIL a4601bb4b7 evas: refactorise code.
SVN revision: 62788
2011-08-25 08:28:34 +00:00
Cedric BAIL cea7b9dddb evas: refactorize OpenGL engine.
SVN revision: 62752
2011-08-24 16:20:15 +00:00
Cedric BAIL 7ae4bd0f31 evas: add YUY2 shader to GL engine.
TODO: add NV12 and NV12T to evas.


SVN revision: 62721
2011-08-23 15:13:40 +00:00
Vincent Torri 18d1e68924 whitespaces--------
SVN revision: 60426
2011-06-17 07:47:28 +00:00
Lucas De Marchi 10237c5b56 evas: fix misspellings
Misspellings found by codespell



SVN revision: 59822
2011-05-30 16:45:08 +00:00
Carsten Haitzler f854f1f275 fix glpipe optimization that stops the pipes from being used with many
maps



SVN revision: 59638
2011-05-24 06:51:47 +00:00
Carsten Haitzler 97a12de552 make get program binary able to be disabled via env var and display if
wee find the extn too. tested on gles now too.



SVN revision: 59178
2011-05-04 08:05:46 +00:00
Jiyoun Park 56111d2b69 From: Jiyoun Park <jy0703.park@samsung.com>
Subject: [E-devel] [Patch] Evas gl shader use binary shader

I make patch related with evas gl binary shader.
 
The concept of binary shader is  compile shader only once.
 
Some people want to use binary shader because of performance issue.
 
In current evas gl engine, every application have to compile shader each
time. 

But I modify code , so only first running application need compile shader.

Other application use already compiled shader(binary shader)

 
The binary shader is made under HOME/.evas/gl_common_shaders directory. 

Binary shader is created according to GL vendor,GL renderer, GL version and
Module_arch.

The basic flow is
 
1.     First running application which use gl engine check binary shader
directory, but it can't find binary shader. 
2.     After compiling shader, It saves compiled shaders..
3.     Other application checks shader directory, it can use binary
shaders.
 
In mobile target, using binary shader, I can save 150ms. (that time, there
is 11 shaders).

If there is more shaders and more applications, this flow maybe save more
total time. 

(the above is now in, changelog coming, with change to using ~/.cache,
some formatting fixes, make ity do the desktop gl one right with the
retrievable hint parameter ont he program etc. - doesn't break desktop
gl at least. yay. a,so fixes to mke it compile at all).



SVN revision: 59167
2011-05-04 06:15:00 +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
Brett Nash 9eaea94252 Evas: Filters:
More work, proudly supported by Samsung.  Filters!

So now you can apply a whole host of cheesy visual effects to objects at
runtime.  This is the first commit, there are a couple of more to come as I
tweak the filters, and fix blur with GL[1].

Please direct bugs to me nash@nash.id.au.

[1] You'd think shaders would be good at this.. but no, generic blur and GL
are like trying to get an apple product to work with Linux.

SVN revision: 58726
2011-04-19 05:47:56 +00:00
Carsten Haitzler 27609d0572 no need to get this.
SVN revision: 58574
2011-04-12 00:06:57 +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 70bc3602c7 fix scossor clip on 90 degree rots.
SVN revision: 58381
2011-04-06 07:32:33 +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
Brett Nash b96d227334 Masking: Push a bit more arbitrary clipping
This seems to have got lost in my big messup before.  This pushes enough of
mask/arbitrary clip to be somewhat useful.  I need to push a little more soon
for it to be 100% happy, but this is useful level.

SVN revision: 58373
2011-04-06 05:38:38 +00:00
Carsten Haitzler 8859f850fb API add: From <dunamis.park@samsung.com> - sungwoo
start of evas gl api (with compile warning fixes).



SVN revision: 58318
2011-04-04 10:23:12 +00:00
Carsten Haitzler 6b4d91830e wer can release compiler data if we want when done with glsl compiling.
SVN revision: 58172
2011-03-29 09:10:57 +00:00
Cedric BAIL 76a0da7a1c evas: rename Evas_GL_Context to Evas_Engine_GL_Context
patch by Sung W. Park <sungwoo@gmail.com>


SVN revision: 57803
2011-03-16 17:32:49 +00:00
Sung W. Park 37c3f59341 From: "Sung W. Park" <sungwoo@gmail.com>
Subject: [E-devel] Evas - OpenGL and Image Object -
evas_object_image_native_surface_set()

Fix bug with yinvert handling of native surfaces.



SVN revision: 57658
2011-03-10 08:23:39 +00:00
Mike Blumenkrantz 63638f7393 _evas_gl_common_viewport_set segv fix: ROUND 2!
SVN revision: 57561
2011-03-08 01:00:21 +00:00
Carsten Haitzler aaad5f7319 fix most of nash's mess. 2 added aborts that nash has to fix.
SVN revision: 56891
2011-02-10 06:52:53 +00:00
Carsten Haitzler 1b89a7ac5f change map points to use double and floats to reduce perspective
correction adjustment seams in gl engine. almost all gone.



SVN revision: 56180
2011-01-16 07:49:49 +00:00
Carsten Haitzler fdc17c8c84 oooh thank you valgrind! found some bad mem access stuff in the gl
engine on shutdown. was freeing the wring kind of thing in the first
place.. and even then it should be more robust, so fix gl texture
robustness and this bug. can cause on-exit crashes if not fixed.



SVN revision: 56068
2011-01-13 10:41:08 +00:00
Carsten Haitzler 87a0e6575d and avoid some work if there is nothing to flush at all.
SVN revision: 55978
2011-01-07 10:22:22 +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 6abe0b3a94 fix flipped object texture if map enabled AND object happens to be
exactly viewport size.



SVN revision: 52940
2010-10-01 06:22:31 +00:00
Carsten Haitzler 5b45763676 aaaah and map in map clip and more bug fixes...
SVN revision: 52939
2010-10-01 04:46:04 +00:00
Carsten Haitzler 94bfb8fbe6 map in map render bug with gl - fix.
SVN revision: 52936
2010-10-01 03:40:12 +00:00