zink: move renderpass inside gfx pipeline state
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 26 Mar 2019 13:53:32 +0000 (14:53 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:44 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_context.h
src/gallium/drivers/zink/zink_pipeline.c
src/gallium/drivers/zink/zink_pipeline.h

index dd2d8d418225173f450a509e9db126279c1f0f5e..c1e5e947148f5d590dc5391a6af91e3fd56c2267 100644 (file)
@@ -472,7 +472,7 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
    struct zink_screen *screen = zink_screen(pctx->screen);
 
    struct zink_render_pass *rp = get_render_pass(ctx, state);
-   zink_render_pass_reference(screen, &ctx->render_pass, rp);
+   zink_render_pass_reference(screen, &ctx->gfx_pipeline_state.render_pass, rp);
 
    struct zink_framebuffer *fb = get_framebuffer(ctx, state, rp);
    zink_framebuffer_reference(screen, &ctx->framebuffer, fb);
@@ -837,8 +837,7 @@ zink_draw_vbo(struct pipe_context *pctx,
 
    VkPipeline pipeline = zink_create_gfx_pipeline(screen->dev,
                                                   gfx_program,
-                                                  &ctx->gfx_pipeline_state,
-                                                  ctx->render_pass);
+                                                  &ctx->gfx_pipeline_state);
 
    bool depth_bias = false;
    switch (u_reduced_prim(dinfo->mode)) {
@@ -874,7 +873,8 @@ zink_draw_vbo(struct pipe_context *pctx,
    if (!cmdbuf)
       return;
 
-   begin_render_pass(cmdbuf, ctx->render_pass, ctx->framebuffer,
+   begin_render_pass(cmdbuf, ctx->gfx_pipeline_state.render_pass,
+                     ctx->framebuffer,
                      ctx->fb_state.width, ctx->fb_state.height);
 
    vkCmdSetViewport(cmdbuf->cmdbuf, 0, ctx->num_viewports, ctx->viewports);
index a0016ce81f323b642614b096515010f73a55fcbf..629321c72bac57173b9265bc31a731ad19caa9f2 100644 (file)
@@ -80,7 +80,6 @@ struct zink_context {
 
    struct primconvert_context *primconvert;
 
-   struct zink_render_pass *render_pass;
    struct zink_framebuffer *framebuffer;
 
    VkViewport viewports[PIPE_MAX_VIEWPORTS];
index f43af2d581acd572c93f774dce6d96cdf5ebd41c..b06f02a2e9270530df2589c84cc3aa26bf31214a 100644 (file)
@@ -35,8 +35,7 @@
 
 VkPipeline
 zink_create_gfx_pipeline(VkDevice dev, struct zink_gfx_program *prog,
-                         struct zink_gfx_pipeline_state *state,
-                         struct zink_render_pass *rp)
+                         struct zink_gfx_pipeline_state *state)
 {
    VkPipelineVertexInputStateCreateInfo vertex_input_state = {};
    vertex_input_state.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
@@ -114,7 +113,7 @@ zink_create_gfx_pipeline(VkDevice dev, struct zink_gfx_program *prog,
    pci.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
    pci.flags = VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT;
    pci.layout = prog->layout;
-   pci.renderPass = rp->render_pass;
+   pci.renderPass = state->render_pass->render_pass;
    pci.pVertexInputState = &vertex_input_state;
    pci.pInputAssemblyState = &primitive_state;
    pci.pRasterizationState = &rast_state;
index 8c0300eebb28ddc549bcb057636323df806af1fd..9990c5058da715c4b892e4555e053c20c298a381 100644 (file)
@@ -37,6 +37,7 @@ struct zink_vertex_elements_state;
 
 struct zink_gfx_pipeline_state {
    VkPrimitiveTopology primitive_topology;
+   struct zink_render_pass *render_pass;
 
    struct zink_vertex_elements_state *element_state;
    VkVertexInputBindingDescription bindings[PIPE_MAX_ATTRIBS]; // combination of element_state and stride
@@ -53,7 +54,6 @@ struct zink_gfx_pipeline_state {
 
 VkPipeline
 zink_create_gfx_pipeline(VkDevice dev, struct zink_gfx_program *prog,
-                         struct zink_gfx_pipeline_state *state,
-                         struct zink_render_pass *rp);
+                         struct zink_gfx_pipeline_state *state);
 
 #endif