forked from enlightenment/efl
parent
267c9bce6c
commit
39913889b3
|
@ -304,24 +304,21 @@ evas_gl_common_context_target_surface_set(Evas_GL_Context *gc,
|
||||||
evas_gl_common_context_flush(gc);
|
evas_gl_common_context_flush(gc);
|
||||||
|
|
||||||
gc->shader.surface = surface;
|
gc->shader.surface = surface;
|
||||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
|
||||||
// FIXME: XXX render-to-texture for gles2
|
|
||||||
#else
|
|
||||||
// FIXME: viewport goopies
|
|
||||||
gc->change.size = 1;
|
gc->change.size = 1;
|
||||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||||
if (gc->shader.surface == gc->def_surface)
|
# ifndef GL_FRAMEBUFFER
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER_OES, 0);
|
# define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
||||||
else
|
# endif
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER_OES, surface->tex->pt->fb);
|
|
||||||
#else
|
#else
|
||||||
|
# ifndef GL_FRAMEBUFFER
|
||||||
|
# define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
if (gc->shader.surface == gc->def_surface)
|
if (gc->shader.surface == gc->def_surface)
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
else
|
else
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER_EXT, surface->tex->pt->fb);
|
glBindFramebuffer(GL_FRAMEBUFFER, surface->tex->pt->fb);
|
||||||
#endif
|
|
||||||
_evas_gl_common_viewport_set(gc);
|
_evas_gl_common_viewport_set(gc);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PUSH_VERTEX(x, y, z) \
|
#define PUSH_VERTEX(x, y, z) \
|
||||||
|
|
|
@ -269,19 +269,20 @@ _pool_tex_render_new(Evas_GL_Context *gc, int w, int h, int intformat, int forma
|
||||||
pt->dataformat = GL_UNSIGNED_BYTE;
|
pt->dataformat = GL_UNSIGNED_BYTE;
|
||||||
pt->references = 0;
|
pt->references = 0;
|
||||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||||
glGenTextures(1, &(pt->texture));
|
# ifndef GL_FRAMEBUFFER
|
||||||
glBindTexture(GL_TEXTURE_2D, pt->texture);
|
# define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
# endif
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
# ifndef GL_COLOR_ATTACHMENT0
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
# define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
# endif
|
||||||
_tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
|
|
||||||
glGenFramebuffers(1, &(pt->fb));
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER_OES, pt->fb);
|
|
||||||
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, pt->texture, 0);
|
|
||||||
glBindFramebufferEXT(GL_FRAMEBUFFER_OES, 0);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, gc->shader.cur_tex);
|
|
||||||
#else
|
#else
|
||||||
|
# ifndef GL_FRAMEBUFFER
|
||||||
|
# define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
|
||||||
|
# endif
|
||||||
|
# ifndef GL_COLOR_ATTACHMENT0
|
||||||
|
# define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
glGenTextures(1, &(pt->texture));
|
glGenTextures(1, &(pt->texture));
|
||||||
glBindTexture(GL_TEXTURE_2D, pt->texture);
|
glBindTexture(GL_TEXTURE_2D, pt->texture);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
@ -290,11 +291,10 @@ _pool_tex_render_new(Evas_GL_Context *gc, int w, int h, int intformat, int forma
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
_tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
|
_tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
|
||||||
glGenFramebuffers(1, &(pt->fb));
|
glGenFramebuffers(1, &(pt->fb));
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER_EXT, pt->fb);
|
glBindFramebuffer(GL_FRAMEBUFFER, pt->fb);
|
||||||
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, pt->texture, 0);
|
glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pt->texture, 0);
|
||||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
|
glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
|
||||||
glBindTexture(GL_TEXTURE_2D, gc->shader.cur_tex);
|
glBindTexture(GL_TEXTURE_2D, gc->shader.cur_tex);
|
||||||
#endif
|
|
||||||
return pt;
|
return pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue