mesa/vbo: Always use buffer objects for storage

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14098>
This commit is contained in:
Adam Jackson 2021-06-02 00:07:36 -04:00 committed by Marge Bot
parent b4ae8ee43e
commit 087f196a08
6 changed files with 10 additions and 20 deletions

View File

@ -856,7 +856,7 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
/* This must be done after extensions are initialized to enable persistent
* mappings immediately.
*/
_vbo_CreateContext(ctx, true);
_vbo_CreateContext(ctx);
_mesa_initialize_dispatch_tables(ctx);
_mesa_initialize_vbo_vtxfmt(ctx);

View File

@ -184,7 +184,7 @@ struct vbo_save_context {
};
GLboolean
_vbo_CreateContext(struct gl_context *ctx, bool use_buffer_objects);
_vbo_CreateContext(struct gl_context *ctx);
void
_vbo_DestroyContext(struct gl_context *ctx);

View File

@ -159,7 +159,7 @@ vbo_exec_update_eval_maps(struct gl_context *ctx)
GLboolean
_vbo_CreateContext(struct gl_context *ctx, bool use_buffer_objects)
_vbo_CreateContext(struct gl_context *ctx)
{
struct vbo_context *vbo = &ctx->vbo_context;
@ -180,7 +180,7 @@ _vbo_CreateContext(struct gl_context *ctx, bool use_buffer_objects)
* will pretty much be permanently installed, which means that the
* vtxfmt mechanism can be removed now.
*/
vbo_exec_init(ctx, use_buffer_objects);
vbo_exec_init(ctx);
if (ctx->API == API_OPENGL_COMPAT)
vbo_save_init(ctx);

View File

@ -109,11 +109,11 @@ _vbo_attribute_alias_map[VP_MODE_MAX][VERT_ATTRIB_MAX] = {
void
vbo_exec_init(struct gl_context *ctx, bool use_buffer_objects)
vbo_exec_init(struct gl_context *ctx)
{
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
vbo_exec_vtx_init(exec, use_buffer_objects);
vbo_exec_vtx_init(exec);
ctx->Driver.NeedFlush = 0;
ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;

View File

@ -40,13 +40,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "vbo_attrib.h"
void
vbo_exec_init(struct gl_context *ctx, bool use_buffer_objects);
vbo_exec_init(struct gl_context *ctx);
void
vbo_exec_destroy(struct gl_context *ctx);
void
vbo_exec_vtx_init(struct vbo_exec_context *exec, bool use_buffer_objects);
vbo_exec_vtx_init(struct vbo_exec_context *exec);
void
vbo_exec_vtx_destroy(struct vbo_exec_context *exec);

View File

@ -1030,21 +1030,11 @@ vbo_reset_all_attr(struct vbo_exec_context *exec)
void
vbo_exec_vtx_init(struct vbo_exec_context *exec, bool use_buffer_objects)
vbo_exec_vtx_init(struct vbo_exec_context *exec)
{
struct gl_context *ctx = gl_context_from_vbo_exec(exec);
if (use_buffer_objects) {
/* Use buffer objects for immediate mode. */
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
exec->vtx.bufferobj = ctx->Driver.NewBufferObject(ctx, IMM_BUFFER_NAME);
} else {
/* Use allocated memory for immediate mode. */
exec->vtx.bufferobj = NULL;
exec->vtx.buffer_map =
align_malloc(ctx->Const.glBeginEndBufferSize, 64);
exec->vtx.buffer_ptr = exec->vtx.buffer_map;
}
exec->vtx.bufferobj = ctx->Driver.NewBufferObject(ctx, IMM_BUFFER_NAME);
vbo_exec_vtxfmt_init(exec);
_mesa_noop_vtxfmt_init(ctx, &exec->vtxfmt_noop);