Cleanup shader handling
This commit is contained in:
@@ -11,6 +11,16 @@
|
||||
|
||||
namespace openVulkanoCpp::Vulkan
|
||||
{
|
||||
VulkanShader::~VulkanShader()
|
||||
{
|
||||
if (!shader) return;
|
||||
device.destroyPipeline(pipeline);
|
||||
for(auto& shaderModule : shaderModules)
|
||||
{
|
||||
device.destroyShaderModule(shaderModule);
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanShader::Init(Context* context, Scene::Shader* shader, IShaderOwner* owner)
|
||||
{
|
||||
this->device = context->device->device;
|
||||
@@ -108,11 +118,5 @@ namespace openVulkanoCpp::Vulkan
|
||||
void VulkanShader::Close()
|
||||
{
|
||||
owner->RemoveShader(this);
|
||||
shader = nullptr;
|
||||
device.destroyPipeline(pipeline);
|
||||
for(auto& shaderModule : shaderModules)
|
||||
{
|
||||
device.destroyShaderModule(shaderModule);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user