On 10/04/2011 04:47 PM, Eric Anholt wrote:
On Tue, 4 Oct 2011 21:11:36 +0100, Dave Airlie<airl...@gmail.com> wrote:
From: Dave Airlie<airl...@redhat.com>
This updates the fbo format table for the integer types.
Signed-off-by: Dave Airlie<airl...@redhat.com>
---
src/mesa/main/fbobject.c | 62 +++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 61 insertions(+), 1 deletions(-)
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 139ff03..bc61ac3 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1220,7 +1220,67 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum
internalFormat)
return ctx->Extensions.EXT_texture_shared_exponent ? GL_RGB : 0;
case GL_R11F_G11F_B10F:
return ctx->Extensions.EXT_packed_float ? GL_RGB : 0;
- /* XXX add integer formats eventually */
+
+ case GL_RGBA8UI_EXT:
+ case GL_RGBA16UI_EXT:
+ case GL_RGBA32UI_EXT:
+ case GL_RGBA8I_EXT:
+ case GL_RGBA16I_EXT:
+ case GL_RGBA32I_EXT:
+ return ctx->Extensions.EXT_texture_integer ? GL_RGBA : 0;
+
+ case GL_RGB8UI_EXT:
+ case GL_RGB16UI_EXT:
+ case GL_RGB32UI_EXT:
+ case GL_RGB8I_EXT:
+ case GL_RGB16I_EXT:
+ case GL_RGB32I_EXT:
+ return ctx->Extensions.EXT_texture_integer ? GL_RGB : 0;
+
+ case GL_R8UI:
+ case GL_R8I:
+ case GL_R16UI:
+ case GL_R16I:
+ case GL_R32UI:
+ case GL_R32I:
+ return ctx->Extensions.ARB_texture_rg&&
+ ctx->Extensions.EXT_texture_integer ? GL_RED : 0;
+
+ case GL_RG8UI:
+ case GL_RG8I:
+ case GL_RG16UI:
+ case GL_RG16I:
+ case GL_RG32UI:
+ case GL_RG32I:
+ return ctx->Extensions.ARB_texture_rg&&
+ ctx->Extensions.EXT_texture_integer ? GL_RG : 0;
+
+ case GL_INTENSITY8I_EXT:
+ case GL_INTENSITY8UI_EXT:
+ case GL_INTENSITY16I_EXT:
+ case GL_INTENSITY16UI_EXT:
+ case GL_INTENSITY32I_EXT:
+ case GL_INTENSITY32UI_EXT:
+ return ctx->Extensions.EXT_texture_integer&&
+ ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
+
+ case GL_LUMINANCE8I_EXT:
+ case GL_LUMINANCE8UI_EXT:
+ case GL_LUMINANCE16I_EXT:
+ case GL_LUMINANCE16UI_EXT:
+ case GL_LUMINANCE32I_EXT:
+ case GL_LUMINANCE32UI_EXT:
+ return ctx->Extensions.EXT_texture_integer&&
+ ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
+
+ case GL_LUMINANCE_ALPHA8I_EXT:
+ case GL_LUMINANCE_ALPHA8UI_EXT:
+ case GL_LUMINANCE_ALPHA16I_EXT:
+ case GL_LUMINANCE_ALPHA16UI_EXT:
+ case GL_LUMINANCE_ALPHA32I_EXT:
+ case GL_LUMINANCE_ALPHA32UI_EXT:
+ return ctx->Extensions.EXT_texture_integer&&
+ ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
Could we drop the _EXT on these tokens?
Since intensity, luminance, and luminance-alpha textures were removed
from the core profile in OpenGL 3.1, the non-EXT enums do not exist.
egrep '(LUMINANCE|LUMINANCE_ALPHA|INTENSITY)[^_]*I' include/GL/glext.h
shows only the _EXT names.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev