Mesa (master): mesa: Update comments/ assertions about buffer mapping for glGetTexImage().

Eric Anholt anholt at kemper.freedesktop.org
Tue Sep 27 19:12:53 UTC 2011


Module: Mesa
Branch: master
Commit: 177110ae3261e6ba91a40ed1c495a865edbe9394
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=177110ae3261e6ba91a40ed1c495a865edbe9394

Author: Brian Paul <brianp at vmware.com>
Date:   Sun Jul 31 21:00:55 2011 -0700

mesa: Update comments/assertions about buffer mapping for glGetTexImage().

This code is about to stop needing ->Data and using MapTextureImage().

Tested-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/texgetimage.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 4d58309..a5e499a 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -409,7 +409,8 @@ get_tex_memcpy(struct gl_context *ctx, GLenum format, GLenum type, GLvoid *pixel
 /**
  * This is the software fallback for Driver.GetTexImage().
  * All error checking will have been done before this routine is called.
- * The texture image must be mapped.
+ * We'll call ctx->Driver.MapTextureImage() to access the data, then
+ * unmap with ctx->Driver.UnmapTextureImage().
  */
 void
 _mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level,
@@ -419,9 +420,6 @@ _mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level,
 {
    GLuint dimensions;
 
-   /* If we get here, the texture image should be mapped */
-   assert(texImage->Data);
-
    switch (target) {
    case GL_TEXTURE_1D:
       dimensions = 1;
@@ -433,6 +431,7 @@ _mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level,
       dimensions = 2;
    }
 
+   /* map dest buffer, if PBO */
    if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
       /* Packing texture image into a PBO.
        * Map the (potentially) VRAM-based buffer into our process space so




More information about the mesa-commit mailing list