summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/zink
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-03-26 14:53:32 +0100
committerErik Faye-Lund <[email protected]>2019-10-28 08:51:44 +0000
commit8e56b828e4a5dc39a2618cabd98eca0c8c40896c (patch)
treee9dd5e336ea6c21646c0561676f2f2b99df9b076 /src/gallium/drivers/zink
parent1cdbeefd2c60426a763fc13730b65f99fda0d3b5 (diff)
zink: move renderpass inside gfx pipeline state
Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/zink')
-rw-r--r--src/gallium/drivers/zink/zink_context.c8
-rw-r--r--src/gallium/drivers/zink/zink_context.h1
-rw-r--r--src/gallium/drivers/zink/zink_pipeline.c5
-rw-r--r--src/gallium/drivers/zink/zink_pipeline.h4
4 files changed, 8 insertions, 10 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index dd2d8d41822..c1e5e947148 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -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);
diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h
index a0016ce81f3..629321c72ba 100644
--- a/src/gallium/drivers/zink/zink_context.h
+++ b/src/gallium/drivers/zink/zink_context.h
@@ -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];
diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c
index f43af2d581a..b06f02a2e92 100644
--- a/src/gallium/drivers/zink/zink_pipeline.c
+++ b/src/gallium/drivers/zink/zink_pipeline.c
@@ -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;
diff --git a/src/gallium/drivers/zink/zink_pipeline.h b/src/gallium/drivers/zink/zink_pipeline.h
index 8c0300eebb2..9990c5058da 100644
--- a/src/gallium/drivers/zink/zink_pipeline.h
+++ b/src/gallium/drivers/zink/zink_pipeline.h
@@ -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