static void pb_debug_buffer_fence(struct pb_buffer *_buf, struct pipe_fence_handle *fence) { struct pb_debug_buffer *buf = pb_debug_buffer(_buf); pb_fence(buf->buffer, fence); }
static void pool_buffer_fence(struct pb_buffer *buf, struct pipe_fence_handle *fence) { struct pool_buffer *pool_buf = pool_buffer(buf); struct pool_pb_manager *pool = pool_buf->mgr; pb_fence(pool->buffer, fence); }
static void mm_buffer_fence(struct pb_buffer *buf, struct pipe_fence_handle *fence) { struct mm_buffer *mm_buf = mm_buffer(buf); struct mm_pb_manager *mm = mm_buf->mgr; pb_fence(mm->buffer, fence); }
void pb_validate_fence(struct pb_validate *vl, struct pipe_fence_handle *fence) { unsigned i; for(i = 0; i < vl->used; ++i) { pb_fence(vl->entries[i].buf, fence); pb_reference(&vl->entries[i].buf, NULL); } vl->used = 0; }
static void pb_ondemand_buffer_fence(struct pb_buffer *_buf, struct pipe_fence_handle *fence) { struct pb_ondemand_buffer *buf = pb_ondemand_buffer(_buf); assert(buf->buffer); if(!buf->buffer) return; pb_fence(buf->buffer, fence); }
static void fenced_buffer_fence(struct pb_buffer *buf, struct pipe_fence_handle *fence) { struct fenced_buffer *fenced_buf = fenced_buffer(buf); struct fenced_manager *fenced_mgr = fenced_buf->mgr; struct pb_fence_ops *ops = fenced_mgr->ops; pipe_mutex_lock(fenced_mgr->mutex); assert(pipe_is_referenced(&fenced_buf->base.base.reference)); assert(fenced_buf->buffer); if(fence != fenced_buf->fence) { assert(fenced_buf->vl); assert(fenced_buf->validation_flags); if (fenced_buf->fence) { boolean destroyed; destroyed = fenced_buffer_remove_locked(fenced_mgr, fenced_buf); assert(!destroyed); } if (fence) { ops->fence_reference(ops, &fenced_buf->fence, fence); fenced_buf->flags |= fenced_buf->validation_flags; fenced_buffer_add_locked(fenced_mgr, fenced_buf); } pb_fence(fenced_buf->buffer, fence); fenced_buf->vl = NULL; fenced_buf->validation_flags = 0; } pipe_mutex_unlock(fenced_mgr->mutex); }