#include "zink_context.h"
#include "zink_fence.h"
+#include "zink_framebuffer.h"
+#include "zink_render_pass.h"
#include "zink_screen.h"
#include "util/u_debug.h"
zink_fence_finish(screen, cmdbuf->fence, PIPE_TIMEOUT_INFINITE);
zink_fence_reference(screen, &cmdbuf->fence, NULL);
+
+ zink_render_pass_reference(screen, &cmdbuf->rp, NULL);
+ zink_framebuffer_reference(screen, &cmdbuf->fb, NULL);
}
struct zink_cmdbuf *
struct zink_context;
struct zink_fence;
+struct zink_framebuffer;
+struct zink_render_pass;
struct zink_cmdbuf {
VkCommandBuffer cmdbuf;
struct zink_fence *fence;
+
+ struct zink_render_pass *rp;
+ struct zink_framebuffer *fb;
};
struct zink_cmdbuf *
}
static void
-begin_render_pass(struct zink_cmdbuf *cmdbuf, struct zink_render_pass *rp,
- struct zink_framebuffer *fb, unsigned width, unsigned height)
+begin_render_pass(struct zink_screen *screen, 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.pClearValues = NULL;
rpbi.framebuffer = fb->fb;
+ assert(rp && fb);
+ assert(!cmdbuf->rp && !cmdbuf->fb);
+ zink_render_pass_reference(screen, &cmdbuf->rp, rp);
+ zink_framebuffer_reference(screen, &cmdbuf->fb, fb);
+
vkCmdBeginRenderPass(cmdbuf->cmdbuf, &rpbi, VK_SUBPASS_CONTENTS_INLINE);
}
if (!cmdbuf)
return;
- begin_render_pass(cmdbuf, ctx->gfx_pipeline_state.render_pass,
+ begin_render_pass(screen, cmdbuf, ctx->gfx_pipeline_state.render_pass,
ctx->framebuffer,
ctx->fb_state.width, ctx->fb_state.height);