[Mesa-dev] [PATCH 07/19] mesa: Remove Mesa IR opcodes that existed only for NV_vertex_program.

Matt Turner mattst88 at gmail.com
Tue Oct 9 19:28:30 PDT 2012


On Tue, Oct 9, 2012 at 6:06 PM, Eric Anholt <eric at anholt.net> wrote:
> ---
>  src/mesa/drivers/dri/i915/i915_fragprog.c |    1 -
>  src/mesa/program/prog_execute.c           |   44 -----------------------------
>  src/mesa/program/prog_instruction.c       |    7 -----
>  src/mesa/program/prog_instruction.h       |    7 -----
>  src/mesa/program/prog_optimize.c          |    2 --
>  src/mesa/program/prog_print.c             |    7 -----
>  6 files changed, 68 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
> index 7a6e067..3038d84 100644
> --- a/src/mesa/drivers/dri/i915/i915_fragprog.c
> +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
> @@ -1088,7 +1088,6 @@ upload_program(struct i915_fragment_program *p)
>
>        case OPCODE_BGNLOOP:
>        case OPCODE_BGNSUB:
> -      case OPCODE_BRA:
>        case OPCODE_BRK:
>        case OPCODE_CAL:
>        case OPCODE_CONT:
> diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c
> index dd1706e..8bfeec6 100644
> --- a/src/mesa/program/prog_execute.c
> +++ b/src/mesa/program/prog_execute.c
> @@ -728,13 +728,6 @@ _mesa_execute_program(struct gl_context * ctx,
>           break;
>        case OPCODE_ENDSUB:      /* end subroutine */
>           break;
> -      case OPCODE_BRA:         /* branch (conditional) */
> -         if (eval_condition(machine, inst)) {
> -            /* take branch */
> -            /* Subtract 1 here since we'll do pc++ below */
> -            pc = inst->BranchTarget - 1;
> -         }
> -         break;
>        case OPCODE_BRK:         /* break out of loop (conditional) */
>           ASSERT(program->Instructions[inst->BranchTarget].Opcode
>                  == OPCODE_ENDLOOP);
> @@ -1367,43 +1360,6 @@ _mesa_execute_program(struct gl_context * ctx,
>              store_vector4(inst, machine, result);
>           }
>           break;
> -      case OPCODE_RCC:  /* clamped riciprocal */
> -         {
> -            const float largest = 1.884467e+19, smallest = 5.42101e-20;
> -            GLfloat a[4], r, result[4];
> -            fetch_vector1(&inst->SrcReg[0], machine, a);
> -            if (DEBUG_PROG) {
> -               if (a[0] == 0)
> -                  printf("RCC(0)\n");
> -               else if (IS_INF_OR_NAN(a[0]))
> -                  printf("RCC(inf)\n");
> -            }
> -            if (a[0] == 1.0F) {
> -               r = 1.0F;
> -            }
> -            else {
> -               r = 1.0F / a[0];
> -            }
> -            if (positive(r)) {

This is the only use of the positive() function, so it can go too.


More information about the mesa-dev mailing list