From 889a946a455c54a5a9bca144b2ea2fe66be39274 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Thu, 20 Aug 2015 20:52:32 -0400 Subject: glsl: use bitfield_insert instead of and + shift + or for packing It is fairly tricky to detect the proper conditions for using bitfield insert, but easy to just use it up front. This removes a lot of instructions on nvc0 when invoking the packing builtins. Signed-off-by: Ilia Mirkin Reviewed-by: Matt Turner --- src/glsl/ir_optimization.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/glsl/ir_optimization.h') diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h index eef107e5249..b955874df84 100644 --- a/src/glsl/ir_optimization.h +++ b/src/glsl/ir_optimization.h @@ -66,7 +66,9 @@ enum lower_packing_builtins_op { LOWER_UNPACK_SNORM_4x8 = 0x0200, LOWER_PACK_UNORM_4x8 = 0x0400, - LOWER_UNPACK_UNORM_4x8 = 0x0800 + LOWER_UNPACK_UNORM_4x8 = 0x0800, + + LOWER_PACK_USE_BFI = 0x1000, }; bool do_common_optimization(exec_list *ir, bool linked, -- cgit v1.2.3