summaryrefslogtreecommitdiff
path: root/modules/glslang
diff options
context:
space:
mode:
Diffstat (limited to 'modules/glslang')
-rw-r--r--modules/glslang/register_types.cpp13
-rw-r--r--modules/glslang/register_types.h7
2 files changed, 13 insertions, 7 deletions
diff --git a/modules/glslang/register_types.cpp b/modules/glslang/register_types.cpp
index 8e69ba78c7..64891d9ee8 100644
--- a/modules/glslang/register_types.cpp
+++ b/modules/glslang/register_types.cpp
@@ -190,7 +190,11 @@ static String _get_cache_key_function_glsl(const RenderingDevice::Capabilities *
return version;
}
-void preregister_glslang_types() {
+void initialize_glslang_module(ModuleInitializationLevel p_level) {
+ if (p_level != MODULE_INITIALIZATION_LEVEL_CORE) {
+ return;
+ }
+
// Initialize in case it's not initialized. This is done once per thread
// and it's safe to call multiple times.
glslang::InitializeProcess();
@@ -198,9 +202,10 @@ void preregister_glslang_types() {
RenderingDevice::shader_set_get_cache_key_function(_get_cache_key_function_glsl);
}
-void register_glslang_types() {
-}
+void uninitialize_glslang_module(ModuleInitializationLevel p_level) {
+ if (p_level != MODULE_INITIALIZATION_LEVEL_CORE) {
+ return;
+ }
-void unregister_glslang_types() {
glslang::FinalizeProcess();
}
diff --git a/modules/glslang/register_types.h b/modules/glslang/register_types.h
index 9d8dc9dc2a..d9611cc02f 100644
--- a/modules/glslang/register_types.h
+++ b/modules/glslang/register_types.h
@@ -33,8 +33,9 @@
#define MODULE_GLSLANG_HAS_PREREGISTER
-void preregister_glslang_types();
-void register_glslang_types();
-void unregister_glslang_types();
+#include "modules/register_module_types.h"
+
+void initialize_glslang_module(ModuleInitializationLevel p_level);
+void uninitialize_glslang_module(ModuleInitializationLevel p_level);
#endif // GLSLANG_REGISTER_TYPES_H