Mesa (main): aux/cso: add flag to disable vbuf
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jun 11 17:42:42 UTC 2021
Module: Mesa
Branch: main
Commit: 3b66d70fba68496ba26b7d535da5979f36bd424d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3b66d70fba68496ba26b7d535da5979f36bd424d
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Thu May 27 11:19:38 2021 -0400
aux/cso: add flag to disable vbuf
it may be known in advance that vbuf shouldn't be used, so allow users
to skip this in case caps would otherwise enable it
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11071>
---
src/gallium/auxiliary/cso_cache/cso_context.c | 3 ++-
src/gallium/auxiliary/cso_cache/cso_context.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index 398f6f674b1..b0ebe70d2a5 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -252,7 +252,8 @@ cso_create_context(struct pipe_context *pipe, unsigned flags)
ctx->pipe = pipe;
ctx->sample_mask = ~0;
- cso_init_vbuf(ctx, flags);
+ if (!(flags & CSO_NO_VBUF))
+ cso_init_vbuf(ctx, flags);
/* Enable for testing: */
if (0) cso_set_maximum_cache_size(&ctx->cache, 4);
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h
index 6af23e26103..f92fd5b8b15 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.h
+++ b/src/gallium/auxiliary/cso_cache/cso_context.h
@@ -44,6 +44,7 @@ struct u_vbuf;
#define CSO_NO_USER_VERTEX_BUFFERS (1 << 0)
#define CSO_NO_64B_VERTEX_BUFFERS (1 << 1)
+#define CSO_NO_VBUF (1 << 2)
struct cso_context *cso_create_context(struct pipe_context *pipe,
unsigned flags);
More information about the mesa-commit
mailing list