diff options
author | Marek Olšák <[email protected]> | 2018-02-22 20:21:42 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-03-07 13:55:42 -0500 |
commit | 16856a1ee86f364212674dddf154caa374310a6b (patch) | |
tree | 558906c8b5d135dff4f8f568fd417bf90f4c676a /src/gallium/drivers/radeonsi | |
parent | 9b554980591251a37d4473b4d1c951362473a129 (diff) |
radeonsi: prevent a negative buffer offset in si_upload_descriptors
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_descriptors.c | 7 |
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 b6e767c2546..b71815fac5c 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -167,11 +167,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; |