From: Ian Romanick Date: Tue, 4 Dec 2012 18:36:10 +0000 (-0800) Subject: mesa: Disallow SNORM formats for renderbuffers in OpenGL ES X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2aae3abd77dc28b3666bb0db04baff18d8f0aa51;p=mesa.git mesa: Disallow SNORM formats for renderbuffers in OpenGL ES v2: Move {RED,RG,RGB,RGBA}_SNORM changes from the previous commit to this commit. Based on suggestions from Ken. Signed-off-by: Ian Romanick Reviewed-by: Marek Olšák Reviewed-by: Kenneth Graunke Reviewed-by: Eric Anholt --- diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 0ae4d387a56..ab53bac7539 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1169,35 +1169,23 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) return ctx->API != API_OPENGLES && ctx->Extensions.ARB_texture_rg ? GL_RG : 0; /* signed normalized texture formats */ - case GL_R8_SNORM: - return ctx->Version >= 30 - || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm) - ? GL_RED : 0; case GL_RED_SNORM: + case GL_R8_SNORM: case GL_R16_SNORM: return _mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_snorm ? GL_RED : 0; - case GL_RG8_SNORM: - return ctx->Version >= 30 - || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm) - ? GL_RG : 0; case GL_RG_SNORM: + case GL_RG8_SNORM: case GL_RG16_SNORM: return _mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_snorm ? GL_RG : 0; - case GL_RGB8_SNORM: - return ctx->Version >= 30 - || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm) - ? GL_RGB : 0; case GL_RGB_SNORM: + case GL_RGB8_SNORM: case GL_RGB16_SNORM: return _mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_snorm ? GL_RGB : 0; - case GL_RGBA8_SNORM: - return ctx->Version >= 30 - || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm) - ? GL_RGBA : 0; case GL_RGBA_SNORM: + case GL_RGBA8_SNORM: case GL_RGBA16_SNORM: return _mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_snorm ? GL_RGBA : 0;