summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-04-19 09:57:46 +0200
committerGitHub <noreply@github.com>2020-04-19 09:57:46 +0200
commit039abbb64aef692495c09c03db25aa84f3375eb6 (patch)
tree871aa6f067d97168003ca44e33dd4f809716934c /servers
parent9690a60c21a89f504cc92b299a7590dedd75b2c9 (diff)
parent49d0c6a5c9726e6575acfc29c08f57362a1bbf10 (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.cpp4
-rw-r--r--servers/rendering/rendering_device.h5
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();
};