From 0d2e43fcb1198a6e67c85feadb1ca8c360ddc284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 18 Aug 2016 16:30:00 +0200 Subject: gallium/radeon: derive buffer placement and flags only at initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Invalidated buffers don't have to go through it. Split r600_init_resource into r600_init_resource_fields and r600_alloc_resource. Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_descriptors.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/radeonsi/si_descriptors.c') diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index eb0e5fa..b80f4f2 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -1427,15 +1427,14 @@ static void si_invalidate_buffer(struct pipe_context *ctx, struct pipe_resource { struct si_context *sctx = (struct si_context*)ctx; struct r600_resource *rbuffer = r600_resource(buf); - unsigned i, shader, alignment = rbuffer->buf->alignment; + unsigned i, shader; uint64_t old_va = rbuffer->gpu_address; unsigned num_elems = sctx->vertex_elements ? sctx->vertex_elements->count : 0; struct si_sampler_view *view; /* Reallocate the buffer in the same pipe_resource. */ - r600_init_resource(&sctx->screen->b, rbuffer, rbuffer->b.b.width0, - alignment); + r600_alloc_resource(&sctx->screen->b, rbuffer); /* We changed the buffer, now we need to bind it where the old one * was bound. This consists of 2 things: -- cgit v1.1