diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/context.c | 3 | ||||
-rw-r--r-- | src/mesa/main/macros.h | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index fbdbd680a2e..8b5693e3771 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -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; diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 422eb5aadaa..7b6148d0940 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. * |