hotfix: descriptor set lifetime fix

This commit is contained in:
IndecisiveTurtle 2024-09-27 02:56:27 +03:00
parent 50fc5e339d
commit cf342e7a4b
2 changed files with 6 additions and 3 deletions

View file

@ -295,10 +295,12 @@ TileManager::TileManager(const Vulkan::Instance& instance, Vulkan::Scheduler& sc
.bindingCount = static_cast<u32>(bindings.size()),
.pBindings = bindings.data(),
};
auto [desc_layout_result, desc_layout] =
auto desc_layout_result =
instance.GetDevice().createDescriptorSetLayoutUnique(desc_layout_ci);
ASSERT_MSG(desc_layout_result == vk::Result::eSuccess,
"Failed to create descriptor set layout: {}", vk::to_string(desc_layout_result));
ASSERT_MSG(desc_layout_result.result == vk::Result::eSuccess,
"Failed to create descriptor set layout: {}",
vk::to_string(desc_layout_result.result));
desc_layout = std::move(desc_layout_result.value);
const vk::PushConstantRange push_constants = {
.stageFlags = vk::ShaderStageFlagBits::eCompute,

View file

@ -51,6 +51,7 @@ private:
private:
const Vulkan::Instance& instance;
Vulkan::Scheduler& scheduler;
vk::UniqueDescriptorSetLayout desc_layout;
std::array<DetilerContext, DetilerType::Max> detilers;
};