summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_builder.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2012-07-09 20:59:29 -0700
committerKenneth Graunke <[email protected]>2012-07-12 10:20:20 -0700
commitd9da350a8334201400a43d105b92fce2bd6a5f32 (patch)
tree60e76ef1eae2e71532b1a03b503fab8a72493a1f /src/glsl/ir_builder.h
parent0bb3d4ba54f98f4d45abe598dabc905f08055cd5 (diff)
glsl/ir_builder: Add a new swizzle_for_size() function.
This swizzles away unwanted components, while preserving the order of the ones that remain. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glsl/ir_builder.h')
-rw-r--r--src/glsl/ir_builder.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h
index 410b08cd052..7a0a196ee67 100644
--- a/src/glsl/ir_builder.h
+++ b/src/glsl/ir_builder.h
@@ -91,6 +91,11 @@ ir_expression *mul(operand a, operand b);
ir_expression *dot(operand a, operand b);
ir_expression *saturate(operand a);
+/**
+ * Swizzle away later components, but preserve the ordering.
+ */
+ir_swizzle *swizzle_for_size(operand a, int components);
+
ir_swizzle *swizzle_xxxx(operand a);
ir_swizzle *swizzle_yyyy(operand a);
ir_swizzle *swizzle_zzzz(operand a);