gallium/radeon: add the size only once in r600_context_add_resource_size
authorMarek Olšák <marek.olsak@amd.com>
Thu, 28 Apr 2016 14:57:09 +0000 (16:57 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 28 Apr 2016 19:06:31 +0000 (21:06 +0200)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/radeon/r600_pipe_common.c

index 823ba46e8c9bd94af4d94d3f4cd9184795ef0bfb..3c08221ca645914e075dcf4489eb8604ca3cee48 100644 (file)
@@ -353,12 +353,10 @@ void r600_context_add_resource_size(struct pipe_context *ctx, struct pipe_resour
         * In practice this gave very good estimate (+/- 10% of the target
         * memory limit).
         */
-       if (rr->domains & RADEON_DOMAIN_GTT) {
-               rctx->gtt += rr->buf->size;
-       }
-       if (rr->domains & RADEON_DOMAIN_VRAM) {
+       if (rr->domains & RADEON_DOMAIN_VRAM)
                rctx->vram += rr->buf->size;
-       }
+       else if (rr->domains & RADEON_DOMAIN_GTT)
+               rctx->gtt += rr->buf->size;
 }
 
 /*