mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-04 16:06:13 +00:00
Fix an assortment of minor resource leaks, make vulkan validator happier.
This commit is contained in:
parent
727058fc27
commit
861a30a6cd
@ -211,6 +211,7 @@ DrawEngineVulkan::~DrawEngineVulkan() {
|
||||
}
|
||||
delete[] uvScale;
|
||||
vkDestroyPipelineLayout(vulkan_->GetDevice(), pipelineLayout_, nullptr);
|
||||
vkDestroyDescriptorSetLayout(vulkan_->GetDevice(), descriptorSetLayout_, nullptr);
|
||||
}
|
||||
|
||||
void DrawEngineVulkan::BeginFrame() {
|
||||
|
@ -193,6 +193,8 @@ FramebufferManagerVulkan::FramebufferManagerVulkan(VulkanContext *vulkan) :
|
||||
}
|
||||
|
||||
FramebufferManagerVulkan::~FramebufferManagerVulkan() {
|
||||
delete[] convBuf_;
|
||||
|
||||
vulkan_->Delete().QueueDeleteRenderPass(rpLoadColorLoadDepth_);
|
||||
vulkan_->Delete().QueueDeleteRenderPass(rpClearColorLoadDepth_);
|
||||
vulkan_->Delete().QueueDeleteRenderPass(rpClearColorClearDepth_);
|
||||
|
@ -20,7 +20,8 @@ void PipelineManagerVulkan::Clear() {
|
||||
// This should kill off all the shaders at once.
|
||||
// This could also be an opportunity to store the whole cache to disk. Will need to also
|
||||
// store the keys.
|
||||
for (auto iter : pipelines_) {
|
||||
for (auto &iter : pipelines_) {
|
||||
vulkan_->Delete().QueueDeletePipeline(iter.second->pipeline);
|
||||
delete iter.second;
|
||||
}
|
||||
pipelines_.clear();
|
||||
@ -98,6 +99,10 @@ static int SetupVertexAttribsPretransformed(VkVertexInputAttributeDescription at
|
||||
return count;
|
||||
}
|
||||
|
||||
static bool UsesBlendConstant(int factor) {
|
||||
return factor == VK_BLEND_FACTOR_CONSTANT_ALPHA || factor == VK_BLEND_FACTOR_CONSTANT_COLOR;
|
||||
}
|
||||
|
||||
static VulkanPipeline *CreateVulkanPipeline(VkDevice device, VkPipelineCache pipelineCache,
|
||||
VkPipelineLayout layout, VkRenderPass renderPass, const VulkanPipelineRasterStateKey &key,
|
||||
const VertexDecoder *vtxDec, VulkanVertexShader *vs, VulkanFragmentShader *fs, bool useHwTransform) {
|
||||
@ -142,7 +147,8 @@ static VulkanPipeline *CreateVulkanPipeline(VkDevice device, VkPipelineCache pip
|
||||
|
||||
VkDynamicState dynamicStates[8];
|
||||
int numDyn = 0;
|
||||
if (key.blendEnable) {
|
||||
if (key.blendEnable &&
|
||||
(UsesBlendConstant(key.srcAlpha) || UsesBlendConstant(key.srcColor) || UsesBlendConstant(key.destAlpha) || UsesBlendConstant(key.destColor))) {
|
||||
dynamicStates[numDyn++] = VK_DYNAMIC_STATE_BLEND_CONSTANTS;
|
||||
}
|
||||
dynamicStates[numDyn++] = VK_DYNAMIC_STATE_SCISSOR;
|
||||
|
@ -150,6 +150,7 @@ TextureCacheVulkan::TextureCacheVulkan(VulkanContext *vulkan)
|
||||
TextureCacheVulkan::~TextureCacheVulkan() {
|
||||
Clear(true);
|
||||
allocator_->Destroy();
|
||||
delete allocator_;
|
||||
}
|
||||
|
||||
void TextureCacheVulkan::DownloadFramebufferForClut(u32 clutAddr, u32 bytes) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user