summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2008-05-07 08:46:28 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2008-05-07 08:46:28 +0100
commit79931e38abc62286151121a3f59127e296144551 (patch)
tree4a30245df3260aff9729ed5b19a1f846510ce1d1 /src/mesa/state_tracker
parent4d1bf8a85eae730ca875194864277602f57582ea (diff)
Revert "gallium: move setup of dest_surface in do_copy_texsubimage()"
This reverts commit f7dbd18371f9cb6686b6a97642b3ca5577e83472. Looks like an accidental revert of commit 650c57f19398800dfdcf357b6e9ec7b68bfa34f1.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 3723b91210..3206215b2e 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1137,7 +1137,6 @@ do_copy_texsubimage(GLcontext *ctx,
struct st_renderbuffer *strb;
struct pipe_context *pipe = ctx->st->pipe;
struct pipe_screen *screen = pipe->screen;
- struct pipe_surface *dest_surface;
uint dest_format, src_format;
uint do_flip = FALSE;
GLboolean use_fallback = GL_TRUE;
@@ -1168,13 +1167,7 @@ do_copy_texsubimage(GLcontext *ctx,
src_format = strb->surface->format;
dest_format = stImage->pt->format;
- dest_surface = screen->get_tex_surface(screen, stImage->pt, stImage->face,
- stImage->level, destZ,
- PIPE_BUFFER_USAGE_CPU_WRITE);
-
- if (ctx->_ImageTransferState == 0x0 &&
- strb->surface->buffer &&
- dest_surface->buffer) {
+ if (ctx->_ImageTransferState == 0x0) {
/* do blit-style copy */
/* XXX may need to invert image depending on window
@@ -1197,6 +1190,14 @@ do_copy_texsubimage(GLcontext *ctx,
x, y + height, dstx, dsty, width, height,
GL_COPY); /* ? */
#else
+ struct pipe_surface *dest_surface;
+
+ dest_surface = screen->get_tex_surface(screen, stImage->pt, stImage->face,
+ stImage->level, destZ,
+ PIPE_BUFFER_USAGE_GPU_WRITE);
+
+ assert(strb->surface->buffer);
+ assert(dest_surface->buffer);
if (src_format == dest_format) {
pipe->surface_copy(pipe,
@@ -1224,6 +1225,8 @@ do_copy_texsubimage(GLcontext *ctx,
0.0, PIPE_TEX_MIPFILTER_NEAREST);
use_fallback = GL_FALSE;
}
+
+ pipe_surface_reference(&dest_surface, NULL);
#endif
}
@@ -1234,8 +1237,6 @@ do_copy_texsubimage(GLcontext *ctx,
srcX, srcY, width, height);
}
- pipe_surface_reference(&dest_surface, NULL);
-
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
ctx->Driver.GenerateMipmap(ctx, target, texObj);
}