Module: Mesa
Branch: master
Commit: 16856a1ee86f364212674dddf154caa374310a6b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=16856a1ee86f364212674dddf154caa374310a6b

Author: Marek Olšák <marek.ol...@amd.com>
Date:   Thu Feb 22 20:21:42 2018 +0100

radeonsi: prevent a negative buffer offset in si_upload_descriptors

---

 src/gallium/drivers/radeonsi/si_descriptors.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c 
b/src/gallium/drivers/radeonsi/si_descriptors.c
index b6e767c254..b71815fac5 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;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to