summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/histogram.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-03 11:23:05 -0600
committerBrian Paul <[email protected]>2009-09-03 11:45:17 -0600
commit95027a00870bc1d12ea24dfb092a0cad6cbd5035 (patch)
tree0e69858daa7f9672fa847aa185bdfd89d4b0d62e /src/mesa/main/histogram.c
parentdc947c8f92732fab75f89015e2d506e964a41ace (diff)
mesa: use new combined PBO validate/map helpers
Diffstat (limited to 'src/mesa/main/histogram.c')
-rw-r--r--src/mesa/main/histogram.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c
index f1d01cdb621..ceb0d5a6a86 100644
--- a/src/mesa/main/histogram.c
+++ b/src/mesa/main/histogram.c
@@ -649,21 +649,11 @@ _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvo
return;
}
- if (!_mesa_validate_pbo_access(1, &ctx->Pack, 2, 1, 1,
- format, type, values)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetMinMax(invalid PBO access)");
- return;
- }
- values = _mesa_map_pbo_dest(ctx, &ctx->Pack, values);
- if (!values) {
- if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
- /* buffer is already mapped - that's an error */
- _mesa_error(ctx, GL_INVALID_OPERATION,"glGetMinMax(PBO is mapped)");
- }
+ values = _mesa_map_validate_pbo_dest(ctx, 1, &ctx->Pack, 2, 1, 1,
+ format, type, values, "glGetMinmax");
+ if (!values)
return;
- }
{
GLfloat minmax[2][4];
@@ -722,20 +712,12 @@ _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, G
return;
}
- if (!_mesa_validate_pbo_access(1, &ctx->Pack, ctx->Histogram.Width, 1, 1,
- format, type, values)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetHistogram(invalid PBO access)");
+ values = _mesa_map_validate_pbo_dest(ctx, 1, &ctx->Pack,
+ ctx->Histogram.Width, 1, 1,
+ format, type, values,
+ "glGetHistogram");
+ if (!values)
return;
- }
-
- values = _mesa_map_pbo_dest(ctx, &ctx->Pack, values);
- if (!values) {
- if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
- _mesa_error(ctx,GL_INVALID_OPERATION,"glGetHistogram(PBO is mapped)");
- }
- return;
- }
pack_histogram(ctx, ctx->Histogram.Width,
(CONST GLuint (*)[4]) ctx->Histogram.Count,