diff options
Diffstat (limited to 'core/config')
-rw-r--r-- | core/config/engine.cpp | 36 | ||||
-rw-r--r-- | core/config/engine.h | 2 |
2 files changed, 38 insertions, 0 deletions
diff --git a/core/config/engine.cpp b/core/config/engine.cpp index 1a6093869f..e1da9eb44e 100644 --- a/core/config/engine.cpp +++ b/core/config/engine.cpp @@ -181,6 +181,42 @@ String Engine::get_license_text() const { return String(GODOT_LICENSE_TEXT); } +String Engine::get_architecture_name() const { +#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) + return "x86_64"; + +#elif defined(__i386) || defined(__i386__) || defined(_M_IX86) + return "x86_32"; + +#elif defined(__aarch64__) || defined(_M_ARM64) + return "arm64"; + +#elif defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7S__) + return "armv7"; + +#elif defined(__riscv) +#if __riscv_xlen == 8 + return "rv64"; +#else + return "riscv"; +#endif + +#elif defined(__powerpc__) +#if defined(__powerpc64__) + return "ppc64"; +#else + return "ppc"; +#endif + +#elif defined(__wasm__) +#if defined(__wasm64__) + return "wasm64"; +#elif defined(__wasm32__) + return "wasm32"; +#endif +#endif +} + bool Engine::is_abort_on_gpu_errors_enabled() const { return abort_on_gpu_errors; } diff --git a/core/config/engine.h b/core/config/engine.h index 68562643e7..649be23717 100644 --- a/core/config/engine.h +++ b/core/config/engine.h @@ -142,6 +142,8 @@ public: void set_write_movie_path(const String &p_path); String get_write_movie_path() const; + String get_architecture_name() const; + void set_shader_cache_path(const String &p_path); String get_shader_cache_path() const; |