From: Matt Turner Date: Tue, 20 Nov 2012 21:45:03 +0000 (-0800) Subject: mesa: Reject texture-only formats as renderbuffer formats in ES 3 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cbef5371f6cb0a03f62586f7c5b4ed66511daff4;p=mesa.git 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 30) broke 3.0+ core profiles. Fixes es3conform's color_buffer_unsupported_format test. Signed-off-by: Matt Turner Signed-off-by: Ian Romanick Acked-by: Kenneth Graunke Reviewed-by: Anuj Phogat Reviewed-by: Ian Romanick --- 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: