render: fix depth write state before choosing layouts

Co-authored-by: MehmetCambaz <mcambaz18@gmail.com>
This commit is contained in:
nmzik
2026-09-07 07:12:58 +04:00
parent 8bccd325ec
commit 2a54310876
5 changed files with 24 additions and 84 deletions
@@ -26,6 +26,7 @@ struct RenderDepthInfo {
bool depth_meta_clear_enable = false;
float depth_clear_value = 0.0f;
bool depth_test_enable = false;
// Effective draw writes; discovery applies test, target-write and clear controls.
bool depth_write_enable = false;
vk::CompareOp depth_compare_op = vk::CompareOp::eNever;
bool depth_bounds_test_enable = false;
@@ -43,10 +44,6 @@ struct RenderDepthInfo {
[[nodiscard]] vk::ImageAspectFlags AttachmentWriteAspects() const;
};
inline bool depth_attachment_read_only(const RenderDepthInfo& depth) {
return !depth.AttachmentWriteAspects();
}
inline vk::ImageLayout depth_attachment_layout(const RenderDepthInfo& depth) {
const auto available = ImageViewOps::DepthAspectMask(depth.desc.view_info.format);
const auto writes = depth.AttachmentWriteAspects();