diff options
author | Marek Olšák <[email protected]> | 2010-03-28 00:07:45 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-03-28 00:07:45 +0100 |
commit | 4a16d325eb79d8c9da22df58aae4490bd79edaba (patch) | |
tree | 6cc9d513dda1dab29683e0f8797505d197cecad9 /src/gallium | |
parent | feb8d995939bd52e880defc1ea95ccb68f5aaa0c (diff) |
r300g: handle TGSI_OPCODE_RET as END
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/r300/r300_tgsi_to_rc.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_tgsi_to_rc.c b/src/gallium/drivers/r300/r300_tgsi_to_rc.c index 1c90cc92a96..3f88a2b82b9 100644 --- a/src/gallium/drivers/r300/r300_tgsi_to_rc.c +++ b/src/gallium/drivers/r300/r300_tgsi_to_rc.c @@ -273,9 +273,6 @@ static void transform_instruction(struct tgsi_to_rc * ttr, struct tgsi_full_inst struct rc_instruction * dst; int i; - if (src->Instruction.Opcode == TGSI_OPCODE_END) - return; - dst = rc_insert_new_instruction(ttr->compiler, ttr->compiler->Program.Instructions.Prev); dst->U.I.Opcode = translate_opcode(src->Instruction.Opcode); dst->U.I.SaturateMode = translate_saturate(src->Instruction.Saturate); @@ -334,6 +331,7 @@ static void handle_immediate(struct tgsi_to_rc * ttr, void r300_tgsi_to_rc(struct tgsi_to_rc * ttr, const struct tgsi_token * tokens) { + struct tgsi_full_instruction *inst; struct tgsi_parse_context parser; unsigned imm_index = 0; int i; @@ -368,7 +366,15 @@ void r300_tgsi_to_rc(struct tgsi_to_rc * ttr, imm_index++; break; case TGSI_TOKEN_TYPE_INSTRUCTION: - transform_instruction(ttr, &parser.FullToken.FullInstruction); + inst = &parser.FullToken.FullInstruction; + /* This hack with the RET opcode woudn't work with + * conditionals. */ + if (inst->Instruction.Opcode == TGSI_OPCODE_END || + inst->Instruction.Opcode == TGSI_OPCODE_RET) { + break; + } + + transform_instruction(ttr, inst); break; } } |