r600g: fix transfer function for tiling.
authorDave Airlie <airlied@redhat.com>
Wed, 13 Oct 2010 00:44:46 +0000 (10:44 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 18 Oct 2010 03:46:42 +0000 (13:46 +1000)
this makes readback with tiled back work better.

src/gallium/drivers/r600/r600_texture.c

index 07156bb7acc870f5f4cf754506ae4d5066c60e82..edaebf863952fd8e8958b5ae9358a6c8bcb9e0b0 100644 (file)
@@ -349,8 +349,6 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
        trans->transfer.sr = sr;
        trans->transfer.usage = usage;
        trans->transfer.box = *box;
-       trans->transfer.stride = rtex->pitch_in_bytes[sr.level];
-       trans->offset = r600_texture_get_offset(rtex, sr.level, box->z, sr.face);
        if (rtex->depth) {
                r = r600_texture_depth_flush(ctx, texture);
                if (r < 0) {
@@ -398,7 +396,10 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
                        /* Always referenced in the blit. */
                        ctx->flush(ctx, 0, NULL);
                }
+               return &trans->transfer;
        }
+       trans->transfer.stride = rtex->pitch_in_bytes[sr.level];
+       trans->offset = r600_texture_get_offset(rtex, sr.level, box->z, sr.face);
        return &trans->transfer;
 }