[Mesa-dev] [PATCH] mesa: do not adjust float format if extension is not enabled

Tapani Pälli tapani.palli at intel.com
Mon Feb 16 04:31:17 PST 2015


Patch wraps float internal format adjustment inside extension check.

v2: explicitly check for OpenGL ES 2.0 (Ian Romanick)

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
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..b8efaef 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 (ctx->API == API_OPENGLES2 && 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



More information about the mesa-dev mailing list