Skip to content

Commit

Permalink
[Vulkan] Clean up render-pass-references
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Jan 30, 2022
1 parent 7af51b7 commit 1b9508b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,6 @@ bool kinc_g5_swap_buffers() {

void kinc_g5_begin(kinc_g5_render_target_t *renderTarget, int window) {
if (renderTarget != NULL) {
renderTarget->impl.renderPass = framebuffer_render_pass;
renderTarget->impl.framebuffer = framebuffers[current_buffer];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ void kinc_g5_command_list_set_render_targets(kinc_g5_command_list_t *list, struc
rp_begin.pClearValues = clear_values;

if (count == 1) {
rp_begin.renderPass = targets[0]->impl.renderPass;
rp_begin.renderPass = rendertarget_render_pass;
rp_begin.framebuffer = targets[0]->impl.framebuffer;
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@ void kinc_g5_render_target_init(kinc_g5_render_target_t *target, int width, int
assert(!err);
}

target->impl.renderPass = rendertarget_render_pass;

VkImageView attachments[2];
attachments[0] = target->impl.sourceView;

Expand All @@ -265,7 +263,7 @@ void kinc_g5_render_target_init(kinc_g5_render_target_t *target, int width, int
VkFramebufferCreateInfo fbufCreateInfo = {0};
fbufCreateInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
fbufCreateInfo.pNext = NULL;
fbufCreateInfo.renderPass = target->impl.renderPass;
fbufCreateInfo.renderPass = contextId >= 0 ? rendertarget_render_pass : framebuffer_render_pass;
fbufCreateInfo.attachmentCount = depthBufferBits > 0 ? 2 : 1;
fbufCreateInfo.pAttachments = attachments;
fbufCreateInfo.width = width;
Expand Down Expand Up @@ -377,8 +375,9 @@ void kinc_g5_render_target_set_depth_stencil_from(kinc_g5_render_target_t *targe
rp_info.dependencyCount = 2;
rp_info.pDependencies = dependencies;

VkResult err = vkCreateRenderPass(device, &rp_info, NULL, &target->impl.renderPass);
assert(!err);
// TODO
// VkResult err = vkCreateRenderPass(device, &rp_info, NULL, &target->impl.renderPass);
// assert(!err);
}

{
Expand All @@ -392,7 +391,7 @@ void kinc_g5_render_target_set_depth_stencil_from(kinc_g5_render_target_t *targe
VkFramebufferCreateInfo fbufCreateInfo = {0};
fbufCreateInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
fbufCreateInfo.pNext = NULL;
fbufCreateInfo.renderPass = target->impl.renderPass;
fbufCreateInfo.renderPass = VK_NULL_HANDLE; // target->impl.renderPass; // TODO
fbufCreateInfo.attachmentCount = target->impl.depthBufferBits > 0 ? 2 : 1;
fbufCreateInfo.pAttachments = attachments;
fbufCreateInfo.width = target->width;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ typedef struct {

VkFramebuffer framebuffer;
VkSampler sampler;
VkRenderPass renderPass;

VkFormat format;

Expand Down

0 comments on commit 1b9508b

Please sign in to comment.