diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-19 09:57:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-19 09:57:46 +0200 |
commit | 039abbb64aef692495c09c03db25aa84f3375eb6 (patch) | |
tree | 871aa6f067d97168003ca44e33dd4f809716934c /servers | |
parent | 9690a60c21a89f504cc92b299a7590dedd75b2c9 (diff) | |
parent | 49d0c6a5c9726e6575acfc29c08f57362a1bbf10 (diff) |
Merge pull request #37997 from reduz/local-rendering-devices
Ability to create local RenderingDevice instances.
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering/rendering_device.cpp | 4 | ||||
-rw-r--r-- | servers/rendering/rendering_device.h | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index a3799b0e4d..75ef38354a 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -60,5 +60,7 @@ Vector<uint8_t> RenderingDevice::shader_compile_from_source(ShaderStage p_stage, } RenderingDevice::RenderingDevice() { - singleton = this; + if (singleton == nullptr) { // there may be more rendering devices later + singleton = this; + } } diff --git a/servers/rendering/rendering_device.h b/servers/rendering/rendering_device.h index 97fe417def..6c58b8fd57 100644 --- a/servers/rendering/rendering_device.h +++ b/servers/rendering/rendering_device.h @@ -1024,6 +1024,11 @@ public: virtual uint32_t get_frame_delay() const = 0; + virtual void submit() = 0; + virtual void sync() = 0; + + virtual RenderingDevice *create_local_device() = 0; + static RenderingDevice *get_singleton(); RenderingDevice(); }; |