i965/vs: Fix order of source arguments to LRP.
authorMatt Turner <mattst88@gmail.com>
Sun, 28 Apr 2013 21:35:01 +0000 (14:35 -0700)
committerMatt Turner <mattst88@gmail.com>
Sun, 28 Apr 2013 21:38:14 +0000 (14:38 -0700)
The order or arguments matches DirectX, and is backwards from GLSL's
mix() built-in.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63983

src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index 88c435ca29245e0ff5a39cfbcee1092cb48ce198..31da01f143bc13c4b89b96db715cf1363daad847 100644 (file)
@@ -1631,7 +1631,10 @@ vec4_visitor::visit(ir_expression *ir)
       op[0] = fix_3src_operand(op[0]);
       op[1] = fix_3src_operand(op[1]);
       op[2] = fix_3src_operand(op[2]);
-      emit(LRP(result_dst, op[0], op[1], op[2]));
+      /* Note that the instruction's argument order is reversed from GLSL
+       * and the IR.
+       */
+      emit(LRP(result_dst, op[2], op[1], op[0]));
       break;
 
    case ir_quadop_vector: