u_vbuf: Return true in u_vbuf_get_caps if nb of vbufs is below minimum
authorPaul Cercueil <paul@crapouillou.net>
Fri, 22 Nov 2019 22:23:36 +0000 (23:23 +0100)
committerMarge Bot <eric+marge@anholt.net>
Sat, 21 Dec 2019 18:29:30 +0000 (18:29 +0000)
Return true in u_vbuf_get_caps if the number of vertex buffers is below
the minimum required for proper OpenGL 2.0.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2807>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2807>

src/gallium/auxiliary/util/u_vbuf.c

index 8ad6346d5478c0b1c78ab8efa2fba6df0cb671f1..a8b57aafed3ee8326771754d04e2cd4c818c628b 100644 (file)
@@ -91,6 +91,7 @@
 #include "util/format/u_format.h"
 #include "util/u_inlines.h"
 #include "util/u_memory.h"
+#include "util/u_screen.h"
 #include "util/u_upload_mgr.h"
 #include "translate/translate.h"
 #include "translate/translate_cache.h"
@@ -292,6 +293,10 @@ boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps,
    caps->max_vertex_buffers =
       screen->get_param(screen, PIPE_CAP_MAX_VERTEX_BUFFERS);
 
+   /* OpenGL 2.0 requires a minimum of 16 vertex buffers */
+   if (caps->max_vertex_buffers < 16)
+      fallback = TRUE;
+
    if (!caps->buffer_offset_unaligned ||
        !caps->buffer_stride_unaligned ||
        !caps->velem_src_offset_unaligned ||