- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- int offset=0, idx=0;
- int i,j;
- radeonScreenPtr rsp=rmesa->radeon.radeonScreen;
- /* Not the most efficient implementation, but, for now, I just want something that
- works */
- /* to do - make single memcpy per column (is it possible ?) */
- /* to do - use dirty flags to avoid redundant copies */
-#define UPLOAD_VECTOR(v, r, f)\
- { \
- /* Is the data dirty ? */ \
- if (v->flags & ((1<<v->size)-1)) { \
- fprintf(stderr, "size=%d vs stride=%d\n", v->size, v->stride); \
- if(v->size*4==v->stride){\
- /* fast path */ \
- memcpy(rsp->gartTextures.map+offset, v->data, v->stride*VB->Count); \
- } else { \
- for(i=0;i<VB->Count;i++){ \
- /* copy one vertex at a time*/ \
- memcpy(rsp->gartTextures.map+offset, VEC_ELT(v, GLfloat, i), v->size*4); \
- } \
- } \
- /* v->flags &= ~((1<<v->size)-1);*/ \
- } \
- array[idx].element_size=v->size; \
- array[idx].stride=v->size; \
- array[idx].format=(f); \
- array[idx].ncomponents=v->size; \
- array[idx].offset=rsp->gartTextures.handle+offset; \
- array[idx].reg=r; \
- offset+=v->size*4*VB->Count; \
- idx++; \
- /* Fill in the rest with the components of default_vector */\
- /* \
- if(v->size<4){ \
- array[idx].element_size=4-v->size; \
- array[idx].stride=0; \
- array[idx].format=(f); \
- array[idx].ncomponents=4-v->size; \
- array[idx].offset=rsp->gartTextures.handle+v->size*4;\
- array[idx].reg=r; \
- idx++; \
- } \
- */\
+ r300ContextPtr rmesa = R300_CONTEXT(ctx);
+ struct radeon_vertex_buffer *VB = &rmesa->state.VB;
+ int i;
+ LOCAL_VARS
+
+ if (RADEON_DEBUG & DEBUG_PRIMS)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (stage) {
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ radeon_vb_to_rvb(rmesa, VB, &tnl->vb);