Commit 63c6509a authored by Kenneth Graunke's avatar Kenneth Graunke

mesa: Drop the "target" parameter from NewBufferObject().

NewBufferObject took a "target" parameter, which it blindly passed to
_mesa_initialize_buffer_object(), which ignored it.

Not much point in passing it around.
Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul's avatarBrian Paul <brianp@vmware.com>
Reviewed-by: 's avatarIan Romanick <ian.d.romanick@intel.com>
parent af31f930
......@@ -68,11 +68,11 @@ release_buffer(struct intel_buffer_object *intel_obj)
* internal structure where somehow shared.
*/
static struct gl_buffer_object *
intel_bufferobj_alloc(struct gl_context * ctx, GLuint name, GLenum target)
intel_bufferobj_alloc(struct gl_context * ctx, GLuint name)
{
struct intel_buffer_object *obj = CALLOC_STRUCT(intel_buffer_object);
_mesa_initialize_buffer_object(ctx, &obj->Base, name, target);
_mesa_initialize_buffer_object(ctx, &obj->Base, name);
obj->buffer = NULL;
......
......@@ -138,14 +138,14 @@ release_buffer(struct intel_buffer_object *intel_obj)
* internal structure where somehow shared.
*/
static struct gl_buffer_object *
intel_bufferobj_alloc(struct gl_context * ctx, GLuint name, GLenum target)
intel_bufferobj_alloc(struct gl_context * ctx, GLuint name)
{
struct intel_buffer_object *obj = CALLOC_STRUCT(intel_buffer_object);
if (!obj) {
_mesa_error_no_memory(__func__);
}
_mesa_initialize_buffer_object(ctx, &obj->Base, name, target);
_mesa_initialize_buffer_object(ctx, &obj->Base, name);
obj->buffer = NULL;
......
......@@ -48,7 +48,7 @@ get_bufferobj_map(struct gl_context *ctx, struct gl_buffer_object *obj,
}
static struct gl_buffer_object *
nouveau_bufferobj_new(struct gl_context *ctx, GLuint buffer, GLenum target)
nouveau_bufferobj_new(struct gl_context *ctx, GLuint buffer)
{
struct nouveau_bufferobj *nbo;
......@@ -56,7 +56,7 @@ nouveau_bufferobj_new(struct gl_context *ctx, GLuint buffer, GLenum target)
if (!nbo)
return NULL;
_mesa_initialize_buffer_object(ctx, &nbo->base, buffer, target);
_mesa_initialize_buffer_object(ctx, &nbo->base, buffer);
return &nbo->base;
}
......
......@@ -40,12 +40,11 @@ get_radeon_buffer_object(struct gl_buffer_object *obj)
static struct gl_buffer_object *
radeonNewBufferObject(struct gl_context * ctx,
GLuint name,
GLenum target)
GLuint name)
{
struct radeon_buffer_object *obj = CALLOC_STRUCT(radeon_buffer_object);
_mesa_initialize_buffer_object(ctx, &obj->Base, name, target);
_mesa_initialize_buffer_object(ctx, &obj->Base, name);
obj->bo = NULL;
......
......@@ -389,14 +389,14 @@ convert_clear_buffer_data(struct gl_context *ctx,
* Default callback for the \c dd_function_table::NewBufferObject() hook.
*/
static struct gl_buffer_object *
_mesa_new_buffer_object( struct gl_context *ctx, GLuint name, GLenum target )
_mesa_new_buffer_object(struct gl_context *ctx, GLuint name)
{
struct gl_buffer_object *obj;
(void) ctx;
obj = MALLOC_STRUCT(gl_buffer_object);
_mesa_initialize_buffer_object(ctx, obj, name, target);
_mesa_initialize_buffer_object(ctx, obj, name);
return obj;
}
......@@ -494,12 +494,10 @@ _mesa_reference_buffer_object_(struct gl_context *ctx,
* Initialize a buffer object to default values.
*/
void
_mesa_initialize_buffer_object( struct gl_context *ctx,
struct gl_buffer_object *obj,
GLuint name, GLenum target )
_mesa_initialize_buffer_object(struct gl_context *ctx,
struct gl_buffer_object *obj,
GLuint name)
{
(void) target;
memset(obj, 0, sizeof(struct gl_buffer_object));
mtx_init(&obj->Mutex, mtx_plain);
obj->RefCount = 1;
......@@ -906,7 +904,7 @@ _mesa_handle_bind_buffer_gen(struct gl_context *ctx,
* never used before, allocate a buffer object now.
*/
ASSERT(ctx->Driver.NewBufferObject);
buf = ctx->Driver.NewBufferObject(ctx, buffer, target);
buf = ctx->Driver.NewBufferObject(ctx, buffer);
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", caller);
return false;
......
......@@ -103,7 +103,7 @@ _mesa_multi_bind_lookup_bufferobj(struct gl_context *ctx,
extern void
_mesa_initialize_buffer_object(struct gl_context *ctx,
struct gl_buffer_object *obj,
GLuint name, GLenum target);
GLuint name);
extern void
_mesa_reference_buffer_object_(struct gl_context *ctx,
......
......@@ -602,7 +602,7 @@ struct dd_function_table {
*/
/*@{*/
struct gl_buffer_object * (*NewBufferObject)(struct gl_context *ctx,
GLuint buffer, GLenum target);
GLuint buffer);
void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
......
......@@ -86,7 +86,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
shared->SamplerObjects = _mesa_NewHashTable();
/* Allocate the default buffer object */
shared->NullBufferObj = ctx->Driver.NewBufferObject(ctx, 0, 0);
shared->NullBufferObj = ctx->Driver.NewBufferObject(ctx, 0);
/* Create default texture objects */
for (i = 0; i < NUM_TEXTURE_TARGETS; i++) {
......
......@@ -54,14 +54,14 @@
* internal structure where somehow shared.
*/
static struct gl_buffer_object *
st_bufferobj_alloc(struct gl_context *ctx, GLuint name, GLenum target)
st_bufferobj_alloc(struct gl_context *ctx, GLuint name)
{
struct st_buffer_object *st_obj = ST_CALLOC_STRUCT(st_buffer_object);
if (!st_obj)
return NULL;
_mesa_initialize_buffer_object(ctx, &st_obj->Base, name, target);
_mesa_initialize_buffer_object(ctx, &st_obj->Base, name);
return &st_obj->Base;
}
......
......@@ -997,7 +997,7 @@ void vbo_use_buffer_objects(struct gl_context *ctx)
/* Allocate a real buffer object now */
_mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL);
exec->vtx.bufferobj = ctx->Driver.NewBufferObject(ctx, bufName, target);
exec->vtx.bufferobj = ctx->Driver.NewBufferObject(ctx, bufName);
if (!ctx->Driver.BufferData(ctx, target, size, NULL, usage,
GL_MAP_WRITE_BIT |
GL_DYNAMIC_STORAGE_BIT |
......
......@@ -191,9 +191,7 @@ alloc_vertex_store(struct gl_context *ctx)
* user. Perhaps there could be a special number for internal
* buffers:
*/
vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx,
VBO_BUF_ID,
GL_ARRAY_BUFFER_ARB);
vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx, VBO_BUF_ID);
if (vertex_store->bufferobj) {
save->out_of_memory =
!ctx->Driver.BufferData(ctx,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment