diff options
author | Erik Faye-Lund <[email protected]> | 2019-03-25 12:58:24 +0100 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-10-28 08:51:43 +0000 |
commit | e64cc463e3fac94e36c530db46734c9833c81ac3 (patch) | |
tree | 624c3e108d5eef61b4bf6c71d274cb5cd89d8a18 /src/gallium/drivers | |
parent | 70344223890d793f1fc00d07c872cb934130bc41 (diff) |
zink: move render-pass begin to helper
Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 0a3d52385fd..9c5167a8797 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -750,6 +750,24 @@ zink_bind_vertex_buffers(VkCommandBuffer cmdbuf, struct zink_context *ctx) } static void +begin_render_pass(struct zink_cmdbuf *cmdbuf, struct zink_render_pass *rp, + struct zink_framebuffer *fb, unsigned width, unsigned height) +{ + VkRenderPassBeginInfo rpbi = {}; + rpbi.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; + rpbi.renderPass = rp->render_pass; + rpbi.renderArea.offset.x = 0; + rpbi.renderArea.offset.y = 0; + rpbi.renderArea.extent.width = width; + rpbi.renderArea.extent.height = height; + rpbi.clearValueCount = 0; + rpbi.pClearValues = NULL; + rpbi.framebuffer = fb->fb; + + vkCmdBeginRenderPass(cmdbuf->cmdbuf, &rpbi, VK_SUBPASS_CONTENTS_INLINE); +} + +static void zink_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *dinfo) { @@ -813,18 +831,8 @@ zink_draw_vbo(struct pipe_context *pctx, if (!cmdbuf) return; - VkRenderPassBeginInfo rpbi = {}; - rpbi.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; - rpbi.renderPass = ctx->render_pass->render_pass; - rpbi.renderArea.offset.x = 0; - rpbi.renderArea.offset.y = 0; - rpbi.renderArea.extent.width = ctx->fb_state.width; - rpbi.renderArea.extent.height = ctx->fb_state.height; - rpbi.clearValueCount = 0; - rpbi.pClearValues = NULL; - rpbi.framebuffer = ctx->framebuffer->fb; - - vkCmdBeginRenderPass(cmdbuf->cmdbuf, &rpbi, VK_SUBPASS_CONTENTS_INLINE); + begin_render_pass(cmdbuf, ctx->render_pass, ctx->framebuffer, + ctx->fb_state.width, ctx->fb_state.height); vkCmdSetViewport(cmdbuf->cmdbuf, 0, ctx->num_viewports, ctx->viewports); |