From 452d64986bd510753d13b56b33951f1b4348e3a9 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 1 Aug 2014 16:41:16 -0700 Subject: [PATCH] mesa/imports: Add a _mesa_half_is_negative helper function Signed-off-by: Jason Ekstrand Reviewed-by: Brian Paul --- src/mesa/main/imports.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 09e55ebf0ff..023ef2e6399 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -552,6 +552,11 @@ _mesa_float_to_half(float f); extern float _mesa_half_to_float(GLhalfARB h); +static inline bool +_mesa_half_is_negative(GLhalfARB h) +{ + return h & 0x8000; +} extern void * _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, -- 2.30.2