Refactored Evas GL engine code so wayland_egl and gl_x11 and other

engines can share the same code. The common codes are in gl_common/
directory and evas_engine just has to implement a few engine functions.



SVN revision: 77032
This commit is contained in:
Sung Park 2012-09-24 07:41:27 +00:00
parent 8f1c793565
commit bbba85b546
10 changed files with 5947 additions and 2479 deletions

View File

@ -1049,3 +1049,11 @@
* Fix native surface crash when setting to null in some
situations.
2012-09-24 Sung W. Park (sung_)
* Refactored Evas GL engine code so wayland_egl and gl_x11 and other
engines can share the same code. The common codes are in gl_common/
directory and evas_engine just has to implement a few engine functions.

View File

@ -26,6 +26,9 @@ evas_gl_font.c \
evas_gl_polygon.c \
evas_gl_line.c \
evas_gl_filter.c \
evas_gl_core.c \
evas_gl_api.c \
evas_gl_api_ext.c \
shader/rect_frag.h \
shader/rect_vert.h \
shader/font_frag.h \

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,286 @@
#include "evas_gl_api_ext.h"
#include <dlfcn.h>
#define MAX_EXTENSION_STRING_BUFFER 10240
char _gl_ext_string[10240] = { 0 };
#ifndef EGL_NATIVE_PIXMAP_KHR
# define EGL_NATIVE_PIXMAP_KHR 0x30b0
#endif
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Extension HEADER
/////////////////////////////////////////////////////////////////////////////////////////////////////
#define _EVASGL_EXT_CHECK_SUPPORT(name)
#define _EVASGL_EXT_DISCARD_SUPPORT()
#define _EVASGL_EXT_BEGIN(name)
#define _EVASGL_EXT_END()
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) ret (*glextsym_##name) param = NULL;
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#include "evas_gl_api_ext_def.h"
#undef _EVASGL_EXT_CHECK_SUPPORT
#undef _EVASGL_EXT_DISCARD_SUPPORT
#undef _EVASGL_EXT_BEGIN
#undef _EVASGL_EXT_END
#undef _EVASGL_EXT_DRVNAME
#undef _EVASGL_EXT_FUNCTION_BEGIN
#undef _EVASGL_EXT_FUNCTION_END
#undef _EVASGL_EXT_FUNCTION_DRVFUNC
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Extension HEADER
/////////////////////////////////////////////////////////////////////////////////////////////////////
#define _EVASGL_EXT_CHECK_SUPPORT(name)
#define _EVASGL_EXT_DISCARD_SUPPORT()
#define _EVASGL_EXT_BEGIN(name) int _gl_ext_support_##name = 0;
#define _EVASGL_EXT_END()
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#include "evas_gl_api_ext_def.h"
#undef _EVASGL_EXT_CHECK_SUPPORT
#undef _EVASGL_EXT_DISCARD_SUPPORT
#undef _EVASGL_EXT_BEGIN
#undef _EVASGL_EXT_END
#undef _EVASGL_EXT_DRVNAME
#undef _EVASGL_EXT_FUNCTION_BEGIN
#undef _EVASGL_EXT_FUNCTION_END
#undef _EVASGL_EXT_FUNCTION_DRVFUNC
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Evas extensions from EGL extensions
#ifdef GL_GLES
static void *
evgl_evasglCreateImage(int target, void* buffer, int *attrib_list)
{
EVGL_Engine *ee = evgl_engine;
EGLDisplay dpy = EGL_NO_DISPLAY;
if ((ee) && (ee->funcs->display_get))
{
dpy = (EGLDisplay)ee->funcs->display_get(ee->engine_data);
return EXT_FUNC(eglCreateImage)(dpy, EGL_NO_CONTEXT, target, buffer, attrib_list);
}
else
{
ERR("Invalid Engine... (Can't acccess EGL Display)\n");
return NULL;
}
}
static void
evgl_evasglDestroyImage(EvasGLImage image)
{
EVGL_Engine *ee = evgl_engine;
EGLDisplay dpy = EGL_NO_DISPLAY;
if ((ee) && (ee->funcs->display_get))
{
dpy = (EGLDisplay)ee->funcs->display_get(ee->engine_data);
EXT_FUNC(eglDestroyImage)(dpy, image);
}
else
ERR("Invalid Engine... (Can't acccess EGL Display)\n");
}
static void
evgl_glEvasGLImageTargetTexture2D(GLenum target, EvasGLImage image)
{
EXT_FUNC(glEGLImageTargetTexture2DOES)(target, image);
}
static void
evgl_glEvasGLImageTargetRenderbufferStorage(GLenum target, EvasGLImage image)
{
EXT_FUNC(glEGLImageTargetTexture2DOES)(target, image);
}
#else
#endif
static int _evgl_api_ext_status = 0;
void
evgl_api_ext_init(void *getproc, const char *glueexts)
{
const char *glexts;
typedef void (*_getproc_fn) (void);
typedef _getproc_fn (*fp_getproc)(const char *);
fp_getproc gp = (fp_getproc)getproc;
memset(_gl_ext_string, 0x00, MAX_EXTENSION_STRING_BUFFER);
#define FINDSYM(getproc, dst, sym) \
if ((!dst) && (getproc)) dst = (__typeof__(dst))getproc(sym); \
if (!dst) dst = (__typeof__(dst))dlsym(RTLD_DEFAULT, sym);
// GLES Extensions
glexts = (const char*)glGetString(GL_EXTENSIONS);
/*
// GLUE Extensions
#ifdef GL_GLES
getproc = &eglGetProcAddress;
glueexts = eglQueryString(re->win->egl_disp, EGL_EXTENSIONS);
#else
getproc = &glXGetProcAddress;
glueexts = glXQueryExtensionsString(re->info->info.display,
re->info->info.screen);
#endif
*/
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Extension HEADER
/////////////////////////////////////////////////////////////////////////////////////////////////////
#define GETPROCADDR(sym) \
(((!(*drvfunc)) && (gp)) ? (__typeof__((*drvfunc)))gp(sym) : (__typeof__((*drvfunc)))dlsym(RTLD_DEFAULT, sym))
#define _EVASGL_EXT_BEGIN(name) \
{ \
int *ext_support = &_gl_ext_support_##name;
#define _EVASGL_EXT_END() \
}
#define _EVASGL_EXT_CHECK_SUPPORT(name) \
(strstr(glexts, #name) != NULL || strstr(glueexts, #name) != NULL)
#define _EVASGL_EXT_DISCARD_SUPPORT() \
ext_support = 0;
#define _EVASGL_EXT_DRVNAME(name) \
if (_EVASGL_EXT_CHECK_SUPPORT(name)) *ext_support = 1;
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
{ \
ret (**drvfunc)param = &glextsym_##name;
#define _EVASGL_EXT_FUNCTION_END() \
if ((*drvfunc) == NULL) _EVASGL_EXT_DISCARD_SUPPORT(); \
}
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name) \
*drvfunc = name;
#include "evas_gl_api_ext_def.h"
#undef _EVASGL_EXT_CHECK_SUPPORT
#undef _EVASGL_EXT_DISCARD_SUPPORT
#undef _EVASGL_EXT_BEGIN
#undef _EVASGL_EXT_END
#undef _EVASGL_EXT_DRVNAME
#undef _EVASGL_EXT_FUNCTION_BEGIN
#undef _EVASGL_EXT_FUNCTION_END
#undef _EVASGL_EXT_FUNCTION_DRVFUNC
#undef GETPROCADDR
/////////////////////////////////////////////////////////////////////////////////////////////////////
_gl_ext_string[0] = 0x00; //NULL;
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Extension HEADER
/////////////////////////////////////////////////////////////////////////////////////////////////////
#define _EVASGL_EXT_BEGIN(name) \
if (_gl_ext_support_##name != 0) strcat(_gl_ext_string, #name" ");
#define _EVASGL_EXT_END()
#define _EVASGL_EXT_CHECK_SUPPORT(name)
#define _EVASGL_EXT_DISCARD_SUPPORT()
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#include "evas_gl_api_ext_def.h"
#undef _EVASGL_EXT_CHECK_SUPPORT
#undef _EVASGL_EXT_DISCARD_SUPPORT
#undef _EVASGL_EXT_BEGIN
#undef _EVASGL_EXT_END
#undef _EVASGL_EXT_DRVNAME
#undef _EVASGL_EXT_FUNCTION_BEGIN
#undef _EVASGL_EXT_FUNCTION_END
#undef _EVASGL_EXT_FUNCTION_DRVFUNC
/////////////////////////////////////////////////////////////////////////////////////////////////////
_evgl_api_ext_status = 1;
}
void
evgl_api_ext_get(Evas_GL_API *gl_funcs)
{
if (_evgl_api_ext_status != 1)
{
ERR("EVGL extension is not yet initialized.");
return;
}
#define ORD(f) EVAS_API_OVERRIDE(f, gl_funcs, glextsym_)
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Extension HEADER
/////////////////////////////////////////////////////////////////////////////////////////////////////
#define _EVASGL_EXT_CHECK_SUPPORT(name)
#define _EVASGL_EXT_DISCARD_SUPPORT()
#define _EVASGL_EXT_BEGIN(name) \
if (_gl_ext_support_##name != 0) \
{
#define _EVASGL_EXT_END() \
}
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
ORD(name);
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_PRIVATE_END()
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#include "evas_gl_api_ext_def.h"
#undef _EVASGL_EXT_CHECK_SUPPORT
#undef _EVASGL_EXT_DISCARD_SUPPORT
#undef _EVASGL_EXT_BEGIN
#undef _EVASGL_EXT_END
#undef _EVASGL_EXT_DRVNAME
#undef _EVASGL_EXT_FUNCTION_BEGIN
#undef _EVASGL_EXT_FUNCTION_END
#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
#undef _EVASGL_EXT_FUNCTION_PRIVATE_END
#undef _EVASGL_EXT_FUNCTION_DRVFUNC
/////////////////////////////////////////////////////////////////////////////////////////////////////
#undef ORD
}
const char *
evgl_api_ext_string_get()
{
if (_evgl_api_ext_status != 1)
{
ERR("EVGL extension is not yet initialized.");
return NULL;
}
return _gl_ext_string;
}

View File

@ -0,0 +1,72 @@
#ifndef _EVAS_GL_API_EXT_H
#define _EVAS_GL_API_EXT_H
typedef char GLchar;
#include "evas_gl_core_private.h"
#ifdef GL_GLES
#include <EGL/egl.h>
#include <EGL/eglext.h>
#else
# include <GL/glext.h>
# include <GL/glx.h>
#endif
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Extension HEADER
/////////////////////////////////////////////////////////////////////////////////////////////////////
#define _EVASGL_EXT_CHECK_SUPPORT(name)
#define _EVASGL_EXT_DISCARD_SUPPORT()
#define _EVASGL_EXT_BEGIN(name)
#define _EVASGL_EXT_END()
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) extern ret (*glextsym_##name) param;
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#include "evas_gl_api_ext_def.h"
#undef _EVASGL_EXT_CHECK_SUPPORT
#undef _EVASGL_EXT_DISCARD_SUPPORT
#undef _EVASGL_EXT_BEGIN
#undef _EVASGL_EXT_END
#undef _EVASGL_EXT_DRVNAME
#undef _EVASGL_EXT_FUNCTION_BEGIN
#undef _EVASGL_EXT_FUNCTION_END
#undef _EVASGL_EXT_FUNCTION_DRVFUNC
/////////////////////////////////////////////////////////////////////////////////////////////////////
#define EXT_FUNC(fname) glextsym_##fname
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Extension HEADER
/////////////////////////////////////////////////////////////////////////////////////////////////////
#define _EVASGL_EXT_CHECK_SUPPORT(name)
#define _EVASGL_EXT_DISCARD_SUPPORT()
#define _EVASGL_EXT_BEGIN(name) extern int _gl_ext_support_##name;
#define _EVASGL_EXT_END()
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#include "evas_gl_api_ext_def.h"
#undef _EVASGL_EXT_CHECK_SUPPORT
#undef _EVASGL_EXT_DISCARD_SUPPORT
#undef _EVASGL_EXT_BEGIN
#undef _EVASGL_EXT_END
#undef _EVASGL_EXT_DRVNAME
#undef _EVASGL_EXT_FUNCTION_BEGIN
#undef _EVASGL_EXT_FUNCTION_END
#undef _EVASGL_EXT_FUNCTION_DRVFUNC
/////////////////////////////////////////////////////////////////////////////////////////////////////
#define EXTENSION_SUPPORT(name) (_gl_ext_support_##name == 1)
extern void evgl_api_ext_init(void *getproc, const char *glueexts);
extern void evgl_api_ext_get(Evas_GL_API *gl_funcs);
extern const char *evgl_api_ext_string_get();
#endif //_EVAS_GL_API_EXT_H

View File

@ -0,0 +1,632 @@
//////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _EVASGL_EXT_BEGIN
#define _EVASGL_EXT_USE_DEFAULT_DEFINE
#define _EVASGL_EXT_CHECK_SUPPORT(name)
#define _EVASGL_EXT_DISCARD_SUPPORT()
// Begin of the extension block (name : EVAS extension name)
#define _EVASGL_EXT_BEGIN(name)
// End of the extension block
#define _EVASGL_EXT_END()
// Driver extensions to wrap (name : SPEC extension name)
#define _EVASGL_EXT_DRVNAME(name)
// These functions will be exported to 'EVAS extension function'.
// The functions of this block must correspond with the functions list in Evas_GL.h.
// Begin of the extension function block (ret : return value, name : function name, param : parameters with bracket)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) ret (*name) param;
// End of the extension function block
#define _EVASGL_EXT_FUNCTION_END()
// These functions will not be exported. Only be used in engines privately.
// Begin of the extension function block (ret : return value, name : function name, param : parameters with bracket)
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param)
// End of the extension function block
#define _EVASGL_EXT_FUNCTION_PRIVATE_END()
// Driver extension functions to wrap (name : SPEC extension function name)
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param) _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_DEFINED
#endif
#ifndef _EVASGL_EXT_FUNCTION_PRIVATE_END
#define _EVASGL_EXT_FUNCTION_PRIVATE_END() _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_PRIVATE_END_DEFINED
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// GL/GLES EXTENSIONS
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
_EVASGL_EXT_BEGIN(get_program_binary)
_EVASGL_EXT_DRVNAME(GL_OES_get_program_binary)
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetProgramBinaryOES, (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetProgramBinary"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glProgramBinaryOES, (GLuint program, GLenum binaryFormat, const void *binary, GLint length))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glProgramBinary"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(mapbuffer)
_EVASGL_EXT_DRVNAME(GL_OES_mapbuffer)
_EVASGL_EXT_FUNCTION_BEGIN(void *, glMapBufferOES, (GLenum target, GLenum access))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glMapBuffer"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(GLboolean, glUnmapBufferOES, (GLenum target))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glUnmapBuffer"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetBufferPointervOES, (GLenum target, GLenum pname, void** params))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetBufferPointerv"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(texture_3D)
_EVASGL_EXT_DRVNAME(GL_OES_texture_3D)
_EVASGL_EXT_FUNCTION_BEGIN(void, glTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glTexImage3D"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glTexSubImage3D"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glCopyTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glCopyTexSubImage3D"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glCompressedTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glCompressedTexImage3D"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glCompressedTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glCompressedTexSubImage3D"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glFramebufferTexture3DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glFramebufferTexture3D"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(AMD_performance_monitor)
_EVASGL_EXT_DRVNAME(AMD_performance_monitor)
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetPerfMonitorGroupsAMD, (GLint* numGroups, GLsizei groupsSize, GLuint* groups))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetPerfMonitorGroupsAMD"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetPerfMonitorCountersAMD, (GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetPerfMonitorCountersAMD"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetPerfMonitorGroupStringAMD, (GLuint group, GLsizei bufSize, GLsizei* length, char* groupString))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetPerfMonitorGroupStringAMD"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetPerfMonitorCounterStringAMD, (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char* counterString))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetPerfMonitorCounterStringAMD"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetPerfMonitorCounterInfoAMD, (GLuint group, GLuint counter, GLenum pname, void* data))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetPerfMonitorCounterInfoAMD"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glGenPerfMonitorsAMD, (GLsizei n, GLuint* monitors))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGenPerfMonitorsAMD"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glDeletePerfMonitorsAMD, (GLsizei n, GLuint* monitors))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glDeletePerfMonitorsAMD"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glSelectPerfMonitorCountersAMD, (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glSelectPerfMonitorCountersAMD"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glBeginPerfMonitorAMD, (GLuint monitor))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glBeginPerfMonitorAMD"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glEndPerfMonitorAMD, (GLuint monitor))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glEndPerfMonitorAMD"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetPerfMonitorCounterDataAMD, (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetPerfMonitorCounterDataAMD"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(discard_framebuffer)
_EVASGL_EXT_DRVNAME(GL_EXT_discard_framebuffer)
_EVASGL_EXT_FUNCTION_BEGIN(void, glDiscardFramebufferEXT, (GLenum target, GLsizei numAttachments, const GLenum* attachments))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glDiscardFramebuffer"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(multi_draw_arrays)
_EVASGL_EXT_DRVNAME(GL_EXT_multi_draw_arrays)
_EVASGL_EXT_FUNCTION_BEGIN(void, glMultiDrawArraysEXT, (GLenum mode, GLint* first, GLsizei* count, GLsizei primcount))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glMultiDrawArrays"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glMultiDrawElementsEXT, (GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glMultiDrawElementsARB"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(NV_fence)
_EVASGL_EXT_DRVNAME(GL_NV_fence)
_EVASGL_EXT_FUNCTION_BEGIN(void, glDeleteFencesNV, (GLsizei n, const GLuint* fences))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glDeleteFencesNV"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glGenFencesNV, (GLsizei n, GLuint* fences))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGenFencesNV"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(unsigned char, glIsFenceNV, (GLuint fence))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glIsFenceNV"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(unsigned char, glTestFenceNV, (GLuint fence))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glTestFenceNV"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetFenceivNV, (GLuint fence, GLenum pname, GLint* params))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetFenceivNV"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glFinishFenceNV, (GLuint fence))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glFinishFenceNV"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glSetFenceNV, (GLuint, GLenum))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glSetFenceNV"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(QCOM_driver_control)
_EVASGL_EXT_DRVNAME(GL_QCOM_driver_control)
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetDriverControlsQCOM, (GLint* num, GLsizei size, GLuint* driverControls))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetDriverControlsQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetDriverControlStringQCOM, (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetDriverControlStringQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glEnableDriverControlQCOM, (GLuint driverControl))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glEnableDriverControlQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glDisableDriverControlQCOM, (GLuint driverControl))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glDisableDriverControlQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(QCOM_extended_get)
_EVASGL_EXT_DRVNAME(GL_QCOM_extended_get)
_EVASGL_EXT_FUNCTION_BEGIN(void, glExtGetTexturesQCOM, (GLuint* textures, GLint maxTextures, GLint* numTextures))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtGetTexturesQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glExtGetBuffersQCOM, (GLuint* buffers, GLint maxBuffers, GLint* numBuffers))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtGetBuffersQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glExtGetRenderbuffersQCOM, (GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtGetRenderbuffersQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glExtGetFramebuffersQCOM, (GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtGetFramebuffersQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glExtGetTexLevelParameterivQCOM, (GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtGetTexLevelParameterivQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glExtTexObjectStateOverrideiQCOM, (GLenum target, GLenum pname, GLint param))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtTexObjectStateOverrideiQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glExtGetTexSubImageQCOM, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void* texels))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtGetTexSubImageQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glExtGetBufferPointervQCOM, (GLenum target, void** params))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtGetBufferPointervQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(QCOM_extended_get2)
_EVASGL_EXT_DRVNAME(GL_QCOM_extended_get2)
_EVASGL_EXT_FUNCTION_BEGIN(void, glExtGetShadersQCOM, (GLuint* shaders, GLint maxShaders, GLint* numShaders))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtGetShadersQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glExtGetProgramsQCOM, (GLuint* programs, GLint maxPrograms, GLint* numPrograms))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtGetProgramsQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(unsigned char, glExtIsProgramBinaryQCOM, (GLuint program))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtIsProgramBinaryQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glExtGetProgramBinarySourceQCOM, (GLuint program, GLenum shadertype, char* source, GLint* length))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glExtGetProgramBinarySourceQCOM"))
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(multisampled_render_to_texture)
_EVASGL_EXT_DRVNAME(GL_IMG_multisampled_render_to_texture)
_EVASGL_EXT_DRVNAME(GL_EXT_multisampled_render_to_texture)
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glRenderbufferStorageMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glRenderbufferStorageMultisampleIMG"))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glRenderbufferStorageMultisampleEXT"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glFramebufferTexture2DMultisample, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glFramebufferTexture2DMultisampleIMG"))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glFramebufferTexture2DMultisampleEXT"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(compressed_ETC1_RGB8_texture)
_EVASGL_EXT_DRVNAME(GL_OES_compressed_ETC1_RGB8_texture)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(compressed_paletted_texture)
_EVASGL_EXT_DRVNAME(GL_OES_compressed_paletted_texture)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(depth24)
_EVASGL_EXT_DRVNAME(GL_OES_depth24)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(depth32)
_EVASGL_EXT_DRVNAME(GL_OES_depth32)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(EGL_image)
_EVASGL_EXT_DRVNAME(GL_OES_EvasGL_image)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(packed_depth_stencil)
_EVASGL_EXT_DRVNAME(GL_OES_packed_depth_stencil)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(rgb8_rgba8)
_EVASGL_EXT_DRVNAME(GL_OES_rgb8_rgba8)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(standard_derivatives)
_EVASGL_EXT_DRVNAME(GL_OES_standard_derivatives)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(stencil1)
_EVASGL_EXT_DRVNAME(GL_OES_stencil1)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(stencil4)
_EVASGL_EXT_DRVNAME(GL_OES_stencil4)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(texture_float)
_EVASGL_EXT_DRVNAME(GL_OES_texture_float)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(texture_half_float)
_EVASGL_EXT_DRVNAME(GL_OES_texture_half_float)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(texture_half_float_linear)
_EVASGL_EXT_DRVNAME(GL_OES_texture_half_float_linear)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(texture_npot) // Desktop differs
_EVASGL_EXT_DRVNAME(GL_OES_texture_npot)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(texture_npot_DESKTOP) // Desktop differs
_EVASGL_EXT_DRVNAME(GL_OES_texture_npot)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(vertex_half_float) // Desktop differs
_EVASGL_EXT_DRVNAME(GL_OES_vertex_half_float)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(vertex_half_float_DESKTOP) // Desktop differs
_EVASGL_EXT_DRVNAME(GL_OES_vertex_half_float)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(vertex_type_10_10_10_2)
_EVASGL_EXT_DRVNAME(GL_OES_vertex_type_10_10_10_2)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(compressed_3DC_texture)
_EVASGL_EXT_DRVNAME(GL_AMD_compressed_3DC_texture)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(compressed_ATC_texture)
_EVASGL_EXT_DRVNAME(GL_AMD_compressed_ATC_texture)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(program_binary_Z400)
_EVASGL_EXT_DRVNAME(GL_AMD_program_binary_Z400)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(blend_minmax)
_EVASGL_EXT_DRVNAME(GL_EXT_blend_minmax)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(read_format_bgra) // Desktop differs
_EVASGL_EXT_DRVNAME(GL_EXT_read_format_bgra)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(read_format_bgra_DESKTOP) // Desktop differs
_EVASGL_EXT_DRVNAME(GL_EXT_read_format_bgra)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(texture_filter_anisotrophic)
_EVASGL_EXT_DRVNAME(GL_EXT_texture_filter_anisotropic)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(texture_format_BGRA8888) // Desktop differs
_EVASGL_EXT_DRVNAME(GL_EXT_texture_format_BGRA8888)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(texture_format_BGRA8888_DESKTOP) // Desktop differs
_EVASGL_EXT_DRVNAME(GL_EXT_texture_format_BGRA8888)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(texture_type_2_10_10_10_rev) // Desktop differs
_EVASGL_EXT_DRVNAME(GL_EXT_texture_type_2_10_10_10_REV)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(texture_type_2_10_10_10_rev_DESKTOP) // Desktop differs
_EVASGL_EXT_DRVNAME(GL_EXT_texture_type_2_10_10_10_REV)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(IMG_program_binary)
_EVASGL_EXT_DRVNAME(GL_IMG_program_binary)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(IMG_read_format)
_EVASGL_EXT_DRVNAME(GL_IMG_read_format)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(IMG_shader_binary)
_EVASGL_EXT_DRVNAME(GL_IMG_shader_binary)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(IMG_texture_compression_pvrtc)
_EVASGL_EXT_DRVNAME(GL_IMG_texture_compression_pvrtc)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(QCOM_perfmon_global_mode)
_EVASGL_EXT_DRVNAME(GL_QCOM_perfmon_global_mode)
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(QCOM_writeonly_rendering)
_EVASGL_EXT_DRVNAME(GL_QCOM_writeonly_rendering)
_EVASGL_EXT_END()
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// EGL EXTENSIONS
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef GL_GLES
_EVASGL_EXT_BEGIN(EGL_KHR_image_base)
_EVASGL_EXT_DRVNAME(EGL_KHR_image_base)
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void *, eglCreateImage, (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const int *e))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("eglCreateImageKHR"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, eglDestroyImage, (EGLDisplay a, void *b))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("eglDestroyImageKHR"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_FUNCTION_BEGIN(EvasGLImage, evasglCreateImage, (int target, void* buffer, int *attrib_list))
_EVASGL_EXT_FUNCTION_DRVFUNC(evgl_evasglCreateImage)
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, evasglDestroyImage, (EvasGLImage image))
_EVASGL_EXT_FUNCTION_DRVFUNC(evgl_evasglDestroyImage)
_EVASGL_EXT_FUNCTION_END()
#ifdef _EVASGL_EXT_VERIFY
{
// Add special function pointers
evgl_evasglCreateImage_ptr = GETPROCADDR("eglCreateImageKHR");
evgl_evasglDestroyImage_ptr = GETPROCADDR("eglDestroyImageKHR");
}
#endif
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(GL_OES_EGL_image)
_EVASGL_EXT_DRVNAME(GL_OES_EGL_image)
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glEGLImageTargetTexture2DOES, (GLenum target, GLeglImageOES image))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glEGLImageTargetTexture2DOES"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glEGLImageTargetRenderbufferStorageOES, (GLenum target, GLeglImageOES image))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glEGLImageTargetRenderbufferStorageOES"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glEvasGLImageTargetTexture2DOES, (GLenum target, EvasGLImage image))
_EVASGL_EXT_FUNCTION_DRVFUNC(evgl_glEvasGLImageTargetTexture2D)
_EVASGL_EXT_FUNCTION_END()
_EVASGL_EXT_FUNCTION_BEGIN(void, glEvasGLImageTargetRenderbufferStorageOES, (GLenum target, EvasGLImage image))
_EVASGL_EXT_FUNCTION_DRVFUNC(evgl_glEvasGLImageTargetRenderbufferStorage)
_EVASGL_EXT_FUNCTION_END()
#ifdef _EVASGL_EXT_VERIFY
{
if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
}
#endif
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(EGL_KHR_image_pixmap)
_EVASGL_EXT_DRVNAME(EGL_KHR_image_pixmap)
#ifdef _EVASGL_EXT_VERIFY
{
if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
}
#endif
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(EGL_KHR_image)
_EVASGL_EXT_DRVNAME(EGL_KHR_image)
#ifdef _EVASGL_EXT_VERIFY
{
if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
}
#endif
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(EGL_KHR_vg_parent_image)
_EVASGL_EXT_DRVNAME(EvasGL_KHR_vg_parent_image)
#ifdef _EVASGL_EXT_VERIFY
{
if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
}
#endif
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(EGL_KHR_gl_texture_2D_image)
_EVASGL_EXT_DRVNAME(EGL_KHR_gl_texture_2D_image)
#ifdef _EVASGL_EXT_VERIFY
{
if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
}
#endif
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(EGL_KHR_gl_texture_cubemap_image)
_EVASGL_EXT_DRVNAME(EGL_KHR_gl_texture_cubemap_image)
#ifdef _EVASGL_EXT_VERIFY
{
if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
}
#endif
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(EGL_KHR_gl_texture_3D_image)
_EVASGL_EXT_DRVNAME(EGL_KHR_gl_texture_3D_image)
#ifdef _EVASGL_EXT_VERIFY
{
if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
}
#endif
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(EGL_KHR_gl_renderbuffer_image)
_EVASGL_EXT_DRVNAME(EGL_KHR_gl_renderbuffer_image)
#ifdef _EVASGL_EXT_VERIFY
{
if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
}
#endif
_EVASGL_EXT_END()
#if 0
_EVASGL_EXT_BEGIN(EGL_SEC_map_image)
_EVASGL_EXT_DRVNAME(EGL_SEC_map_image)
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void *, eglMapImageSEC, void *a, void *b))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("eglMapImageSEC"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(unsigned int, eglUnmapImageSEC, void *a, void *b))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("eglUnmapImageSEC"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_END()
#endif
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// GLX EXTENSIONS
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#if 0
#ifdef GL_GLES
#else
_EVASGL_EXT_BEGIN(GLX_EXT_swap_control)
_EVASGL_EXT_DRVNAME(GLX_EXT_swap_control)
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glXSwapIntervalEXT, (Display *dpy, GLXDrawable drawable, int interval))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glXSwapIntervalEXT"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(GLX_SGI_swap_control)
_EVASGL_EXT_DRVNAME(GLX_SGI_swap_control)
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(int, glXSwapIntervalSGI, (int interval))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glXSwapIntervalSGI"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(GLX_SGI_video_sync)
_EVASGL_EXT_DRVNAME(GLX_SGI_video_sync)
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(int, glXGetVideoSyncSGI, (uint *count))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glXGetVideoSyncSGI"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(int, glXWaitVideoSyncSGI, (int divisor, int remainder, unsigned int *count))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glXWaitVideoSyncSGI"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_END()
_EVASGL_EXT_BEGIN(GLX_EXT_texture_from_pixmap)
_EVASGL_EXT_DRVNAME(GLX_EXT_texture_from_pixmap)
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glXBindTexImageEXT, (Display *display, GLXDrawable drawable, int buffer, const int *attrib_list))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glXBindTexImageEXT"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glXReleaseTexImageEXT, (Display *display, GLXDrawable drawable, int buffer))
_EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glXReleaseTexImageEXT"))
_EVASGL_EXT_FUNCTION_PRIVATE_END()
_EVASGL_EXT_END()
#endif
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_DEFINED
#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_DEFINED
#endif
#ifdef _EVASGL_EXT_FUNCTION_PRIVATE_END_DEFINED
#undef _EVASGL_EXT_FUNCTION_PRIVATE_END
#undef _EVASGL_EXT_FUNCTION_PRIVATE_END_DEFINED
#endif
#ifdef _EVASGL_EXT_USE_DEFAULT_DEFINE
#undef _EVASGL_EXT_CHECK_SUPPORT
#undef _EVASGL_EXT_DISCARD_SUPPORT
#undef _EVASGL_EXT_BEGIN
#undef _EVASGL_EXT_END
#undef _EVASGL_EXT_DRVNAME
#undef _EVASGL_EXT_FUNCTION_BEGIN
#undef _EVASGL_EXT_FUNCTION_END
#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
#undef _EVASGL_EXT_FUNCTION_PRIVATE_END
#undef _EVASGL_EXT_FUNCTION_DRVFUNC
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,39 @@
#ifndef _EVAS_GL_CORE_H
#define _EVAS_GL_CORE_H
#define EVAS_GL_NO_GL_H_CHECK 1
#include "Evas_GL.h"
typedef void *EVGLNative_Display;
typedef void *EVGLNative_Surface;
typedef void *EVGLNative_Context;
typedef struct _EVGL_Engine EVGL_Engine;
typedef struct _EVGL_Interface EVGL_Interface;
typedef struct _EVGL_Surface EVGL_Surface;
typedef struct _EVGL_Native_Surface EVGL_Native_Surface;
typedef struct _EVGL_Context EVGL_Context;
typedef struct _EVGL_Resource EVGL_Resource;
typedef struct _EVGL_Cap EVGL_Cap;
typedef struct _EVGL_Surface_Cap EVGL_Surface_Cap;
typedef struct _EVGL_Surface_Format EVGL_Surface_Format;
typedef struct _Native_Surface Native_Surface;
extern EVGL_Engine *evgl_engine_create(EVGL_Interface *efunc, void *engine_data);
extern int evgl_engine_destroy(EVGL_Engine *ee);
extern void *evgl_surface_create(EVGL_Engine *ee, Evas_GL_Config *cfg, int w, int h);
extern int evgl_surface_destroy(EVGL_Engine *ee, EVGL_Surface *sfc);
extern void *evgl_context_create(EVGL_Engine *ee, EVGL_Context *share_ctx);
extern int evgl_context_destroy(EVGL_Engine *ee, EVGL_Context *ctx);
extern int evgl_make_current(EVGL_Engine *ee, EVGL_Surface *sfc, EVGL_Context *ctx);
extern const char *evgl_string_query(EVGL_Engine *ee, int name);
extern void *evgl_proc_address_get(const char *name);
extern int evgl_native_surface_get(EVGL_Engine *ee, EVGL_Surface *sfc, Evas_Native_Surface *ns);
extern Evas_GL_API *evgl_api_get(EVGL_Engine *ee);
extern int evgl_direct_enabled(EVGL_Engine *ee);
extern void evgl_direct_img_obj_set(EVGL_Engine *ee, Evas_Object *img);
extern Evas_Object *evgl_direct_img_obj_get(EVGL_Engine *ee);
#endif //_EVAS_GL_CORE_H

