zink: pass screen to zink_create_gfx_pipeline
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 23 Sep 2019 20:11:35 +0000 (22:11 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:48 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_pipeline.c
src/gallium/drivers/zink/zink_pipeline.h
src/gallium/drivers/zink/zink_program.c

index 9516a8fbb82c6c2cbf7bf2c096bf28112bae9514..25806bbbfcb7af37be5538ee0e071e25d0254042 100644 (file)
@@ -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;
    }
index 0a448be7b4ecb98b08f4a68c735c6d1e2d8cc4a6..a7124c5b8b597503fb3286a7359b052c3c0e4f5b 100644 (file)
@@ -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);
 
index 020b311f493ac62d49189e2c2d5eeff78245cbf8..92a75489cf557569dead907016d5f2d2c4741c18 100644 (file)
@@ -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;