mesa: Remove support for named parameters.
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>
This commit is contained in:
@@ -173,7 +173,6 @@ src_vector(struct i915_fragment_program *p,
|
|||||||
|
|
||||||
case PROGRAM_CONSTANT:
|
case PROGRAM_CONSTANT:
|
||||||
case PROGRAM_STATE_VAR:
|
case PROGRAM_STATE_VAR:
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
case PROGRAM_UNIFORM:
|
case PROGRAM_UNIFORM:
|
||||||
src = i915_emit_param4fv(p,
|
src = i915_emit_param4fv(p,
|
||||||
&program->Base.Parameters->ParameterValues[source->Index][0].f);
|
&program->Base.Parameters->ParameterValues[source->Index][0].f);
|
||||||
|
@@ -599,7 +599,7 @@ fs_visitor::setup_fp_regs()
|
|||||||
for (int i = 0; i < num_temp; i++)
|
for (int i = 0; i < num_temp; i++)
|
||||||
fp_temp_regs[i] = fs_reg(this, glsl_type::vec4_type);
|
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) {
|
if (c->dispatch_width == 8) {
|
||||||
for (unsigned p = 0;
|
for (unsigned p = 0;
|
||||||
p < c->fp->program.Base.Parameters->NumParameters; p++) {
|
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_STATE_VAR:
|
||||||
case PROGRAM_UNIFORM:
|
case PROGRAM_UNIFORM:
|
||||||
case PROGRAM_CONSTANT:
|
case PROGRAM_CONSTANT:
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
/* We actually want to look at the type in the Parameters list for this,
|
/* We actually want to look at the type in the Parameters list for this,
|
||||||
* because this lets us upload constant builtin uniforms, as actual
|
* because this lets us upload constant builtin uniforms, as actual
|
||||||
* constants.
|
* constants.
|
||||||
*/
|
*/
|
||||||
switch (plist->Parameters[src->Index].Type) {
|
switch (plist->Parameters[src->Index].Type) {
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
case PROGRAM_CONSTANT: {
|
case PROGRAM_CONSTANT: {
|
||||||
result = fs_reg(this, glsl_type::vec4_type);
|
result = fs_reg(this, glsl_type::vec4_type);
|
||||||
|
|
||||||
|
@@ -123,7 +123,6 @@ static GLboolean r200VertexProgUpdateParams(struct gl_context *ctx, struct r200_
|
|||||||
for(pi = 0; pi < paramList->NumParameters; pi++) {
|
for(pi = 0; pi < paramList->NumParameters; pi++) {
|
||||||
switch(paramList->Parameters[pi].Type) {
|
switch(paramList->Parameters[pi].Type) {
|
||||||
case PROGRAM_STATE_VAR:
|
case PROGRAM_STATE_VAR:
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
//fprintf(stderr, "%s", vp->Parameters->Parameters[pi].Name);
|
//fprintf(stderr, "%s", vp->Parameters->Parameters[pi].Name);
|
||||||
case PROGRAM_CONSTANT:
|
case PROGRAM_CONSTANT:
|
||||||
*fcmd++ = paramList->ParameterValues[pi][0].f;
|
*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_LOCAL_PARAM:
|
||||||
case PROGRAM_ENV_PARAM:
|
case PROGRAM_ENV_PARAM:
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
case PROGRAM_CONSTANT:
|
case PROGRAM_CONSTANT:
|
||||||
case PROGRAM_STATE_VAR:
|
case PROGRAM_STATE_VAR:
|
||||||
return VSF_IN_CLASS_PARAM;
|
return VSF_IN_CLASS_PARAM;
|
||||||
|
@@ -1841,7 +1841,7 @@ struct gl_transform_feedback_state
|
|||||||
* NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c)
|
* NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c)
|
||||||
* All values should fit in a 4-bit field.
|
* 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
|
* PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be considered to
|
||||||
* be "uniform" variables since they can only be set outside glBegin/End.
|
* be "uniform" variables since they can only be set outside glBegin/End.
|
||||||
* They're also all stored in the same Parameters array.
|
* They're also all stored in the same Parameters array.
|
||||||
@@ -1855,7 +1855,6 @@ typedef enum
|
|||||||
PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */
|
PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */
|
||||||
PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */
|
PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */
|
||||||
PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */
|
PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */
|
||||||
PROGRAM_NAMED_PARAM, /**< gl_program->Parameters[] */
|
|
||||||
PROGRAM_CONSTANT, /**< gl_program->Parameters[] */
|
PROGRAM_CONSTANT, /**< gl_program->Parameters[] */
|
||||||
PROGRAM_UNIFORM, /**< gl_program->Parameters[] */
|
PROGRAM_UNIFORM, /**< gl_program->Parameters[] */
|
||||||
PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */
|
PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */
|
||||||
|
@@ -136,8 +136,6 @@ get_src_register_pointer(const struct prog_src_register *source,
|
|||||||
case PROGRAM_CONSTANT:
|
case PROGRAM_CONSTANT:
|
||||||
/* Fallthrough */
|
/* Fallthrough */
|
||||||
case PROGRAM_UNIFORM:
|
case PROGRAM_UNIFORM:
|
||||||
/* Fallthrough */
|
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
if (reg >= (GLint) prog->Parameters->NumParameters)
|
if (reg >= (GLint) prog->Parameters->NumParameters)
|
||||||
return ZeroVec;
|
return ZeroVec;
|
||||||
return (GLfloat *) prog->Parameters->ParameterValues[reg];
|
return (GLfloat *) prog->Parameters->ParameterValues[reg];
|
||||||
|
@@ -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.
|
* Add a new named constant to the parameter list.
|
||||||
* This will be used when the program contains something like this:
|
* This will be used when the program contains something like this:
|
||||||
|
@@ -71,7 +71,7 @@ typedef union gl_constant_value
|
|||||||
struct gl_program_parameter
|
struct gl_program_parameter
|
||||||
{
|
{
|
||||||
const char *Name; /**< Null-terminated string */
|
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 */
|
GLenum DataType; /**< GL_FLOAT, GL_FLOAT_VEC2, etc */
|
||||||
/**
|
/**
|
||||||
* Number of components (1..4), or more.
|
* 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],
|
const gl_state_index state[STATE_LENGTH],
|
||||||
GLbitfield flags);
|
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
|
extern GLint
|
||||||
_mesa_add_named_constant(struct gl_program_parameter_list *paramList,
|
_mesa_add_named_constant(struct gl_program_parameter_list *paramList,
|
||||||
const char *name, const gl_constant_value values[4],
|
const char *name, const gl_constant_value values[4],
|
||||||
|
@@ -60,8 +60,6 @@ _mesa_register_file_name(gl_register_file f)
|
|||||||
return "INPUT";
|
return "INPUT";
|
||||||
case PROGRAM_OUTPUT:
|
case PROGRAM_OUTPUT:
|
||||||
return "OUTPUT";
|
return "OUTPUT";
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
return "NAMED";
|
|
||||||
case PROGRAM_CONSTANT:
|
case PROGRAM_CONSTANT:
|
||||||
return "CONST";
|
return "CONST";
|
||||||
case PROGRAM_UNIFORM:
|
case PROGRAM_UNIFORM:
|
||||||
|
@@ -916,9 +916,6 @@ _mesa_valid_register_index(const struct gl_context *ctx,
|
|||||||
case PROGRAM_LOCAL_PARAM:
|
case PROGRAM_LOCAL_PARAM:
|
||||||
return index >= 0 && index < c->MaxLocalParams;
|
return index >= 0 && index < c->MaxLocalParams;
|
||||||
|
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
return index >= 0 && index < c->MaxParameters;
|
|
||||||
|
|
||||||
case PROGRAM_UNIFORM:
|
case PROGRAM_UNIFORM:
|
||||||
case PROGRAM_STATE_VAR:
|
case PROGRAM_STATE_VAR:
|
||||||
/* aka constant buffer */
|
/* aka constant buffer */
|
||||||
|
@@ -74,7 +74,6 @@ extern "C" {
|
|||||||
#define PROGRAM_ANY_CONST ((1 << PROGRAM_LOCAL_PARAM) | \
|
#define PROGRAM_ANY_CONST ((1 << PROGRAM_LOCAL_PARAM) | \
|
||||||
(1 << PROGRAM_ENV_PARAM) | \
|
(1 << PROGRAM_ENV_PARAM) | \
|
||||||
(1 << PROGRAM_STATE_VAR) | \
|
(1 << PROGRAM_STATE_VAR) | \
|
||||||
(1 << PROGRAM_NAMED_PARAM) | \
|
|
||||||
(1 << PROGRAM_CONSTANT) | \
|
(1 << PROGRAM_CONSTANT) | \
|
||||||
(1 << PROGRAM_UNIFORM))
|
(1 << PROGRAM_UNIFORM))
|
||||||
|
|
||||||
@@ -536,7 +535,6 @@ glsl_to_tgsi_visitor::emit(ir_instruction *ir, unsigned op,
|
|||||||
case PROGRAM_LOCAL_PARAM:
|
case PROGRAM_LOCAL_PARAM:
|
||||||
case PROGRAM_ENV_PARAM:
|
case PROGRAM_ENV_PARAM:
|
||||||
case PROGRAM_STATE_VAR:
|
case PROGRAM_STATE_VAR:
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
case PROGRAM_CONSTANT:
|
case PROGRAM_CONSTANT:
|
||||||
case PROGRAM_UNIFORM:
|
case PROGRAM_UNIFORM:
|
||||||
this->indirect_addr_consts = true;
|
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_LOCAL_PARAM:
|
||||||
case PROGRAM_ENV_PARAM:
|
case PROGRAM_ENV_PARAM:
|
||||||
case PROGRAM_STATE_VAR:
|
case PROGRAM_STATE_VAR:
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
case PROGRAM_CONSTANT:
|
case PROGRAM_CONSTANT:
|
||||||
case PROGRAM_UNIFORM:
|
case PROGRAM_UNIFORM:
|
||||||
this->indirect_addr_consts = true;
|
this->indirect_addr_consts = true;
|
||||||
@@ -4041,7 +4038,6 @@ src_register(struct st_translate *t,
|
|||||||
t->temps[index] = ureg_DECL_local_temporary(t->ureg);
|
t->temps[index] = ureg_DECL_local_temporary(t->ureg);
|
||||||
return ureg_src(t->temps[index]);
|
return ureg_src(t->temps[index]);
|
||||||
|
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
case PROGRAM_ENV_PARAM:
|
case PROGRAM_ENV_PARAM:
|
||||||
case PROGRAM_LOCAL_PARAM:
|
case PROGRAM_LOCAL_PARAM:
|
||||||
case PROGRAM_UNIFORM:
|
case PROGRAM_UNIFORM:
|
||||||
@@ -4692,7 +4688,6 @@ st_translate_program(
|
|||||||
case PROGRAM_ENV_PARAM:
|
case PROGRAM_ENV_PARAM:
|
||||||
case PROGRAM_LOCAL_PARAM:
|
case PROGRAM_LOCAL_PARAM:
|
||||||
case PROGRAM_STATE_VAR:
|
case PROGRAM_STATE_VAR:
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
case PROGRAM_UNIFORM:
|
case PROGRAM_UNIFORM:
|
||||||
t->constants[i] = ureg_DECL_constant(ureg, i);
|
t->constants[i] = ureg_DECL_constant(ureg, i);
|
||||||
break;
|
break;
|
||||||
|
@@ -49,7 +49,6 @@
|
|||||||
#define PROGRAM_ANY_CONST ((1 << PROGRAM_LOCAL_PARAM) | \
|
#define PROGRAM_ANY_CONST ((1 << PROGRAM_LOCAL_PARAM) | \
|
||||||
(1 << PROGRAM_ENV_PARAM) | \
|
(1 << PROGRAM_ENV_PARAM) | \
|
||||||
(1 << PROGRAM_STATE_VAR) | \
|
(1 << PROGRAM_STATE_VAR) | \
|
||||||
(1 << PROGRAM_NAMED_PARAM) | \
|
|
||||||
(1 << PROGRAM_CONSTANT) | \
|
(1 << PROGRAM_CONSTANT) | \
|
||||||
(1 << PROGRAM_UNIFORM))
|
(1 << PROGRAM_UNIFORM))
|
||||||
|
|
||||||
@@ -221,7 +220,6 @@ src_register( struct st_translate *t,
|
|||||||
t->temps[index] = ureg_DECL_temporary( t->ureg );
|
t->temps[index] = ureg_DECL_temporary( t->ureg );
|
||||||
return ureg_src(t->temps[index]);
|
return ureg_src(t->temps[index]);
|
||||||
|
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
case PROGRAM_ENV_PARAM:
|
case PROGRAM_ENV_PARAM:
|
||||||
case PROGRAM_LOCAL_PARAM:
|
case PROGRAM_LOCAL_PARAM:
|
||||||
case PROGRAM_UNIFORM:
|
case PROGRAM_UNIFORM:
|
||||||
@@ -1209,7 +1207,6 @@ st_translate_mesa_program(
|
|||||||
case PROGRAM_ENV_PARAM:
|
case PROGRAM_ENV_PARAM:
|
||||||
case PROGRAM_LOCAL_PARAM:
|
case PROGRAM_LOCAL_PARAM:
|
||||||
case PROGRAM_STATE_VAR:
|
case PROGRAM_STATE_VAR:
|
||||||
case PROGRAM_NAMED_PARAM:
|
|
||||||
case PROGRAM_UNIFORM:
|
case PROGRAM_UNIFORM:
|
||||||
t->constants[i] = ureg_DECL_constant( ureg, i );
|
t->constants[i] = ureg_DECL_constant( ureg, i );
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user