From 10beee8a7757e956ab0e02ec8402ec1273d8edce Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 21 Mar 2020 23:56:07 -0400 Subject: 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 Part-of: --- src/mesa/main/pixel.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mesa/main/pixel.c') diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index f5856a0ea79..d8dfab7be2b 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -158,7 +158,7 @@ validate_pbo_access(struct gl_context *ctx, &ctx->DefaultPacking.BufferObj, NULL); if (!ok) { - if (_mesa_is_bufferobj(pack->BufferObj)) { + if (pack->BufferObj) { _mesa_error(ctx, GL_INVALID_OPERATION, "gl[Get]PixelMap*v(out of bounds PBO access)"); } else { @@ -199,7 +199,7 @@ _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) values = (const GLfloat *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { + if (ctx->Unpack.BufferObj) { _mesa_error(ctx, GL_INVALID_OPERATION, "glPixelMapfv(PBO is mapped)"); } @@ -240,7 +240,7 @@ _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) values = (const GLuint *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { + if (ctx->Unpack.BufferObj) { _mesa_error(ctx, GL_INVALID_OPERATION, "glPixelMapuiv(PBO is mapped)"); } @@ -295,7 +295,7 @@ _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) values = (const GLushort *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { + if (ctx->Unpack.BufferObj) { _mesa_error(ctx, GL_INVALID_OPERATION, "glPixelMapusv(PBO is mapped)"); } @@ -344,7 +344,7 @@ _mesa_GetnPixelMapfvARB( GLenum map, GLsizei bufSize, GLfloat *values ) values = (GLfloat *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { + if (ctx->Pack.BufferObj) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetPixelMapfv(PBO is mapped)"); } @@ -393,7 +393,7 @@ _mesa_GetnPixelMapuivARB( GLenum map, GLsizei bufSize, GLuint *values ) values = (GLuint *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { + if (ctx->Pack.BufferObj) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetPixelMapuiv(PBO is mapped)"); } @@ -442,7 +442,7 @@ _mesa_GetnPixelMapusvARB( GLenum map, GLsizei bufSize, GLushort *values ) values = (GLushort *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { + if (ctx->Pack.BufferObj) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetPixelMapusv(PBO is mapped)"); } -- cgit v1.2.3