From 2bab56737c54dada29b4a868b717dc6785415f88 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 14 Mar 2023 14:11:33 -0400 Subject: [PATCH] panfrost: Note glDrawRangeElements underflow Hopefully this helps someone wiring up robustness later on. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_helpers.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_helpers.c b/src/gallium/drivers/panfrost/pan_helpers.c index fb27e10..5a1859f 100644 --- a/src/gallium/drivers/panfrost/pan_helpers.c +++ b/src/gallium/drivers/panfrost/pan_helpers.c @@ -127,6 +127,12 @@ panfrost_get_index_buffer_bounded(struct panfrost_batch *batch, struct panfrost_context *ctx = batch->ctx; bool needs_indices = true; + /* Note: if index_bounds_valid is set but the bounds are wrong, page faults + * (at least on Mali-G52) can be triggered an underflow reading varyings. + * Providing invalid index bounds in GLES is implementation-defined + * behaviour. This should be fine for now but this needs to be revisited when + * wiring up robustness later. + */ if (info->index_bounds_valid) { *min_index = info->min_index; *max_index = info->max_index; -- 2.7.4