diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h index 4ef8d9a6135..f967ccb1d4b 100644 --- a/src/compiler/glsl/ir.h +++ b/src/compiler/glsl/ir.h @@ -51,6 +51,8 @@ struct gl_builtin_uniform_desc; #ifdef __cplusplus +using float16_t = mesa::float16_t; + /** * \defgroup IR Intermediate representation nodes * diff --git a/src/util/half_float.h b/src/util/half_float.h index fed99277d58..7254c7533b8 100644 --- a/src/util/half_float.h +++ b/src/util/half_float.h @@ -126,6 +126,9 @@ _mesa_half_is_negative(uint16_t h) #ifdef __cplusplus +namespace mesa +{ + /* Helper class for disambiguating fp16 from uint16_t in C++ overloads */ struct float16_t { @@ -137,6 +140,8 @@ struct float16_t { static float16_t zero() { return float16_t(FP16_ZERO); } }; +} /* namespace mesa */ + #endif