View File

@ -0,0 +1,224 @@
#ifndef _EVAS_GL_CORE_PRIVATE_H
#define _EVAS_GL_CORE_PRIVATE_H
#include "evas_gl_private.h"
#include "evas_gl_core.h"
#include "evas_gl_api_ext.h"
#define EVAS_GL_NO_GL_H_CHECK 1
#include "Evas_GL.h"
//#include "evas_gl_ext.h"
struct _EVGL_Interface
{
// Returns the native display of evas engine.
void *(*display_get)(void *data);
// Returns the Window surface that evas uses for direct rendering opt.
void *(*evas_surface_get)(void *data);
void *(*native_window_create)(void *data);
int *(*native_window_destroy)(void *data, void *window);
// Creates/Destroys the native surface from evas engine.
void *(*surface_create)(void *data, void *native_window);
int (*surface_destroy)(void *data, void *surface);
// Creates/Destroys the native surface from evas engine.
void *(*context_create)(void *data, void *share_ctx);
int (*context_destroy)(void *data, void *context);
// Calls the make_current from evas_engine.
int (*make_current)(void *data, void *surface, void *context, int flush);
// Returns the get proc_address function
void *(*proc_address_get)(const char *name);
// Returns the string of supported extensions
const char *(*ext_string_get)(void *data);
// Returns the current rotation angle of evas
int (*rotation_angle_get)(void *data);
};
struct _EVGL_Surface
{
int w, h;
//-------------------------//
// Related to FBO Surface
// MSAA
GLint msaa_samples;
// Color Buffer Target
GLuint color_buf;
GLint color_ifmt;
GLenum color_fmt;
// Depth Buffer Target
GLuint depth_buf;
GLenum depth_fmt;
// Stencil Buffer Target
GLuint stencil_buf;
GLenum stencil_fmt;
// Depth_Stencil Target
GLuint depth_stencil_buf;
GLenum depth_stencil_fmt;
// Direct Rendering Option
int direct_fb_opt;
//int direct_override;
int cfg_index;
// Attached Context
int fbo_attached;
//-------------------------//
int direct_enabled;
Evas_Object *direct_img_obj;
EVGL_Context *current_ctx;
};
struct _EVGL_Context
{
EVGLNative_Context context;
// Context FBO
GLuint surface_fbo;
// Current FBO
GLuint current_fbo;
// Direct Rendering Related
int scissor_enabled;
int scissor_upated;
int scissor_coord[4];
int direct_scissor;
EVGL_Surface *current_sfc;
};
typedef enum _EVGL_Color_Bit
{
COLOR_NONE = 0,
COLOR_RGB_888 = 0x1,
COLOR_RGBA_8888 = 0x3,
} EVGL_Color_Bit;
typedef enum _EVGL_Depth_Bit
{
DEPTH_NONE = 0,
DEPTH_BIT_8 = 0x1,
DEPTH_BIT_16 = 0x3,
DEPTH_BIT_24 = 0x7,
DEPTH_BIT_32 = 0xF,
DEPTH_STENCIL = 0xFF,
} EVGL_Depth_Bit;
typedef enum _EVGL_Stencil_Bit
{
STENCIL_NONE = 0,
STENCIL_BIT_1 = 0x1,
STENCIL_BIT_2 = 0x3,
STENCIL_BIT_4 = 0x7,
STENCIL_BIT_8 = 0xF,
STENCIL_BIT_16 = 0x1F,
} EVGL_Stencil_Bit;
struct _EVGL_Surface_Format
{
int index;
EVGL_Color_Bit color_bit;
GLint color_ifmt;
GLenum color_fmt;
EVGL_Depth_Bit depth_bit;
GLenum depth_fmt;
EVGL_Stencil_Bit stencil_bit;
GLenum stencil_fmt;
GLenum depth_stencil_fmt;
int samples;
};
struct _EVGL_Cap
{
EVGL_Surface_Format fbo_fmts[100];
int num_fbo_fmts;
int max_w;
int max_h;
int msaa_supported;
int msaa_samples[3]; // High, Med, Low
};
struct _EVGL_Resource
{
int id;
EVGLNative_Display display;
EVGLNative_Context context;
EVGLNative_Surface surface;
EVGL_Context *current_ctx;
//EVGL_Surface *current_sfc;
Evas_Object *direct_img_obj;
};
struct _Native_Surface
{
void *surface;
void *window;
};
struct _EVGL_Engine
{
int initted;
EVGL_Interface *funcs;
EVGL_Cap caps;
const char *gl_ext;
const char *evgl_ext;
// Resource context/surface per Thread in TLS for evasgl use
LK(resource_lock);
Eina_TLS resource_key;
Eina_List *resource_list;
int resource_count;
int main_tid;
int pool_num;
Native_Surface *surface_pool;
int direct_override;
// Force Off fo Debug purposes
int force_direct_off;
void *engine_data;
};
// Evas GL Engine
extern EVGL_Engine *evgl_engine;
// Internally used functions
extern void _evgl_api_get(Evas_GL_API *api);
extern EVGL_Resource *_evgl_tls_resource_get();
extern EVGL_Context *_evgl_current_context_get();
#endif //_EVAS_GL_CORE_PRIVATE_H

File diff suppressed because it is too large Load Diff