panfrost: Note glDrawRangeElements underflow
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 14 Mar 2023 18:11:33 +0000 (14:11 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 14 Mar 2023 23:10:01 +0000 (23:10 +0000)
Hopefully this helps someone wiring up robustness later on.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>

src/gallium/drivers/panfrost/pan_helpers.c

index fb27e10..5a1859f 100644 (file)
@@ -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;