diff options
author | Brian Paul <[email protected]> | 2011-07-31 21:00:21 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-09-27 12:12:07 -0700 |
commit | ce62473408f884c876ee535f5f48cfe70dacb1ef (patch) | |
tree | 69e26bd151f1d3af4d0c20e84a6ea3e34428ede2 /src/mesa/state_tracker | |
parent | 429b45e7c0001c0979e0d0fd20c3821c166da4a9 (diff) |
mesa: Finally, convert RGBA glGetTexImage() to using MapTextureImage().
v2: Changes by Brian to MapTexImage in the decompression path.
v3: Changes by anholt to fix srcRowStride for decompression of NPOT.
Tested-by: Brian Paul <[email protected]> (v2)
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 560b6b56172..354e58de91d 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -938,7 +938,6 @@ st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level, format, type); GLuint depth, i; GLubyte *dest; - GLboolean do_map = GL_TRUE; if (stImage->pt && util_format_is_s3tc(stImage->pt->format)) { /* Need to decompress the texture. @@ -950,37 +949,6 @@ st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level, return; } - if (format == GL_DEPTH_STENCIL || - format == GL_DEPTH_COMPONENT) { - do_map = GL_FALSE; - } - - /* Map */ - if (do_map && stImage->pt) { - /* Image is stored in hardware format in a buffer managed by the - * kernel. Need to explicitly map and unmap it. - */ - texImage->Data = st_texture_image_map(st, stImage, 0, - PIPE_TRANSFER_READ, 0, 0, - stImage->base.Width, - stImage->base.Height); - /* compute stride in texels from stride in bytes */ - texImage->RowStride = stImage->transfer->stride - * util_format_get_blockwidth(stImage->pt->format) - / util_format_get_blocksize(stImage->pt->format); - } - else if (do_map) { - /* Otherwise, the image should actually be stored in - * texImage->Data. This is pretty confusing for - * everybody, I'd much prefer to separate the two functions of - * texImage->Data - storage for texture images in main memory - * and access (ie mappings) of images. In other words, we'd - * create a new texImage->Map field and leave Data simply for - * storage. - */ - assert(texImage->Data); - } - depth = texImage->Depth; texImage->Depth = 1; @@ -1003,12 +971,6 @@ st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level, } texImage->Depth = depth; - - /* Unmap */ - if (do_map && stImage->pt) { - st_texture_image_unmap(st, stImage); - texImage->Data = NULL; - } } |