aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/vbo/vbo_exec_draw.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-04 12:18:13 +0100
committermarha <marha@users.sourceforge.net>2014-03-04 12:23:48 +0100
commit45392e4a0642880b569ea5d4a350cdc395a2c7db (patch)
treec3c2a49de903a18c3f8e1bf79684c29337ebcf7c /mesalib/src/mesa/vbo/vbo_exec_draw.c
parent5ec0616d4e3c4c6095f4975abbe9c21e5b6af967 (diff)
parent321c01267ae1c446f1bd22b642567fcafa016c02 (diff)
downloadvcxsrv-45392e4a0642880b569ea5d4a350cdc395a2c7db.tar.gz
vcxsrv-45392e4a0642880b569ea5d4a350cdc395a2c7db.tar.bz2
vcxsrv-45392e4a0642880b569ea5d4a350cdc395a2c7db.zip
Merge remote-tracking branch 'origin/released'
* origin/released: libX11 libxcb mesa xserver xcb-proto xkeyboard-config git update 4 Mar 2014 Conflicts: mesalib/src/mapi/glapi/glapi.h mesalib/src/mapi/glapi/glthread.c mesalib/src/mesa/drivers/dri/common/dri_util.c mesalib/src/mesa/main/bufferobj.c xorg-server/dix/dispatch.c xorg-server/hw/xwin/glx/gen_gl_wrappers.py xorg-server/hw/xwin/winmultiwindowwm.c
Diffstat (limited to 'mesalib/src/mesa/vbo/vbo_exec_draw.c')
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_draw.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/mesalib/src/mesa/vbo/vbo_exec_draw.c b/mesalib/src/mesa/vbo/vbo_exec_draw.c
index 75115ce66..c454c6943 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_draw.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_draw.c
@@ -220,9 +220,10 @@ vbo_exec_bind_arrays( struct gl_context *ctx )
if (_mesa_is_bufferobj(exec->vtx.bufferobj)) {
/* a real buffer obj: Ptr is an offset, not a pointer*/
- assert(exec->vtx.bufferobj->Pointer); /* buf should be mapped */
+ assert(exec->vtx.bufferobj->Mappings[MAP_INTERNAL].Pointer);
assert(offset >= 0);
- arrays[attr].Ptr = (GLubyte *)exec->vtx.bufferobj->Offset + offset;
+ arrays[attr].Ptr = (GLubyte *)
+ exec->vtx.bufferobj->Mappings[MAP_INTERNAL].Offset + offset;
}
else {
/* Ptr into ordinary app memory */
@@ -261,12 +262,15 @@ vbo_exec_vtx_unmap( struct vbo_exec_context *exec )
struct gl_context *ctx = exec->ctx;
if (ctx->Driver.FlushMappedBufferRange) {
- GLintptr offset = exec->vtx.buffer_used - exec->vtx.bufferobj->Offset;
- GLsizeiptr length = (exec->vtx.buffer_ptr - exec->vtx.buffer_map) * sizeof(float);
+ GLintptr offset = exec->vtx.buffer_used -
+ exec->vtx.bufferobj->Mappings[MAP_INTERNAL].Offset;
+ GLsizeiptr length = (exec->vtx.buffer_ptr - exec->vtx.buffer_map) *
+ sizeof(float);
if (length)
ctx->Driver.FlushMappedBufferRange(ctx, offset, length,
- exec->vtx.bufferobj);
+ exec->vtx.bufferobj,
+ MAP_INTERNAL);
}
exec->vtx.buffer_used += (exec->vtx.buffer_ptr -
@@ -275,7 +279,7 @@ vbo_exec_vtx_unmap( struct vbo_exec_context *exec )
assert(exec->vtx.buffer_used <= VBO_VERT_BUFFER_SIZE);
assert(exec->vtx.buffer_ptr != NULL);
- ctx->Driver.UnmapBuffer(ctx, exec->vtx.bufferobj);
+ ctx->Driver.UnmapBuffer(ctx, exec->vtx.bufferobj, MAP_INTERNAL);
exec->vtx.buffer_map = NULL;
exec->vtx.buffer_ptr = NULL;
exec->vtx.max_vert = 0;
@@ -312,7 +316,8 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec )
(VBO_VERT_BUFFER_SIZE -
exec->vtx.buffer_used),
accessRange,
- exec->vtx.bufferobj);
+ exec->vtx.bufferobj,
+ MAP_INTERNAL);
exec->vtx.buffer_ptr = exec->vtx.buffer_map;
}
else {
@@ -325,14 +330,19 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec )
exec->vtx.buffer_used = 0;
if (ctx->Driver.BufferData(ctx, GL_ARRAY_BUFFER_ARB,
- VBO_VERT_BUFFER_SIZE,
- NULL, usage, exec->vtx.bufferobj)) {
+ VBO_VERT_BUFFER_SIZE,
+ NULL, usage,
+ GL_MAP_WRITE_BIT |
+ GL_DYNAMIC_STORAGE_BIT |
+ GL_CLIENT_STORAGE_BIT,
+ exec->vtx.bufferobj)) {
/* buffer allocation worked, now map the buffer */
exec->vtx.buffer_map =
(GLfloat *)ctx->Driver.MapBufferRange(ctx,
0, VBO_VERT_BUFFER_SIZE,
accessRange,
- exec->vtx.bufferobj);
+ exec->vtx.bufferobj,
+ MAP_INTERNAL);
}
else {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "VBO allocation");