From: Mike Blumenkrantz Date: Thu, 6 May 2021 19:26:54 +0000 (-0400) Subject: zink: split dummy buffer creation and populate X-Git-Tag: upstream/21.2.3~1125 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63df413f95377120a147cb209b349e914804e208;p=platform%2Fupstream%2Fmesa.git 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 Part-of: --- diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index baddd13..a8947b2 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++) {