gallium/radeon: set new r600_resource fields correctly in other places too
authorMarek Olšák <marek.olsak@amd.com>
Mon, 12 Sep 2016 10:47:13 +0000 (12:47 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 13 Sep 2016 18:38:25 +0000 (20:38 +0200)
This was missed in:

    commit 0d2e43fcb1198a6e67c85feadb1ca8c360ddc284
    Author: Marek Olšák <marek.olsak@amd.com>
    Date:   Thu Aug 18 16:30:00 2016 +0200

        gallium/radeon: derive buffer placement and flags only at initialization

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_texture.c

index d3a498fb35d9c3841b5b9b473c57d35823e01aa2..b02b2dc527dc2fb99fa034e1b85fc6540d845c10 100644 (file)
@@ -497,7 +497,12 @@ static void r600_degrade_tile_mode_to_linear(struct r600_common_context *rctx,
        rtex->resource.b.b.bind = templ.bind;
        pb_reference(&rtex->resource.buf, new_tex->resource.buf);
        rtex->resource.gpu_address = new_tex->resource.gpu_address;
+       rtex->resource.vram_usage = new_tex->resource.vram_usage;
+       rtex->resource.gart_usage = new_tex->resource.gart_usage;
+       rtex->resource.bo_size = new_tex->resource.bo_size;
+       rtex->resource.bo_alignment = new_tex->resource.bo_alignment;
        rtex->resource.domains = new_tex->resource.domains;
+       rtex->resource.flags = new_tex->resource.flags;
        rtex->size = new_tex->size;
        rtex->surface = new_tex->surface;
        rtex->non_disp_tiling = new_tex->non_disp_tiling;
@@ -1119,7 +1124,13 @@ r600_texture_create_object(struct pipe_screen *screen,
        } else {
                resource->buf = buf;
                resource->gpu_address = rscreen->ws->buffer_get_virtual_address(resource->buf);
+               resource->bo_size = buf->size;
+               resource->bo_alignment = buf->alignment;
                resource->domains = rscreen->ws->buffer_get_initial_domain(resource->buf);
+               if (resource->domains & RADEON_DOMAIN_VRAM)
+                       resource->vram_usage = buf->size;
+               else if (resource->domains & RADEON_DOMAIN_GTT)
+                       resource->gart_usage = buf->size;
        }
 
        if (rtex->cmask.size) {