From 59f8ba05f5307646e033c4f8a021df3c72b1f14a Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 23 Sep 2019 22:11:35 +0200 Subject: [PATCH] zink: pass screen to zink_create_gfx_pipeline Acked-by: Jordan Justen --- src/gallium/drivers/zink/zink_pipeline.c | 6 ++++-- src/gallium/drivers/zink/zink_pipeline.h | 4 +++- src/gallium/drivers/zink/zink_program.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c index 9516a8fbb82..25806bbbfcb 100644 --- a/src/gallium/drivers/zink/zink_pipeline.c +++ b/src/gallium/drivers/zink/zink_pipeline.c @@ -34,7 +34,8 @@ #include "util/u_prim.h" VkPipeline -zink_create_gfx_pipeline(VkDevice dev, struct zink_gfx_program *prog, +zink_create_gfx_pipeline(struct zink_screen *screen, + struct zink_gfx_program *prog, struct zink_gfx_pipeline_state *state, VkPrimitiveTopology primitive_topology) { @@ -144,7 +145,8 @@ zink_create_gfx_pipeline(VkDevice dev, struct zink_gfx_program *prog, pci.stageCount = num_stages; VkPipeline pipeline; - if (vkCreateGraphicsPipelines(dev, VK_NULL_HANDLE, 1, &pci, NULL, &pipeline) != VK_SUCCESS) { + if (vkCreateGraphicsPipelines(screen->dev, VK_NULL_HANDLE, 1, &pci, + NULL, &pipeline) != VK_SUCCESS) { debug_printf("vkCreateGraphicsPipelines failed\n"); return VK_NULL_HANDLE; } diff --git a/src/gallium/drivers/zink/zink_pipeline.h b/src/gallium/drivers/zink/zink_pipeline.h index 0a448be7b4e..a7124c5b8b5 100644 --- a/src/gallium/drivers/zink/zink_pipeline.h +++ b/src/gallium/drivers/zink/zink_pipeline.h @@ -33,6 +33,7 @@ struct zink_depth_stencil_alpha_state; struct zink_gfx_program; struct zink_rasterizer_state; struct zink_render_pass; +struct zink_screen; struct zink_vertex_elements_state; struct zink_gfx_pipeline_state { @@ -55,7 +56,8 @@ struct zink_gfx_pipeline_state { }; VkPipeline -zink_create_gfx_pipeline(VkDevice dev, struct zink_gfx_program *prog, +zink_create_gfx_pipeline(struct zink_screen *screen, + struct zink_gfx_program *prog, struct zink_gfx_pipeline_state *state, VkPrimitiveTopology primitive_topology); diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 020b311f493..92a75489cf5 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -229,7 +229,7 @@ zink_get_gfx_pipeline(struct zink_screen *screen, struct hash_entry *entry = _mesa_hash_table_search(prog->pipelines[mode], state); if (!entry) { VkPrimitiveTopology vkmode = primitive_topology(mode); - VkPipeline pipeline = zink_create_gfx_pipeline(screen->dev, prog, + VkPipeline pipeline = zink_create_gfx_pipeline(screen, prog, state, vkmode); if (pipeline == VK_NULL_HANDLE) return VK_NULL_HANDLE; -- 2.30.2