Mesa (master): iris: Fix downcast of bound_vertex_buffers from uint64_t to int

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 29 07:01:54 UTC 2020


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Apr 28 14:04:58 2020 -0700

iris: Fix downcast of bound_vertex_buffers from uint64_t to int

This is the wrong data type, the original field - and the values we're
adding in - are both 64-bit unsigned.  Keep the original data type.

Thanks to Dave Airlie for finding this while reading the code.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4802>

---

 src/gallium/drivers/iris/iris_state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index d708f6a45bc..30fbd59c15e 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -5988,7 +5988,7 @@ iris_upload_dirty_render_state(struct iris_context *ice,
 
    if (dirty & IRIS_DIRTY_VERTEX_BUFFERS) {
       int count = util_bitcount64(ice->state.bound_vertex_buffers);
-      int dynamic_bound = ice->state.bound_vertex_buffers;
+      uint64_t dynamic_bound = ice->state.bound_vertex_buffers;
 
       if (ice->state.vs_uses_draw_params) {
          assert(ice->draw.draw_params.res);



More information about the mesa-commit mailing list