aux/cso: add flag to disable vbuf
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 27 May 2021 15:19:38 +0000 (11:19 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 11 Jun 2021 17:19:36 +0000 (17:19 +0000)
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@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11071>

src/gallium/auxiliary/cso_cache/cso_context.c
src/gallium/auxiliary/cso_cache/cso_context.h

index 398f6f6..b0ebe70 100644 (file)
@@ -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);
index 6af23e2..f92fd5b 100644 (file)
@@ -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);