zink: move renderpass inside gfx pipeline state
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
@@ -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);
|
||||
|
@@ -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];
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user