Skip to content

Commit

Permalink
working on subpass dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Kbz-8 committed Dec 4, 2024
1 parent fc74873 commit 841d140
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CXXPCHFLAGS = -xc++-header
PCH = runtime/Includes/PreCompiled.h
GCH =

NZSLC = nzslc
NZRRC = nzslc

ifeq ($(TOOLCHAIN), gcc)
CXX = g++
Expand Down
3 changes: 0 additions & 3 deletions runtime/Sources/Renderer/Descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,7 @@ namespace mlx
return set == rhs_set;
});
if(it == m_used_sets.end())
{
Error("Vulkan: cannot return descriptor set to pool, invalid pool");
return;
}
m_used_sets.erase(it);
m_free_sets.push_back(set);
}
Expand Down
28 changes: 9 additions & 19 deletions runtime/Sources/Renderer/Pipelines/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,27 +178,17 @@ namespace mlx
{
attachments.push_back(kvfBuildAttachmentDescription(KVF_IMAGE_COLOR, image->GetFormat(), image->GetLayout(), image->GetLayout(), clear_attachments, VK_SAMPLE_COUNT_1_BIT));
attachment_views.push_back(image->GetImageView());
#if 0
VkSubpassDependency& first_dependency = dependencies.emplace_back();
first_dependency.srcSubpass = VK_SUBPASS_EXTERNAL;
first_dependency.dstSubpass = 0;
first_dependency.srcStageMask = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
first_dependency.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
first_dependency.srcAccessMask = VK_ACCESS_SHADER_READ_BIT;
first_dependency.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
first_dependency.dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;

VkSubpassDependency& second_dependency = dependencies.emplace_back();
second_dependency.srcSubpass = 0;
second_dependency.dstSubpass = VK_SUBPASS_EXTERNAL;
second_dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
second_dependency.dstStageMask = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
second_dependency.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
second_dependency.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
second_dependency.dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;
#endif
}

VkSubpassDependency& dependency = dependencies.emplace_back();
dependency.srcSubpass = VK_SUBPASS_EXTERNAL;
dependency.dstSubpass = 0;
dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
dependency.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
dependency.srcAccessMask = 0;
dependency.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
dependency.dependencyFlags = 0;

m_renderpass = kvfCreateRenderPassWithSubpassDependencies(RenderCore::Get().GetDevice(), attachments.data(), attachments.size(), GetPipelineBindPoint(), dependencies.data(), dependencies.size());
m_clears.clear();
m_clears.resize(attachments.size());
Expand Down

0 comments on commit 841d140

Please sign in to comment.