summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_texture.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-09-18 13:14:36 +1000
committerBen Skeggs <skeggsb@gmail.com>2008-09-18 13:14:36 +1000
commitb1d8b6c4d986a6526f20e1e89982036f0ba85222 (patch)
tree5ca75a54aff8c5504731fe1e3dead9bbe3b92c44 /src/mesa/state_tracker/st_cb_texture.c
parent6fca18696d0e6a243f6fbb5a30de45100a8e5fa0 (diff)
parenta06d38a74e865a0373a7314aad26b25c27ef8c57 (diff)
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/mesa/state_tracker/st_cb_texture.c')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index a3e8fc992d..2e1ad93942 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -455,6 +455,11 @@ st_TexImage(GLcontext * ctx,
_mesa_align_free(texImage->Data);
}
+ if (width == 0 || height == 0 || depth == 0) {
+ /* stop after freeing old image */
+ return;
+ }
+
/* If this is the only mipmap level in the texture, could call
* bmBufferData with NULL data to free the old block and avoid
* waiting on any outstanding fences.
@@ -1048,7 +1053,8 @@ st_copy_texsubimage(GLcontext *ctx,
GLboolean use_fallback = GL_TRUE;
GLboolean matching_base_formats;
- st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
+ /* any rendering in progress must complete before we grab the fb image */
+ st_finish(ctx->st);
/* determine if copying depth or color data */
if (texBaseFormat == GL_DEPTH_COMPONENT) {