Mesa (gallium-0.1): tgsi: Implement OPCODE_ARR.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Wed Nov 26 12:47:38 UTC 2008


Module: Mesa
Branch: gallium-0.1
Commit: eee3d216049f21507a3ff6908f1d506c683efad0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=eee3d216049f21507a3ff6908f1d506c683efad0

Author: Michal Krol <michal at tungstengraphics.com>
Date:   Wed Nov 26 13:17:25 2008 +0100

tgsi: Implement OPCODE_ARR.

---

 src/gallium/auxiliary/tgsi/tgsi_exec.c |    5 +----
 src/gallium/auxiliary/tgsi/tgsi_sse2.c |    7 ++++++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 41dffc3..7114119 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -2067,6 +2067,7 @@ exec_instruction(
       break;
 
    case TGSI_OPCODE_ROUND:
+   case TGSI_OPCODE_ARR:
       FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
          FETCH( &r[0], 0, chan_index );
          micro_rnd( &r[0], &r[0] );
@@ -2367,10 +2368,6 @@ exec_instruction(
       assert (0);
       break;
 
-   case TGSI_OPCODE_ARR:
-      assert (0);
-      break;
-
    case TGSI_OPCODE_BRA:
       assert (0);
       break;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/tgsi_sse2.c
index 151d2b1..752c7c3 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_sse2.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.c
@@ -1906,7 +1906,12 @@ emit_instruction(
       break;
 
    case TGSI_OPCODE_ARR:
-      return 0;
+      FOR_EACH_DST0_ENABLED_CHANNEL( *inst, chan_index ) {
+         FETCH( func, *inst, 0, 0, chan_index );
+         emit_rnd( func, 0, 0 );
+         emit_f2it( func, 0 );
+         STORE( func, *inst, 0, 0, chan_index );
+      }
       break;
 
    case TGSI_OPCODE_BRA:




More information about the mesa-commit mailing list