mesa: Remove support for NV_vertex_program's special attributes aliasing

Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Eric Anholt
2012-10-09 15:38:53 -07:00
parent 6a20f0e561
commit 4f9d351ef1
9 changed files with 11 additions and 73 deletions

View File

@@ -1528,20 +1528,13 @@ static void _ae_update_state( struct gl_context *ctx )
for (i = 1; i < VERT_ATTRIB_GENERIC_MAX; i++) { /* skip zero! */
struct gl_client_array *attribArray = &arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(i)];
if (attribArray->Enabled) {
GLint intOrNorm;
at->array = attribArray;
/* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV
* function pointer here (for float arrays) since the pointer may
* change from one execution of _ae_ArrayElement() to
* the next. Doing so caused UT to break.
*/
if (ctx->VertexProgram._Enabled
&& ctx->VertexProgram.Current->IsNVProgram) {
at->func = AttribFuncsNV[at->array->Normalized]
[at->array->Size-1]
[TYPE_IDX(at->array->Type)];
}
else {
GLint intOrNorm;
if (at->array->Integer)
intOrNorm = 2;
else if (at->array->Normalized)
@@ -1552,7 +1545,7 @@ static void _ae_update_state( struct gl_context *ctx )
at->func = AttribFuncsARB[intOrNorm]
[at->array->Size-1]
[TYPE_IDX(at->array->Type)];
}
at->index = i;
check_vbo(actx, at->array->BufferObj);
at++;

View File

@@ -314,8 +314,6 @@ _mesa_update_array_object_max_element(struct gl_context *ctx,
if (!ctx->VertexProgram._Current ||
ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram) {
enabled = _mesa_array_object_get_enabled_ff(arrayObj);
} else if (ctx->VertexProgram._Current->IsNVProgram) {
enabled = _mesa_array_object_get_enabled_nv(arrayObj);
} else {
enabled = _mesa_array_object_get_enabled_arb(arrayObj);
}

View File

@@ -87,18 +87,6 @@ _mesa_array_object_get_enabled_ff(const struct gl_array_object *arrayObj)
return arrayObj->_Enabled & VERT_BIT_FF_ALL;
}
/** Returns the bitmask of all enabled arrays in nv shader mode.
*
* In nv shader mode, the nv generic arrays take precedence over
* the legacy arrays.
*/
static inline GLbitfield64
_mesa_array_object_get_enabled_nv(const struct gl_array_object *arrayObj)
{
GLbitfield64 enabled = arrayObj->_Enabled;
return enabled & ~(VERT_BIT_FF_NVALIAS & (enabled >> VERT_ATTRIB_GENERIC0));
}
/** Returns the bitmask of all enabled arrays in arb/glsl shader mode.
*
* In arb/glsl shader mode all the fixed function and the arb/glsl generic

View File

@@ -195,8 +195,6 @@ typedef enum
#define VERT_BIT_TEX(i) VERT_BIT(VERT_ATTRIB_TEX(i))
#define VERT_BIT_TEX_ALL \
BITFIELD64_RANGE(VERT_ATTRIB_TEX(0), VERT_ATTRIB_TEX_MAX)
#define VERT_BIT_FF_NVALIAS \
BITFIELD64_RANGE(VERT_ATTRIB_POS, VERT_ATTRIB_TEX(VERT_ATTRIB_TEX_MAX))
#define VERT_BIT_GENERIC_NV(i) VERT_BIT(VERT_ATTRIB_GENERIC_NV(i))
#define VERT_BIT_GENERIC_NV_ALL \

View File

@@ -106,8 +106,6 @@ get_program_mode( struct gl_context *ctx )
return VP_NONE;
else if (ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram)
return VP_NONE;
else if (ctx->VertexProgram._Current->IsNVProgram)
return VP_NV;
else
return VP_ARB;
}

View File

@@ -55,7 +55,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/** Current vertex program mode */
enum vp_mode {
VP_NONE, /**< fixed function */
VP_NV, /**< NV vertex program */
VP_ARB /**< ARB vertex program or GLSL vertex shader */
};

View File

@@ -440,32 +440,6 @@ recalculate_input_bindings(struct gl_context *ctx)
}
break;
case VP_NV:
/* NV_vertex_program - attribute arrays alias and override
* conventional, legacy arrays. No materials, and the generic
* slots are vacant.
*/
for (i = 0; i < VERT_ATTRIB_FF_MAX; i++) {
if (i < VERT_ATTRIB_GENERIC_MAX
&& vertexAttrib[VERT_ATTRIB_GENERIC(i)].Enabled)
inputs[i] = &vertexAttrib[VERT_ATTRIB_GENERIC(i)];
else if (vertexAttrib[VERT_ATTRIB_FF(i)].Enabled)
inputs[i] = &vertexAttrib[VERT_ATTRIB_FF(i)];
else {
inputs[i] = &vbo->currval[VBO_ATTRIB_POS+i];
const_inputs |= VERT_BIT_FF(i);
}
}
/* Could use just about anything, just to fill in the empty
* slots:
*/
for (i = 0; i < VERT_ATTRIB_GENERIC_MAX; i++) {
inputs[VERT_ATTRIB_GENERIC(i)] = &vbo->currval[VBO_ATTRIB_GENERIC0+i];
const_inputs |= VERT_BIT_GENERIC(i);
}
break;
case VP_ARB:
/* GL_ARB_vertex_program or GLSL vertex shader - Only the generic[0]
* attribute array aliases and overrides the legacy position array.

View File

@@ -180,12 +180,7 @@ vbo_exec_bind_arrays( struct gl_context *ctx )
}
map = vbo->map_vp_none;
break;
case VP_NV:
case VP_ARB:
/* The aliasing of attributes for NV vertex programs has already
* occurred. NV vertex programs cannot access material values,
* nor attributes greater than VERT_ATTRIB_TEX7.
*/
for (attr = 0; attr < VERT_ATTRIB_FF_MAX; attr++) {
exec->vtx.inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr];
}

View File

@@ -152,12 +152,7 @@ static void vbo_bind_vertex_list(struct gl_context *ctx,
}
map = vbo->map_vp_none;
break;
case VP_NV:
case VP_ARB:
/* The aliasing of attributes for NV vertex programs has already
* occurred. NV vertex programs cannot access material values,
* nor attributes greater than VERT_ATTRIB_TEX7.
*/
for (attr = 0; attr < VERT_ATTRIB_FF_MAX; attr++) {
save->inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr];
}