mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
thin3d: Plug leaks in samplers and vk shaders.
This commit is contained in:
parent
2d34c0a8bc
commit
bdc0dac6c5
2 changed files with 9 additions and 0 deletions
|
@ -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) {
|
||||
|
|
|
@ -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<uint32_t> spirv;
|
||||
if (!GLSLtoSPV(stage_, source, spirv)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue