diff options
author | Brian Paul <[email protected]> | 2009-09-03 11:23:05 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-09-03 11:45:17 -0600 |
commit | 95027a00870bc1d12ea24dfb092a0cad6cbd5035 (patch) | |
tree | 0e69858daa7f9672fa847aa185bdfd89d4b0d62e /src/mesa/main/colortab.c | |
parent | dc947c8f92732fab75f89015e2d506e964a41ace (diff) |
mesa: use new combined PBO validate/map helpers
Diffstat (limited to 'src/mesa/main/colortab.c')
-rw-r--r-- | src/mesa/main/colortab.c | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 91c29882ecc..5a7de5f2098 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -179,21 +179,12 @@ store_colortable_entries(GLcontext *ctx, struct gl_color_table *table, GLfloat bScale, GLfloat bBias, GLfloat aScale, GLfloat aBias) { - if (!_mesa_validate_pbo_access(1, &ctx->Unpack, count, 1, 1, - format, type, data)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glColor[Sub]Table(bad PBO access)"); + data = _mesa_map_validate_pbo_source(ctx, + 1, &ctx->Unpack, count, 1, 1, + format, type, data, + "glColor[Sub]Table"); + if (!data) return; - } - - data = _mesa_map_pbo_source(ctx, &ctx->Unpack, data); - if (!data) { - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glColor[Sub]Table(PBO mapped)"); - } - return; - } { /* convert user-provided data to GLfloat values */ @@ -688,22 +679,12 @@ _mesa_GetColorTable( GLenum target, GLenum format, return; } - if (!_mesa_validate_pbo_access(1, &ctx->Pack, table->Size, 1, 1, - format, type, data)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetColorTable(invalid PBO access)"); + data = _mesa_map_validate_pbo_dest(ctx, + 1, &ctx->Pack, table->Size, 1, 1, + format, type, data, + "glGetColorTable"); + if (!data) return; - } - - data = _mesa_map_pbo_dest(ctx, &ctx->Pack, data); - if (!data) { - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetColorTable(PBO is mapped)"); - } - return; - } _mesa_pack_rgba_span_float(ctx, table->Size, rgba, format, type, data, &ctx->Pack, 0x0); |