Mesa (master): mesa: update fbo format tablet for integer types.

Dave Airlie airlied at kemper.freedesktop.org
Wed Oct 5 12:44:59 UTC 2011


Module: Mesa
Branch: master
Commit: 9c697a9d004da4aa7a26d3bda17cc473f50345ea
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c697a9d004da4aa7a26d3bda17cc473f50345ea

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Oct  4 20:59:40 2011 +0100

mesa: update fbo format tablet for integer types.

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 1d39806..7571155 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1231,7 +1231,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;
    }




More information about the mesa-commit mailing list