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);
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)) {
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);
struct primconvert_context *primconvert;
- struct zink_render_pass *render_pass;
struct zink_framebuffer *framebuffer;
VkViewport viewports[PIPE_MAX_VIEWPORTS];
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;
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;
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
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