diff options
author | José Fonseca <[email protected]> | 2011-02-18 15:07:50 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2011-02-18 16:43:44 +0000 |
commit | f9b48678463e926571ab5e547bb5ced5f4a6896a (patch) | |
tree | 6ce53bddc28551a1c5d560e435116bbfcc85bbdd | |
parent | 0cb6329e8941dc7937c8aeea4b2e83c77881bd3a (diff) |
svga: Cannot use negate or abs on source to dsx/dsy instructions.
-rw-r--r-- | src/gallium/drivers/svga/svga_tgsi_insn.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c index f5842eff3d2..99600cf5c00 100644 --- a/src/gallium/drivers/svga/svga_tgsi_insn.c +++ b/src/gallium/drivers/svga/svga_tgsi_insn.c @@ -1704,6 +1704,10 @@ static boolean emit_deriv(struct svga_shader_emitter *emit, } else { unsigned opcode; + const struct tgsi_full_src_register *reg = &insn->Src[0]; + SVGA3dShaderInstToken inst; + SVGA3dShaderDestToken dst; + struct src_register src0; switch (insn->Instruction.Opcode) { case TGSI_OPCODE_DDX: @@ -1716,7 +1720,21 @@ static boolean emit_deriv(struct svga_shader_emitter *emit, return FALSE; } - return emit_simple_instruction( emit, opcode, insn ); + inst = inst_token( opcode ); + dst = translate_dst_register( emit, insn, 0 ); + src0 = translate_src_register( emit, reg ); + + /* We cannot use negate or abs on source to dsx/dsy instruction. + */ + if (reg->Register.Absolute || + reg->Register.Negate) { + SVGA3dShaderDestToken temp = get_temp( emit ); + + if (!emit_repl( emit, temp, &src0 )) + return FALSE; + } + + return submit_op1( emit, inst, dst, src0 ); } } |