Mesa (master): mesa: Reject texture-only formats as renderbuffer formats in ES 3

Ian Romanick idr at kemper.freedesktop.org
Tue Jan 15 21:42:01 UTC 2013


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

Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Nov 20 13:45:03 2012 -0800

mesa: Reject texture-only formats as renderbuffer formats in ES 3

ES 3 specifies some formats as texture-only (i.e., not available for
renderbuffers).

See the "Required Texture Formats" section (pg 126) of the ES 3 spec.

v2: Allow RED and RG float rendering in core profiles The check used to
be (version > 30) || (compat profile w/extensions).  Just deleting
<version > 30) broke 3.0+ core profiles.

Fixes es3conform's color_buffer_unsupported_format test.

Signed-off-by: Matt Turner <mattst88 at gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Acked-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/main/fbobject.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index bb8ee2d..a525877 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1111,7 +1111,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
    case GL_RGB16:
       return _mesa_is_desktop_gl(ctx) ? GL_RGB : 0;
    case GL_SRGB8_EXT:
-      return _mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx) ? GL_RGB : 0;
+      return _mesa_is_desktop_gl(ctx) ? GL_RGB : 0;
    case GL_RGBA4:
    case GL_RGB5_A1:
    case GL_RGBA8:
@@ -1198,25 +1198,21 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
              ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
    case GL_R16F:
    case GL_R32F:
-      return ctx->Version >= 30
-         || (ctx->API == API_OPENGL_COMPAT &&
+      return (_mesa_is_desktop_gl(ctx) &&
              ctx->Extensions.ARB_texture_rg &&
              ctx->Extensions.ARB_texture_float) ? GL_RED : 0;
    case GL_RG16F:
    case GL_RG32F:
-      return ctx->Version >= 30
-         || (ctx->API == API_OPENGL_COMPAT &&
+      return (_mesa_is_desktop_gl(ctx) &&
              ctx->Extensions.ARB_texture_rg &&
              ctx->Extensions.ARB_texture_float) ? GL_RG : 0;
    case GL_RGB16F:
    case GL_RGB32F:
       return (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_float)
-         || _mesa_is_gles3(ctx)
          ? GL_RGB : 0;
    case GL_RGBA16F:
    case GL_RGBA32F:
       return (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_float)
-         || _mesa_is_gles3(ctx)
          ? GL_RGBA : 0;
    case GL_ALPHA16F_ARB:
    case GL_ALPHA32F_ARB:
@@ -1241,10 +1237,10 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
    case GL_RGB9_E5:
       return (_mesa_is_desktop_gl(ctx)
               && ctx->Extensions.EXT_texture_shared_exponent)
-         || _mesa_is_gles3(ctx) ? GL_RGB : 0;
+         ? GL_RGB : 0;
    case GL_R11F_G11F_B10F:
       return (_mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_packed_float)
-         || _mesa_is_gles3(ctx) ? GL_RGB : 0;
+         ? GL_RGB : 0;
 
    case GL_RGBA8UI_EXT:
    case GL_RGBA16UI_EXT:




More information about the mesa-commit mailing list