From: Keith Whitwell Date: Tue, 3 Mar 2009 11:51:14 +0000 (+0000) Subject: Merge commit 'origin/gallium-0.1' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=916de35d677ca5238e9515840fa5aa9f81302c5b;p=mesa.git Merge commit 'origin/gallium-0.1' Conflicts: scons/gallium.py src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c src/gallium/include/pipe/p_defines.h src/mesa/vbo/vbo_exec_api.c src/mesa/vbo/vbo_exec_draw.c --- 916de35d677ca5238e9515840fa5aa9f81302c5b diff --cc src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index 533c0a15f39,9282bca2eb8..a0a483ecaad --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@@ -471,8 -399,50 +481,53 @@@ fenced_buffer_create(struct fenced_buff } ++<<<<<<< HEAD:src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c ++======= + void + buffer_fence(struct pb_buffer *buf, + struct pipe_fence_handle *fence) + { + struct fenced_buffer *fenced_buf; + struct fenced_buffer_list *fenced_list; + struct pipe_winsys *winsys; + /* FIXME: receive this as a parameter */ + unsigned flags = fence ? PIPE_BUFFER_USAGE_GPU_READ_WRITE : 0; + + /* This is a public function, so be extra cautious with the buffer passed, + * as happens frequently to receive null buffers, or pointer to buffers + * other than fenced buffers. */ + assert(buf); + if(!buf) + return; + assert(buf->vtbl == &fenced_buffer_vtbl); + if(buf->vtbl != &fenced_buffer_vtbl) + return; + + if(!fence) + return; + + fenced_buf = fenced_buffer(buf); + fenced_list = fenced_buf->list; + winsys = fenced_list->winsys; + + if(fence == fenced_buf->fence) { + fenced_buf->flags |= flags & PIPE_BUFFER_USAGE_GPU_READ_WRITE; + return; + } + + pipe_mutex_lock(fenced_list->mutex); + if (fenced_buf->fence) + _fenced_buffer_remove(fenced_list, fenced_buf); + winsys->fence_reference(winsys, &fenced_buf->fence, fence); + fenced_buf->flags |= flags & PIPE_BUFFER_USAGE_GPU_READ_WRITE; + _fenced_buffer_add(fenced_buf); + pipe_mutex_unlock(fenced_list->mutex); + } + + ++>>>>>>> origin/gallium-0.1:src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c struct fenced_buffer_list * -fenced_buffer_list_create(struct pipe_winsys *winsys) +fenced_buffer_list_create(struct pb_fence_ops *ops) { struct fenced_buffer_list *fenced_list; diff --cc src/mesa/main/dd.h index 411b6a7b21f,b33c26dfed2..a335f77479d --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@@ -34,8 -34,24 +34,24 @@@ /* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */ struct gl_pixelstore_attrib; -struct mesa_display_list; +struct gl_display_list; + #if FEATURE_ARB_vertex_buffer_object + /* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return + * NULL) if buffer is unavailable for immediate mapping. + * + * Does GL_MAP_INVALIDATE_RANGE_BIT do this? It seems so, but it + * would require more book-keeping in the driver than seems necessary + * at this point. + * + * Does GL_MAP_INVALDIATE_BUFFER_BIT do this? Not really -- we don't + * want to provoke the driver to throw away the old storage, we will + * respect the contents of already referenced data. + */ + #define MESA_MAP_NOWAIT_BIT 0x0040 + #endif + + /** * Device driver function table. * Core Mesa uses these function pointers to call into device drivers. diff --cc src/mesa/vbo/vbo_exec_api.c index 2743bf6b55c,1ba39c8aa20..c0ffdb55e47 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@@ -707,8 -705,8 +704,9 @@@ void vbo_exec_vtx_init( struct vbo_exec &exec->vtx.bufferobj, ctx->Array.NullBufferObj); + ASSERT(!exec->vtx.buffer_map); - exec->vtx.buffer_map = ALIGN_MALLOC(VBO_VERT_BUFFER_SIZE * sizeof(GLfloat), 64); + exec->vtx.buffer_map = (GLfloat *)ALIGN_MALLOC(VBO_VERT_BUFFER_SIZE, 64); + vbo_exec_vtxfmt_init( exec ); /* Hook our functions into the dispatch table. diff --cc src/mesa/vbo/vbo_exec_draw.c index 45133fa4f32,a89f1506544..38b6c56f479 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@@ -263,12 -313,14 +327,13 @@@ void vbo_exec_vtx_flush( struct vbo_exe if (ctx->NewState) _mesa_update_state( ctx ); - /* if using a real VBO, unmap it before drawing */ - if (exec->vtx.bufferobj->Name) { - ctx->Driver.UnmapBuffer(ctx, target, exec->vtx.bufferobj); - exec->vtx.buffer_map = NULL; + vbo_exec_vtx_unmap( exec ); } + if (0) _mesa_printf("%s %d %d\n", __FUNCTION__, exec->vtx.prim_count, + exec->vtx.vert_count); + vbo_context(ctx)->draw_prims( ctx, exec->vtx.inputs, exec->vtx.prim,