DrawContext destructor: Need to call DestroyPresets earlier.

This commit is contained in:
Henrik Rydgård 2022-12-29 17:32:49 +01:00
parent bd2a0c99bb
commit d83f84fdfd
5 changed files with 8 additions and 1 deletions

View File

@ -341,6 +341,8 @@ D3D11DrawContext::D3D11DrawContext(ID3D11Device *device, ID3D11DeviceContext *de
}
D3D11DrawContext::~D3D11DrawContext() {
DestroyPresets();
upBuffer_->Release();
packTexture_->Release();

View File

@ -815,6 +815,7 @@ D3D9Context::D3D9Context(IDirect3D9 *d3d, IDirect3D9Ex *d3dEx, int adapterId, ID
}
D3D9Context::~D3D9Context() {
DestroyPresets();
}
ShaderModule *D3D9Context::CreateShaderModule(ShaderStage stage, ShaderLanguage language, const uint8_t *data, size_t size, const char *tag) {

View File

@ -764,6 +764,8 @@ OpenGLContext::OpenGLContext() {
}
OpenGLContext::~OpenGLContext() {
DestroyPresets();
for (int i = 0; i < GLRenderManager::MAX_INFLIGHT_FRAMES; i++) {
renderManager_.DeletePushBuffer(frameData_[i].push);
}

View File

@ -1004,6 +1004,8 @@ VKContext::VKContext(VulkanContext *vulkan)
}
VKContext::~VKContext() {
DestroyPresets();
delete nullTexture_;
// This also destroys all descriptor sets.
for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) {

View File

@ -523,7 +523,7 @@ void DrawContext::DestroyPresets() {
}
DrawContext::~DrawContext() {
DestroyPresets();
// TODO: Can't call DestroyPresets here, too late.
}
void ConvertFromRGBA8888(uint8_t *dst, const uint8_t *src, uint32_t dstStride, uint32_t srcStride, uint32_t width, uint32_t height, DataFormat format) {