diff options
author | Brian Paul <[email protected]> | 2009-07-17 22:00:47 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-07-17 22:00:47 -0600 |
commit | b96ae1b2c463d6d99ee0418083ef68f4027b7cd7 (patch) | |
tree | f34f89c267b940eb7408475bd0c2ff57c7fbe992 /src/mesa/state_tracker | |
parent | f81f57e25db18b1c69f2f8076380603340fa2cda (diff) | |
parent | cd10996d4f517c69e306eaf6dfb0654432651b3a (diff) |
Merge branch 'mesa_7_5_branch'
Conflicts:
Makefile
progs/glsl/multitex.c
src/mesa/main/enums.c
src/mesa/main/state.c
src/mesa/main/texenvprogram.c
src/mesa/main/version.h
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 909189f9d39..15f84b66382 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -237,14 +237,12 @@ do_memcpy(void *dest, const void *src, size_t n) } -static int -logbase2(int n) +static INLINE unsigned +logbase2(unsigned n) { - GLint i = 1, log2 = 0; - while (n > i) { - i *= 2; - log2++; - } + unsigned log2 = 0; + while (n >>= 1) + ++log2; return log2; } @@ -950,8 +948,9 @@ st_get_tex_image(GLcontext * ctx, GLenum target, GLint level, /* Image is stored in hardware format in a buffer managed by the * kernel. Need to explicitly map and unmap it. */ + unsigned face = _mesa_tex_target_to_face(target); - st_teximage_flush_before_map(ctx->st, stImage->pt, 0, level, + st_teximage_flush_before_map(ctx->st, stImage->pt, face, level, PIPE_TRANSFER_READ); texImage->Data = st_texture_image_map(ctx->st, stImage, 0, @@ -1080,13 +1079,15 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level, * from uploading the buffer under us. */ if (stImage->pt) { + unsigned face = _mesa_tex_target_to_face(target); + if (format == GL_DEPTH_COMPONENT && pf_is_depth_and_stencil(stImage->pt->format)) transfer_usage = PIPE_TRANSFER_READ_WRITE; else transfer_usage = PIPE_TRANSFER_WRITE; - st_teximage_flush_before_map(ctx->st, stImage->pt, 0, level, + st_teximage_flush_before_map(ctx->st, stImage->pt, face, level, transfer_usage); texImage->Data = st_texture_image_map(ctx->st, stImage, zoffset, transfer_usage, @@ -1213,7 +1214,9 @@ st_CompressedTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, int y; if (stImage->pt) { - st_teximage_flush_before_map(ctx->st, stImage->pt, 0, level, + unsigned face = _mesa_tex_target_to_face(target); + + st_teximage_flush_before_map(ctx->st, stImage->pt, face, level, PIPE_TRANSFER_WRITE); texImage->Data = st_texture_image_map(ctx->st, stImage, 0, PIPE_TRANSFER_WRITE, |