OSDN Git Service

mesa: New feature FEATURE_beginend.
[android-x86/external-mesa.git] / src / mesa / vbo / vbo_exec_draw.c
index d76c45f..ee148df 100644 (file)
@@ -35,6 +35,9 @@
 #include "vbo_context.h"
 
 
+#if FEATURE_beginend
+
+
 static void
 vbo_exec_debug_verts( struct vbo_exec_context *exec )
 {
@@ -218,7 +221,9 @@ vbo_exec_bind_arrays( GLcontext *ctx )
             /* a real buffer obj: Ptr is an offset, not a pointer*/
             GLsizeiptr offset;
             assert(exec->vtx.bufferobj->Pointer);  /* buf should be mapped */
-            offset = (GLbyte *) data - (GLbyte *) exec->vtx.bufferobj->Pointer;
+            offset = (GLbyte *) data -
+              (GLbyte *) exec->vtx.bufferobj->Pointer +
+              exec->vtx.bufferobj->Offset;
             assert(offset >= 0);
             arrays[attr].Ptr = (void *) offset;
          }
@@ -398,7 +403,8 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap )
       vbo_exec_vtx_unmap( exec );
    }
 
-   if (unmap) 
+
+   if (unmap || exec->vtx.vertex_size == 0)
       exec->vtx.max_vert = 0;
    else
       exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / 
@@ -408,3 +414,6 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap )
    exec->vtx.prim_count = 0;
    exec->vtx.vert_count = 0;
 }
+
+
+#endif /* FEATURE_beginend */