*/
-#include "glheader.h"
-#include "context.h"
-#include "dlist.h"
-#include "enums.h"
-#include "macros.h"
-#include "api_validate.h"
-#include "api_arrayelt.h"
-#include "vtxfmt.h"
-#include "dispatch.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/dlist.h"
+#include "main/enums.h"
+#include "main/macros.h"
+#include "main/api_validate.h"
+#include "main/api_arrayelt.h"
+#include "main/vtxfmt.h"
+#include "glapi/dispatch.h"
#include "vbo_context.h"
+#ifdef ERROR
+#undef ERROR
+#endif
+
/*
* NOTE: Old 'parity' issue is gone, but copying can still be
assert(!vertex_store->buffer);
vertex_store->buffer = (GLfloat *)ctx->Driver.MapBuffer(ctx,
GL_ARRAY_BUFFER_ARB, /* not used */
- GL_STATIC_DRAW_ARB, /* not used */
+ GL_WRITE_ONLY, /* not used */
vertex_store->bufferobj);
assert(vertex_store->buffer);
if (save->active_sz[A] != N) \
save_fixup_vertex(ctx, A, N); \
\
- _mesa_printf("Attr %d, sz %d: %f %f %f %f\n", A, N, V0, V1, V2, V3 ); \
- \
{ \
GLfloat *dest = save->attrptr[A]; \
if (N>0) dest[0] = V0; \
if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
return;
+ _ae_map_vbos( ctx );
+
vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK );
+
for (i = 0; i < count; i++)
CALL_ArrayElement(GET_DISPATCH(), (start + i));
CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
}
/* Could do better by copying the arrays and element list intact and
if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices ))
return;
+ _ae_map_vbos( ctx );
+
+ if (ctx->Array.ElementArrayBufferObj->Name)
+ indices = ADD_POINTERS(ctx->Array.ElementArrayBufferObj->Pointer, indices);
+
vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK );
switch (type) {
}
CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
}
static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode,
save->current[i] = ctx->ListState.CurrentAttrib[j];
}
- for (i = VBO_ATTRIB_FIRST_MATERIAL; i <= VBO_ATTRIB_MAT_FRONT_AMBIENT; i++) {
+ for (i = VBO_ATTRIB_FIRST_MATERIAL; i <= VBO_ATTRIB_LAST_MATERIAL; i++) {
const GLuint j = i - VBO_ATTRIB_FIRST_MATERIAL;
ASSERT(j < MAT_ATTRIB_MAX);
save->currentsz[i] = &ctx->ListState.ActiveMaterialSize[j];