diff options
author | Brian Paul <[email protected]> | 2006-07-19 16:13:15 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-07-19 16:13:15 +0000 |
commit | ad15866ef0e77478508eeb534b28f0136462b644 (patch) | |
tree | c3b6beed6f71dcd2a12f4fbd6b778d7689e3fd5e /src/mesa/main/teximage.c | |
parent | 0749e2723b32ba430539791b94acd95dcf939a1d (diff) |
For glGetTexImage(), move the _mesa_validate_pbo_access() error check into
_mesa_GetTexImage() so it's not needed in the fallback or driver functions.
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r-- | src/mesa/main/teximage.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index f8528dd96e5..2ada4a89420 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2162,6 +2162,18 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, return; } + if (ctx->Pack.BufferObj->Name) { + /* packing texture image into a PBO */ + const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2; + if (!_mesa_validate_pbo_access(dimensions, &ctx->Pack, texImage->Width, + texImage->Height, texImage->Depth, + format, type, pixels)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetTexImage(invalid PBO access)"); + return; + } + } + /* typically, this will call _mesa_get_teximage() */ ctx->Driver.GetTexImage(ctx, target, level, format, type, pixels, texObj, texImage); |