Fix shader Close
This commit is contained in:
@@ -17,8 +17,15 @@ namespace OpenVulkano::Vulkan
|
||||
|
||||
VulkanShader::~VulkanShader()
|
||||
{
|
||||
if (!shader) return;
|
||||
Close();
|
||||
if (shader) Close();
|
||||
device.destroyPipeline(pipeline);
|
||||
for(auto& shaderModule : shaderModules)
|
||||
{
|
||||
device.destroyShaderModule(shaderModule);
|
||||
}
|
||||
device.destroyPipelineLayout(pipelineLayout);
|
||||
for(auto& descriptorSetLayout : descriptorSetLayouts)
|
||||
device.destroyDescriptorSetLayout(descriptorSetLayout);
|
||||
}
|
||||
|
||||
void VulkanShader::Init(Context* context, Scene::Shader* shader, IShaderOwner* owner)
|
||||
@@ -125,16 +132,9 @@ namespace OpenVulkano::Vulkan
|
||||
void VulkanShader::Close()
|
||||
{
|
||||
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);
|
||||
owner = nullptr;
|
||||
}
|
||||
|
||||
void VulkanShader::CreatePipelineLayout()
|
||||
|
||||
Reference in New Issue
Block a user