aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2020-04-16 10:30:16 -0700
committerMarge Bot <[email protected]>2020-04-23 04:49:52 +0000
commitb88778e2de3a593587e20a8d4f0363a499f91455 (patch)
treed7fae8ed68d335e28d1ebf60d571df69fe2f5bab /src/gallium/auxiliary/util
parent7e1b57a6d964ac58e84ec4ece2951e4e643d6b1a (diff)
mesa/st: avoid u_vbuf for GLES
64b VBO types are not required for GLES. So avoid u_vbuf if that was otherwise the only reason it was used. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4619>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_vbuf.c7
-rw-r--r--src/gallium/auxiliary/util/u_vbuf.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index 567cb6a75c9..62b2e0efc3d 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -256,7 +256,8 @@ static const struct {
{ PIPE_FORMAT_R8G8B8A8_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
};
-void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
+void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps,
+ bool needs64b)
{
unsigned i;
@@ -272,6 +273,10 @@ void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
for (i = 0; i < ARRAY_SIZE(vbuf_format_fallbacks); i++) {
enum pipe_format format = vbuf_format_fallbacks[i].from;
+ unsigned comp_bits = util_format_get_component_bits(format, 0, 0);
+
+ if ((comp_bits > 32) && !needs64b)
+ continue;
if (!screen->is_format_supported(screen, format, PIPE_BUFFER, 0, 0,
PIPE_BIND_VERTEX_BUFFER)) {
diff --git a/src/gallium/auxiliary/util/u_vbuf.h b/src/gallium/auxiliary/util/u_vbuf.h
index 81dac2caf33..1b09bf02e2d 100644
--- a/src/gallium/auxiliary/util/u_vbuf.h
+++ b/src/gallium/auxiliary/util/u_vbuf.h
@@ -62,7 +62,8 @@ struct u_vbuf_caps {
};
-void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps);
+void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps,
+ bool needs64b);
struct u_vbuf *
u_vbuf_create(struct pipe_context *pipe, struct u_vbuf_caps *caps);