[vulkan] Destroy pipeline on shutdown

This commit is contained in:
Bill Currie 2021-01-05 23:54:22 +09:00
parent 5eb1afdcb3
commit 3b06ca01af
3 changed files with 15 additions and 0 deletions

View file

@ -150,5 +150,7 @@ qfv_pipelineset_t *
QFV_CreateComputePipelines (struct qfv_device_s *device,
VkPipelineCache cache,
qfv_computepipelinecreateinfoset_t *cpciSet);
void
QFV_DestroyPipeline (struct qfv_device_s *device, VkPipeline pipeline);
#endif//__QF_Vulkan_pipeline_h

View file

@ -153,3 +153,12 @@ QFV_CreateComputePipelines (qfv_device_t *device,
pipelines->a);
return pipelines;
}
void
QFV_DestroyPipeline (qfv_device_t *device, VkPipeline pipeline)
{
VkDevice dev = device->dev;
qfv_devfuncs_t *dfunc = device->funcs;
dfunc->vkDestroyPipeline (dev, pipeline, 0);
}

View file

@ -58,6 +58,7 @@
#include "QF/Vulkan/command.h"
#include "QF/Vulkan/instance.h"
#include "QF/Vulkan/image.h"
#include "QF/Vulkan/pipeline.h"
#include "QF/Vulkan/renderpass.h"
#include "QF/Vulkan/shader.h"
#include "QF/Vulkan/swapchain.h"
@ -158,6 +159,9 @@ clear_table (hashtab_t **table)
void
Vulkan_Shutdown_Common (vulkan_ctx_t *ctx)
{
if (ctx->pipeline) {
QFV_DestroyPipeline (ctx->device, ctx->pipeline);
}
if (ctx->framebuffers.size) {
Vulkan_DestroyFramebuffers (ctx);
}