summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-06-23 09:32:39 +1000
committerTimothy Arceri <[email protected]>2016-07-21 12:06:11 +1000
commit4b57b53f85a7b125fa19508b5dcdd92b9e00c25f (patch)
treecdb7066fbf754ab504295ea2c956879f270f8c4f
parentd2b4b16589b1206b20aea638f8b0c7cf740b3a4f (diff)
i965: add helpers for creating component layout swizzle
This will be used to swizzle components to the beginning or end of the vector based on the component layout qualifier and whether we are doing a load or store. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_reg.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h
index 38cf8e31371..7eab7b51e38 100644
--- a/src/mesa/drivers/dri/i965/brw_reg.h
+++ b/src/mesa/drivers/dri/i965/brw_reg.h
@@ -88,6 +88,9 @@ struct brw_device_info;
#define BRW_SWIZZLE_ZWZW BRW_SWIZZLE4(2,3,2,3)
#define BRW_SWIZZLE_WZYX BRW_SWIZZLE4(3,2,1,0)
+#define BRW_SWZ_COMP_INPUT(comp) (BRW_SWIZZLE_XYZW >> ((comp)*2))
+#define BRW_SWZ_COMP_OUTPUT(comp) (BRW_SWIZZLE_XYZW << ((comp)*2))
+
static inline bool
brw_is_single_value_swizzle(unsigned swiz)
{