[Mesa-dev] [PATCH 4/4] mesa: update fbo format tablet for integer types.

Dave Airlie airlied at gmail.com
Tue Oct 4 13:11:36 PDT 2011


From: Dave Airlie <airlied at redhat.com>

This updates the fbo format table for the integer types.

Signed-off-by: Dave Airlie <airlied at 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;
    default:
       return 0;
    }
-- 
1.7.6.2



More information about the mesa-dev mailing list