summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_pack_color.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/util/u_pack_color.h')
-rw-r--r--src/gallium/auxiliary/util/u_pack_color.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_pack_color.h b/src/gallium/auxiliary/util/u_pack_color.h
index 9dacc6d83d..30cc7969e9 100644
--- a/src/gallium/auxiliary/util/u_pack_color.h
+++ b/src/gallium/auxiliary/util/u_pack_color.h
@@ -37,6 +37,7 @@
#include "pipe/p_compiler.h"
#include "pipe/p_format.h"
+#include "util/u_format.h"
#include "util/u_math.h"
@@ -307,7 +308,7 @@ util_pack_color(const float rgba[4], enum pipe_format format, void *dest)
ubyte b = 0;
ubyte a = 0;
- if (pf_size_x(format) <= 8) {
+ if (util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 0) <= 8) {
/* format uses 8-bit components or less */
r = float_to_ubyte(rgba[0]);
g = float_to_ubyte(rgba[1]);