summaryrefslogtreecommitdiff
path: root/servers/visual/rasterizer.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-02-11 16:01:55 +0100
committerGitHub <noreply@github.com>2020-02-11 16:01:55 +0100
commit1eb424ec9549bdd086dfb54c847d107519be73d9 (patch)
treed9a3ec0c72f3a4eda02e16ed883f560e02cf1ccf /servers/visual/rasterizer.cpp
parent3e3f8a47616327d7faeb17f558bb81a943385e82 (diff)
parentdb81928e08cb58d5f67908c6dfcf9433e572ffe8 (diff)
Merge pull request #36098 from godotengine/vulkan
Add initial Vulkan support, master branch goes UNSTABLE
Diffstat (limited to 'servers/visual/rasterizer.cpp')
-rw-r--r--servers/visual/rasterizer.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/servers/visual/rasterizer.cpp b/servers/visual/rasterizer.cpp
index 77c716379a..a3f93a3f8c 100644
--- a/servers/visual/rasterizer.cpp
+++ b/servers/visual/rasterizer.cpp
@@ -35,11 +35,40 @@
Rasterizer *(*Rasterizer::_create_func)() = NULL;
+void RasterizerScene::InstanceDependency::instance_notify_changed(bool p_aabb, bool p_dependencies) {
+ for (Map<InstanceBase *, uint32_t>::Element *E = instances.front(); E; E = E->next()) {
+ E->key()->dependency_changed(p_aabb, p_dependencies);
+ }
+}
+void RasterizerScene::InstanceDependency::instance_notify_deleted(RID p_deleted) {
+ for (Map<InstanceBase *, uint32_t>::Element *E = instances.front(); E; E = E->next()) {
+ E->key()->dependency_deleted(p_deleted);
+ }
+ for (Map<InstanceBase *, uint32_t>::Element *E = instances.front(); E; E = E->next()) {
+ E->key()->dependencies.erase(this);
+ }
+
+ instances.clear();
+}
+
+RasterizerScene::InstanceDependency::~InstanceDependency() {
+#ifdef DEBUG_ENABLED
+ if (instances.size()) {
+ WARN_PRINT("Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.");
+ for (Map<InstanceBase *, uint32_t>::Element *E = instances.front(); E; E = E->next()) {
+ E->key()->dependencies.erase(this);
+ }
+ }
+#endif
+}
+
Rasterizer *Rasterizer::create() {
return _create_func();
}
+RasterizerCanvas *RasterizerCanvas::singleton = NULL;
+
RasterizerStorage *RasterizerStorage::base_singleton = NULL;
RasterizerStorage::RasterizerStorage() {