Mesa (master): svga: Cannot use negate or abs on source to dsx/ dsy instructions.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Fri Feb 18 16:44:41 UTC 2011


Module: Mesa
Branch: master
Commit: f9b48678463e926571ab5e547bb5ced5f4a6896a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9b48678463e926571ab5e547bb5ced5f4a6896a

Author: José Fonseca <jfonseca at vmware.com>
Date:   Fri Feb 18 15:07:50 2011 +0000

svga: Cannot use negate or abs on source to dsx/dsy instructions.

---

 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 f5842ef..99600cf 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 );
    }
 }
 




More information about the mesa-commit mailing list