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/polygon.c | |
parent | dc947c8f92732fab75f89015e2d506e964a41ace (diff) |
mesa: use new combined PBO validate/map helpers
Diffstat (limited to 'src/mesa/main/polygon.c')
-rw-r--r-- | src/mesa/main/polygon.c | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index e327a524159..376a87a3967 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -193,21 +193,12 @@ _mesa_PolygonMode( GLenum face, GLenum mode ) void _mesa_polygon_stipple(GLcontext *ctx, const GLubyte *pattern) { - if (!_mesa_validate_pbo_access(2, &ctx->Unpack, 32, 32, 1, - GL_COLOR_INDEX, GL_BITMAP, pattern)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPolygonStipple(bad PBO access)"); + pattern = _mesa_map_validate_pbo_source(ctx, 2, + &ctx->Unpack, 32, 32, 1, + GL_COLOR_INDEX, GL_BITMAP, pattern, + "glPolygonStipple"); + if (!pattern) return; - } - - pattern = _mesa_map_pbo_source(ctx, &ctx->Unpack, pattern); - if (!pattern) { - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPolygonStipple(PBO mapped)"); - } - return; - } _mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack); @@ -248,21 +239,12 @@ _mesa_GetPolygonStipple( GLubyte *dest ) if (MESA_VERBOSE&VERBOSE_API) _mesa_debug(ctx, "glGetPolygonStipple\n"); - if (!_mesa_validate_pbo_access(2, &ctx->Pack, 32, 32, 1, - GL_COLOR_INDEX, GL_BITMAP, dest)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPolygonStipple(bad PBO access)"); + dest = _mesa_map_validate_pbo_dest(ctx, 2, + &ctx->Pack, 32, 32, 1, + GL_COLOR_INDEX, GL_BITMAP, dest, + "glGetPolygonStipple"); + if (!dest) return; - } - - dest = _mesa_map_pbo_dest(ctx, &ctx->Pack, dest); - if (!dest) { - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPolygonStipple(PBO mapped)"); - } - return; - } _mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack); |