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

Author: Jason Ekstrand <[email protected]>
Date:   Tue Jul 11 19:04:38 2017 -0700

anv: Round u_vector element sizes to a power of two

This fixes 32-bit builds of the driver.  Commit 08413a81b93dc537fb0c3
changed things so that we now put struct anv_states in the u_vector for
binding tables.  On 64-bit builds, sizeof(struct anv_state) is a power
of two but it isn't on 32-bit builds.

Fixes: 08413a81b93dc537fb0c34327ad162f07e8c3427
Reviewed-by: Kenneth Graunke <[email protected]>
Cc: [email protected]

---

 src/intel/vulkan/anv_batch_chain.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c 
b/src/intel/vulkan/anv_batch_chain.c
index 47fee7398f..ad76dc1fc0 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -706,9 +706,10 @@ anv_cmd_buffer_init_batch_bo_chain(struct anv_cmd_buffer 
*cmd_buffer)
 
    *(struct anv_batch_bo **)u_vector_add(&cmd_buffer->seen_bbos) = batch_bo;
 
+   /* u_vector requires power-of-two size elements */
+   unsigned pow2_state_size = util_next_power_of_two(sizeof(struct anv_state));
    success = u_vector_init(&cmd_buffer->bt_block_states,
-                           sizeof(struct anv_state),
-                           8 * sizeof(struct anv_state));
+                           pow2_state_size, 8 * pow2_state_size);
    if (!success)
       goto fail_seen_bbos;
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to