summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-06-03 14:50:42 +0200
committerNicolai Hähnle <[email protected]>2016-06-07 15:17:39 +0200
commitc32cd4b78dba16abae5e4cb9ed96d58a2578401c (patch)
treeb79d373aa40b5541623140f0ad60d62386a77fcc
parent031b57bc2f4065ed86973900c611dfdad721e41f (diff)
radeonsi: move descriptor set begin_new_cs handling into a separate function
Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index f51ebd230aa..0065ac55856 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -249,6 +249,18 @@ static bool si_upload_descriptors(struct si_context *sctx,
return true;
}
+static void
+si_descriptors_begin_new_cs(struct si_context *sctx, struct si_descriptors *desc)
+{
+ desc->ce_ram_dirty = true;
+
+ if (!desc->buffer)
+ return;
+
+ radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx, desc->buffer,
+ RADEON_USAGE_READ, RADEON_PRIO_DESCRIPTORS);
+}
+
/* SAMPLER VIEWS */
static void si_release_sampler_views(struct si_sampler_views *views)
@@ -287,12 +299,7 @@ static void si_sampler_views_begin_new_cs(struct si_context *sctx,
RADEON_USAGE_READ);
}
- views->desc.ce_ram_dirty = true;
-
- if (!views->desc.buffer)
- return;
- radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx, views->desc.buffer,
- RADEON_USAGE_READWRITE, RADEON_PRIO_DESCRIPTORS);
+ si_descriptors_begin_new_cs(sctx, &views->desc);
}
void si_set_mutable_tex_desc_fields(struct r600_texture *tex,
@@ -489,14 +496,7 @@ si_image_views_begin_new_cs(struct si_context *sctx, struct si_images_info *imag
RADEON_USAGE_READWRITE);
}
- images->desc.ce_ram_dirty = true;
-
- if (images->desc.buffer) {
- radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx,
- images->desc.buffer,
- RADEON_USAGE_READ,
- RADEON_PRIO_DESCRIPTORS);
- }
+ si_descriptors_begin_new_cs(sctx, &images->desc);
}
static void
@@ -743,13 +743,7 @@ static void si_buffer_resources_begin_new_cs(struct si_context *sctx,
buffers->shader_usage, buffers->priority);
}
- buffers->desc.ce_ram_dirty = true;
-
- if (!buffers->desc.buffer)
- return;
- radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx,
- buffers->desc.buffer, RADEON_USAGE_READWRITE,
- RADEON_PRIO_DESCRIPTORS);
+ si_descriptors_begin_new_cs(sctx, &buffers->desc);
}
/* VERTEX BUFFERS */