diff options
author | Marek Olšák <[email protected]> | 2020-03-21 23:56:07 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2020-04-06 10:28:53 -0400 |
commit | 10beee8a7757e956ab0e02ec8402ec1273d8edce (patch) | |
tree | c6bce7c442f7f87ed18e973b623ccd9d49cd209a /src/mesa/vbo | |
parent | 58fab9a6fe258395d934b69c454f1b54bcefedf1 (diff) |
mesa: remove no longer needed _mesa_is_bufferobj function
All buffers have Name != 0.
Note that there is no longer the pointer dereference to get Name,
so it's faster.
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r-- | src/mesa/vbo/vbo_exec_draw.c | 10 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_minmax_index.c | 4 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_save_api.c | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 93a74cc07ad..54ee7af86f6 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -89,7 +89,7 @@ vbo_exec_bind_arrays(struct gl_context *ctx) struct vbo_exec_context *exec = &vbo->exec; GLintptr buffer_offset; - if (_mesa_is_bufferobj(exec->vtx.bufferobj)) { + if (exec->vtx.bufferobj) { assert(exec->vtx.bufferobj->Mappings[MAP_INTERNAL].Pointer); buffer_offset = exec->vtx.bufferobj->Mappings[MAP_INTERNAL].Offset + exec->vtx.buffer_offset; @@ -137,7 +137,7 @@ vbo_exec_bind_arrays(struct gl_context *ctx) } _mesa_enable_vertex_array_attribs(ctx, vao, vao_enabled); assert(vao_enabled == vao->Enabled); - assert(!_mesa_is_bufferobj(exec->vtx.bufferobj) || + assert(!exec->vtx.bufferobj || (vao_enabled & ~vao->VertexAttribBufferMask) == 0); _mesa_set_draw_vao(ctx, vao, _vbo_get_vao_filter(mode)); @@ -150,7 +150,7 @@ vbo_exec_bind_arrays(struct gl_context *ctx) static void vbo_exec_vtx_unmap(struct vbo_exec_context *exec) { - if (_mesa_is_bufferobj(exec->vtx.bufferobj)) { + if (exec->vtx.bufferobj) { struct gl_context *ctx = exec->ctx; if (ctx->Driver.FlushMappedBufferRange && @@ -211,7 +211,7 @@ vbo_exec_vtx_map(struct vbo_exec_context *exec) MESA_MAP_NOWAIT_BIT; } - if (!_mesa_is_bufferobj(exec->vtx.bufferobj)) + if (!exec->vtx.bufferobj) return; assert(!exec->vtx.buffer_map); @@ -295,7 +295,7 @@ vbo_exec_vtx_flush(struct vbo_exec_context *exec) { /* Only unmap if persistent mappings are unsupported. */ bool persistent_mapping = exec->ctx->Extensions.ARB_buffer_storage && - _mesa_is_bufferobj(exec->vtx.bufferobj) && + exec->vtx.bufferobj && exec->vtx.buffer_map; if (0) diff --git a/src/mesa/vbo/vbo_minmax_index.c b/src/mesa/vbo/vbo_minmax_index.c index 0c87ffbea3c..f66ed3dee39 100644 --- a/src/mesa/vbo/vbo_minmax_index.c +++ b/src/mesa/vbo/vbo_minmax_index.c @@ -248,7 +248,7 @@ vbo_get_minmax_index(struct gl_context *ctx, GLintptr offset = 0; indices = (char *) ib->ptr + (prim->start << ib->index_size_shift); - if (_mesa_is_bufferobj(ib->obj)) { + if (ib->obj) { GLsizeiptr size = MIN2(count << ib->index_size_shift, ib->obj->Size); if (vbo_get_minmax_cached(ib->obj, 1 << ib->index_size_shift, (GLintptr) indices, @@ -338,7 +338,7 @@ vbo_get_minmax_index(struct gl_context *ctx, unreachable("not reached"); } - if (_mesa_is_bufferobj(ib->obj)) { + if (ib->obj) { vbo_minmax_cache_store(ctx, ib->obj, 1 << ib->index_size_shift, offset, count, *min_index, *max_index); ctx->Driver.UnmapBuffer(ctx, ib->obj, MAP_INTERNAL); diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 63a5b0ebb90..52ed86cf3b7 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -1374,7 +1374,7 @@ _save_OBE_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, _mesa_vao_map(ctx, vao, GL_MAP_READ_BIT); - if (_mesa_is_bufferobj(indexbuf)) + if (indexbuf) indices = ADD_POINTERS(indexbuf->Mappings[MAP_INTERNAL].Pointer, indices); |