r300-gallium: r500-fs: Add ABS.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 16 Mar 2009 13:48:05 +0000 (06:48 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 16 Mar 2009 13:49:22 +0000 (06:49 -0700)
src/gallium/drivers/r300/r300_state_shader.c

index 0a4f7c8d7e9446b685a0197f266e0ad94f45921f..564acad83b3db3b47be17e090e6ada0d9b90bf33 100644 (file)
@@ -398,6 +398,19 @@ static void r500_fs_instruction(struct r500_fragment_shader* fs,
                     &inst->FullDstRegisters[0], inst->Instruction.Opcode, 3,
                     false);
             break;
+        case TGSI_OPCODE_ABS:
+            r500_emit_maths(fs, assembler, inst->FullSrcRegisters,
+                    &inst->FullDstRegisters[0], inst->Instruction.Opcode, 3,
+                    false);
+            /* Set absolute value modifiers. */
+            i = fs->instruction_count - 1;
+            fs->instructions[i].inst3 |=
+                R500_ALU_RGB_MOD_A_ABS |
+                R500_ALU_RGB_MOD_B_ABS;
+            fs->instructions[i].inst4 |=
+                R500_ALPHA_MOD_A_ABS |
+                R500_ALPHA_MOD_B_ABS;
+            break;
         case TGSI_OPCODE_MAD:
             r500_emit_maths(fs, assembler, inst->FullSrcRegisters,
                     &inst->FullDstRegisters[0], inst->Instruction.Opcode, 3,