mirror of https://github.com/godotengine/godot
Merge pull request #103521 from Olle-Lukowski/gpu-finalize-fix
Delete rendering device on the same thread it was created
This commit is contained in:
commit
a56e918292
|
|
@ -259,6 +259,14 @@ void BetsyCompressor::_thread_exit() {
|
|||
compress_rd->free(cached_shaders[i].compiled);
|
||||
}
|
||||
}
|
||||
|
||||
// Free the RD (and RCD if necessary).
|
||||
memdelete(compress_rd);
|
||||
compress_rd = nullptr;
|
||||
if (compress_rcd != nullptr) {
|
||||
memdelete(compress_rcd);
|
||||
compress_rcd = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -268,16 +276,6 @@ void BetsyCompressor::finish() {
|
|||
WorkerThreadPool::get_singleton()->wait_for_task_completion(task_id);
|
||||
task_id = WorkerThreadPool::INVALID_TASK_ID;
|
||||
}
|
||||
|
||||
if (compress_rd != nullptr) {
|
||||
// Free the RD (and RCD if necessary).
|
||||
memdelete(compress_rd);
|
||||
compress_rd = nullptr;
|
||||
if (compress_rcd != nullptr) {
|
||||
memdelete(compress_rcd);
|
||||
compress_rcd = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Helper functions.
|
||||
|
|
|
|||
Loading…
Reference in New Issue