Fix some shader issues
This commit is contained in:
@@ -17,14 +17,7 @@ namespace OpenVulkano::Vulkan
|
||||
VulkanShader::~VulkanShader()
|
||||
{
|
||||
if (!shader) return;
|
||||
device.destroyPipeline(pipeline);
|
||||
for(auto& shaderModule : shaderModules)
|
||||
{
|
||||
device.destroyShaderModule(shaderModule);
|
||||
}
|
||||
device.destroyPipelineLayout(pipelineLayout);
|
||||
for(auto& descriptorSetLayout : descriptorSetLayouts)
|
||||
device.destroyDescriptorSetLayout(descriptorSetLayout);
|
||||
Close();
|
||||
}
|
||||
|
||||
void VulkanShader::Init(Context* context, Scene::Shader* shader, IShaderOwner* owner)
|
||||
@@ -124,7 +117,17 @@ namespace OpenVulkano::Vulkan
|
||||
|
||||
void VulkanShader::Close()
|
||||
{
|
||||
owner->RemoveShader(this);
|
||||
shader->renderShader = nullptr;
|
||||
device.destroyPipeline(pipeline);
|
||||
for(auto& shaderModule : shaderModules)
|
||||
{
|
||||
device.destroyShaderModule(shaderModule);
|
||||
}
|
||||
device.destroyPipelineLayout(pipelineLayout);
|
||||
for(auto& descriptorSetLayout : descriptorSetLayouts)
|
||||
device.destroyDescriptorSetLayout(descriptorSetLayout);
|
||||
shader = nullptr;
|
||||
if (owner) owner->RemoveShader(this);
|
||||
}
|
||||
|
||||
void VulkanShader::CreatePipelineLayout()
|
||||
@@ -150,4 +153,4 @@ namespace OpenVulkano::Vulkan
|
||||
vk::PipelineLayoutCreateInfo plci = { {}, static_cast<uint32_t>(descriptorSetLayouts.size()), descriptorSetLayouts.data(), 0, nullptr };
|
||||
pipelineLayout = this->device.createPipelineLayout(plci);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user