Skip to content

Commit

Permalink
[RHI]Fix render pass object state mismatch with read-only depth stenc…
Browse files Browse the repository at this point in the history
…il attachment.

[Studio]Fix program crash.
  • Loading branch information
JX-Master committed Oct 24, 2024
1 parent 1ae6e7e commit 4cb3a05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Modules/Luna/RHI/Source/Vulkan/RenderPassPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,14 @@ namespace Luna
dst.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
}
depth_stencil_attachment_ref.attachment = attachment_index;
depth_stencil_attachment_ref.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
if (key.depth_stencil_read_only)
{
depth_stencil_attachment_ref.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL;
}
else
{
depth_stencil_attachment_ref.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
}
++attachment_index;
}
VkSubpassDescription subpass{};
Expand Down
3 changes: 2 additions & 1 deletion Programs/Studio/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ namespace Luna
module_asset(),
module_obj_loader(),
module_rg(),
module_job_system()}));
module_job_system(),
module_shader_compiler()}));
auto r = init_modules();
if (failed(r))
{
Expand Down

0 comments on commit 4cb3a05

Please sign in to comment.