Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/include/graphics/vulkan/ComputePipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class ComputePipeline : public IPipeline {
void init(VkDevice device) override;
void bind(VkCommandBuffer cmd) override;
void destroy() override;

~ComputePipeline() override {
ComputePipeline::destroy();
}
VkPipeline getPipeline() const override { return _pipeline; }
VkPipelineLayout getLayout() const override { return _pipelineLayout; }

Expand Down
9 changes: 9 additions & 0 deletions src/include/graphics/vulkan/vk_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ enum class MaterialPass : uint8_t { MainColor, Transparent, Other };
struct MaterialPipeline {
VkPipeline pipeline;
VkPipelineLayout layout;
VkDevice _device = VK_NULL_HANDLE;
~MaterialPipeline() {
if (_device != VK_NULL_HANDLE) {
vkDestroyPipelineLayout(_device, layout, nullptr);
vkDestroyPipeline(_device, pipeline, nullptr);
pipeline = VK_NULL_HANDLE;
layout = VK_NULL_HANDLE;
}
}
};

struct MaterialInstance {
Expand Down
Loading