summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/r600_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-08-18 16:30:00 +0200
committerMarek Olšák <[email protected]>2016-09-05 18:01:15 +0200
commit0d2e43fcb1198a6e67c85feadb1ca8c360ddc284 (patch)
treedb9eec8c7f041d0be80e03d7c2602928db81e1e7 /src/gallium/drivers/radeon/r600_texture.c
parenta14c50bceb6b201e361b2cf6e3f453359d510284 (diff)
gallium/radeon: derive buffer placement and flags only at initialization
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 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_texture.c')
-rw-r--r--src/gallium/drivers/radeon/r600_texture.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index e19150b7900..fb3068a94d8 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -1103,8 +1103,10 @@ r600_texture_create_object(struct pipe_screen *screen,
/* Now create the backing buffer. */
if (!buf) {
- if (!r600_init_resource(rscreen, resource, rtex->size,
- rtex->surface.bo_alignment)) {
+ r600_init_resource_fields(rscreen, resource, rtex->size,
+ rtex->surface.bo_alignment);
+
+ if (!r600_alloc_resource(rscreen, resource)) {
FREE(rtex);
return NULL;
}
@@ -1418,8 +1420,7 @@ static void r600_texture_invalidate_storage(struct r600_common_context *rctx,
assert(rtex->surface.level[0].mode == RADEON_SURF_MODE_LINEAR_ALIGNED);
/* Reallocate the buffer in the same pipe_resource. */
- r600_init_resource(rscreen, &rtex->resource, rtex->size,
- rtex->surface.bo_alignment);
+ r600_alloc_resource(rscreen, &rtex->resource);
/* Initialize the CMASK base address (needed even without CMASK). */
rtex->cmask.base_address_reg =