summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2019-04-15 21:36:32 +0200
committerDylan Baker <dylan@pnwbakers.com>2019-04-16 09:43:25 -0700
commitce4b6974cdf9133b9e7017cb4f4a3ce186bae8fb (patch)
treedfcd0aa1cf98a94127fb93b27a2cdfea57c843e5
parent0ffd4c744d065d865fd7b9064f972ebad85099da (diff)
gallivm: fix bogus assert in get_indirect_index
0 is a valid value as max index, and the code handles it fine. This isn't commonly seen, as it will only happen with array declarations of size 1. Fixes piglit tests/shaders/complex-loop-analysis-bug.shader_test Fixes: a3c898dc97ec "gallivm: fix improper clamping of vertex index when fetching gs inputs" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110441 Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit 88e0bbf24aa82000195d10c7873f881d190b825b)
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 0f5b3d9acb7..d6af1d84471 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -1108,7 +1108,7 @@ get_indirect_index(struct lp_build_tgsi_soa_context *bld,
* larger than the declared size but smaller than the buffer size.
*/
if (reg_file != TGSI_FILE_CONSTANT) {
- assert(index_limit > 0);
+ assert(index_limit >= 0);
max_index = lp_build_const_int_vec(bld->bld_base.base.gallivm,
uint_bld->type, index_limit);