Module: Mesa
Branch: main
Commit: 56b4d199a05ef8f9d73ad3215b27238231a477fb
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=56b4d199a05ef8f9d73ad3215b27238231a477fb

Author: Marek Olšák <marek.ol...@amd.com>
Date:   Sat Jan  6 17:57:26 2024 -0500

glthread: don't unroll draws using user VBOs with GLES

The unrolling uses glBegin, which is unsupported by GLES and the GL
dispatch fails.

Fixes: 50d791ca73e52c6 - glthread: add a vertex upload path that unrolls 
indices for glDrawElements

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-pra...@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26916>

---

 src/mesa/main/glthread_draw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/glthread_draw.c b/src/mesa/main/glthread_draw.c
index e362b428745..4e55d8c25ab 100644
--- a/src/mesa/main/glthread_draw.c
+++ b/src/mesa/main/glthread_draw.c
@@ -736,7 +736,8 @@ should_convert_to_begin_end(struct gl_context *ctx, 
unsigned count,
     * Others prevent syncing, such as disallowing buffer objects because we
     * can't map them without syncing.
     */
-   return util_is_vbo_upload_ratio_too_large(count, num_upload_vertices) &&
+   return ctx->API == API_OPENGL_COMPAT &&
+          util_is_vbo_upload_ratio_too_large(count, num_upload_vertices) &&
           instance_count == 1 &&                /* no instancing */
           vao->CurrentElementBufferName == 0 && /* only user indices */
           !ctx->GLThread._PrimitiveRestart &&   /* no primitive restart */

Reply via email to