aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/vbo/vbo_exec_api.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-04-12 09:53:17 +0000
committermarha <marha@users.sourceforge.net>2010-04-12 09:53:17 +0000
commit29b86f9852b2b7ecc31cdfee56679537e40bc6e2 (patch)
tree1e6ec8ccf2dbf773260a1953b8e13c49f9b7c5f5 /mesalib/src/mesa/vbo/vbo_exec_api.c
parent529236591df7366479a6fac30b387667678fd1ba (diff)
downloadvcxsrv-29b86f9852b2b7ecc31cdfee56679537e40bc6e2.tar.gz
vcxsrv-29b86f9852b2b7ecc31cdfee56679537e40bc6e2.tar.bz2
vcxsrv-29b86f9852b2b7ecc31cdfee56679537e40bc6e2.zip
svn merge -r524:HEAD "^/branches/released" .
Diffstat (limited to 'mesalib/src/mesa/vbo/vbo_exec_api.c')
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_api.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c
index f0a7eeadd..e40f5f9dc 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_api.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_api.c
@@ -41,7 +41,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/light.h"
#include "main/api_arrayelt.h"
#include "main/api_noop.h"
-#include "glapi/dispatch.h"
+#include "main/dispatch.h"
#include "vbo_context.h"
@@ -126,8 +126,8 @@ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec )
assert(exec->vtx.max_vert - exec->vtx.vert_count > exec->vtx.copied.nr);
for (i = 0 ; i < exec->vtx.copied.nr ; i++) {
- _mesa_memcpy( exec->vtx.buffer_ptr, data,
- exec->vtx.vertex_size * sizeof(GLfloat));
+ memcpy( exec->vtx.buffer_ptr, data,
+ exec->vtx.vertex_size * sizeof(GLfloat));
exec->vtx.buffer_ptr += exec->vtx.vertex_size;
data += exec->vtx.vertex_size;
exec->vtx.vert_count++;
@@ -414,13 +414,13 @@ static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u )
}
- _mesa_memcpy( exec->vtx.copied.buffer, exec->vtx.vertex,
- exec->vtx.vertex_size * sizeof(GLfloat));
+ memcpy( exec->vtx.copied.buffer, exec->vtx.vertex,
+ exec->vtx.vertex_size * sizeof(GLfloat));
vbo_exec_do_EvalCoord1f( exec, u );
- _mesa_memcpy( exec->vtx.vertex, exec->vtx.copied.buffer,
- exec->vtx.vertex_size * sizeof(GLfloat));
+ memcpy( exec->vtx.vertex, exec->vtx.copied.buffer,
+ exec->vtx.vertex_size * sizeof(GLfloat));
}
static void GLAPIENTRY vbo_exec_EvalCoord2f( GLfloat u, GLfloat v )
@@ -444,13 +444,13 @@ static void GLAPIENTRY vbo_exec_EvalCoord2f( GLfloat u, GLfloat v )
vbo_exec_fixup_vertex( ctx, VBO_ATTRIB_NORMAL, 3 );
}
- _mesa_memcpy( exec->vtx.copied.buffer, exec->vtx.vertex,
- exec->vtx.vertex_size * sizeof(GLfloat));
+ memcpy( exec->vtx.copied.buffer, exec->vtx.vertex,
+ exec->vtx.vertex_size * sizeof(GLfloat));
vbo_exec_do_EvalCoord2f( exec, u, v );
- _mesa_memcpy( exec->vtx.vertex, exec->vtx.copied.buffer,
- exec->vtx.vertex_size * sizeof(GLfloat));
+ memcpy( exec->vtx.vertex, exec->vtx.copied.buffer,
+ exec->vtx.vertex_size * sizeof(GLfloat));
}
static void GLAPIENTRY vbo_exec_EvalCoord1fv( const GLfloat *u )
@@ -759,6 +759,7 @@ void vbo_use_buffer_objects(GLcontext *ctx)
}
/* Allocate a real buffer object now */
+ _mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL);
exec->vtx.bufferobj = ctx->Driver.NewBufferObject(ctx, bufName, target);
ctx->Driver.BufferData(ctx, target, size, NULL, usage, exec->vtx.bufferobj);
}
@@ -780,7 +781,7 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec )
ctx->Shared->NullBufferObj);
ASSERT(!exec->vtx.buffer_map);
- exec->vtx.buffer_map = (GLfloat *)ALIGN_MALLOC(VBO_VERT_BUFFER_SIZE, 64);
+ exec->vtx.buffer_map = (GLfloat *)_mesa_align_malloc(VBO_VERT_BUFFER_SIZE, 64);
exec->vtx.buffer_ptr = exec->vtx.buffer_map;
vbo_exec_vtxfmt_init( exec );
@@ -803,8 +804,19 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec )
{
struct gl_client_array *arrays = exec->vtx.arrays;
+ unsigned i;
+
memcpy(arrays, vbo->legacy_currval, 16 * sizeof(arrays[0]));
memcpy(arrays + 16, vbo->generic_currval, 16 * sizeof(arrays[0]));
+
+ for (i = 0; i < 16; ++i) {
+ arrays[i ].BufferObj = NULL;
+ arrays[i + 16].BufferObj = NULL;
+ _mesa_reference_buffer_object(ctx, &arrays[i ].BufferObj,
+ vbo->legacy_currval[i].BufferObj);
+ _mesa_reference_buffer_object(ctx, &arrays[i + 16].BufferObj,
+ vbo->generic_currval[i].BufferObj);
+ }
}
exec->vtx.vertex_size = 0;
@@ -823,7 +835,7 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec )
ASSERT(exec->vtx.bufferobj->Name == 0 ||
exec->vtx.bufferobj->Name == IMM_BUFFER_NAME);
if (exec->vtx.bufferobj->Name == 0) {
- ALIGN_FREE(exec->vtx.buffer_map);
+ _mesa_align_free(exec->vtx.buffer_map);
exec->vtx.buffer_map = NULL;
exec->vtx.buffer_ptr = NULL;
}
@@ -845,7 +857,7 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec )
void vbo_exec_BeginVertices( GLcontext *ctx )
{
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
- if (0) _mesa_printf("%s\n", __FUNCTION__);
+ if (0) printf("%s\n", __FUNCTION__);
vbo_exec_vtx_map( exec );
assert((exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) == 0);
@@ -880,10 +892,10 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
assert(exec->flush_call_depth == 1);
#endif
- if (0) _mesa_printf("%s\n", __FUNCTION__);
+ if (0) printf("%s\n", __FUNCTION__);
if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
- if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__);
+ if (0) printf("%s - inside begin/end\n", __FUNCTION__);
#ifdef DEBUG
exec->flush_call_depth--;
assert(exec->flush_call_depth == 0);