diff --git a/ext/native/thin3d/thin3d.cpp b/ext/native/thin3d/thin3d.cpp index d72e72f9a9..ccc4c216c1 100644 --- a/ext/native/thin3d/thin3d.cpp +++ b/ext/native/thin3d/thin3d.cpp @@ -192,6 +192,11 @@ Thin3DContext::~Thin3DContext() { ssPresets_[i]->Release(); } } + for (int i = 0; i < SAMPS_MAX_PRESET; i++) { + if (sampsPresets_[i]) { + sampsPresets_[i]->Release(); + } + } } static T3DImageFormat ZimToT3DFormat(int zim) { diff --git a/ext/native/thin3d/thin3d_vulkan.cpp b/ext/native/thin3d/thin3d_vulkan.cpp index 95d863c63c..8180f42c76 100644 --- a/ext/native/thin3d/thin3d_vulkan.cpp +++ b/ext/native/thin3d/thin3d_vulkan.cpp @@ -194,10 +194,12 @@ public: bool Compile(VulkanContext *vulkan, const char *source); const std::string &GetSource() const { return source_; } ~Thin3DVKShader() { + vkDestroyShaderModule(device_, module_, nullptr); } VkShaderModule Get() const { return module_; } private: + VkDevice device_; VkShaderModule module_; VkShaderStageFlagBits stage_; bool ok_; @@ -205,6 +207,8 @@ private: }; bool Thin3DVKShader::Compile(VulkanContext *vulkan, const char *source) { + // We'll need this to free it later. + device_ = vulkan->GetDevice(); this->source_ = source; std::vector spirv; if (!GLSLtoSPV(stage_, source, spirv)) {