From ff6fcc91793c0719ae8aef94967b87da38eb4907 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 7 May 2017 10:53:04 +0200 Subject: [PATCH] More vulkan fixes --- GPU/Vulkan/GPU_Vulkan.cpp | 1 + Windows/GPU/WindowsVulkanContext.cpp | 2 ++ ext/native/thin3d/thin3d_vulkan.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 2eb32460ad..b9d71f8104 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -159,6 +159,7 @@ GPU_Vulkan::GPU_Vulkan(GraphicsContext *gfxCtx, Draw::DrawContext *draw) GPU_Vulkan::~GPU_Vulkan() { framebufferManagerVulkan_->DestroyAllFBOs(); depalShaderCache_.Clear(); + delete textureCacheVulkan_; delete pipelineManager_; delete shaderManagerVulkan_; } diff --git a/Windows/GPU/WindowsVulkanContext.cpp b/Windows/GPU/WindowsVulkanContext.cpp index 71e6de3f58..143d4f264d 100644 --- a/Windows/GPU/WindowsVulkanContext.cpp +++ b/Windows/GPU/WindowsVulkanContext.cpp @@ -138,6 +138,8 @@ static VkBool32 VKAPI_CALL Vulkan_Dbg(VkDebugReportFlagsEXT msgFlags, VkDebugRep return false; if (msgCode == 11) return false; + if (msgCode == 63 && startsWith(pMsg, "vkCmdClearAttachments() issued on command buffer ")) + return false; #ifdef _WIN32 std::string msg = message.str(); diff --git a/ext/native/thin3d/thin3d_vulkan.cpp b/ext/native/thin3d/thin3d_vulkan.cpp index 9522411135..033780e8e5 100644 --- a/ext/native/thin3d/thin3d_vulkan.cpp +++ b/ext/native/thin3d/thin3d_vulkan.cpp @@ -262,11 +262,12 @@ public: class VKPipeline : public Pipeline { public: - VKPipeline(size_t size) { + VKPipeline(VulkanContext *vulkan, size_t size) : vulkan_(vulkan) { uboSize_ = (int)size; ubo_ = new uint8_t[uboSize_]; } ~VKPipeline() { + vulkan_->Delete().QueueDeletePipeline(vkpipeline); delete[] ubo_; } @@ -292,6 +293,7 @@ public: int dynamicUniformSize = 0; private: + VulkanContext *vulkan_; uint8_t *ubo_; int uboSize_; }; @@ -831,7 +833,7 @@ VkDescriptorSet VKContext::GetOrCreateDescriptorSet(VkBuffer buf) { } Pipeline *VKContext::CreateGraphicsPipeline(const PipelineDesc &desc) { - VKPipeline *pipeline = new VKPipeline(desc.uniformDesc ? desc.uniformDesc->uniformBufferSize : 16 * sizeof(float)); + VKPipeline *pipeline = new VKPipeline(vulkan_, desc.uniformDesc ? desc.uniformDesc->uniformBufferSize : 16 * sizeof(float)); VKInputLayout *input = (VKInputLayout *)desc.inputLayout; VKBlendState *blend = (VKBlendState *)desc.blend; VKDepthStencilState *depth = (VKDepthStencilState *)desc.depthStencil;