forked from enlightenment/efl
and simplify gles suport to #ifdef GL_GLES :) we dont need sgx+6410
stuff anymore. SVN revision: 77028
This commit is contained in:
parent
15aa383ae8
commit
cde875d438
|
@ -670,7 +670,6 @@ AC_ARG_ENABLE(gl-flavor-gles,
|
|||
[
|
||||
if test "x$enableval" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(GLES_VARIETY_SGX, 1, [GLSL runtime shader GLES2 support])
|
||||
AC_DEFINE(GL_GLES, 1, [GLSL runtime shader GLES2 support])
|
||||
gl_flavor_gles="yes"
|
||||
gles_variety_sgx="yes"
|
||||
|
@ -1902,7 +1901,7 @@ echo " Software Memory Buffer.....: $have_evas_engine_buffer"
|
|||
echo " Software X11...............: $have_evas_engine_software_x11 (Xlib: $have_evas_engine_software_xlib) (XCB: $have_evas_engine_software_xcb)"
|
||||
echo $ECHO_N " OpenGL X11.................: $have_evas_engine_gl_x11 (Xlib: $have_evas_engine_gl_xlib) (XCB: $have_evas_engine_gl_xcb) $ECHO_C"
|
||||
if test "x$have_evas_engine_gl_x11" = "xyes"; then
|
||||
echo "(GLES: $gl_flavor_gles) (SGX: $gles_variety_sgx) (s3c6410: $gles_variety_s3c6410)"
|
||||
echo "(GLES: $gl_flavor_gles)"
|
||||
else
|
||||
echo
|
||||
fi
|
||||
|
@ -1911,7 +1910,7 @@ echo " Software DirectDraw........: $have_evas_engine_software_ddraw"
|
|||
echo " Direct3d...................: $have_evas_engine_direct3d"
|
||||
echo " OpenGL SDL.................: $have_evas_engine_gl_sdl $ECHO_C"
|
||||
if test "x$have_evas_engine_gl_sdl" = "xyes"; then
|
||||
echo "(GLES: $gl_flavor_gles) (SGX: $gles_variety_sgx) (s3c6410: $gles_variety_s3c6410)"
|
||||
echo "(GLES: $gl_flavor_gles)"
|
||||
else
|
||||
echo
|
||||
fi
|
||||
|
|
|
@ -174,7 +174,7 @@ else
|
|||
evas_engine_[]$1[]_libs="${x_libs} -lGLESv2 -lEGL -lm $gl_pt_lib"
|
||||
evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib"
|
||||
have_dep="yes"
|
||||
AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support])
|
||||
AC_DEFINE(GL_GLES, 1, [GLSL runtime shader GLES2 support])
|
||||
gles_variety_sgx="yes"
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -1106,7 +1106,7 @@ evgl_glBindRenderbuffer(GLenum target, GLuint renderbuffer)
|
|||
static void
|
||||
evgl_glClearDepthf(GLclampf depth)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glClearDepthf(depth);
|
||||
#else
|
||||
glClearDepth(depth);
|
||||
|
@ -1116,7 +1116,7 @@ evgl_glClearDepthf(GLclampf depth)
|
|||
static void
|
||||
evgl_glDepthRangef(GLclampf zNear, GLclampf zFar)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glDepthRangef(zNear, zFar);
|
||||
#else
|
||||
glDepthRange(zNear, zFar);
|
||||
|
@ -1126,7 +1126,7 @@ evgl_glDepthRangef(GLclampf zNear, GLclampf zFar)
|
|||
static void
|
||||
evgl_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
|
||||
#else
|
||||
if (range)
|
||||
|
@ -1146,7 +1146,7 @@ evgl_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint*
|
|||
static void
|
||||
evgl_glReleaseShaderCompiler(void)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glReleaseShaderCompiler();
|
||||
#else
|
||||
#endif
|
||||
|
@ -1155,7 +1155,7 @@ evgl_glReleaseShaderCompiler(void)
|
|||
static void
|
||||
evgl_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glShaderBinary(n, shaders, binaryformat, binary, length);
|
||||
#else
|
||||
// FIXME: need to dlsym/getprocaddress for this
|
||||
|
|
|
@ -20,19 +20,15 @@
|
|||
# include <OpenGL/glext.h>
|
||||
#else
|
||||
# ifdef _EVAS_ENGINE_SDL_H
|
||||
# if defined(GLES_VARIETY_S3C6410) || defined(GLES_VARIETY_SGX)
|
||||
# ifdef GL_GLES
|
||||
# include <SDL/SDL_opengles.h>
|
||||
# else
|
||||
# include <SDL/SDL_opengl.h>
|
||||
# endif
|
||||
# else
|
||||
# if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
# if defined(GLES_VARIETY_S3C6410)
|
||||
# include <GLES2/gl2.h>
|
||||
# elif defined(GLES_VARIETY_SGX)
|
||||
# include <GLES2/gl2.h>
|
||||
# include <GLES2/gl2ext.h>
|
||||
# endif
|
||||
# ifdef GL_GLES
|
||||
# include <GLES2/gl2.h>
|
||||
# include <GLES2/gl2ext.h>
|
||||
# else
|
||||
# include <GL/gl.h>
|
||||
# include <GL/glext.h>
|
||||
|
@ -354,7 +350,7 @@ struct _Evas_Engine_GL_Context
|
|||
/* If this is set: Force drawing with a particular filter */
|
||||
GLuint filter_prog;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// FIXME: hack. expose egl display to gl core for egl image sec extn.
|
||||
void *egldisp;
|
||||
#endif
|
||||
|
@ -649,7 +645,7 @@ extern void (*glsym_glReleaseShaderCompiler)(void);
|
|||
extern void *(*glsym_glMapBuffer) (GLenum a, GLenum b);
|
||||
extern GLboolean (*glsym_glUnmapBuffer) (GLenum a);
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
extern void *(*secsym_eglCreateImage) (void *a, void *b, GLenum c, void *d, const int *e);
|
||||
extern unsigned int (*secsym_eglDestroyImage) (void *a, void *b);
|
||||
extern void (*secsym_glEGLImageTargetTexture2DOES) (int a, void *b);
|
||||
|
|
|
@ -27,7 +27,7 @@ void (*glsym_glReleaseShaderCompiler)(void) = NULL;
|
|||
void *(*glsym_glMapBuffer) (GLenum a, GLenum b) = NULL;
|
||||
GLboolean (*glsym_glUnmapBuffer) (GLenum a) = NULL;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// just used for finding symbols :)
|
||||
typedef void (*_eng_fn) (void);
|
||||
|
||||
|
@ -118,7 +118,7 @@ gl_symbols(void)
|
|||
FINDSYM(glsym_glUnmapBuffer, "glUnmapBufferKHR", glsym_func_boolean);
|
||||
}
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
#undef FINDSYM
|
||||
#define FINDSYM(dst, sym, typ) \
|
||||
if ((!dst) && (secsym_eglGetProcAddress)) dst = (typ)secsym_eglGetProcAddress(sym); \
|
||||
|
@ -558,7 +558,7 @@ evas_gl_common_context_new(void)
|
|||
(strstr((char *)ext, "GL_EXT_texture_format_BGRA8888")))
|
||||
shared->info.bgra = 1;
|
||||
#endif
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// FIXME: there should be an extension name/string to check for
|
||||
// not just symbols in the lib
|
||||
i = 0;
|
||||
|
@ -993,7 +993,7 @@ evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc,
|
|||
|
||||
gc->pipe[0].shader.surface = surface;
|
||||
gc->change.size = 1;
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
# ifndef GL_FRAMEBUFFER
|
||||
# define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
||||
# endif
|
||||
|
@ -2425,7 +2425,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
}
|
||||
if (gc->pipe[i].array.im)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (gc->pipe[i].array.im->tex->pt->dyn.img)
|
||||
{
|
||||
secsym_glEGLImageTargetTexture2DOES
|
||||
|
@ -2693,7 +2693,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (gc->pipe[i].shader.cur_texu_dyn)
|
||||
secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
|
||||
#endif
|
||||
|
@ -2702,7 +2702,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (gc->pipe[i].shader.cur_texv_dyn)
|
||||
secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn);
|
||||
#endif
|
||||
|
@ -2720,7 +2720,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (gc->pipe[i].shader.cur_texu_dyn)
|
||||
secsym_glEGLImageTargetTexture2DOES
|
||||
(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
|
||||
|
|
|
@ -736,7 +736,7 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
|
|||
}
|
||||
|
||||
p->prog = glCreateProgram();
|
||||
#if defined(GLES_VARIETY_S3C6410) || defined(GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
#else
|
||||
if ((glsym_glGetProgramBinary) && (glsym_glProgramParameteri))
|
||||
glsym_glProgramParameteri(p->prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT,
|
||||
|
@ -940,7 +940,7 @@ evas_gl_common_shader_program_init(Evas_GL_Shared *shared)
|
|||
void
|
||||
evas_gl_common_shader_program_init_done(void)
|
||||
{
|
||||
#if defined(GLES_VARIETY_S3C6410) || defined(GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glReleaseShaderCompiler();
|
||||
#else
|
||||
if (glsym_glReleaseShaderCompiler) glsym_glReleaseShaderCompiler();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
static const GLenum rgba_fmt = GL_RGBA;
|
||||
static const GLenum rgba_ifmt = GL_RGBA;
|
||||
//#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
//#ifdef GL_GLES
|
||||
//static const GLenum rgb_fmt = GL_RGBA;
|
||||
//static const GLenum rgb_ifmt = GL_RGBA;
|
||||
//#else
|
||||
|
@ -10,7 +10,7 @@ static const GLenum rgb_fmt = GL_RGBA;
|
|||
static const GLenum rgb_ifmt = GL_RGB;
|
||||
//#endif
|
||||
#ifdef GL_BGRA
|
||||
# if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
# ifdef GL_GLES
|
||||
static const GLenum bgra_fmt = GL_BGRA;
|
||||
static const GLenum bgra_ifmt = GL_BGRA;
|
||||
static const GLenum bgr_fmt = GL_BGRA;
|
||||
|
@ -322,7 +322,7 @@ evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im)
|
|||
&u, &v, &l_after,
|
||||
gc->shared->info.tune.atlas.max_alloc_size);
|
||||
else
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
|
||||
im->cache_entry.h + 1, rgba_ifmt, rgba_fmt,
|
||||
&u, &v, &l_after,
|
||||
|
@ -371,7 +371,7 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
|
|||
pt->dataformat = GL_UNSIGNED_BYTE;
|
||||
pt->render = 1;
|
||||
pt->references = 0;
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
# ifndef GL_FRAMEBUFFER
|
||||
# define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
||||
# endif
|
||||
|
@ -456,7 +456,7 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
|
|||
glBindTexture(im->native.target, pt->texture);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
#else
|
||||
if (im->native.loose)
|
||||
{
|
||||
|
@ -485,7 +485,7 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
|
|||
{
|
||||
Evas_GL_Texture_Pool *pt = NULL;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
int fmt; // EGL_MAP_GL_TEXTURE_RGBA_SEC or EGL_MAP_GL_TEXTURE_RGB_SEC or bust
|
||||
int pixtype; // EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC or bust
|
||||
int attr[] =
|
||||
|
@ -600,7 +600,7 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
|
|||
return pt;
|
||||
|
||||
/* ERROR HANDLING */
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
error:
|
||||
secsym_eglDestroyImage(egldisplay, pt->dyn.img);
|
||||
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
|
||||
|
@ -652,7 +652,7 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
|
|||
|
||||
_print_tex_count();
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (pt->dyn.img)
|
||||
{
|
||||
if (pt->dyn.checked_out > 0)
|
||||
|
@ -1292,7 +1292,7 @@ evas_gl_common_texture_nv12_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsign
|
|||
{
|
||||
Evas_GL_Texture *tex;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
tex = _evas_gl_common_texture_y2uv_new(gc, w, h, EINA_TRUE, EINA_TRUE, lum_ifmt, lum_fmt, lum_alpha_ifmt, lum_alpha_fmt, 1);
|
||||
if (!tex)
|
||||
#endif
|
||||
|
@ -1307,7 +1307,7 @@ evas_gl_common_texture_nv12tiled_new(Evas_Engine_GL_Context *gc, DATA8 **rows, u
|
|||
{
|
||||
Evas_GL_Texture *tex = NULL;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
tex = _evas_gl_common_texture_y2uv_new(gc, w, h, EINA_TRUE, EINA_TRUE, lum_ifmt, lum_fmt, lum_alpha_ifmt, lum_alpha_fmt, 1);
|
||||
if (!tex)
|
||||
#endif
|
||||
|
@ -1439,7 +1439,7 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
|
|||
mb_w = w / 64 + (w % 64 ? 1 : 0);
|
||||
mb_h = h / 32 + (h % 32 ? 1 : 0);
|
||||
|
||||
#if defined(GLES_VARIETY_S3C6410) || defined(GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (tex->dyn)
|
||||
{
|
||||
char *texture_addr;
|
||||
|
|
|
@ -243,7 +243,7 @@ eng_output_flush(void *data)
|
|||
re->draw.drew = 0;
|
||||
|
||||
#if 0
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// glFlush();
|
||||
eglSwapBuffers(re->egl_disp, re->egl_surface[0]);
|
||||
#else
|
||||
|
@ -499,7 +499,7 @@ struct _Native
|
|||
{
|
||||
Evas_Native_Surface ns;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
EGLSurface egl_surface;
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "config.h"
|
||||
#include <SDL/SDL.h>
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
# include <EGL/egl.h>
|
||||
# include <SDL/SDL_opengles.h>
|
||||
# ifdef HAVE_SDL_FLAG_OPENGLES
|
||||
|
@ -61,7 +61,7 @@ struct _Render_Engine
|
|||
int drew : 1;
|
||||
int x1, y1, x2, y2;
|
||||
} draw;
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
EGLContext egl_context[1];
|
||||
EGLSurface egl_surface[1];
|
||||
EGLConfig egl_config;
|
||||
|
|
|
@ -10,15 +10,6 @@
|
|||
#define EVAS_GL_NO_GL_H_CHECK 1
|
||||
#include "Evas_GL.h"
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
// EGL / GLES
|
||||
# if defined(GLES_VARIETY_S3C6410)
|
||||
# elif defined(GLES_VARIETY_SGX)
|
||||
# endif
|
||||
#else
|
||||
// GLX
|
||||
#endif
|
||||
|
||||
typedef struct _Render_Engine Render_Engine;
|
||||
typedef struct _Render_Engine_GL_Surface Render_Engine_GL_Surface;
|
||||
typedef struct _Render_Engine_GL_Context Render_Engine_GL_Context;
|
||||
|
@ -92,7 +83,7 @@ struct _Render_Engine_GL_Surface
|
|||
GLuint rb_depth_stencil;
|
||||
GLenum rb_depth_stencil_fmt;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
EGLSurface direct_sfc;
|
||||
#else
|
||||
Window direct_sfc;
|
||||
|
@ -104,7 +95,7 @@ struct _Render_Engine_GL_Surface
|
|||
struct _Render_Engine_GL_Context
|
||||
{
|
||||
int initialized;
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
EGLContext context;
|
||||
#else
|
||||
GLXContext context;
|
||||
|
@ -122,7 +113,7 @@ struct _Render_Engine_GL_Context
|
|||
struct _Render_Engine_GL_Resource
|
||||
{
|
||||
// Resource context/surface per Thread in TLS for evasgl use
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
EGLContext context;
|
||||
EGLSurface surface;
|
||||
#else
|
||||
|
@ -165,7 +156,7 @@ typedef unsigned char (*glsym_func_uchar) ();
|
|||
typedef unsigned char *(*glsym_func_uchar_ptr) ();
|
||||
typedef const char *(*glsym_func_const_char_ptr) ();
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
|
||||
#ifndef EGL_NATIVE_PIXMAP_KHR
|
||||
# define EGL_NATIVE_PIXMAP_KHR 0x30b0
|
||||
|
@ -256,7 +247,7 @@ void (*glsym_glExtGetProgramBinarySourceQCOM) (GLuint program, GLenum shadertyp
|
|||
|
||||
//------ GLES 2.0 Extensions supported in EvasGL -----//
|
||||
static Extension_Entry _gl_ext_entries[] = {
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
//--- Function Extensions ---//
|
||||
{ "GL_OES_get_program_binary", "get_program_binary", 0 },
|
||||
{ "GL_OES_mapbuffer", "mapbuffer", 0 },
|
||||
|
@ -353,7 +344,7 @@ static Extension_Entry _gl_ext_entries[] = {
|
|||
|
||||
//------ Extensions supported in EvasGL -----//
|
||||
static Extension_Entry _evasgl_ext_entries[] = {
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
{ "EvasGL_KHR_image", "EGL_KHR_image", 0 },
|
||||
{ "EvasGL_KHR_vg_parent_image", "EGL_KHR_vg_parent_image", 0 },
|
||||
{ "EvasGL_KHR_gl_texture_2D_image", "EGL_KHR_gl_texture_2D_image", 0 },
|
||||
|
@ -372,7 +363,7 @@ _gl_ext_sym_init(void)
|
|||
|
||||
if (done) return;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
#define FINDSYM(dst, sym, typ) \
|
||||
if ((!dst) && (glsym_eglGetProcAddress)) dst = (typ)glsym_eglGetProcAddress(sym); \
|
||||
if (!dst) dst = (typ)dlsym(RTLD_DEFAULT, sym)
|
||||
|
@ -649,7 +640,7 @@ _gl_ext_init(Render_Engine *re)
|
|||
}
|
||||
DBG(" ");
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// EGL Extensions
|
||||
if (glsym_eglQueryString)
|
||||
{
|
||||
|
@ -798,7 +789,7 @@ _create_internal_glue_resources(void *data)
|
|||
|
||||
if (!rsc) return NULL;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// EGL
|
||||
int context_attrs[3];
|
||||
context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
|
||||
|
@ -889,7 +880,7 @@ _destroy_internal_glue_resources(void *data)
|
|||
Render_Engine_GL_Resource *rsc;
|
||||
|
||||
LKL(resource_lock);
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// EGL
|
||||
// Delete the Resources
|
||||
EINA_LIST_FOREACH(resource_list, l, rsc)
|
||||
|
@ -954,7 +945,7 @@ _internal_resources_make_current(void *data)
|
|||
}
|
||||
|
||||
// Use resource surface/context to create surface resrouces
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// Update the evas' window surface
|
||||
if (eina_main_loop_is()) rsc->surface = re->win->egl_surface[0];
|
||||
|
||||
|
@ -985,7 +976,7 @@ eng_setup(Evas *e, void *in)
|
|||
info = (Evas_Engine_Info_GL_X11 *)in;
|
||||
if (!e->engine.data.output)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
#else
|
||||
int eb, evb;
|
||||
|
||||
|
@ -1205,7 +1196,7 @@ eng_output_free(void *data)
|
|||
// if (re->xrdb) XrmDestroyDatabase(re->xrdb);
|
||||
|
||||
#if 0
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// Destroy the resource surface
|
||||
// Only required for EGL case
|
||||
if (re->surface)
|
||||
|
@ -1339,7 +1330,7 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
|
|||
*/
|
||||
evas_common_tilebuf_free_render_rects(rects);
|
||||
evas_common_tilebuf_clear(re->tb);
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// dont need to for egl - eng_window_use() can check for other ctxt's
|
||||
#else
|
||||
eng_window_use(NULL);
|
||||
|
@ -1361,7 +1352,7 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
|
|||
return NULL;
|
||||
/*
|
||||
if (!re->win->draw.redraw) return NULL;
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// dont need to for egl - eng_window_use() can check for other ctxt's
|
||||
#else
|
||||
eng_window_use(NULL);
|
||||
|
@ -1428,7 +1419,7 @@ eng_output_redraws_next_update_push(void *data, void *surface __UNUSED__, int x
|
|||
}
|
||||
}
|
||||
}
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// this is needed to make sure all previous rendering is flushed to
|
||||
// buffers/surfaces
|
||||
#ifdef FRAMECOUNT
|
||||
|
@ -1466,7 +1457,7 @@ eng_output_flush(void *data)
|
|||
re->win->draw.drew = 0;
|
||||
eng_window_use(re->win);
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
#ifdef FRAMECOUNT
|
||||
double t0 = get_time();
|
||||
#endif
|
||||
|
@ -1860,7 +1851,7 @@ struct _Native
|
|||
Pixmap pixmap;
|
||||
Visual *visual;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
void *egl_surface;
|
||||
#else
|
||||
void *fbc;
|
||||
|
@ -1885,7 +1876,7 @@ _native_bind_cb(void *data, void *image)
|
|||
|
||||
if (n->ns.type == EVAS_NATIVE_SURFACE_X11)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (n->egl_surface)
|
||||
{
|
||||
if (glsym_glEGLImageTargetTexture2DOES)
|
||||
|
@ -1929,7 +1920,7 @@ _native_unbind_cb(void *data, void *image)
|
|||
|
||||
if (n->ns.type == EVAS_NATIVE_SURFACE_X11)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// nothing
|
||||
#else
|
||||
# ifdef GLX_BIND_TO_TEXTURE_TARGETS_EXT
|
||||
|
@ -1967,7 +1958,7 @@ _native_free_cb(void *data, void *image)
|
|||
{
|
||||
pmid = n->pixmap;
|
||||
eina_hash_del(re->win->gl_context->shared->native_pm_hash, &pmid, im);
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (n->egl_surface)
|
||||
{
|
||||
if (glsym_eglDestroyImage)
|
||||
|
@ -2128,7 +2119,7 @@ eng_image_native_set(void *data, void *image, void *native)
|
|||
if (!im) return NULL;
|
||||
if (ns->type == EVAS_NATIVE_SURFACE_X11)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (native)
|
||||
{
|
||||
n = calloc(1, sizeof(Native));
|
||||
|
@ -2314,7 +2305,7 @@ eng_image_native_set(void *data, void *image, void *native)
|
|||
|
||||
n->pixmap = 0;
|
||||
n->visual = 0;
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
n->egl_surface = 0;
|
||||
#else
|
||||
n->fbc = 0;
|
||||
|
@ -2545,7 +2536,7 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, i
|
|||
return im;
|
||||
}
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
eng_window_use(re->win);
|
||||
|
||||
if ((im->tex) && (im->tex->pt) && (im->tex->pt->dyn.img) && (im->cs.space == EVAS_COLORSPACE_ARGB8888))
|
||||
|
@ -2655,7 +2646,7 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data)
|
|||
if (im->tex->pt->dyn.checked_out > 0)
|
||||
{
|
||||
im->tex->pt->dyn.checked_out--;
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (im->tex->pt->dyn.checked_out == 0)
|
||||
glsym_eglUnmapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img);
|
||||
#endif
|
||||
|
@ -2979,7 +2970,7 @@ _check_gl_surface_format(GLint int_fmt, GLenum fmt, GLenum attachment, GLenum at
|
|||
// Render Target Attachment (Stencil or Depth)
|
||||
if (attachment)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// This is a little hacky but this is how we'll have to do for now.
|
||||
if (attach_fmt == GL_DEPTH_STENCIL_OES)
|
||||
{
|
||||
|
@ -3123,7 +3114,7 @@ _set_gl_surface_cap(Render_Engine *re)
|
|||
if (!re) return;
|
||||
if (re->gl_cap_initted) return;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
int max_samples = 0;
|
||||
|
||||
glGetIntegerv(GL_MAX_SAMPLES_IMG, &max_samples);
|
||||
|
@ -3154,7 +3145,7 @@ _set_gl_surface_cap(Render_Engine *re)
|
|||
|
||||
glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &re->gl_cap.max_rb_size);
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
count = (re->gl_cap.msaa_support) ? 4 : 1;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
|
@ -3370,7 +3361,7 @@ _attach_fbo_surface(Render_Engine *data __UNUSED__,
|
|||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
|
||||
#else
|
||||
|
@ -3407,7 +3398,7 @@ _attach_fbo_surface(Render_Engine *data __UNUSED__,
|
|||
// Depth Stencil RenderBuffer - Attach it to FBO
|
||||
if (sfc->rb_depth_stencil)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
curr_tex = 0;
|
||||
glGetIntegerv(GL_TEXTURE_BINDING_2D, &curr_tex);
|
||||
glBindTexture(GL_TEXTURE_2D, sfc->rb_depth_stencil);
|
||||
|
@ -3523,7 +3514,7 @@ _create_rt_buffers(Render_Engine *data __UNUSED__,
|
|||
// First check if packed buffer is to be used.
|
||||
if (sfc->rb_depth_stencil_fmt)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glGenTextures(1, &sfc->rb_depth_stencil);
|
||||
#else
|
||||
glGenRenderbuffers(1, &sfc->rb_depth_stencil);
|
||||
|
@ -3554,7 +3545,7 @@ _create_rt_buffers(Render_Engine *data __UNUSED__,
|
|||
if (sfc->rt_tex) glDeleteTextures(1, &sfc->rt_tex);
|
||||
if (sfc->rb_depth) glDeleteRenderbuffers(1, &sfc->rb_depth);
|
||||
if (sfc->rb_stencil) glDeleteRenderbuffers(1, &sfc->rb_stencil);
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (sfc->rb_depth_stencil) glDeleteTextures(1, &sfc->rb_depth_stencil);
|
||||
#else
|
||||
if (sfc->rb_depth_stencil) glDeleteRenderbuffers(1, &sfc->rb_depth_stencil);
|
||||
|
@ -3601,7 +3592,7 @@ eng_gl_surface_create(void *data, void *config, int w, int h)
|
|||
if (cfg->options_bits & EVAS_GL_OPTIONS_DIRECT)
|
||||
{
|
||||
DBG("Enabling Direct rendering to the Evas' window.");
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
sfc->direct_sfc = re->win->egl_surface[0];
|
||||
#else
|
||||
sfc->direct_sfc = re->win->win;
|
||||
|
@ -3643,7 +3634,7 @@ eng_gl_surface_create(void *data, void *config, int w, int h)
|
|||
|
||||
finish:
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
res = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
#else
|
||||
res = glXMakeCurrent(re->info->info.display, None, NULL);
|
||||
|
@ -3702,7 +3693,7 @@ eng_gl_surface_destroy(void *data, void *surface)
|
|||
|
||||
if (sfc->rb_depth_stencil)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glDeleteTextures(1, &sfc->rb_depth_stencil);
|
||||
#else
|
||||
glDeleteRenderbuffers(1, &sfc->rb_depth_stencil);
|
||||
|
@ -3710,7 +3701,7 @@ eng_gl_surface_destroy(void *data, void *surface)
|
|||
}
|
||||
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
#else
|
||||
ret = glXMakeCurrent(re->info->info.display, None, NULL);
|
||||
|
@ -3734,7 +3725,7 @@ eng_gl_context_create(void *data, void *share_context)
|
|||
Render_Engine *re;
|
||||
Render_Engine_GL_Context *ctx;
|
||||
Render_Engine_GL_Context *share_ctx;
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
int context_attrs[3];
|
||||
#endif
|
||||
|
||||
|
@ -3747,7 +3738,7 @@ eng_gl_context_create(void *data, void *share_context)
|
|||
|
||||
// Set the share context to Evas' GL context if share_context is NULL.
|
||||
// Otherwise set it to the given share_context.
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// EGL
|
||||
context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
|
||||
context_attrs[1] = 2;
|
||||
|
@ -3828,7 +3819,7 @@ eng_gl_context_destroy(void *data, void *context)
|
|||
glDeleteFramebuffers(1, &ctx->context_fbo);
|
||||
|
||||
// Destroy the Context
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
eglDestroyContext(re->win->egl_disp, ctx->context);
|
||||
|
||||
ctx->context = EGL_NO_CONTEXT;
|
||||
|
@ -3864,7 +3855,7 @@ eng_gl_make_current(void *data __UNUSED__, void *surface, void *context)
|
|||
Render_Engine_GL_Surface *sfc;
|
||||
Render_Engine_GL_Context *ctx;
|
||||
int ret = 0;
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
Render_Engine_GL_Resource *rsc;
|
||||
#endif
|
||||
|
||||
|
@ -3877,7 +3868,7 @@ eng_gl_make_current(void *data __UNUSED__, void *surface, void *context)
|
|||
// Unset surface/context
|
||||
if ((!sfc) || (!ctx))
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE,
|
||||
EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
#else
|
||||
|
@ -3902,7 +3893,7 @@ eng_gl_make_current(void *data __UNUSED__, void *surface, void *context)
|
|||
// correct rendering.
|
||||
if ((sfc->direct_fb_opt) && (gl_direct_img_obj || gl_direct_override))
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
sfc->direct_sfc = re->win->egl_surface[0];
|
||||
#else
|
||||
sfc->direct_sfc = re->win->win;
|
||||
|
@ -3917,7 +3908,7 @@ eng_gl_make_current(void *data __UNUSED__, void *surface, void *context)
|
|||
GLint curr_fbo = 0;
|
||||
|
||||
// Do a make current only if it's not already current
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if ((eglGetCurrentContext() != ctx->context) ||
|
||||
(eglGetCurrentSurface(EGL_READ) != sfc->direct_sfc) ||
|
||||
(eglGetCurrentSurface(EGL_DRAW) != sfc->direct_sfc) )
|
||||
|
@ -3963,7 +3954,7 @@ eng_gl_make_current(void *data __UNUSED__, void *surface, void *context)
|
|||
else
|
||||
{
|
||||
// Do a make current only if it's not already current
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (eina_main_loop_is())
|
||||
{
|
||||
if ((eglGetCurrentContext() != ctx->context) ||
|
||||
|
@ -4074,7 +4065,7 @@ eng_gl_string_query(void *data __UNUSED__, int name)
|
|||
static void *
|
||||
eng_gl_proc_address_get(void *data __UNUSED__, const char *name)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (glsym_eglGetProcAddress) return glsym_eglGetProcAddress(name);
|
||||
return dlsym(RTLD_DEFAULT, name);
|
||||
#else
|
||||
|
@ -4381,7 +4372,7 @@ evgl_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
|
|||
static void
|
||||
evgl_glClearDepthf(GLclampf depth)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glClearDepthf(depth);
|
||||
#else
|
||||
glClearDepth(depth);
|
||||
|
@ -4391,7 +4382,7 @@ evgl_glClearDepthf(GLclampf depth)
|
|||
static void
|
||||
evgl_glDepthRangef(GLclampf zNear, GLclampf zFar)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glDepthRangef(zNear, zFar);
|
||||
#else
|
||||
glDepthRange(zNear, zFar);
|
||||
|
@ -4401,7 +4392,7 @@ evgl_glDepthRangef(GLclampf zNear, GLclampf zFar)
|
|||
static void
|
||||
evgl_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
|
||||
#else
|
||||
if (range)
|
||||
|
@ -4420,7 +4411,7 @@ evgl_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint*
|
|||
static void
|
||||
evgl_glReleaseShaderCompiler(void)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glReleaseShaderCompiler();
|
||||
#else
|
||||
#endif
|
||||
|
@ -4429,7 +4420,7 @@ evgl_glReleaseShaderCompiler(void)
|
|||
static void
|
||||
evgl_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
glShaderBinary(n, shaders, binaryformat, binary, length);
|
||||
#else
|
||||
// FIXME: need to dlsym/getprocaddress for this
|
||||
|
@ -4440,7 +4431,7 @@ evgl_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const
|
|||
}
|
||||
|
||||
//--------------------------------//
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// EGL Extensions
|
||||
static void *
|
||||
evgl_evasglCreateImage(int target, void* buffer, int *attrib_list)
|
||||
|
@ -4709,7 +4700,7 @@ eng_gl_api_get(void *data __UNUSED__)
|
|||
|
||||
ORD(glGetString);
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
// GLES 2.0 Extensions that needs wrapping
|
||||
ORD(evasglCreateImage);
|
||||
ORD(evasglDestroyImage);
|
||||
|
|
|
@ -10,26 +10,16 @@
|
|||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
# if defined(GLES_VARIETY_S3C6410)
|
||||
# include <EGL/egl.h>
|
||||
# include <GLES2/gl2.h>
|
||||
# include <X11/Xlib.h>
|
||||
# include <X11/Xatom.h>
|
||||
# include <X11/Xutil.h>
|
||||
# include <X11/extensions/Xrender.h>
|
||||
# include <X11/Xresource.h> // xres - dpi
|
||||
# elif defined(GLES_VARIETY_SGX)
|
||||
# define SUPPORT_X11 1
|
||||
# include <EGL/egl.h>
|
||||
# include <GLES2/gl2.h>
|
||||
# include <GLES2/gl2ext.h>
|
||||
# include <X11/Xlib.h>
|
||||
# include <X11/Xatom.h>
|
||||
# include <X11/Xutil.h>
|
||||
# include <X11/extensions/Xrender.h>
|
||||
# include <X11/Xresource.h> // xres - dpi
|
||||
# endif
|
||||
#ifdef GL_GLES
|
||||
# define SUPPORT_X11 1
|
||||
# include <EGL/egl.h>
|
||||
# include <GLES2/gl2.h>
|
||||
# include <GLES2/gl2ext.h>
|
||||
# include <X11/Xlib.h>
|
||||
# include <X11/Xatom.h>
|
||||
# include <X11/Xutil.h>
|
||||
# include <X11/extensions/Xrender.h>
|
||||
# include <X11/Xresource.h> // xres - dpi
|
||||
#else
|
||||
# include <X11/Xlib.h>
|
||||
# include <X11/Xatom.h>
|
||||
|
@ -87,7 +77,7 @@ struct _Evas_GL_X11_Window
|
|||
int drew : 1;
|
||||
int x1, y1, x2, y2;
|
||||
} draw;
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
EGLContext egl_context[1];
|
||||
EGLSurface egl_surface[1];
|
||||
EGLConfig egl_config;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
static Evas_GL_X11_Window *_evas_gl_x11_window = NULL;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
static EGLContext context = EGL_NO_CONTEXT;
|
||||
#else
|
||||
// FIXME: this will only work for 1 display connection (glx land can have > 1)
|
||||
|
@ -36,7 +36,7 @@ eng_window_new(Display *disp,
|
|||
int rot)
|
||||
{
|
||||
Evas_GL_X11_Window *gw;
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
int context_attrs[3];
|
||||
int config_attrs[40];
|
||||
int major_version, minor_version;
|
||||
|
@ -66,7 +66,7 @@ eng_window_new(Display *disp,
|
|||
vi_use = _evas_gl_x11_vi;
|
||||
if (gw->alpha)
|
||||
{
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (_evas_gl_x11_rgba_vi)
|
||||
{
|
||||
vi_use = _evas_gl_x11_rgba_vi;
|
||||
|
@ -83,54 +83,16 @@ eng_window_new(Display *disp,
|
|||
gw->visualinfo = vi_use;
|
||||
|
||||
// EGL / GLES
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
|
||||
context_attrs[1] = 2;
|
||||
context_attrs[2] = EGL_NONE;
|
||||
|
||||
# if defined(GLES_VARIETY_S3C6410)
|
||||
if (gw->visualinfo->depth == 16) // 16bpp
|
||||
{
|
||||
config_attrs[n++] = EGL_SURFACE_TYPE;
|
||||
config_attrs[n++] = EGL_WINDOW_BIT;
|
||||
config_attrs[n++] = EGL_RENDERABLE_TYPE;
|
||||
config_attrs[n++] = EGL_OPENGL_ES2_BIT;
|
||||
config_attrs[n++] = EGL_RED_SIZE;
|
||||
config_attrs[n++] = 5;
|
||||
config_attrs[n++] = EGL_GREEN_SIZE;
|
||||
config_attrs[n++] = 6;
|
||||
config_attrs[n++] = EGL_BLUE_SIZE;
|
||||
config_attrs[n++] = 5;
|
||||
config_attrs[n++] = EGL_DEPTH_SIZE;
|
||||
config_attrs[n++] = 0;
|
||||
config_attrs[n++] = EGL_STENCIL_SIZE;
|
||||
config_attrs[n++] = 0;
|
||||
config_attrs[n++] = EGL_NONE;
|
||||
}
|
||||
else // 24/32bit. no one does 8bpp anymore. and 15bpp... dead
|
||||
{
|
||||
config_attrs[n++] = EGL_SURFACE_TYPE;
|
||||
config_attrs[n++] = EGL_WINDOW_BIT;
|
||||
config_attrs[n++] = EGL_RENDERABLE_TYPE;
|
||||
config_attrs[n++] = EGL_OPENGL_ES2_BIT;
|
||||
config_attrs[n++] = EGL_RED_SIZE;
|
||||
config_attrs[n++] = 8;
|
||||
config_attrs[n++] = EGL_GREEN_SIZE;
|
||||
config_attrs[n++] = 8;
|
||||
config_attrs[n++] = EGL_BLUE_SIZE;
|
||||
config_attrs[n++] = 8;
|
||||
config_attrs[n++] = EGL_DEPTH_SIZE;
|
||||
config_attrs[n++] = 0;
|
||||
config_attrs[n++] = EGL_STENCIL_SIZE;
|
||||
config_attrs[n++] = 0;
|
||||
config_attrs[n++] = EGL_NONE;
|
||||
}
|
||||
# elif defined(GLES_VARIETY_SGX)
|
||||
config_attrs[n++] = EGL_SURFACE_TYPE;
|
||||
config_attrs[n++] = EGL_WINDOW_BIT;
|
||||
config_attrs[n++] = EGL_RENDERABLE_TYPE;
|
||||
config_attrs[n++] = EGL_OPENGL_ES2_BIT;
|
||||
#if 0
|
||||
# if 0
|
||||
// FIXME: n900 - omap3 sgx libs break here
|
||||
config_attrs[n++] = EGL_RED_SIZE;
|
||||
config_attrs[n++] = 1;
|
||||
|
@ -139,7 +101,7 @@ eng_window_new(Display *disp,
|
|||
config_attrs[n++] = EGL_BLUE_SIZE;
|
||||
config_attrs[n++] = 1;
|
||||
// FIXME: end n900 breakage
|
||||
#endif
|
||||
# endif
|
||||
if (gw->alpha)
|
||||
{
|
||||
config_attrs[n++] = EGL_ALPHA_SIZE;
|
||||
|
@ -155,7 +117,6 @@ eng_window_new(Display *disp,
|
|||
config_attrs[n++] = EGL_STENCIL_SIZE;
|
||||
config_attrs[n++] = 0;
|
||||
config_attrs[n++] = EGL_NONE;
|
||||
# endif
|
||||
|
||||
gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)(gw->disp));
|
||||
if (!gw->egl_disp)
|
||||
|
@ -528,7 +489,7 @@ eng_window_new(Display *disp,
|
|||
eng_window_free(gw);
|
||||
return NULL;
|
||||
}
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
gw->gl_context->egldisp = gw->egl_disp;
|
||||
#endif
|
||||
eng_window_use(gw);
|
||||
|
@ -550,7 +511,7 @@ eng_window_free(Evas_GL_X11_Window *gw)
|
|||
ref = gw->gl_context->references - 1;
|
||||
evas_gl_common_context_free(gw->gl_context);
|
||||
}
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
if (gw->egl_surface[0] != EGL_NO_SURFACE)
|
||||
eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
|
||||
|
@ -582,7 +543,7 @@ eng_window_use(Evas_GL_X11_Window *gw)
|
|||
{
|
||||
Eina_Bool force_use = EINA_FALSE;
|
||||
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (_evas_gl_x11_window)
|
||||
{
|
||||
if ((eglGetCurrentContext() !=
|
||||
|
@ -611,7 +572,7 @@ eng_window_use(Evas_GL_X11_Window *gw)
|
|||
if (gw)
|
||||
{
|
||||
// EGL / GLES
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (gw->egl_surface[0] != EGL_NO_SURFACE)
|
||||
{
|
||||
if (eglMakeCurrent(gw->egl_disp,
|
||||
|
@ -652,7 +613,7 @@ eng_window_unsurf(Evas_GL_X11_Window *gw)
|
|||
if (!getenv("EVAS_GL_WIN_RESURF")) return;
|
||||
if (getenv("EVAS_GL_INFO"))
|
||||
printf("unsurf %p\n", gw);
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (_evas_gl_x11_window)
|
||||
evas_gl_common_context_flush(_evas_gl_x11_window->gl_context);
|
||||
if (_evas_gl_x11_window == gw)
|
||||
|
@ -681,7 +642,7 @@ eng_window_resurf(Evas_GL_X11_Window *gw)
|
|||
if (gw->surf) return;
|
||||
if (getenv("EVAS_GL_INFO"))
|
||||
printf("resurf %p\n", gw);
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
gw->egl_surface[0] = eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
|
||||
(EGLNativeWindowType)gw->win,
|
||||
NULL);
|
||||
|
@ -729,7 +690,7 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
|
|||
int alpha;
|
||||
|
||||
// EGL / GLES
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
for (alpha = 0; alpha < 2; alpha++)
|
||||
{
|
||||
int depth = DefaultDepth(einfo->info.display,
|
||||
|
@ -871,7 +832,7 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
|
|||
if (einfo->info.destination_alpha)
|
||||
{
|
||||
// EGL / GLES
|
||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||
#ifdef GL_GLES
|
||||
if (_evas_gl_x11_rgba_vi) return _evas_gl_x11_rgba_vi->visual;
|
||||
#else
|
||||
//# ifdef NEWGL
|
||||
|
|
|
@ -38,44 +38,6 @@ eng_window_new(struct wl_display *disp, struct wl_surface *surface, int screen,
|
|||
context_attrs[1] = 2;
|
||||
context_attrs[2] = EGL_NONE;
|
||||
|
||||
#if defined(GLES_VARIETY_S3C6410)
|
||||
if (gw->depth == 16) // 16bpp
|
||||
{
|
||||
config_attrs[n++] = EGL_SURFACE_TYPE;
|
||||
config_attrs[n++] = EGL_WINDOW_BIT;
|
||||
config_attrs[n++] = EGL_RENDERABLE_TYPE;
|
||||
config_attrs[n++] = EGL_OPENGL_ES2_BIT;
|
||||
config_attrs[n++] = EGL_RED_SIZE;
|
||||
config_attrs[n++] = 5;
|
||||
config_attrs[n++] = EGL_GREEN_SIZE;
|
||||
config_attrs[n++] = 6;
|
||||
config_attrs[n++] = EGL_BLUE_SIZE;
|
||||
config_attrs[n++] = 5;
|
||||
config_attrs[n++] = EGL_DEPTH_SIZE;
|
||||
config_attrs[n++] = 0;
|
||||
config_attrs[n++] = EGL_STENCIL_SIZE;
|
||||
config_attrs[n++] = 0;
|
||||
config_attrs[n++] = EGL_NONE;
|
||||
}
|
||||
else // 24/32bit. no one does 8bpp anymore. and 15bpp... dead
|
||||
{
|
||||
config_attrs[n++] = EGL_SURFACE_TYPE;
|
||||
config_attrs[n++] = EGL_WINDOW_BIT;
|
||||
config_attrs[n++] = EGL_RENDERABLE_TYPE;
|
||||
config_attrs[n++] = EGL_OPENGL_ES2_BIT;
|
||||
config_attrs[n++] = EGL_RED_SIZE;
|
||||
config_attrs[n++] = 8;
|
||||
config_attrs[n++] = EGL_GREEN_SIZE;
|
||||
config_attrs[n++] = 8;
|
||||
config_attrs[n++] = EGL_BLUE_SIZE;
|
||||
config_attrs[n++] = 8;
|
||||
config_attrs[n++] = EGL_DEPTH_SIZE;
|
||||
config_attrs[n++] = 0;
|
||||
config_attrs[n++] = EGL_STENCIL_SIZE;
|
||||
config_attrs[n++] = 0;
|
||||
config_attrs[n++] = EGL_NONE;
|
||||
}
|
||||
#elif defined(GLES_VARIETY_SGX)
|
||||
config_attrs[n++] = EGL_SURFACE_TYPE;
|
||||
config_attrs[n++] = EGL_WINDOW_BIT;
|
||||
config_attrs[n++] = EGL_RENDERABLE_TYPE;
|
||||
|
@ -105,7 +67,6 @@ eng_window_new(struct wl_display *disp, struct wl_surface *surface, int screen,
|
|||
config_attrs[n++] = EGL_STENCIL_SIZE;
|
||||
config_attrs[n++] = 0;
|
||||
config_attrs[n++] = EGL_NONE;
|
||||
#endif
|
||||
|
||||
gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)(gw->disp));
|
||||
if (!gw->egl_disp)
|
||||
|
|
Loading…
Reference in New Issue