Summary:
When either FBO or EGL image from texture extension is not supported,
we can use pixmap surface as indirect surface fallback.
Since native pixmaps have (0,0) in the upper left while
FBOs have (0,0) in the lower left, we should invert the y coordinates
when native pixmaps are used as the render target.
To accomodate run-time y-invert check we add a new callback for
EVAS_NATIVE_SURFACE_EVASGL type.
Reviewers: cedric, jpeg
Subscribers: wonsik, mer.kim, cedric
if yuou use 709 instead of 601 yuv (ycbcr) evas will just be wrong and
use 601. this fixes that and implements 709. it also fixes a scaling
bug for yuv in the gl engine. no one noticed but me, so i won't call
this a bug fix, and it can go into the next efl release - no need to
backport unless it actually bothers peolpe (which it seemingly doesn't)
Summary:
It is need in case Evas_3D_Mesh created with not normileze texture coordinate
and flag repeat mode for Evas_3D_Texture
Additional info see here https://phab.enlightenment.org/conpherence/54/
Use Evas_GL_Image for generation texture unit for Evas_3D_Texture
see here https://phab.enlightenment.org/D2371
Reviewers: jpeg, cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2375
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This should fix Dave's crash with the GL engine.
Indeed the pointer to the color array is passed directly
to the driver, without memcpy. Then, during glDrawArrays, the
driver will try to address it... but it could as well be NULL or
invalid. So, crashes would occur.
Also mark use_vertex as always true. We keep this field only for the
alloc() function.
Remove all individual shaders, factorize everything into
one vertex and one fragment shader. All previous functionality
has been kept as is[*]. Some new features have been added
(new shader types).
This is a first step in simplifying and improving the shaders system.
Next: simplify shader selection
[*] Yeah, that's quite a bold statement here. Maybe I broke everything.
Invert the meaning of scaled (w,h), so that im->(w,h) corresponds
to the final scaled size, and the original size is stored directly
in the texture itself.
This simplifies code a little bit.
Also, lift the limitation on the maximum texture size, as those
virtual textures are not limited by GPU texture size.
Use the same method as for map masking:
- Pass absolute geometry of the mask to the push functions,
- Compute absolute position in the shader (like gl_Position)
and apply scaling factor + offset to sample the mask.
Masking now uses a single vec4 attribute instead of hi-jacking
other vertices.
This way, all masking shaders share the same code and are way
simpler. On the other hand, the vertex shaders have a little bit
more work to do.
Summary:
Change function and variable names to more suitable ones.
Remove FBO_FUNC macros.
Little tidying up from previous commit.
Test Plan: Local Evas GL tests for 1.1, 2.0, and 3.0
Reviewers: jpeg
Subscribers: cedric, mer.kim, mythri, wonsik
Differential Revision: https://phab.enlightenment.org/D2126
Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
Summary:
Fix build errors for glx backend made from previous commit
Revert parameter naming
Test Plan: Local Evas GL tests for 1.1, 2.0, and 3.0
Reviewers: jpeg
Subscribers: mythri, wonsik, cedric, mer.kim
Differential Revision: https://phab.enlightenment.org/D2117
Summary:
When the context version between Evas GL and GL backend differs,
we cannot share texture between them.
So, when the driver has support for KHR_gl_texture_2D_image extension,
use EGL image to share between Evas GL and GL backend
Test Plan: Local Evas GL tests for 1.1, 2.0 and 3.0
Reviewers: jpeg
Subscribers: mythri, mer.kim, wonsik, cedric
Differential Revision: https://phab.enlightenment.org/D2115
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.
Unfortunately, this "feature" has many problems and does not really
fix those it was supposed to address:
- Elm Photocam becomes horrible to use (the transition from
low-res to high-res tiles triggers this miniature path).
- Evas async preload callback is called before the full image
is ready (ie. the texture is not uploaded yet), when really
the preload callback should be triggered only once the image
is 100% ready. (TODO)
- Sometimes the miniature image keeps being used even though the
main image has been uploaded (eg. with E background). Maybe the
object image is not redrawn when it should.
- This uses a separate thread for the upload, which is both a good
and bad idea because we need to do a make current. Also, this does
not upload the full-res image tile by tile, but only in one pass,
thus blocking the render loop until finished.
This patch changes the env var from "EVAS_GL_NOPRELOAD" to
"EVAS_GL_PRELOAD" (and only "1" will enable).
Sorry Cedric, we can talk later about how to improve this.
not changed.
Automatically fallback to indirect rendering on FBO or X11 Pixmap
if the Evas Object Image is not marked as dirty. This should
improve the performance and/or power consumption in those
rare cases where this area of the canvas needs to be redrawn
but the GL content has not changed.
@feature
Summary:
Currently dynamic hint set is implemented using eglMapImageSEC extension,
which is no longer supported by any drivers (should be deprecated)
This patch implements dynamic hint set using Khronos extension EGL_TIZEN_image_native_surface.
Since tbm surface library is required for this, libtbm.so is queried at context new.
Test Plan: Local tests
Reviewers: raster, Hermet, cedric, jpeg
Subscribers: mer.kim, wonsik, cedric
Differential Revision: https://phab.enlightenment.org/D2027
Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
jpeg: I also fixed a few minor style issues and two warnings (bad function
names, glsym instead of secsym).
Remove last traces of the uniforms stuff for shaders, that was
removed in the following commits: 6b48c106d3 and cfd337a758.
Don't use uniforms in the evas GL pipeline, at least not like that.
This will currently optimize most of the masks when using the
GL engine[1].
This is a very special case that adds a highly optimized path
for masking in GL. It works by creating a virtual image, containing
a pointer to the original image and a new geometry[2].
Instead of creating a new FBO-based surface (image_map_surface),
we refer to the original image and adjust the mask geometry on
the fly.
KNOWN BUGS:
- masking a map with such a scaled image is now broken.
[1] Right now all masks are simple Evas Object Image, so that means
all cases of masking, except masks of masks, or masks of maps,
will be optimized with this new method.
[2] This virtual image mechanism is still quite hackish and may
be improved (for memory usage, refcounting, etc...)
This reverts commit 986b60eaf0.
Added PUSH_SAMPLE for simplicity.
It was dumb of me to use uniforms, so I added a comment to prevent
other dumb people from making the same mistake later.
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.
This should speed up setting uniforms in the shaders, by storing
their locations in the Evas_GL_Program description.
I kept the previous solution with name as fallback, but it won't
actually be used with the current shaders.
Image and texture programs "12", "21" and "22" used tex_sample
as a texture attribute passed to the vertex shader. Instead of
this seemingly hackish solution, use a vec2 uniform.
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>
Some shader files (shd) were not included in EXTRA_DIST. This didn't break
the build because the .x file was correctly generated.
I guess the missing files in previous releases also had no impact because
the .h files would be generated and shipped.
Also generate the enum automagically. New shaders need to be added
to Makefile_Evas.am.
Masking is not used (there even was a recent commit by Hermet to
remove most of the occurences of mask shaders in GL), and I've
introduced a new ETC1+Alpha feature. Replace the old texm and
associated variables by texa for alpha texures.