OSDN Git Service

gallium: remove noise opcodes
authorKeith Whitwell <keithw@vmware.com>
Fri, 23 Oct 2009 12:49:04 +0000 (13:49 +0100)
committerKeith Whitwell <keithw@vmware.com>
Fri, 23 Oct 2009 12:56:07 +0000 (13:56 +0100)
Provide a dummy implementation in the GL state tracker (move 0.5 to
the destination regs).

At some point, a motivated person could add a better
implementation of noise.  Currently not even the nvidia
binary drivers do anything more than this.  In any case, the
place to do this is in the GL state tracker, not the poor
driver.

src/gallium/auxiliary/tgsi/tgsi_exec.c
src/gallium/auxiliary/tgsi/tgsi_info.c
src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h
src/gallium/drivers/cell/spu/spu_exec.c
src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c
src/gallium/drivers/nv30/nv30_fragprog.c
src/gallium/drivers/nv40/nv40_fragprog.c
src/gallium/drivers/r300/r300_tgsi_to_rc.c
src/gallium/include/pipe/p_shader_tokens.h
src/mesa/state_tracker/st_mesa_to_tgsi.c

index c79c56d..d9661c7 100644 (file)
@@ -3223,22 +3223,6 @@ exec_instruction(
       /* no-op */
       break;
 
-   case TGSI_OPCODE_NOISE1:
-      assert( 0 );
-      break;
-
-   case TGSI_OPCODE_NOISE2:
-      assert( 0 );
-      break;
-
-   case TGSI_OPCODE_NOISE3:
-      assert( 0 );
-      break;
-
-   case TGSI_OPCODE_NOISE4:
-      assert( 0 );
-      break;
-
    case TGSI_OPCODE_NOP:
       break;
 
index 17af4cb..fe8b0bd 100644 (file)
@@ -134,10 +134,10 @@ static const struct tgsi_opcode_info opcode_info[TGSI_OPCODE_LAST] =
    { 0, 0, 0, 0, 0, 1, "BGNSUB", TGSI_OPCODE_BGNSUB },
    { 0, 0, 0, 1, 1, 0, "ENDLOOP", TGSI_OPCODE_ENDLOOP },
    { 0, 0, 0, 0, 1, 0, "ENDSUB", TGSI_OPCODE_ENDSUB },
-   { 1, 1, 0, 0, 0, 0, "NOISE1", TGSI_OPCODE_NOISE1 },
-   { 1, 1, 0, 0, 0, 0, "NOISE2", TGSI_OPCODE_NOISE2 },
-   { 1, 1, 0, 0, 0, 0, "NOISE3", TGSI_OPCODE_NOISE3 },
-   { 1, 1, 0, 0, 0, 0, "NOISE4", TGSI_OPCODE_NOISE4 },
+   { 0, 0, 0, 0, 0, 0, "", 103 },     /* removed */
+   { 0, 0, 0, 0, 0, 0, "", 104 },     /* removed */
+   { 0, 0, 0, 0, 0, 0, "", 105 },     /* removed */
+   { 0, 0, 0, 0, 0, 0, "", 106 },     /* removed */
    { 0, 0, 0, 0, 0, 0, "NOP", TGSI_OPCODE_NOP },
    { 0, 0, 0, 0, 0, 0, "", 108 },     /* removed */
    { 0, 0, 0, 0, 0, 0, "", 109 },     /* removed */
index e7bcf4b..d321f01 100644 (file)
@@ -139,10 +139,6 @@ OP00_LBL(BGNLOOP)
 OP00(BGNSUB)
 OP00_LBL(ENDLOOP)
 OP00(ENDSUB)
-OP11(NOISE1)
-OP11(NOISE2)
-OP11(NOISE3)
-OP11(NOISE4)
 OP00(NOP)
 OP11(NRM4)
 OP01(CALLNZ)
index 0eaae2e..725a72b 100644 (file)
@@ -1807,22 +1807,6 @@ exec_instruction(
       /* no-op */
       break;
 
-   case TGSI_OPCODE_NOISE1:
-      ASSERT( 0 );
-      break;
-
-   case TGSI_OPCODE_NOISE2:
-      ASSERT( 0 );
-      break;
-
-   case TGSI_OPCODE_NOISE3:
-      ASSERT( 0 );
-      break;
-
-   case TGSI_OPCODE_NOISE4:
-      ASSERT( 0 );
-      break;
-
    case TGSI_OPCODE_NOP:
       break;
 
index adc8156..926cc1c 100644 (file)
@@ -1386,15 +1386,6 @@ emit_instruction(
       return 0;
       break;
 
-   case TGSI_OPCODE_NOISE1:
-   case TGSI_OPCODE_NOISE2:
-   case TGSI_OPCODE_NOISE3:
-   case TGSI_OPCODE_NOISE4:
-      FOR_EACH_DST0_ENABLED_CHANNEL( inst, chan_index ) {
-         dst0[chan_index] = bld->base.zero;
-      }
-      break;
-
    case TGSI_OPCODE_NOP:
       break;
 
index a48ba97..62c6c76 100644 (file)
@@ -527,12 +527,6 @@ nv30_fragprog_parse_instruction(struct nv30_fpc *fpc,
        case TGSI_OPCODE_MUL:
                arith(fpc, sat, MUL, dst, mask, src[0], src[1], none);
                break;
-       case TGSI_OPCODE_NOISE1:
-       case TGSI_OPCODE_NOISE2:
-       case TGSI_OPCODE_NOISE3:
-       case TGSI_OPCODE_NOISE4:
-               arith(fpc, sat, SFL, dst, mask, none, none, none);
-               break;
        case TGSI_OPCODE_POW:
                arith(fpc, sat, POW, dst, mask, src[0], src[1], none);
                break;
index 32d9ed1..e3550ba 100644 (file)
@@ -568,12 +568,6 @@ nv40_fragprog_parse_instruction(struct nv40_fpc *fpc,
        case TGSI_OPCODE_MUL:
                arith(fpc, sat, MUL, dst, mask, src[0], src[1], none);
                break;
-       case TGSI_OPCODE_NOISE1:
-       case TGSI_OPCODE_NOISE2:
-       case TGSI_OPCODE_NOISE3:
-       case TGSI_OPCODE_NOISE4:
-               arith(fpc, sat, SFL, dst, mask, none, none, none);
-               break;
        case TGSI_OPCODE_POW:
                tmp = temp(fpc);
                arith(fpc, 0, LG2, tmp, MASK_X,
index 74d4fb5..3d2f6ca 100644 (file)
@@ -135,10 +135,6 @@ static unsigned translate_opcode(unsigned opcode)
      /* case TGSI_OPCODE_BGNSUB: return RC_OPCODE_BGNSUB; */
      /* case TGSI_OPCODE_ENDLOOP2: return RC_OPCODE_ENDLOOP2; */
      /* case TGSI_OPCODE_ENDSUB: return RC_OPCODE_ENDSUB; */
-     /* case TGSI_OPCODE_NOISE1: return RC_OPCODE_NOISE1; */
-     /* case TGSI_OPCODE_NOISE2: return RC_OPCODE_NOISE2; */
-     /* case TGSI_OPCODE_NOISE3: return RC_OPCODE_NOISE3; */
-     /* case TGSI_OPCODE_NOISE4: return RC_OPCODE_NOISE4; */
         case TGSI_OPCODE_NOP: return RC_OPCODE_NOP;
                                         /* gap */
      /* case TGSI_OPCODE_NRM4: return RC_OPCODE_NRM4; */
index 5fa6c9a..48e6583 100644 (file)
@@ -266,10 +266,7 @@ union tgsi_immediate_data
 #define TGSI_OPCODE_BGNSUB              100
 #define TGSI_OPCODE_ENDLOOP             101
 #define TGSI_OPCODE_ENDSUB              102
-#define TGSI_OPCODE_NOISE1              103
-#define TGSI_OPCODE_NOISE2              104
-#define TGSI_OPCODE_NOISE3              105
-#define TGSI_OPCODE_NOISE4              106
+                                /* gap */
 #define TGSI_OPCODE_NOP                 107
                                 /* gap */
 #define TGSI_OPCODE_NRM4                112
index 70d7c4f..1b9d35d 100644 (file)
@@ -481,14 +481,6 @@ translate_opcode( unsigned op )
       return TGSI_OPCODE_MOV;
    case OPCODE_MUL:
       return TGSI_OPCODE_MUL;
-   case OPCODE_NOISE1:
-      return TGSI_OPCODE_NOISE1;
-   case OPCODE_NOISE2:
-      return TGSI_OPCODE_NOISE2;
-   case OPCODE_NOISE3:
-      return TGSI_OPCODE_NOISE3;
-   case OPCODE_NOISE4:
-      return TGSI_OPCODE_NOISE4;
    case OPCODE_NOP:
       return TGSI_OPCODE_NOP;
    case OPCODE_NRM3:
@@ -616,6 +608,21 @@ compile_instruction(
                  src, num_src );
       break;
 
+   case OPCODE_NOISE1:
+   case OPCODE_NOISE2:
+   case OPCODE_NOISE3:
+   case OPCODE_NOISE4:
+      /* At some point, a motivated person could add a better
+       * implementation of noise.  Currently not even the nvidia
+       * binary drivers do anything more than this.  In any case, the
+       * place to do this is in the GL state tracker, not the poor
+       * driver.
+       */
+      ureg_MOV( ureg, dst[0], ureg_imm1f(ureg, 0.5) );
+      break;
+                
+
+
    default:
       ureg_insn( ureg, 
                  translate_opcode( inst->Opcode ),