Mesa (master): broadcom/vc5: Clamp the instance divisor to 16 bits.

Eric Anholt anholt at kemper.freedesktop.org
Wed Mar 21 17:04:23 UTC 2018


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 20 10:00:21 2018 -0700

broadcom/vc5: Clamp the instance divisor to 16 bits.

Fixes debug assert on
GTF-GLES3.gtf.GL3Tests.instanced_arrays.instanced_arrays_divisor

Signed-off-by: Eric Anholt <eric at anholt.net>

---

 src/gallium/drivers/vc5/vc5_state.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/vc5/vc5_state.c b/src/gallium/drivers/vc5/vc5_state.c
index 65dd9a2c42..75cd948e4a 100644
--- a/src/gallium/drivers/vc5/vc5_state.c
+++ b/src/gallium/drivers/vc5/vc5_state.c
@@ -319,7 +319,8 @@ vc5_vertex_state_create(struct pipe_context *pctx, unsigned num_elements,
 
                         attr.normalized_int_type = desc->channel[0].normalized;
                         attr.read_as_int_uint = desc->channel[0].pure_integer;
-                        attr.instance_divisor = elem->instance_divisor;
+                        attr.instance_divisor = MIN2(elem->instance_divisor,
+                                                     0xffff);
 
                         switch (desc->channel[0].type) {
                         case UTIL_FORMAT_TYPE_FLOAT:




More information about the mesa-commit mailing list