summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-02-22 20:21:42 +0100
committerEmil Velikov <[email protected]>2018-03-20 16:57:26 +0000
commit05ae1d463faef1ab5dd5e7078d874eb8f4a5ed23 (patch)
treed8b3f5443726e9048f0763640061cabc8c29f849
parent3d4383f1399f9bd3cdaea794b0fa9be87f3d80f8 (diff)
radeonsi: prevent a negative buffer offset in si_upload_descriptors
(cherry picked from commit 16856a1ee86f364212674dddf154caa374310a6b)
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index e484ab338a7..df7ac5a412b 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -161,11 +161,10 @@ static bool si_upload_descriptors(struct si_context *sctx,
}
uint32_t *ptr;
- int buffer_offset;
- u_upload_alloc(sctx->b.b.const_uploader, 0, upload_size,
+ unsigned buffer_offset;
+ u_upload_alloc(sctx->b.b.const_uploader, first_slot_offset, upload_size,
si_optimal_tcc_alignment(sctx, upload_size),
- (unsigned*)&buffer_offset,
- (struct pipe_resource**)&desc->buffer,
+ &buffer_offset, (struct pipe_resource**)&desc->buffer,
(void**)&ptr);
if (!desc->buffer) {
desc->gpu_address = 0;