This commit is contained in:
parent
13ed750f68
commit
a1bdb0005f
2 changed files with 20 additions and 12 deletions
|
@ -40,8 +40,16 @@ Device::~Device()
|
|||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
vkc(vk_device_wait_idle(m_device));
|
||||
vk_destroy_device(m_device, nullptr);
|
||||
}
|
||||
catch (const std::exception &exp)
|
||||
{
|
||||
log_err("Failed to destroy vk device:");
|
||||
log_err("\twhat: {}", exp.what());
|
||||
}
|
||||
}
|
||||
|
||||
void Device::initialize_logical_device()
|
||||
|
|
|
@ -10,7 +10,15 @@ Pass::Pass(
|
|||
const lt::assets::ShaderAsset &vertex_shader,
|
||||
const lt::assets::ShaderAsset &fragment_shader
|
||||
)
|
||||
: m_device(static_cast<Device *>(device))
|
||||
: m_device(static_cast<Device *>(device)), m_layout(m_device->create_pipeline_layout(
|
||||
VkPipelineLayoutCreateInfo {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
|
||||
.setLayoutCount = 0u,
|
||||
.pSetLayouts = nullptr,
|
||||
.pushConstantRangeCount = 0u,
|
||||
.pPushConstantRanges = nullptr,
|
||||
}
|
||||
))
|
||||
{
|
||||
auto *vertex_module = create_module(
|
||||
vertex_shader.unpack(lt::assets::ShaderAsset::BlobTag::code)
|
||||
|
@ -103,15 +111,7 @@ Pass::Pass(
|
|||
.blendConstants = { 0.0f, 0.0, 0.0, 0.0 },
|
||||
};
|
||||
|
||||
m_layout = m_device->create_pipeline_layout(
|
||||
VkPipelineLayoutCreateInfo {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
|
||||
.setLayoutCount = 0u,
|
||||
.pSetLayouts = nullptr,
|
||||
.pushConstantRangeCount = 0u,
|
||||
.pPushConstantRanges = nullptr,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
auto attachment_description = VkAttachmentDescription {
|
||||
.format = static_cast<Swapchain *>(swapchain)->get_format(),
|
||||
|
|
Loading…
Add table
Reference in a new issue