mesa: Remove support for named parameters.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 14 Oct 2012 23:43:15 +0000 (16:43 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 16 Oct 2012 18:35:24 +0000 (11:35 -0700)
These were only part of NV_fragment_program, so we can kill them.

The fact that PROGRAM_NAMED_PARAM appears in r200_vertprog.c is rather
comedic, but also demonstrates that people just spam the various types
of parameters everywhere because they're confusing.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i915/i915_fragprog.c
src/mesa/drivers/dri/i965/brw_fs_fp.cpp
src/mesa/drivers/dri/r200/r200_vertprog.c
src/mesa/main/mtypes.h
src/mesa/program/prog_execute.c
src/mesa/program/prog_parameter.c
src/mesa/program/prog_parameter.h
src/mesa/program/prog_print.c
src/mesa/program/program.c
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
src/mesa/state_tracker/st_mesa_to_tgsi.c

index 3038d84f3ed2cf3d7b6ec62bb7ce9a9acca6202d..23f2f0f9da055948319a7f526c94b733d420afbb 100644 (file)
@@ -173,7 +173,6 @@ src_vector(struct i915_fragment_program *p,
 
    case PROGRAM_CONSTANT:
    case PROGRAM_STATE_VAR:
-   case PROGRAM_NAMED_PARAM:
    case PROGRAM_UNIFORM:
       src = i915_emit_param4fv(p,
         &program->Base.Parameters->ParameterValues[source->Index][0].f);
index be00f6ea8f5558fe36b33dccd300e81d76d53d98..080435b5114c86f9976d7ff38a0936aabbf2681f 100644 (file)
@@ -599,7 +599,7 @@ fs_visitor::setup_fp_regs()
    for (int i = 0; i < num_temp; i++)
       fp_temp_regs[i] = fs_reg(this, glsl_type::vec4_type);
 
-   /* PROGRAM_STATE_VAR, PROGRAM_NAMED_PARAM, etc. */
+   /* PROGRAM_STATE_VAR etc. */
    if (c->dispatch_width == 8) {
       for (unsigned p = 0;
            p < c->fp->program.Base.Parameters->NumParameters; p++) {
@@ -722,13 +722,11 @@ fs_visitor::get_fp_src_reg(const prog_src_register *src)
    case PROGRAM_STATE_VAR:
    case PROGRAM_UNIFORM:
    case PROGRAM_CONSTANT:
-   case PROGRAM_NAMED_PARAM:
       /* We actually want to look at the type in the Parameters list for this,
        * because this lets us upload constant builtin uniforms, as actual
        * constants.
        */
       switch (plist->Parameters[src->Index].Type) {
-      case PROGRAM_NAMED_PARAM:
       case PROGRAM_CONSTANT: {
          result = fs_reg(this, glsl_type::vec4_type);
 
index a3d8be951265876afdaaa6302e8b5a17afd1a74f..20664dd0c9749a37855f7d2668df501274988f7b 100644 (file)
@@ -123,7 +123,6 @@ static GLboolean r200VertexProgUpdateParams(struct gl_context *ctx, struct r200_
    for(pi = 0; pi < paramList->NumParameters; pi++) {
       switch(paramList->Parameters[pi].Type) {
       case PROGRAM_STATE_VAR:
-      case PROGRAM_NAMED_PARAM:
       //fprintf(stderr, "%s", vp->Parameters->Parameters[pi].Name);
       case PROGRAM_CONSTANT:
         *fcmd++ = paramList->ParameterValues[pi][0].f;
@@ -214,7 +213,6 @@ static unsigned long t_src_class(gl_register_file file)
 
    case PROGRAM_LOCAL_PARAM:
    case PROGRAM_ENV_PARAM:
-   case PROGRAM_NAMED_PARAM:
    case PROGRAM_CONSTANT:
    case PROGRAM_STATE_VAR:
       return VSF_IN_CLASS_PARAM;
index 7444df9c46b50b917ed8a70dd1c64ea35d7b9b2c..8bff789ac80f8ec870a3895cab1520829ca6387a 100644 (file)
@@ -1841,7 +1841,7 @@ struct gl_transform_feedback_state
  * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c)
  * All values should fit in a 4-bit field.
  *
- * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR, PROGRAM_NAMED_PARAM,
+ * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR,
  * PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be considered to
  * be "uniform" variables since they can only be set outside glBegin/End.
  * They're also all stored in the same Parameters array.
@@ -1855,7 +1855,6 @@ typedef enum
    PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */
    PROGRAM_ENV_PARAM,   /**< gl_program->Parameters[] */
    PROGRAM_STATE_VAR,   /**< gl_program->Parameters[] */
-   PROGRAM_NAMED_PARAM, /**< gl_program->Parameters[] */
    PROGRAM_CONSTANT,    /**< gl_program->Parameters[] */
    PROGRAM_UNIFORM,     /**< gl_program->Parameters[] */
    PROGRAM_WRITE_ONLY,  /**< A dummy, write-only register */
index f57027c0756185c1d54d94a02834fa3e77308662..5b6a5c14927a6795c3a014688b3d37a7ef60fc47 100644 (file)
@@ -136,8 +136,6 @@ get_src_register_pointer(const struct prog_src_register *source,
    case PROGRAM_CONSTANT:
       /* Fallthrough */
    case PROGRAM_UNIFORM:
-      /* Fallthrough */
-   case PROGRAM_NAMED_PARAM:
       if (reg >= (GLint) prog->Parameters->NumParameters)
          return ZeroVec;
       return (GLfloat *) prog->Parameters->ParameterValues[reg];
index b9f4d9d572a1ed8af7afdf752e7f662c22142e90..ed421b5a15f460b401608867057ca6939afd8fb0 100644 (file)
@@ -179,20 +179,6 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList,
 }
 
 
-/**
- * Add a new named program parameter (Ex: NV_fragment_program DEFINE statement)
- * \return index of the new entry in the parameter list
- */
-GLint
-_mesa_add_named_parameter(struct gl_program_parameter_list *paramList,
-                          const char *name, const gl_constant_value values[4])
-{
-   return _mesa_add_parameter(paramList, PROGRAM_NAMED_PARAM, name,
-                              4, GL_NONE, values, NULL, 0x0);
-                              
-}
-
-
 /**
  * Add a new named constant to the parameter list.
  * This will be used when the program contains something like this:
index 3c6dc8cf99645c85010a456d3a4da3109781435a..d17069090efc5311384ad5eb44865daf7632722d 100644 (file)
@@ -71,7 +71,7 @@ typedef union gl_constant_value
 struct gl_program_parameter
 {
    const char *Name;        /**< Null-terminated string */
-   gl_register_file Type;   /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */
+   gl_register_file Type;   /**< PROGRAM_CONSTANT or STATE_VAR */
    GLenum DataType;         /**< GL_FLOAT, GL_FLOAT_VEC2, etc */
    /**
     * Number of components (1..4), or more.
@@ -133,10 +133,6 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList,
                     const gl_state_index state[STATE_LENGTH],
                     GLbitfield flags);
 
-extern GLint
-_mesa_add_named_parameter(struct gl_program_parameter_list *paramList,
-                          const char *name, const gl_constant_value values[4]);
-
 extern GLint
 _mesa_add_named_constant(struct gl_program_parameter_list *paramList,
                          const char *name, const gl_constant_value values[4],
index 99623c1f152d9571bea651d5fcf92d77e308a8ed..26191baa6e5c22fbe4bc1eb8d54543b1312044f7 100644 (file)
@@ -60,8 +60,6 @@ _mesa_register_file_name(gl_register_file f)
       return "INPUT";
    case PROGRAM_OUTPUT:
       return "OUTPUT";
-   case PROGRAM_NAMED_PARAM:
-      return "NAMED";
    case PROGRAM_CONSTANT:
       return "CONST";
    case PROGRAM_UNIFORM:
index 4c533a9035de69ff0076c9aa3ea5e2701f36a7c5..993803dd5ff7fa6ea44a4b0f3d8a5b940e104133 100644 (file)
@@ -916,9 +916,6 @@ _mesa_valid_register_index(const struct gl_context *ctx,
    case PROGRAM_LOCAL_PARAM:
       return index >= 0 && index < c->MaxLocalParams;
 
-   case PROGRAM_NAMED_PARAM:
-      return index >= 0 && index < c->MaxParameters;
-
    case PROGRAM_UNIFORM:
    case PROGRAM_STATE_VAR:
       /* aka constant buffer */
index 852dceaf618f02f354e2b7e3ccea63471a475f4c..705f2b055af74bbb09460a8bde012bd1f244c83e 100644 (file)
@@ -74,7 +74,6 @@ extern "C" {
 #define PROGRAM_ANY_CONST ((1 << PROGRAM_LOCAL_PARAM) |  \
                            (1 << PROGRAM_ENV_PARAM) |    \
                            (1 << PROGRAM_STATE_VAR) |    \
-                           (1 << PROGRAM_NAMED_PARAM) |  \
                            (1 << PROGRAM_CONSTANT) |     \
                            (1 << PROGRAM_UNIFORM))
 
@@ -536,7 +535,6 @@ glsl_to_tgsi_visitor::emit(ir_instruction *ir, unsigned op,
       case PROGRAM_LOCAL_PARAM:
       case PROGRAM_ENV_PARAM:
       case PROGRAM_STATE_VAR:
-      case PROGRAM_NAMED_PARAM:
       case PROGRAM_CONSTANT:
       case PROGRAM_UNIFORM:
          this->indirect_addr_consts = true;
@@ -558,7 +556,6 @@ glsl_to_tgsi_visitor::emit(ir_instruction *ir, unsigned op,
             case PROGRAM_LOCAL_PARAM:
             case PROGRAM_ENV_PARAM:
             case PROGRAM_STATE_VAR:
-            case PROGRAM_NAMED_PARAM:
             case PROGRAM_CONSTANT:
             case PROGRAM_UNIFORM:
                this->indirect_addr_consts = true;
@@ -4041,7 +4038,6 @@ src_register(struct st_translate *t,
          t->temps[index] = ureg_DECL_local_temporary(t->ureg);
       return ureg_src(t->temps[index]);
 
-   case PROGRAM_NAMED_PARAM:
    case PROGRAM_ENV_PARAM:
    case PROGRAM_LOCAL_PARAM:
    case PROGRAM_UNIFORM:
@@ -4692,7 +4688,6 @@ st_translate_program(
          case PROGRAM_ENV_PARAM:
          case PROGRAM_LOCAL_PARAM:
          case PROGRAM_STATE_VAR:
-         case PROGRAM_NAMED_PARAM:
          case PROGRAM_UNIFORM:
             t->constants[i] = ureg_DECL_constant(ureg, i);
             break;
index daf34192c6a25d437603ce63efd3d088332674ec..8f2ba7c8e182c7b14f6e93c98422d41ea43389f9 100644 (file)
@@ -49,7 +49,6 @@
 #define PROGRAM_ANY_CONST ((1 << PROGRAM_LOCAL_PARAM) |  \
                            (1 << PROGRAM_ENV_PARAM) |    \
                            (1 << PROGRAM_STATE_VAR) |    \
-                           (1 << PROGRAM_NAMED_PARAM) |  \
                            (1 << PROGRAM_CONSTANT) |     \
                            (1 << PROGRAM_UNIFORM))
 
@@ -221,7 +220,6 @@ src_register( struct st_translate *t,
          t->temps[index] = ureg_DECL_temporary( t->ureg );
       return ureg_src(t->temps[index]);
 
-   case PROGRAM_NAMED_PARAM:
    case PROGRAM_ENV_PARAM:
    case PROGRAM_LOCAL_PARAM:
    case PROGRAM_UNIFORM:
@@ -1209,7 +1207,6 @@ st_translate_mesa_program(
          case PROGRAM_ENV_PARAM:
          case PROGRAM_LOCAL_PARAM:
          case PROGRAM_STATE_VAR:
-         case PROGRAM_NAMED_PARAM:
          case PROGRAM_UNIFORM:
             t->constants[i] = ureg_DECL_constant( ureg, i );
             break;