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/mesa/state_tracker/st_glsl_to_tgsi.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 695644117ac..7a8c4e1b8fa 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -6019,6 +6019,9 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) LOWER_PACK_HALF_2x16 | LOWER_UNPACK_HALF_2x16; + if (ctx->Extensions.ARB_gpu_shader5) + lower_inst |= LOWER_PACK_USE_BFI; + lower_packing_builtins(ir, lower_inst); } -- cgit v1.2.3