Mesa (10.2): mesa: set UniformBooleanTrue = 1.0f by default

Emil Velikov evelikov at kemper.freedesktop.org
Tue Sep 9 20:31:03 UTC 2014


Module: Mesa
Branch: 10.2
Commit: 92427707243940521fe55bab92a347d3608a5353
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=92427707243940521fe55bab92a347d3608a5353

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Thu Sep  4 15:03:31 2014 +0200

mesa: set UniformBooleanTrue = 1.0f by default

because NativeIntegers is 0 by default.

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

Cc: 10.2 10.3 mesa-stable at lists.freedesktop.org
Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
(cherry picked from commit d67db73458c8d66861b97675660289a9555695ce)
[emil velikov: s|consts->|ctx->Const.|]
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>

---

 src/mesa/main/context.c |    3 +++
 src/mesa/main/macros.h  |    7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 9eba126..6b95b60 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -647,6 +647,9 @@ _mesa_init_constants(struct gl_context *ctx)
    /* GL_ARB_framebuffer_object */
    ctx->Const.MaxSamples = 0;
 
+   /* GLSL default if NativeIntegers == FALSE */
+   ctx->Const.UniformBooleanTrue = FLT_AS_UINT(1.0f);
+
    /* GL_ARB_sync */
    ctx->Const.MaxServerWaitTimeout = 0x1fff7fffffffULL;
 
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index 5228c3a..886e0cd 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -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.
  *




More information about the mesa-commit mailing list