[Mesa-dev] [PATCH 06/15] i965: add helper for creating packing writemask
Timothy Arceri
timothy.arceri at collabora.com
Tue Jul 19 06:33:18 UTC 2016
For example where n=3 first_component=1 this will give us
0xE (WRITEMASK_YZW).
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
---
src/mesa/drivers/dri/i965/brw_reg.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h
index 7eab7b5..abd63e4 100644
--- a/src/mesa/drivers/dri/i965/brw_reg.h
+++ b/src/mesa/drivers/dri/i965/brw_reg.h
@@ -972,6 +972,12 @@ brw_writemask_for_size(unsigned n)
return (1 << n) - 1;
}
+static inline unsigned
+brw_writemask_for_component_packing(unsigned n, unsigned first_component)
+{
+ return (((1 << n) - 1) << first_component);
+}
+
static inline struct brw_reg
negate(struct brw_reg reg)
{
--
2.7.4
More information about the mesa-dev
mailing list