1
0
Fork 0

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:
Thaddeus Crews 2025-03-05 12:07:36 -06:00
commit a56e918292
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84
1 changed files with 8 additions and 10 deletions

View File

@ -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.