Mesa (main): zink: split dummy buffer creation and populate

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 30 04:47:27 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu May  6 15:26:54 2021 -0400

zink: split dummy buffer creation and populate

populate requires the queue to be set up, but the resources must be created
before descriptor init

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11591>

---

 src/gallium/drivers/zink/zink_context.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index baddd132365..a8947b25254 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -3506,12 +3506,12 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
       goto fail;
 
    const uint8_t data[] = {0};
-   ctx->dummy_vertex_buffer = pipe_buffer_create_with_data(&ctx->base,
-      PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_SHADER_IMAGE, PIPE_USAGE_IMMUTABLE, sizeof(data), data);
+   ctx->dummy_vertex_buffer = pipe_buffer_create(&screen->base,
+      PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_SHADER_IMAGE, PIPE_USAGE_IMMUTABLE, sizeof(data));
    if (!ctx->dummy_vertex_buffer)
       goto fail;
-   ctx->dummy_xfb_buffer = pipe_buffer_create_with_data(&ctx->base,
-      PIPE_BIND_STREAM_OUTPUT, PIPE_USAGE_DEFAULT, sizeof(data), data);
+   ctx->dummy_xfb_buffer = pipe_buffer_create(&screen->base,
+      PIPE_BIND_STREAM_OUTPUT, PIPE_USAGE_DEFAULT, sizeof(data));
    if (!ctx->dummy_xfb_buffer)
       goto fail;
    ctx->dummy_surface = zink_surface_create_null(ctx, PIPE_TEXTURE_2D, 1, 1, 1);
@@ -3536,6 +3536,9 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
    if (!ctx->batch.state)
       goto fail;
 
+   pipe_buffer_write(&ctx->base, ctx->dummy_vertex_buffer, 0, sizeof(data), data);
+   pipe_buffer_write(&ctx->base, ctx->dummy_xfb_buffer, 0, sizeof(data), data);
+
    for (unsigned i = 0; i < PIPE_SHADER_TYPES; i++) {
       /* need to update these based on screen config for null descriptors */
       for (unsigned j = 0; j < 32; j++) {



More information about the mesa-commit mailing list