From 61d94dd207459e0c42d98c9d6eb7df5eabdfd8a4 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 22 Apr 2010 21:11:56 -0400 Subject: mesa: Move GL_RGB565 workaround into fbobject.c --- src/mesa/main/fbobject.c | 15 +++++++++++++++ src/mesa/main/fbobject.h | 4 ++++ src/mesa/main/glheader.h | 4 ++++ 3 files changed, 23 insertions(+) (limited to 'src/mesa/main') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 8d44246618..201a023246 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1110,7 +1110,22 @@ _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, renderbuffer_storage(target, internalFormat, width, height, samples); } +void GLAPIENTRY +_es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height) +{ + switch (internalFormat) { + case GL_RGB565: + /* XXX this confuses GL_RENDERBUFFER_INTERNAL_FORMAT_OES */ + /* choose a closest format */ + internalFormat = GL_RGB5; + break; + default: + break; + } + renderbuffer_storage(target, internalFormat, width, height, 0); +} void GLAPIENTRY _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index 28f75dfca7..40a18f8341 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -88,6 +88,10 @@ _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +extern void GLAPIENTRY +_es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height); + extern void GLAPIENTRY _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image); diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index 77544c88c6..7f01d9f39b 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -85,6 +85,10 @@ typedef void *GLeglImageOES; #define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 #endif +/* GLES 2.0 token */ +#ifndef GL_RGB565 +#define GL_RGB565 0x8D62 +#endif /** * Special, internal token -- cgit v1.2.3