[Mesa-dev] [PATCH] fixup! glsl: Add a pass to lower bitfield-insert into bfm+bfi.

Matt Turner mattst88 at gmail.com
Tue Apr 30 15:28:42 PDT 2013


---
Does this squashed in seem okay, Eric?

 src/glsl/lower_instructions.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/glsl/lower_instructions.cpp b/src/glsl/lower_instructions.cpp
index 6c70a4a..d32ec80 100644
--- a/src/glsl/lower_instructions.cpp
+++ b/src/glsl/lower_instructions.cpp
@@ -321,9 +321,10 @@ lower_instructions_visitor::bitfield_insert_to_bfm_bfi(ir_expression *ir)
    ir_rvalue *base_expr = ir->operands[0];
 
    ir->operation = ir_triop_bfi;
-   ir->operands[0] = new(ir) ir_expression(ir_binop_bfm, ir->type,
-                                           swizzle_xxxx(ir->operands[3]),
-                                           swizzle_xxxx(ir->operands[2]));
+   ir->operands[0] = new(ir) ir_expression(ir_binop_bfm,
+                                           ir->type->get_base_type(),
+                                           ir->operands[3],
+                                           ir->operands[2]);
    /* ir->operands[1] is still the value to insert. */
    ir->operands[2] = base_expr;
    ir->operands[3] = NULL;
-- 
1.8.1.5



More information about the mesa-dev mailing list