mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 11:32:13 +00:00
Merge pull request #98391 from RandomShaper/rd_thread_switch
Some checks are pending
🔗 GHA / 📊 Static checks (push) Waiting to run
🔗 GHA / 🤖 Android (push) Blocked by required conditions
🔗 GHA / 🍏 iOS (push) Blocked by required conditions
🔗 GHA / 🐧 Linux (push) Blocked by required conditions
🔗 GHA / 🍎 macOS (push) Blocked by required conditions
🔗 GHA / 🏁 Windows (push) Blocked by required conditions
🔗 GHA / 🌐 Web (push) Blocked by required conditions
🔗 GHA / 🪲 Godot CPP (push) Blocked by required conditions
Some checks are pending
🔗 GHA / 📊 Static checks (push) Waiting to run
🔗 GHA / 🤖 Android (push) Blocked by required conditions
🔗 GHA / 🍏 iOS (push) Blocked by required conditions
🔗 GHA / 🐧 Linux (push) Blocked by required conditions
🔗 GHA / 🍎 macOS (push) Blocked by required conditions
🔗 GHA / 🏁 Windows (push) Blocked by required conditions
🔗 GHA / 🌐 Web (push) Blocked by required conditions
🔗 GHA / 🪲 Godot CPP (push) Blocked by required conditions
Implement thread ownership change for RenderingDevice
This commit is contained in:
commit
533c616cb8
@ -7260,6 +7260,10 @@ void RenderingDevice::_bind_methods() {
|
||||
BIND_ENUM_CONSTANT(DEBUG_PASS);
|
||||
}
|
||||
|
||||
void RenderingDevice::make_current() {
|
||||
render_thread_id = Thread::get_caller_id();
|
||||
}
|
||||
|
||||
RenderingDevice::~RenderingDevice() {
|
||||
finalize();
|
||||
|
||||
|
@ -1496,6 +1496,8 @@ public:
|
||||
|
||||
static RenderingDevice *get_singleton();
|
||||
|
||||
void make_current();
|
||||
|
||||
RenderingDevice();
|
||||
~RenderingDevice();
|
||||
|
||||
|
@ -370,6 +370,8 @@ Size2i RenderingServerDefault::get_maximum_viewport_size() const {
|
||||
void RenderingServerDefault::_assign_mt_ids(WorkerThreadPool::TaskID p_pump_task_id) {
|
||||
server_thread = Thread::get_caller_id();
|
||||
server_task_id = p_pump_task_id;
|
||||
// This is needed because the main RD is created on the main thread.
|
||||
RenderingDevice::get_singleton()->make_current();
|
||||
}
|
||||
|
||||
void RenderingServerDefault::_thread_exit() {
|
||||
|
Loading…
Reference in New Issue
Block a user