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)
- intOrNorm = 1;
- else
- intOrNorm = 0;
-
- at->func = AttribFuncsARB[intOrNorm]
- [at->array->Size-1]
- [TYPE_IDX(at->array->Type)];
- }
+ if (at->array->Integer)
+ intOrNorm = 2;
+ else if (at->array->Normalized)
+ intOrNorm = 1;
+ else
+ intOrNorm = 0;
+
+ at->func = AttribFuncsARB[intOrNorm]
+ [at->array->Size-1]
+ [TYPE_IDX(at->array->Type)];
+
at->index = i;
check_vbo(actx, at->array->BufferObj);
at++;
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);
}
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
#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 \
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;
}
/** 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 */
};
}
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.
}
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];
}
}
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];
}