mesa: set UniformBooleanTrue = 1.0f by default
authorMarek Olšák <marek.olsak@amd.com>
Thu, 4 Sep 2014 13:03:31 +0000 (15:03 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 5 Sep 2014 13:41:47 +0000 (15:41 +0200)
because NativeIntegers is 0 by default.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82882

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/main/context.c
src/mesa/main/macros.h

index fbdbd680a2e6e6b35f327b5ae4d3993ba485f22f..8b5693e3771c841673eb290d1d552b059203f7c0 100644 (file)
@@ -653,6 +653,9 @@ _mesa_init_constants(struct gl_constants *consts, gl_api api)
    /* GL_ARB_framebuffer_object */
    consts->MaxSamples = 0;
 
+   /* GLSL default if NativeIntegers == FALSE */
+   consts->UniformBooleanTrue = FLT_AS_UINT(1.0f);
+
    /* GL_ARB_sync */
    consts->MaxServerWaitTimeout = 0x1fff7fffffffULL;
 
index 422eb5aadaad1eeef62581fca3d8f387460159ea..7b6148d09401dd765eecce607362700664011af9 100644 (file)
@@ -184,6 +184,13 @@ static inline GLfloat UINT_AS_FLT(GLuint u)
    return tmp.f;
 }
 
+static inline unsigned FLT_AS_UINT(float f)
+{
+   fi_type tmp;
+   tmp.f = f;
+   return tmp.u;
+}
+
 /**
  * Convert a floating point value to an unsigned fixed point value.
  *