nvc0: reset texture base address after read transfer
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 2 Feb 2011 20:38:07 +0000 (21:38 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 9 Feb 2011 15:04:59 +0000 (16:04 +0100)
src/gallium/drivers/nvc0/nvc0_transfer.c

index 92e006cba49ce87b88fd7ab42ae46168c2834870..b279bdc6e7d8cba02092ccc45c8a1e8fd1813358 100644 (file)
@@ -318,6 +318,7 @@ nvc0_miptree_transfer_new(struct pipe_context *pctx,
    tx->rect[1].domain = NOUVEAU_BO_GART;
 
    if (usage & PIPE_TRANSFER_READ) {
+      unsigned base = tx->rect[0].base;
       unsigned i;
       for (i = 0; i < tx->nlayers; ++i) {
          nvc0_m2mf_transfer_rect(pscreen, &tx->rect[1], &tx->rect[0],
@@ -328,9 +329,10 @@ nvc0_miptree_transfer_new(struct pipe_context *pctx,
             tx->rect[0].base += mt->layer_stride;
          tx->rect[1].base += size;
       }
+      tx->rect[0].z = z;
+      tx->rect[0].base = base;
+      tx->rect[1].base = 0;
    }
-   tx->rect[0].z = z;
-   tx->rect[1].base = 0;
 
    return &tx->base;
 }