aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_util.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h
index d676f80d71b..a762c8f0575 100644
--- a/src/gallium/drivers/freedreno/freedreno_util.h
+++ b/src/gallium/drivers/freedreno/freedreno_util.h
@@ -38,6 +38,7 @@
#include "util/u_math.h"
#include "util/u_half.h"
#include "util/u_dynarray.h"
+#include "util/u_pack_color.h"
#include "adreno_common.xml.h"
#include "adreno_pm4.xml.h"
@@ -250,4 +251,12 @@ static inline uint32_t env2u(const char *envvar)
return 0;
}
+static inline uint32_t
+pack_rgba(enum pipe_format format, const float *rgba)
+{
+ union util_color uc;
+ util_pack_color(rgba, format, &uc);
+ return uc.ui[0];
+}
+
#endif /* FREEDRENO_UTIL_H_ */