summaryrefslogtreecommitdiffstats
path: root/src/mesa/es
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2009-11-24 12:11:26 +0800
committerBrian Paul <[email protected]>2010-01-04 14:15:16 -0700
commitc4b9e1aa1a2f1fda9e5764e3f7dd1a268216df09 (patch)
treec233d34208c195009abb27b7109917d719d5e219 /src/mesa/es
parentb80ec33f3559e9a14d08f84c8e369a0dc81b46d7 (diff)
mesa/es: Fix GL_RGB565 support in FBO.
In GL_OES_framebuffer_object and OpenGL ES 2.0, GL_RGB565 is a valid internal format. Since it is not supported by the core, map it to GL_RGB5 as a workaround. Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/mesa/es')
-rw-r--r--src/mesa/es/main/APIspec.xml2
-rw-r--r--src/mesa/es/main/es_fbo.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/es/main/APIspec.xml b/src/mesa/es/main/APIspec.xml
index a7dbdc42499..f6f33130b15 100644
--- a/src/mesa/es/main/APIspec.xml
+++ b/src/mesa/es/main/APIspec.xml
@@ -4041,7 +4041,7 @@
<function name="BindRenderbufferOES" template="BindRenderbuffer"/>
<function name="DeleteRenderbuffersOES" template="DeleteRenderbuffers"/>
<function name="GenRenderbuffersOES" template="GenRenderbuffers"/>
- <function name="RenderbufferStorageOES" template="RenderbufferStorage"/>
+ <function name="RenderbufferStorageOES" external="true" template="RenderbufferStorage"/>
<function name="FramebufferRenderbufferOES" template="FramebufferRenderbuffer"/>
<function name="FramebufferTexture2DOES" template="FramebufferTexture2D"/>
<function name="CheckFramebufferStatusOES" template="CheckFramebufferStatus"/>
diff --git a/src/mesa/es/main/es_fbo.c b/src/mesa/es/main/es_fbo.c
index db53a1449f3..18036378304 100644
--- a/src/mesa/es/main/es_fbo.c
+++ b/src/mesa/es/main/es_fbo.c
@@ -10,6 +10,11 @@
#include "GLES2/gl2ext.h"
+#ifndef GL_RGB5
+#define GL_RGB5 0x8050
+#endif
+
+
extern void GL_APIENTRY _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height);
extern void GL_APIENTRY _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height);
@@ -20,18 +25,13 @@ _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
GLsizei width, GLsizei height)
{
switch (internalFormat) {
- case GL_RGBA4:
- case GL_RGB5_A1:
case GL_RGB565:
- internalFormat = GL_RGBA;
- break;
- case GL_STENCIL_INDEX1_OES:
- case GL_STENCIL_INDEX4_OES:
- case GL_STENCIL_INDEX8:
- internalFormat = GL_STENCIL_INDEX;
+ /* XXX this confuses GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
+ /* choose a closest format */
+ internalFormat = GL_RGB5;
break;
default:
- ; /* no op */
+ break;
}
_mesa_RenderbufferStorageEXT(target, internalFormat, width, height);
}