- if (stage->changed_inputs) {
-
- if (ctx->_NeedEyeCoords) {
- /* Separate modelview transformation:
- * Use combined ModelProject to avoid some depth artifacts
- */
- if (ctx->ModelviewMatrixStack.Top->type == MATRIX_IDENTITY)
- VB->EyePtr = VB->ObjPtr;
- else
- VB->EyePtr = TransformRaw( &store->eye,
- ctx->ModelviewMatrixStack.Top,
- VB->ObjPtr);
-
- if (ctx->ProjectionMatrixStack.Top->type == MATRIX_IDENTITY)
- VB->ClipPtr = VB->EyePtr;
- else
- VB->ClipPtr = TransformRaw( &store->clip,
- &ctx->_ModelProjectMatrix,
- VB->ObjPtr );
- }
- else {
- /* Combined modelviewproject transform:
- */
- if (ctx->_ModelProjectMatrix.type == MATRIX_IDENTITY)
- VB->ClipPtr = VB->ObjPtr;
- else
- VB->ClipPtr = TransformRaw( &store->clip,
- &ctx->_ModelProjectMatrix,
- VB->ObjPtr );
- }
-
- /* Drivers expect this to be clean to element 4...
- */
- if (VB->ClipPtr->size < 4) {
- if (VB->ClipPtr->flags & VEC_NOT_WRITEABLE) {
- ASSERT(VB->ClipPtr == VB->ObjPtr);
- VB->import_data( ctx, VERT_BIT_POS, VEC_NOT_WRITEABLE );
- VB->ClipPtr = VB->ObjPtr;
- }
- if (VB->ClipPtr->size == 2)
- _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 2 );
- _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 3 );
- }
-
- /* Cliptest and perspective divide. Clip functions must clear
- * the clipmask.