summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-07-31 01:31:19 +0200
committerMarek Olšák <[email protected]>2017-08-01 17:06:38 +0200
commit1482861abee4686dbb4290c6e9f77b445a4963ce (patch)
treedf113db77e124a393ad972422ed9bd9022bb7420 /src/gallium/drivers
parent404f524fe2a3e3cc0024b3b8f8dc2e592a8aafed (diff)
radeonsi: fix printing vertex buffer descriptors into ddebug reports
Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeonsi/si_debug.c3
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c
index 06dea61e3c9..7c8a0fed99e 100644
--- a/src/gallium/drivers/radeonsi/si_debug.c
+++ b/src/gallium/drivers/radeonsi/si_debug.c
@@ -392,6 +392,9 @@ static void si_dump_descriptor_list(struct si_descriptors *desc,
{
unsigned i, j;
+ if (!desc->list)
+ return;
+
for (i = 0; i < num_elements; i++) {
unsigned dw_offset = slot_remap(i) * element_dw_size;
uint32_t *gpu_ptr = desc->gpu_list ? desc->gpu_list : desc->list;
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index b080562348c..26a8d815183 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -1101,6 +1101,7 @@ bool si_upload_vertex_buffer_descriptors(struct si_context *sctx)
if (!desc->buffer)
return false;
+ desc->list = ptr;
radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx,
desc->buffer, RADEON_USAGE_READ,
RADEON_PRIO_DESCRIPTORS);
@@ -2834,6 +2835,8 @@ void si_init_all_descriptors(struct si_context *sctx)
si_init_descriptors(sctx, &sctx->vertex_buffers, SI_SGPR_VERTEX_BUFFERS,
4, SI_NUM_VERTEX_BUFFERS, 0, 0, NULL);
+ FREE(sctx->vertex_buffers.list); /* not used */
+ sctx->vertex_buffers.list = NULL;
sctx->descriptors_dirty = u_bit_consecutive(0, SI_NUM_DESCS);
sctx->total_ce_ram_allocated = ce_offset;
@@ -2947,6 +2950,8 @@ void si_release_all_descriptors(struct si_context *sctx)
for (i = 0; i < SI_NUM_DESCS; ++i)
si_release_descriptors(&sctx->descriptors[i]);
+
+ sctx->vertex_buffers.list = NULL; /* points into a mapped buffer */
si_release_descriptors(&sctx->vertex_buffers);
}