From fe4497d0e68f54a17d9e142df0e75ffc000678c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Thu, 12 Feb 2015 09:27:28 +0200 Subject: [PATCH] mesa: do not adjust float format if extension is not enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch wraps float internal format adjustment inside extension check. Signed-off-by: Tapani Pälli Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88907 --- src/mesa/main/teximage.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 29c325b..347bab5 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3246,14 +3246,17 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims, /* In case of HALF_FLOAT_OES or FLOAT_OES, find corresponding sized * internal floating point format for the given base format. */ - if (_mesa_is_gles(ctx) && format == internalFormat) { - if (type == GL_FLOAT) { - texObj->_IsFloat = GL_TRUE; - } else if (type == GL_HALF_FLOAT_OES || type == GL_HALF_FLOAT) { - texObj->_IsHalfFloat = GL_TRUE; - } + if (ctx->Extensions.OES_texture_float || + ctx->Extensions.OES_texture_half_float) { + if (_mesa_is_gles(ctx) && format == internalFormat) { + if (type == GL_FLOAT) { + texObj->_IsFloat = GL_TRUE; + } else if (type == GL_HALF_FLOAT_OES || type == GL_HALF_FLOAT) { + texObj->_IsHalfFloat = GL_TRUE; + } - internalFormat = adjust_for_oes_float_texture(format, type); + internalFormat = adjust_for_oes_float_texture(format, type); + } } texFormat = _mesa_choose_texture_format(ctx, texObj, target, level, -- 2.1.0