diff options
author | Matt Turner <mattst88@gmail.com> | 2012-11-20 13:45:03 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2013-01-15 13:34:00 -0800 |
commit | cbef5371f6cb0a03f62586f7c5b4ed66511daff4 (patch) | |
tree | cfa8029f854507c2bd188631ff300548bfc483eb /src | |
parent | 8907b6a8e4461f6064e32ff5419053e74274e770 (diff) |
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@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | 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 bb8ee2d8d78..a525877a336 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: |