diff options
433 files changed, 19211 insertions, 8537 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0911ff98bf..b8082fb136 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -51,12 +51,14 @@ doc_classes/* @godotengine/documentation # Editor /editor/*debugger* @godotengine/debugger +/editor/gui/ @godotengine/usability @godotengine/gui-nodes /editor/icons/ @godotengine/usability /editor/import/ @godotengine/import /editor/plugins/*2d_*.* @godotengine/2d-editor /editor/plugins/*3d_*.* @godotengine/3d-editor /editor/plugins/script_*.* @godotengine/script-editor /editor/plugins/*shader*.* @godotengine/shaders +/editor/themes/ @godotengine/usability @godotengine/gui-nodes /editor/code_editor.* @godotengine/script-editor /editor/*dock*.* @godotengine/docks /editor/*shader*.* @godotengine/shaders diff --git a/.github/workflows/web_builds.yml b/.github/workflows/web_builds.yml index d314991fee..9524b5260b 100644 --- a/.github/workflows/web_builds.yml +++ b/.github/workflows/web_builds.yml @@ -17,7 +17,24 @@ concurrency: jobs: web-template: runs-on: "ubuntu-22.04" - name: Template (target=template_release) + name: ${{ matrix.name }} + strategy: + fail-fast: false + matrix: + include: + - name: Template w/ threads (target=template_release, threads=yes) + cache-name: web-template + target: template_release + sconsflags: threads=yes + tests: false + artifact: true + + - name: Template w/o threads (target=template_release, threads=no) + cache-name: web-nothreads-template + target: template_release + sconsflags: threads=no + tests: false + artifact: true steps: - uses: actions/checkout@v4 @@ -34,6 +51,8 @@ jobs: - name: Setup Godot build cache uses: ./.github/actions/godot-cache + with: + cache-name: ${{ matrix.cache-name }} continue-on-error: true - name: Setup python and scons @@ -42,10 +61,13 @@ jobs: - name: Compilation uses: ./.github/actions/godot-build with: - sconsflags: ${{ env.SCONSFLAGS }} + sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }} platform: web - target: template_release - tests: false + target: ${{ matrix.target }} + tests: ${{ matrix.tests }} - name: Upload artifact uses: ./.github/actions/upload-artifact + if: ${{ matrix.artifact }} + with: + name: ${{ matrix.cache-name }} diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index c549761beb..625aac8c13 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -508,7 +508,6 @@ Comment: Vulkan Headers Copyright: 2014-2023, The Khronos Group Inc. 2014-2023, Valve Corporation 2014-2023, LunarG, Inc. - 2015-2023, Google Inc. License: Apache-2.0 Files: ./thirdparty/vulkan/vk_mem_alloc.h diff --git a/SConstruct b/SConstruct index c7b9d5bc86..6a4dea2c09 100644 --- a/SConstruct +++ b/SConstruct @@ -183,6 +183,7 @@ opts.Add(BoolVariable("separate_debug_symbols", "Extract debugging symbols to a opts.Add(EnumVariable("lto", "Link-time optimization (production builds)", "none", ("none", "auto", "thin", "full"))) opts.Add(BoolVariable("production", "Set defaults to build Godot for use in production", False)) opts.Add(BoolVariable("generate_apk", "Generate an APK/AAB after building Android library by calling Gradle", False)) +opts.Add(BoolVariable("threads", "Enable threading support", True)) # Components opts.Add(BoolVariable("deprecated", "Enable compatibility code for deprecated and removed features", True)) @@ -832,6 +833,10 @@ if selected_platform in platform_list: suffix += ".double" suffix += "." + env["arch"] + + if not env["threads"]: + suffix += ".nothreads" + suffix += env.extra_suffix sys.path.remove(tmppath) @@ -972,6 +977,9 @@ if selected_platform in platform_list: env.Tool("compilation_db") env.Alias("compiledb", env.CompilationDatabase()) + if env["threads"]: + env.Append(CPPDEFINES=["THREADS_ENABLED"]) + Export("env") # Build subdirs, the build order is dependent on link order. diff --git a/core/debugger/remote_debugger.cpp b/core/debugger/remote_debugger.cpp index a817ea871d..d3b0039e72 100644 --- a/core/debugger/remote_debugger.cpp +++ b/core/debugger/remote_debugger.cpp @@ -36,6 +36,7 @@ #include "core/debugger/engine_profiler.h" #include "core/debugger/script_debugger.h" #include "core/input/input.h" +#include "core/io/resource_loader.h" #include "core/object/script_language.h" #include "core/os/os.h" @@ -435,9 +436,7 @@ void RemoteDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) { messages.insert(Thread::get_caller_id(), List<Message>()); } - mutex.lock(); while (is_peer_connected()) { - mutex.unlock(); flush_output(); _poll_messages(); @@ -515,8 +514,9 @@ void RemoteDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) { _send_stack_vars(globals, globals_vals, 2); } else if (command == "reload_scripts") { + script_paths_to_reload = data; + } else if (command == "reload_all_scripts") { reload_all_scripts = true; - } else if (command == "breakpoint") { ERR_FAIL_COND(data.size() < 3); bool set = data[2]; @@ -591,19 +591,36 @@ void RemoteDebugger::poll_events(bool p_is_idle) { } // Reload scripts during idle poll only. - if (p_is_idle && reload_all_scripts) { - for (int i = 0; i < ScriptServer::get_language_count(); i++) { - ScriptServer::get_language(i)->reload_all_scripts(); + if (p_is_idle) { + if (reload_all_scripts) { + for (int i = 0; i < ScriptServer::get_language_count(); i++) { + ScriptServer::get_language(i)->reload_all_scripts(); + } + reload_all_scripts = false; + } else if (!script_paths_to_reload.is_empty()) { + Array scripts_to_reload; + for (int i = 0; i < script_paths_to_reload.size(); ++i) { + String path = script_paths_to_reload[i]; + Error err = OK; + Ref<Script> script = ResourceLoader::load(path, "", ResourceFormatLoader::CACHE_MODE_REUSE, &err); + ERR_CONTINUE_MSG(err != OK, vformat("Could not reload script '%s': %s", path, error_names[err])); + ERR_CONTINUE_MSG(script.is_null(), vformat("Could not reload script '%s': Not a script!", path, error_names[err])); + scripts_to_reload.push_back(script); + } + for (int i = 0; i < ScriptServer::get_language_count(); i++) { + ScriptServer::get_language(i)->reload_scripts(scripts_to_reload, true); + } } - reload_all_scripts = false; + script_paths_to_reload.clear(); } } Error RemoteDebugger::_core_capture(const String &p_cmd, const Array &p_data, bool &r_captured) { r_captured = true; if (p_cmd == "reload_scripts") { + script_paths_to_reload = p_data; + } else if (p_cmd == "reload_all_scripts") { reload_all_scripts = true; - } else if (p_cmd == "breakpoint") { ERR_FAIL_COND_V(p_data.size() < 3, ERR_INVALID_DATA); bool set = p_data[2]; diff --git a/core/debugger/remote_debugger.h b/core/debugger/remote_debugger.h index 7c399178c6..519a90e7cc 100644 --- a/core/debugger/remote_debugger.h +++ b/core/debugger/remote_debugger.h @@ -74,6 +74,7 @@ private: int warn_count = 0; int last_reset = 0; bool reload_all_scripts = false; + Array script_paths_to_reload; // Make handlers and send_message thread safe. Mutex mutex; diff --git a/core/input/input_builders.py b/core/input/input_builders.py index e98e2441e2..94c566493e 100644 --- a/core/input/input_builders.py +++ b/core/input/input_builders.py @@ -45,10 +45,10 @@ def make_default_controller_mappings(target, source, env): platform_mappings[current_platform][guid] = line platform_variables = { - "Linux": "#if LINUXBSD_ENABLED", + "Linux": "#ifdef LINUXBSD_ENABLED", "Windows": "#ifdef WINDOWS_ENABLED", "Mac OS X": "#ifdef MACOS_ENABLED", - "Android": "#if defined(__ANDROID__)", + "Android": "#ifdef ANDROID_ENABLED", "iOS": "#ifdef IOS_ENABLED", "Web": "#ifdef WEB_ENABLED", } diff --git a/core/math/aabb.h b/core/math/aabb.h index 859810df37..cea845bf7c 100644 --- a/core/math/aabb.h +++ b/core/math/aabb.h @@ -200,11 +200,11 @@ inline bool AABB::encloses(const AABB &p_aabb) const { return ( (src_min.x <= dst_min.x) && - (src_max.x > dst_max.x) && + (src_max.x >= dst_max.x) && (src_min.y <= dst_min.y) && - (src_max.y > dst_max.y) && + (src_max.y >= dst_max.y) && (src_min.z <= dst_min.z) && - (src_max.z > dst_max.z)); + (src_max.z >= dst_max.z)); } Vector3 AABB::get_support(const Vector3 &p_normal) const { diff --git a/core/object/script_language.h b/core/object/script_language.h index 66106bf139..bb714d5bc3 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -371,6 +371,7 @@ public: virtual Vector<StackInfo> debug_get_current_stack_info() { return Vector<StackInfo>(); } virtual void reload_all_scripts() = 0; + virtual void reload_scripts(const Array &p_scripts, bool p_soft_reload) = 0; virtual void reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) = 0; /* LOADER FUNCTIONS */ diff --git a/core/object/script_language_extension.h b/core/object/script_language_extension.h index 8b01667519..5b10739486 100644 --- a/core/object/script_language_extension.h +++ b/core/object/script_language_extension.h @@ -562,6 +562,7 @@ public: } EXBIND0(reload_all_scripts) + EXBIND2(reload_scripts, const Array &, bool) EXBIND2(reload_tool_script, const Ref<Script> &, bool) /* LOADER FUNCTIONS */ diff --git a/core/object/worker_thread_pool.cpp b/core/object/worker_thread_pool.cpp index 8e8a2ef06b..e2ab473b01 100644 --- a/core/object/worker_thread_pool.cpp +++ b/core/object/worker_thread_pool.cpp @@ -47,6 +47,7 @@ WorkerThreadPool *WorkerThreadPool::singleton = nullptr; thread_local CommandQueueMT *WorkerThreadPool::flushing_cmd_queue = nullptr; void WorkerThreadPool::_process_task(Task *p_task) { +#ifdef THREADS_ENABLED int pool_thread_index = thread_ids[Thread::get_caller_id()]; ThreadData &curr_thread = threads[pool_thread_index]; Task *prev_task = nullptr; // In case this is recursively called. @@ -69,6 +70,7 @@ void WorkerThreadPool::_process_task(Task *p_task) { curr_thread.current_task = p_task; task_mutex.unlock(); } +#endif if (p_task->group) { // Handling a group @@ -143,6 +145,7 @@ void WorkerThreadPool::_process_task(Task *p_task) { } } +#ifdef THREADS_ENABLED { curr_thread.current_task = prev_task; if (p_task->low_priority) { @@ -159,6 +162,7 @@ void WorkerThreadPool::_process_task(Task *p_task) { } set_current_thread_safe_for_nodes(safe_for_nodes_backup); +#endif } void WorkerThreadPool::_thread_function(void *p_user) { @@ -542,6 +546,7 @@ bool WorkerThreadPool::is_group_task_completed(GroupID p_group) const { } void WorkerThreadPool::wait_for_group_task_completion(GroupID p_group) { +#ifdef THREADS_ENABLED task_mutex.lock(); Group **groupp = groups.getptr(p_group); task_mutex.unlock(); @@ -574,6 +579,7 @@ void WorkerThreadPool::wait_for_group_task_completion(GroupID p_group) { task_mutex.lock(); // This mutex is needed when Physics 2D and/or 3D is selected to run on a separate thread. groups.erase(p_group); task_mutex.unlock(); +#endif } int WorkerThreadPool::get_thread_index() { diff --git a/core/os/condition_variable.h b/core/os/condition_variable.h index 6a49ced31b..2b6b272e18 100644 --- a/core/os/condition_variable.h +++ b/core/os/condition_variable.h @@ -33,6 +33,8 @@ #include "core/os/mutex.h" +#ifdef THREADS_ENABLED + #ifdef MINGW_ENABLED #define MINGW_STDTHREAD_REDUNDANCY_WARNING #include "thirdparty/mingw-std-threads/mingw.condition_variable.h" @@ -66,4 +68,16 @@ public: } }; +#else // No threads. + +class ConditionVariable { +public: + template <class BinaryMutexT> + void wait(const MutexLock<BinaryMutexT> &p_lock) const {} + void notify_one() const {} + void notify_all() const {} +}; + +#endif // THREADS_ENABLED + #endif // CONDITION_VARIABLE_H diff --git a/core/os/mutex.cpp b/core/os/mutex.cpp index 5d4e457c5f..9a8a2a2961 100644 --- a/core/os/mutex.cpp +++ b/core/os/mutex.cpp @@ -40,7 +40,11 @@ void _global_unlock() { _global_mutex.unlock(); } +#ifdef THREADS_ENABLED + template class MutexImpl<THREADING_NAMESPACE::recursive_mutex>; template class MutexImpl<THREADING_NAMESPACE::mutex>; template class MutexLock<MutexImpl<THREADING_NAMESPACE::recursive_mutex>>; template class MutexLock<MutexImpl<THREADING_NAMESPACE::mutex>>; + +#endif diff --git a/core/os/mutex.h b/core/os/mutex.h index 03af48ca7c..69f494d9cd 100644 --- a/core/os/mutex.h +++ b/core/os/mutex.h @@ -43,6 +43,8 @@ #define THREADING_NAMESPACE std #endif +#ifdef THREADS_ENABLED + template <class MutexT> class MutexLock; @@ -125,8 +127,8 @@ class MutexLock { THREADING_NAMESPACE::unique_lock<typename MutexT::StdMutexType> lock; public: - _ALWAYS_INLINE_ explicit MutexLock(const MutexT &p_mutex) : - lock(p_mutex.mutex){}; + explicit MutexLock(const MutexT &p_mutex) : + lock(p_mutex.mutex) {} }; // This specialization is needed so manual locking and MutexLock can be used @@ -155,4 +157,38 @@ extern template class MutexImpl<THREADING_NAMESPACE::mutex>; extern template class MutexLock<MutexImpl<THREADING_NAMESPACE::recursive_mutex>>; extern template class MutexLock<MutexImpl<THREADING_NAMESPACE::mutex>>; +#else // No threads. + +class MutexImpl { + mutable THREADING_NAMESPACE::mutex mutex; + +public: + void lock() const {} + void unlock() const {} + bool try_lock() const { return true; } +}; + +template <int Tag> +class SafeBinaryMutex : public MutexImpl { + static thread_local uint32_t count; +}; + +template <class MutexT> +class MutexLock { +public: + MutexLock(const MutexT &p_mutex) {} +}; + +template <int Tag> +class MutexLock<SafeBinaryMutex<Tag>> { +public: + MutexLock(const SafeBinaryMutex<Tag> &p_mutex) {} + ~MutexLock() {} +}; + +using Mutex = MutexImpl; +using BinaryMutex = MutexImpl; + +#endif // THREADS_ENABLED + #endif // MUTEX_H diff --git a/core/os/os.cpp b/core/os/os.cpp index 26ae286979..d5d9988cc1 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -504,6 +504,12 @@ bool OS::has_feature(const String &p_feature) { } #endif +#ifdef THREADS_ENABLED + if (p_feature == "threads") { + return true; + } +#endif + if (_check_internal_feature_support(p_feature)) { return true; } diff --git a/core/os/semaphore.h b/core/os/semaphore.h index b8ae35b86b..19ef1dedc0 100644 --- a/core/os/semaphore.h +++ b/core/os/semaphore.h @@ -31,6 +31,10 @@ #ifndef SEMAPHORE_H #define SEMAPHORE_H +#include <cstdint> + +#ifdef THREADS_ENABLED + #include "core/error/error_list.h" #include "core/typedefs.h" #ifdef DEBUG_ENABLED @@ -132,4 +136,17 @@ public: #endif }; +#else // No threads. + +class Semaphore { +public: + void post(uint32_t p_count = 1) const {} + void wait() const {} + bool try_wait() const { + return true; + } +}; + +#endif // THREADS_ENABLED + #endif // SEMAPHORE_H diff --git a/core/os/thread.cpp b/core/os/thread.cpp index 2ba90ba42c..afc74364f6 100644 --- a/core/os/thread.cpp +++ b/core/os/thread.cpp @@ -33,19 +33,22 @@ #include "thread.h" +#ifdef THREADS_ENABLED #include "core/object/script_language.h" #include "core/templates/safe_refcount.h" -Thread::PlatformFunctions Thread::platform_functions; - SafeNumeric<uint64_t> Thread::id_counter(1); // The first value after .increment() is 2, hence by default the main thread ID should be 1. thread_local Thread::ID Thread::caller_id = Thread::UNASSIGNED_ID; +#endif + +Thread::PlatformFunctions Thread::platform_functions; void Thread::_set_platform_functions(const PlatformFunctions &p_functions) { platform_functions = p_functions; } +#ifdef THREADS_ENABLED void Thread::callback(ID p_caller_id, const Settings &p_settings, Callback p_callback, void *p_userdata) { Thread::caller_id = p_caller_id; if (platform_functions.set_priority) { @@ -107,4 +110,6 @@ Thread::~Thread() { } } +#endif // THREADS_ENABLED + #endif // PLATFORM_THREAD_OVERRIDE diff --git a/core/os/thread.h b/core/os/thread.h index cc954678f9..a0ecc24c91 100644 --- a/core/os/thread.h +++ b/core/os/thread.h @@ -53,6 +53,8 @@ class String; +#ifdef THREADS_ENABLED + class Thread { public: typedef void (*Callback)(void *p_userdata); @@ -86,6 +88,8 @@ public: private: friend class Main; + static PlatformFunctions platform_functions; + ID id = UNASSIGNED_ID; static SafeNumeric<uint64_t> id_counter; static thread_local ID caller_id; @@ -93,8 +97,6 @@ private: static void callback(ID p_caller_id, const Settings &p_settings, Thread::Callback p_callback, void *p_userdata); - static PlatformFunctions platform_functions; - static void make_main_thread() { caller_id = MAIN_ID; } static void release_main_thread() { caller_id = UNASSIGNED_ID; } @@ -125,6 +127,64 @@ public: ~Thread(); }; +#else // No threads. + +class Thread { +public: + typedef void (*Callback)(void *p_userdata); + + typedef uint64_t ID; + + enum : ID { + UNASSIGNED_ID = 0, + MAIN_ID = 1 + }; + + enum Priority { + PRIORITY_LOW, + PRIORITY_NORMAL, + PRIORITY_HIGH + }; + + struct Settings { + Priority priority; + Settings() { priority = PRIORITY_NORMAL; } + }; + + struct PlatformFunctions { + Error (*set_name)(const String &) = nullptr; + void (*set_priority)(Thread::Priority) = nullptr; + void (*init)() = nullptr; + void (*wrapper)(Thread::Callback, void *) = nullptr; + void (*term)() = nullptr; + }; + +private: + friend class Main; + + static PlatformFunctions platform_functions; + + static void make_main_thread() {} + static void release_main_thread() {} + +public: + static void _set_platform_functions(const PlatformFunctions &p_functions); + + _FORCE_INLINE_ ID get_id() const { return 0; } + _FORCE_INLINE_ static ID get_caller_id() { return MAIN_ID; } + _FORCE_INLINE_ static ID get_main_id() { return MAIN_ID; } + + _FORCE_INLINE_ static bool is_main_thread() { return true; } + + static Error set_name(const String &p_name) { return ERR_UNAVAILABLE; } + + void start(Thread::Callback p_callback, void *p_user, const Settings &p_settings = Settings()) {} + bool is_started() const { return false; } + void wait_to_finish() {} +}; + +#endif // THREADS_ENABLED + #endif // THREAD_H #endif // PLATFORM_THREAD_OVERRIDE diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 8fa15a2736..d72fc61394 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -877,6 +877,7 @@ [/codeblocks] [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print] or [method print_rich]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. [b]Note:[/b] On Windows, only Windows 10 and later correctly displays ANSI escape codes in standard output. + [b]Note:[/b] Output displayed in the editor supports clickable [code skip-lint][url=address]text[/url][/code] tags. The [code skip-lint][url][/code] tag's [code]address[/code] value is handled by [method OS.shell_open] when clicked. </description> </method> <method name="print_verbose" qualifiers="vararg"> diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index c1c637d2d6..427d38d421 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -4,10 +4,10 @@ A 3D axis-aligned bounding box. </brief_description> <description> - [AABB] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. - It uses floating-point coordinates. The 2D counterpart to [AABB] is [Rect2]. - Negative values for [member size] are not supported and will not work for most methods. Use [method abs] to get an AABB with a positive size. - [b]Note:[/b] Unlike [Rect2], [AABB] does not have a variant that uses integer coordinates. + The [AABB] built-in [Variant] type represents an axis-aligned bounding box in a 3D space. It is defined by its [member position] and [member size], which are [Vector3]. It is frequently used for fast overlap tests (see [method intersects]). Although [AABB] itself is axis-aligned, it can be combined with [Transform3D] to represent a rotated or skewed bounding box. + It uses floating-point coordinates. The 2D counterpart to [AABB] is [Rect2]. There is no version of [AABB] that uses integer coordinates. + [b]Note:[/b] Negative values for [member size] are not supported. With negative size, most [AABB] methods do not work correctly. Use [method abs] to get an equivalent [AABB] with a non-negative size. + [b]Note:[/b] In a boolean context, a [AABB] evaluates to [code]false[/code] if both [member position] and [member size] are zero (equal to [constant Vector3.ZERO]). Otherwise, it always evaluates to [code]true[/code]. </description> <tutorials> <link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link> @@ -18,7 +18,7 @@ <constructor name="AABB"> <return type="AABB" /> <description> - Constructs a default-initialized [AABB] with default (zero) values of [member position] and [member size]. + Constructs an [AABB] with its [member position] and [member size] set to [constant Vector3.ZERO]. </description> </constructor> <constructor name="AABB"> @@ -33,7 +33,7 @@ <param index="0" name="position" type="Vector3" /> <param index="1" name="size" type="Vector3" /> <description> - Constructs an [AABB] from a position and size. + Constructs an [AABB] by [param position] and [param size]. </description> </constructor> </constructors> @@ -41,34 +41,78 @@ <method name="abs" qualifiers="const"> <return type="AABB" /> <description> - Returns an AABB with equivalent position and size, modified so that the most-negative corner is the origin and the size is positive. + Returns an [AABB] equivalent to this bounding box, with its width, height, and depth modified to be non-negative values. + [codeblocks] + [gdscript] + var box = AABB(Vector3(5, 0, 5), Vector3(-20, -10, -5)) + var absolute = box.abs() + print(absolute.position) # Prints (-15, -10, 0) + print(absolute.size) # Prints (20, 10, 5) + [/gdscript] + [csharp] + var box = new Aabb(new Vector3(5, 0, 5), new Vector3(-20, -10, -5)); + var absolute = box.Abs(); + GD.Print(absolute.Position); // Prints (-15, -10, 0) + GD.Print(absolute.Size); // Prints (20, 10, 5) + [/csharp] + [/codeblocks] + [b]Note:[/b] It's recommended to use this method when [member size] is negative, as most other methods in Godot assume that the [member size]'s components are greater than [code]0[/code]. </description> </method> <method name="encloses" qualifiers="const"> <return type="bool" /> <param index="0" name="with" type="AABB" /> <description> - Returns [code]true[/code] if this [AABB] completely encloses another one. + Returns [code]true[/code] if this bounding box [i]completely[/i] encloses the [param with] box. The edges of both boxes are included. + [codeblocks] + [gdscript] + var a = AABB(Vector3(0, 0, 0), Vector3(4, 4, 4)) + var b = AABB(Vector3(1, 1, 1), Vector3(3, 3, 3)) + var c = AABB(Vector3(2, 2, 2), Vector3(8, 8, 8)) + + print(a.encloses(a)) # Prints true + print(a.encloses(b)) # Prints true + print(a.encloses(c)) # Prints false + [/gdscript] + [csharp] + var a = new Aabb(new Vector3(0, 0, 0), new Vector3(4, 4, 4)); + var b = new Aabb(new Vector3(1, 1, 1), new Vector3(3, 3, 3)); + var c = new Aabb(new Vector3(2, 2, 2), new Vector3(8, 8, 8)); + + GD.Print(a.Encloses(a)); // Prints True + GD.Print(a.Encloses(b)); // Prints True + GD.Print(a.Encloses(c)); // Prints False + [/csharp] + [/codeblocks] </description> </method> <method name="expand" qualifiers="const"> <return type="AABB" /> <param index="0" name="to_point" type="Vector3" /> <description> - Returns a copy of this [AABB] expanded to include a given point. - [b]Example:[/b] + Returns a copy of this bounding box expanded to align the edges with the given [param to_point], if necessary. [codeblocks] [gdscript] - # position (-3, 2, 0), size (1, 1, 1) - var box = AABB(Vector3(-3, 2, 0), Vector3(1, 1, 1)) - # position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB and Vector3(0, -1, 2) - var box2 = box.expand(Vector3(0, -1, 2)) + var box = AABB(Vector3(0, 0, 0), Vector3(5, 2, 5)) + + box = box.expand(Vector3(10, 0, 0)) + print(box.position) # Prints (0, 0, 0) + print(box.size) # Prints (10, 2, 5) + + box = box.expand(Vector3(-5, 0, 5)) + print(box.position) # Prints (-5, 0, 0) + print(box.size) # Prints (15, 2, 5) [/gdscript] [csharp] - // position (-3, 2, 0), size (1, 1, 1) - var box = new Aabb(new Vector3(-3, 2, 0), new Vector3(1, 1, 1)); - // position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB and Vector3(0, -1, 2) - var box2 = box.Expand(new Vector3(0, -1, 2)); + var box = new Aabb(new Vector3(0, 0, 0), new Vector3(5, 2, 5)); + + box = box.Expand(new Vector3(10, 0, 0)); + GD.Print(box.Position); // Prints (0, 0, 0) + GD.Print(box.Size); // Prints (10, 2, 5) + + box = box.Expand(new Vector3(-5, 0, 5)); + GD.Print(box.Position); // Prints (-5, 0, 0) + GD.Print(box.Size); // Prints (15, 2, 5) [/csharp] [/codeblocks] </description> @@ -76,111 +120,188 @@ <method name="get_center" qualifiers="const"> <return type="Vector3" /> <description> - Returns the center of the [AABB], which is equal to [member position] + ([member size] / 2). + Returns the center point of the bounding box. This is the same as [code]position + (size / 2.0)[/code]. </description> </method> <method name="get_endpoint" qualifiers="const"> <return type="Vector3" /> <param index="0" name="idx" type="int" /> <description> - Gets the position of the 8 endpoints of the [AABB] in space. + Returns the position of one of the 8 vertices that compose this bounding box. With a [param idx] of [code]0[/code] this is the same as [member position], and a [param idx] of [code]7[/code] is the same as [member end]. </description> </method> <method name="get_longest_axis" qualifiers="const"> <return type="Vector3" /> <description> - Returns the normalized longest axis of the [AABB]. + Returns the longest normalized axis of this bounding box's [member size], as a [Vector3] ([constant Vector3.RIGHT], [constant Vector3.UP], or [constant Vector3.BACK]). + [codeblocks] + [gdscript] + var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8)) + + print(box.get_longest_axis()) # Prints (0, 0, 1) + print(box.get_longest_axis_index()) # Prints 2 + print(box.get_longest_axis_size()) # Prints 8 + [/gdscript] + [csharp] + var box = new Aabb(new Vector3(0, 0, 0), new Vector3(2, 4, 8)); + + GD.Print(box.GetLongestAxis()); // Prints (0, 0, 1) + GD.Print(box.GetLongestAxisIndex()); // Prints 2 + GD.Print(box.GetLongestAxisSize()); // Prints 8 + [/csharp] + [/codeblocks] + See also [method get_longest_axis_index] and [method get_longest_axis_size]. </description> </method> <method name="get_longest_axis_index" qualifiers="const"> <return type="int" /> <description> - Returns the index of the longest axis of the [AABB] (according to [Vector3]'s [code]AXIS_*[/code] constants). + Returns the index to the longest axis of this bounding box's [member size] (see [constant Vector3.AXIS_X], [constant Vector3.AXIS_Y], and [constant Vector3.AXIS_Z]). + For an example, see [method get_longest_axis]. </description> </method> <method name="get_longest_axis_size" qualifiers="const"> <return type="float" /> <description> - Returns the scalar length of the longest axis of the [AABB]. + Returns the longest dimension of this bounding box's [member size]. + For an example, see [method get_longest_axis]. </description> </method> <method name="get_shortest_axis" qualifiers="const"> <return type="Vector3" /> <description> - Returns the normalized shortest axis of the [AABB]. + Returns the shortest normaalized axis of this bounding box's [member size], as a [Vector3] ([constant Vector3.RIGHT], [constant Vector3.UP], or [constant Vector3.BACK]). + [codeblocks] + [gdscript] + var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8)) + + print(box.get_shortest_axis()) # Prints (1, 0, 0) + print(box.get_shortest_axis_index()) # Prints 0 + print(box.get_shortest_axis_size()) # Prints 2 + [/gdscript] + [csharp] + var box = new Aabb(new Vector3(0, 0, 0), new Vector3(2, 4, 8)); + + GD.Print(box.GetShortestAxis()); // Prints (1, 0, 0) + GD.Print(box.GetShortestAxisIndex()); // Prints 0 + GD.Print(box.GetShortestAxisSize()); // Prints 2 + [/csharp] + [/codeblocks] + See also [method get_shortest_axis_index] and [method get_shortest_axis_size]. </description> </method> <method name="get_shortest_axis_index" qualifiers="const"> <return type="int" /> <description> - Returns the index of the shortest axis of the [AABB] (according to [Vector3]::AXIS* enum). + Returns the index to the shortest axis of this bounding box's [member size] (see [constant Vector3.AXIS_X], [constant Vector3.AXIS_Y], and [constant Vector3.AXIS_Z]). + For an example, see [method get_shortest_axis]. </description> </method> <method name="get_shortest_axis_size" qualifiers="const"> <return type="float" /> <description> - Returns the scalar length of the shortest axis of the [AABB]. + Returns the shortest dimension of this bounding box's [member size]. + For an example, see [method get_shortest_axis]. </description> </method> <method name="get_support" qualifiers="const"> <return type="Vector3" /> <param index="0" name="dir" type="Vector3" /> <description> - Returns the vertex of the AABB that's the farthest in a given direction. This point is commonly known as the support point in collision detection algorithms. + Returns the vertex's position of this bounding box that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms. </description> </method> <method name="get_volume" qualifiers="const"> <return type="float" /> <description> - Returns the volume of the [AABB]. + Returns the bounding box's volume. This is equivalent to [code]size.x * size.y * size.z[/code]. See also [method has_volume]. </description> </method> <method name="grow" qualifiers="const"> <return type="AABB" /> <param index="0" name="by" type="float" /> <description> - Returns a copy of the [AABB] grown a given number of units towards all the sides. + Returns a copy of this bounding box extended on all sides by the given amount [param by]. A negative amount shrinks the box instead. + [codeblocks] + [gdscript] + var a = AABB(Vector3(4, 4, 4), Vector3(8, 8, 8)).grow(4) + print(a.position) # Prints (0, 0, 0) + print(a.size) # Prints (16, 16, 16) + + var b = AABB(Vector3(0, 0, 0), Vector3(8, 4, 2)).grow(2) + print(b.position) # Prints (-2, -2, -2) + print(b.size) # Prints (12, 8, 6) + [/gdscript] + [csharp] + var a = new Aabb(new Vector3(4, 4, 4), new Vector3(8, 8, 8)).Grow(4); + GD.Print(a.Position); // Prints (0, 0, 0) + GD.Print(a.Size); // Prints (16, 16, 16) + + var b = new Aabb(new Vector3(0, 0, 0), new Vector3(8, 4, 2)).Grow(2); + GD.Print(b.Position); // Prints (-2, -2, -2) + GD.Print(b.Size); // Prints (12, 8, 6) + [/csharp] + [/codeblocks] </description> </method> <method name="has_point" qualifiers="const"> <return type="bool" /> <param index="0" name="point" type="Vector3" /> <description> - Returns [code]true[/code] if the [AABB] contains a point. Points on the faces of the AABB are considered included, though float-point precision errors may impact the accuracy of such checks. - [b]Note:[/b] This method is not reliable for [AABB] with a [i]negative size[/i]. Use [method abs] to get a positive sized equivalent [AABB] to check for contained points. + Returns [code]true[/code] if the bounding box contains the given [param point]. By convention, points exactly on the right, top, and front sides are [b]not[/b] included. + [b]Note:[/b] This method is not reliable for [AABB] with a [i]negative[/i] [member size]. Use [method abs] first to get a valid bounding box. </description> </method> <method name="has_surface" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if the [AABB] has a surface or a length, and [code]false[/code] if the [AABB] is empty (all components of [member size] are zero or negative). + Returns [code]true[/code] if this bounding box has a surface or a length, that is, at least one component of [member size] is greater than [code]0[/code]. Otherwise, returns [code]false[/code]. </description> </method> <method name="has_volume" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if the [AABB] has a volume, and [code]false[/code] if the [AABB] is flat, empty, or has a negative [member size]. + Returns [code]true[/code] if this bounding box's width, height, and depth are all positive. See also [method get_volume]. </description> </method> <method name="intersection" qualifiers="const"> <return type="AABB" /> <param index="0" name="with" type="AABB" /> <description> - Returns the intersection between two [AABB]. An empty AABB (size [code](0, 0, 0)[/code]) is returned on failure. + Returns the intersection between this bounding box and [param with]. If the boxes do not intersect, returns an empty [AABB]. If the boxes intersect at the edge, returns a flat [AABB] with no volume (see [method has_surface] and [method has_volume]). + [codeblocks] + [gdscript] + var box1 = AABB(Vector3(0, 0, 0), Vector3(5, 2, 8)) + var box2 = AABB(Vector3(2, 0, 2), Vector3(8, 4, 4)) + + var intersection = box1.intersection(box2) + print(intersection.position) # Prints (2, 0, 2) + print(intersection.size) # Prints (3, 2, 4) + [/gdscript] + [csharp] + var box1 = new Aabb(new Vector3(0, 0, 0), new Vector3(5, 2, 8)); + var box2 = new Aabb(new Vector3(2, 0, 2), new Vector3(8, 4, 4)); + + var intersection = box1.Intersection(box2); + GD.Print(intersection.Position); // Prints (2, 0, 2) + GD.Print(intersection.Size); // Prints (3, 2, 4) + [/csharp] + [/codeblocks] + [b]Note:[/b] If you only need to know whether two bounding boxes are intersecting, use [method intersects], instead. </description> </method> <method name="intersects" qualifiers="const"> <return type="bool" /> <param index="0" name="with" type="AABB" /> <description> - Returns [code]true[/code] if the [AABB] overlaps with another. + Returns [code]true[/code] if this bounding box overlaps with the box [param with]. The edges of both boxes are [i]always[/i] excluded. </description> </method> <method name="intersects_plane" qualifiers="const"> <return type="bool" /> <param index="0" name="plane" type="Plane" /> <description> - Returns [code]true[/code] if the [AABB] is on both sides of a plane. + Returns [code]true[/code] if this bounding box is on both sides of the given [param plane]. </description> </method> <method name="intersects_ray" qualifiers="const"> @@ -188,7 +309,8 @@ <param index="0" name="from" type="Vector3" /> <param index="1" name="dir" type="Vector3" /> <description> - Returns the point of intersection of the given ray with this [AABB] or [code]null[/code] if there is no intersection. Ray length is infinite. + Returns the first point where this bounding box and the given ray intersect, as a [Vector3]. If no intersection occurs, returns [code]null[/code]. + The ray begin at [param from], faces [param dir] and extends towards infinity. </description> </method> <method name="intersects_segment" qualifiers="const"> @@ -196,40 +318,41 @@ <param index="0" name="from" type="Vector3" /> <param index="1" name="to" type="Vector3" /> <description> - Returns the point of intersection between [param from] and [param to] with this [AABB] or [code]null[/code] if there is no intersection. + Returns the first point where this bounding box and the given segment intersect, as a [Vector3]. If no intersection occurs, returns [code]null[/code]. + The segment begins at [param from] and ends at [param to]. </description> </method> <method name="is_equal_approx" qualifiers="const"> <return type="bool" /> <param index="0" name="aabb" type="AABB" /> <description> - Returns [code]true[/code] if this [AABB] and [param aabb] are approximately equal, by calling [method @GlobalScope.is_equal_approx] on each component. + Returns [code]true[/code] if this bounding box and [param aabb] are approximately equal, by calling [method Vector2.is_equal_approx] on the [member position] and the [member size]. </description> </method> <method name="is_finite" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if this [AABB] is finite, by calling [method @GlobalScope.is_finite] on each component. + Returns [code]true[/code] if this bounding box's values are finite, by calling [method Vector2.is_finite] on the [member position] and the [member size]. </description> </method> <method name="merge" qualifiers="const"> <return type="AABB" /> <param index="0" name="with" type="AABB" /> <description> - Returns a larger [AABB] that contains both this [AABB] and [param with]. + Returns an [AABB] that encloses both this bounding box and [param with] around the edges. See also [method encloses]. </description> </method> </methods> <members> <member name="end" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)"> - Ending corner. This is calculated as [code]position + size[/code]. Setting this value will change the size. + The ending point. This is usually the corner on the top-right and forward of the bounding box, and is equivalent to [code]position + size[/code]. Setting this point affects the [member size]. </member> <member name="position" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)"> - Beginning corner. Typically has values lower than [member end]. + The origin point. This is usually the corner on the bottom-left and back of the bounding box. </member> <member name="size" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)"> - Size from [member position] to [member end]. Typically, all components are positive. - If the size is negative, you can use [method abs] to fix it. + The bounding box's width, height, and depth starting from [member position]. Setting this value also affects the [member end] point. + [b]Note:[/b] It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Godot assume that the [member position] is the bottom-left-back corner, and the [member end] is the top-right-forward corner. To get an equivalent bounding box with non-negative size, use [method abs]. </member> </members> <operators> @@ -237,7 +360,7 @@ <return type="bool" /> <param index="0" name="right" type="AABB" /> <description> - Returns [code]true[/code] if the AABBs are not equal. + Returns [code]true[/code] if the [member position] or [member size] of both bounding boxes are not equal. [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. </description> </operator> @@ -254,7 +377,7 @@ <return type="bool" /> <param index="0" name="right" type="AABB" /> <description> - Returns [code]true[/code] if the AABBs are exactly equal. + Returns [code]true[/code] if both [member position] and [member size] of the bounding boxes are exactly equal, respectively. [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. </description> </operator> diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index 15f6b16439..2a88e70818 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -8,21 +8,23 @@ [codeblocks] [gdscript] # This creates an animation that makes the node "Enemy" move to the right by - # 100 pixels in 0.5 seconds. + # 100 pixels in 2.0 seconds. var animation = Animation.new() var track_index = animation.add_track(Animation.TYPE_VALUE) animation.track_set_path(track_index, "Enemy:position:x") animation.track_insert_key(track_index, 0.0, 0) - animation.track_insert_key(track_index, 0.5, 100) + animation.track_insert_key(track_index, 2.0, 100) + animation.length = 2.0 [/gdscript] [csharp] // This creates an animation that makes the node "Enemy" move to the right by - // 100 pixels in 0.5 seconds. + // 100 pixels in 2.0 seconds. var animation = new Animation(); int trackIndex = animation.AddTrack(Animation.TrackType.Value); animation.TrackSetPath(trackIndex, "Enemy:position:x"); animation.TrackInsertKey(trackIndex, 0.0f, 0); - animation.TrackInsertKey(trackIndex, 0.5f, 100); + animation.TrackInsertKey(trackIndex, 2.0f, 100); + animation.Length = 2.0f; [/csharp] [/codeblocks] Animations are just data containers, and must be added to nodes such as an [AnimationPlayer] to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check [enum TrackType] to see available types. diff --git a/doc/classes/AnimationNodeStateMachine.xml b/doc/classes/AnimationNodeStateMachine.xml index 1c96110540..86311542ad 100644 --- a/doc/classes/AnimationNodeStateMachine.xml +++ b/doc/classes/AnimationNodeStateMachine.xml @@ -182,7 +182,7 @@ Seeking to the beginning is treated as seeking to the beginning of the animation in the current state. Transition to the end state, or the absence of transitions in each state, is treated as exiting the state machine. </constant> <constant name="STATE_MACHINE_TYPE_GROUPED" value="2" enum="StateMachineType"> - This is a grouped state machine that can be controlled from a parent state machine. It does not work on standalone. There must be a state machine with [member state_machine_type] of [constant STATE_MACHINE_TYPE_ROOT] or [constant STATE_MACHINE_TYPE_NESTED] in the parent or ancestor. + This is a grouped state machine that can be controlled from a parent state machine. It does not work independently. There must be a state machine with [member state_machine_type] of [constant STATE_MACHINE_TYPE_ROOT] or [constant STATE_MACHINE_TYPE_NESTED] in the parent or ancestor. </constant> </constants> </class> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 3252cbf840..39b9dde043 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -479,7 +479,7 @@ <return type="Variant" /> <param index="0" name="position" type="int" /> <description> - Removes and returns the element of the array at index [param position]. If negative, [param position] is considered relative to the end of the array. Leaves the array untouched and returns [code]null[/code] if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty. + Removes and returns the element of the array at index [param position]. If negative, [param position] is considered relative to the end of the array. Leaves the array unchanged and returns [code]null[/code] if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty. [b]Note:[/b] On large arrays, this method can be slower than [method pop_back] as it will reindex the array's elements that are located after the removed element. The larger the array and the lower the index of the removed element, the slower [method pop_at] will be. </description> </method> diff --git a/doc/classes/AudioEffectPitchShift.xml b/doc/classes/AudioEffectPitchShift.xml index ec60e6a75a..4d4baa34ab 100644 --- a/doc/classes/AudioEffectPitchShift.xml +++ b/doc/classes/AudioEffectPitchShift.xml @@ -18,7 +18,7 @@ The oversampling factor to use. Higher values result in better quality, but are more demanding on the CPU and may cause audio cracking if the CPU can't keep up. </member> <member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale" default="1.0"> - The pitch scale to use. [code]1.0[/code] is the default pitch and plays sounds unaltered. [member pitch_scale] can range from [code]0.0[/code] (infinitely low pitch, inaudible) to [code]16[/code] (16 times higher than the initial pitch). + The pitch scale to use. [code]1.0[/code] is the default pitch and plays sounds unaffected. [member pitch_scale] can range from [code]0.0[/code] (infinitely low pitch, inaudible) to [code]16[/code] (16 times higher than the initial pitch). </member> </members> <constants> diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml index 12e09b235f..6e30775fee 100644 --- a/doc/classes/AudioStream.xml +++ b/doc/classes/AudioStream.xml @@ -28,6 +28,12 @@ <description> </description> </method> + <method name="_get_parameter_list" qualifiers="virtual const"> + <return type="Dictionary[]" /> + <description> + Return the controllable parameters of this stream. This array contains dictionaries with a property info description format (see [method Object.get_property_list]). Additionally, the default value for this parameter must be added tho each dictionary in "default_value" field. + </description> + </method> <method name="_get_stream_name" qualifiers="virtual const"> <return type="String" /> <description> @@ -62,4 +68,11 @@ </description> </method> </methods> + <signals> + <signal name="parameter_list_changed"> + <description> + Signal to be emitted to notify when the parameter list changed. + </description> + </signal> + </signals> </class> diff --git a/doc/classes/AudioStreamPlayback.xml b/doc/classes/AudioStreamPlayback.xml index 7692690b5e..a090989194 100644 --- a/doc/classes/AudioStreamPlayback.xml +++ b/doc/classes/AudioStreamPlayback.xml @@ -15,6 +15,13 @@ <description> </description> </method> + <method name="_get_parameter" qualifiers="virtual const"> + <return type="Variant" /> + <param index="0" name="name" type="StringName" /> + <description> + Return the current value of a playback parameter by name (see [method AudioStream._get_parameter_list]). + </description> + </method> <method name="_get_playback_position" qualifiers="virtual const"> <return type="float" /> <description> @@ -39,6 +46,14 @@ <description> </description> </method> + <method name="_set_parameter" qualifiers="virtual"> + <return type="void" /> + <param index="0" name="name" type="StringName" /> + <param index="1" name="value" type="Variant" /> + <description> + Set the current value of a playback parameter by name (see [method AudioStream._get_parameter_list]). + </description> + </method> <method name="_start" qualifiers="virtual"> <return type="void" /> <param index="0" name="from_pos" type="float" /> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 2f76f64cff..6f4dc47fb9 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -501,7 +501,7 @@ <method name="is_visible_in_tree" qualifiers="const"> <return type="bool" /> <description> - Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is consequently not drawn (see [method _draw]). + Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is therefore not drawn (see [method _draw]). </description> </method> <method name="make_canvas_position_local" qualifiers="const"> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 8436cbf6ee..2d4c2c9682 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -1754,7 +1754,7 @@ The ID of the main window spawned by the engine, which can be passed to methods expecting a [code]window_id[/code]. </constant> <constant name="INVALID_WINDOW_ID" value="-1"> - The ID that refers to a nonexisting window. This is be returned by some [DisplayServer] methods if no window matches the requested result. + The ID that refers to a nonexistent window. This is returned by some [DisplayServer] methods if no window matches the requested result. </constant> <constant name="SCREEN_LANDSCAPE" value="0" enum="ScreenOrientation"> Default landscape orientation. @@ -1955,16 +1955,16 @@ [b]Note:[/b] This flag is implemented only on macOS. </constant> <constant name="VSYNC_DISABLED" value="0" enum="VSyncMode"> - No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (notwithstanding [member Engine.max_fps]). + No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (regardless of [member Engine.max_fps]). </constant> <constant name="VSYNC_ENABLED" value="1" enum="VSyncMode"> - Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). Framerate is limited by the monitor refresh rate (notwithstanding [member Engine.max_fps]). + Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). Framerate is limited by the monitor refresh rate (regardless of [member Engine.max_fps]). </constant> <constant name="VSYNC_ADAPTIVE" value="2" enum="VSyncMode"> - Behaves like [constant VSYNC_DISABLED] when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible). Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is limited by the monitor refresh rate (notwithstanding [member Engine.max_fps]). Behaves like [constant VSYNC_ENABLED] when using the Compatibility rendering method. + Behaves like [constant VSYNC_DISABLED] when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible). Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is limited by the monitor refresh rate (regardless of [member Engine.max_fps]). Behaves like [constant VSYNC_ENABLED] when using the Compatibility rendering method. </constant> <constant name="VSYNC_MAILBOX" value="3" enum="VSyncMode"> - Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (notwithstanding [member Engine.max_fps]). + Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (regardless of [member Engine.max_fps]). Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag (also called "Fast" V-Sync mode). [constant VSYNC_MAILBOX] works best when at least twice as many frames as the display refresh rate are rendered. Behaves like [constant VSYNC_ENABLED] when using the Compatibility rendering method. </constant> <constant name="DISPLAY_HANDLE" value="0" enum="HandleType"> diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 5c317a5088..b7f3ec9963 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -662,12 +662,16 @@ <member name="interface/theme/accent_color" type="Color" setter="" getter=""> The color to use for "highlighted" user interface elements in the editor (pressed and hovered items). </member> - <member name="interface/theme/additional_spacing" type="float" setter="" getter=""> - The spacing to add for buttons and list items in the editor (in pixels). Increasing this value is useful to improve usability on touch screens, at the cost of reducing the amount of usable screen real estate. + <member name="interface/theme/additional_spacing" type="int" setter="" getter=""> + The extra spacing to add to various GUI elements in the editor (in pixels). Increasing this value is useful to improve usability on touch screens, at the cost of reducing the amount of usable screen real estate. + See also [member interface/theme/spacing_preset]. </member> <member name="interface/theme/base_color" type="Color" setter="" getter=""> The base color to use for user interface elements in the editor. Secondary colors (such as darker/lighter variants) are derived from this color. </member> + <member name="interface/theme/base_spacing" type="int" setter="" getter=""> + The base spacing used by various GUI elements in the editor (in pixels). See also [member interface/theme/spacing_preset]. + </member> <member name="interface/theme/border_size" type="int" setter="" getter=""> The border size to use for interface elements (in pixels). </member> @@ -699,6 +703,9 @@ <member name="interface/theme/relationship_line_opacity" type="float" setter="" getter=""> The opacity to use when drawing relationship lines in the editor's [Tree]-based GUIs (such as the Scene tree dock). </member> + <member name="interface/theme/spacing_preset" type="String" setter="" getter=""> + The editor theme spacing preset to use. See also [member interface/theme/base_spacing] and [member interface/theme/additional_spacing]. + </member> <member name="interface/touchscreen/enable_long_press_as_right_click" type="bool" setter="" getter=""> If [code]true[/code], long press on touchscreen is treated as right click. [b]Note:[/b] Defaults to [code]true[/code] on touchscreen devices. diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 0a544077e4..653dc4fd88 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -293,7 +293,7 @@ Controls the maximum number of physics steps that can be simulated each rendered frame. The default value is tuned to avoid "spiral of death" situations where expensive physics simulations trigger more expensive simulations indefinitely. However, the game will appear to slow down if the rendering FPS is less than [code]1 / max_physics_steps_per_frame[/code] of [member physics_ticks_per_second]. This occurs even if [code]delta[/code] is consistently used in physics calculations. To avoid this, increase [member max_physics_steps_per_frame] if you have increased [member physics_ticks_per_second] significantly above its default value. </member> <member name="physics_jitter_fix" type="float" setter="set_physics_jitter_fix" getter="get_physics_jitter_fix" default="0.5"> - Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of the in-game clock and real clock but smooth out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. + Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of the in-game clock and real clock but smooth out framerate jitters. The default value of 0.5 should be good enough for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. [b]Note:[/b] For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics_jitter_fix] to [code]0[/code]. </member> <member name="physics_ticks_per_second" type="int" setter="set_physics_ticks_per_second" getter="get_physics_ticks_per_second" default="60"> diff --git a/doc/classes/GeometryInstance3D.xml b/doc/classes/GeometryInstance3D.xml index 990efbb3a4..6b0d2e4a62 100644 --- a/doc/classes/GeometryInstance3D.xml +++ b/doc/classes/GeometryInstance3D.xml @@ -34,7 +34,7 @@ The selected shadow casting flag. See [enum ShadowCastingSetting] for possible values. </member> <member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB(0, 0, 0, 0, 0, 0)"> - Overrides the bounding box of this node with a custom one. This can be used to avoid the expensive [AABB] recalculation that happens when a skeleton is used with a [MeshInstance3D] or to have fine control over the [MeshInstance3D]'s bounding box. To use the default AABB, set value to an [AABB] with all fields set to [code]0.0[/code]. To avoid frustum culling, set [member custom_aabb] to a very large AABB that covers your entire game world such as [code]AABB(-10000, -10000, -10000, 20000, 20000, 20000)[/code]. To disable all forms of culling (including occlusion culling), call [method RenderingServer.instance_set_ignore_culling] on the [GeometryInstance3D]'s [RID]. + Overrides the bounding box of this node with a custom one. This can be used to avoid the expensive [AABB] recalculation that happens when a skeleton is used with a [MeshInstance3D] or to have precise control over the [MeshInstance3D]'s bounding box. To use the default AABB, set value to an [AABB] with all fields set to [code]0.0[/code]. To avoid frustum culling, set [member custom_aabb] to a very large AABB that covers your entire game world such as [code]AABB(-10000, -10000, -10000, 20000, 20000, 20000)[/code]. To disable all forms of culling (including occlusion culling), call [method RenderingServer.instance_set_ignore_culling] on the [GeometryInstance3D]'s [RID]. </member> <member name="extra_cull_margin" type="float" setter="set_extra_cull_margin" getter="get_extra_cull_margin" default="0.0"> The extra distance added to the GeometryInstance3D's bounding box ([AABB]) to increase its cull box. diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml index 4c6c9d3524..b01a3f7a0e 100644 --- a/doc/classes/MainLoop.xml +++ b/doc/classes/MainLoop.xml @@ -5,7 +5,7 @@ </brief_description> <description> [MainLoop] is the abstract base class for a Godot project's game loop. It is inherited by [SceneTree], which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own [MainLoop] subclass instead of the scene tree. - Upon the application start, a [MainLoop] implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a [SceneTree] is created) unless a [MainLoop] [Script] is provided from the command line (with e.g. [code]godot -s my_loop.gd[/code] or the "Main Loop Type" project setting is overwritten. + Upon the application start, a [MainLoop] implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a [SceneTree] is created) unless a [MainLoop] [Script] is provided from the command line (with e.g. [code]godot -s my_loop.gd[/code]) or the "Main Loop Type" project setting is overwritten. Here is an example script implementing a simple [MainLoop]: [codeblocks] [gdscript] diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml index 02631841bf..2bb0090282 100644 --- a/doc/classes/NavigationServer2D.xml +++ b/doc/classes/NavigationServer2D.xml @@ -456,7 +456,7 @@ <description> This function immediately forces synchronization of the specified navigation [param map] [RID]. By default navigation maps are only synchronized at the end of each physics frame. This function can be used to immediately (re)calculate all the navigation meshes and region connections of the navigation map. This makes it possible to query a navigation path for a changed map immediately and in the same frame (multiple times if needed). Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update. - Avoidance processing and dispatch of the [code]safe_velocity[/code] signals is untouched by this function and continues to happen for all maps and agents at the end of the physics frame. + Avoidance processing and dispatch of the [code]safe_velocity[/code] signals is unaffected by this function and continues to happen for all maps and agents at the end of the physics frame. [b]Note:[/b] With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight. </description> </method> diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml index c04017651c..bff5d63a17 100644 --- a/doc/classes/NavigationServer3D.xml +++ b/doc/classes/NavigationServer3D.xml @@ -495,7 +495,7 @@ <description> This function immediately forces synchronization of the specified navigation [param map] [RID]. By default navigation maps are only synchronized at the end of each physics frame. This function can be used to immediately (re)calculate all the navigation meshes and region connections of the navigation map. This makes it possible to query a navigation path for a changed map immediately and in the same frame (multiple times if needed). Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update. - Avoidance processing and dispatch of the [code]safe_velocity[/code] signals is untouched by this function and continues to happen for all maps and agents at the end of the physics frame. + Avoidance processing and dispatch of the [code]safe_velocity[/code] signals is unaffected by this function and continues to happen for all maps and agents at the end of the physics frame. [b]Note:[/b] With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight. </description> </method> diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml index d04d8eea52..2b47cd2deb 100644 --- a/doc/classes/PrimitiveMesh.xml +++ b/doc/classes/PrimitiveMesh.xml @@ -12,6 +12,7 @@ <method name="_create_mesh_array" qualifiers="virtual const"> <return type="Array" /> <description> + Override this method to customize how this primitive mesh should be generated. Should return an [Array] where each element is another Array of values required for the mesh (see the [enum Mesh.ArrayType] constants). </description> </method> <method name="get_mesh_arrays" qualifiers="const"> diff --git a/doc/classes/ProceduralSkyMaterial.xml b/doc/classes/ProceduralSkyMaterial.xml index 3fb9f9059c..1503bb2e78 100644 --- a/doc/classes/ProceduralSkyMaterial.xml +++ b/doc/classes/ProceduralSkyMaterial.xml @@ -6,7 +6,7 @@ <description> [ProceduralSkyMaterial] provides a way to create an effective background quickly by defining procedural parameters for the sun, the sky and the ground. The sky and ground are defined by a main color, a color at the horizon, and an easing curve to interpolate between them. Suns are described by a position in the sky, a color, and a max angle from the sun at which the easing curve ends. The max angle therefore defines the size of the sun in the sky. [ProceduralSkyMaterial] supports up to 4 suns, using the color, and energy, direction, and angular distance of the first four [DirectionalLight3D] nodes in the scene. This means that the suns are defined individually by the properties of their corresponding [DirectionalLight3D]s and globally by [member sun_angle_max] and [member sun_curve]. - [ProceduralSkyMaterial] uses a lightweight shader to draw the sky and is therefore suited for real time updates. This makes it a great option for a sky that is simple and computationally cheap, but unrealistic. If you need a more realistic procedural option, use [PhysicalSkyMaterial]. + [ProceduralSkyMaterial] uses a lightweight shader to draw the sky and is therefore suited for real-time updates. This makes it a great option for a sky that is simple and computationally cheap, but unrealistic. If you need a more realistic procedural option, use [PhysicalSkyMaterial]. </description> <tutorials> </tutorials> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index e80b349da9..e0d41ab90a 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -406,7 +406,7 @@ [b]Note:[/b] Enabling TTS can cause addition idle CPU usage and interfere with the sleep mode, so consider disabling it if TTS is not used. </member> <member name="audio/video/video_delay_compensation_ms" type="int" setter="" getter="" default="0"> - Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing. + Setting to hardcode audio delay when playing video. Best to leave this unchanged unless you know what you are doing. </member> <member name="collada/use_ambient" type="bool" setter="" getter="" default="false"> If [code]true[/code], ambient lights will be imported from COLLADA models as [DirectionalLight3D]. If [code]false[/code], ambient lights will be ignored. @@ -2210,7 +2210,7 @@ [b]Note:[/b] This property is only read when the project starts. To change the maximum number of simulated physics steps per frame at runtime, set [member Engine.max_physics_steps_per_frame] instead. </member> <member name="physics/common/physics_jitter_fix" type="float" setter="" getter="" default="0.5"> - Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. + Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be good enough for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. [b]Note:[/b] For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0[/code]. [b]Note:[/b] This property is only read when the project starts. To change the physics jitter fix at runtime, set [member Engine.physics_jitter_fix] instead. </member> @@ -2551,6 +2551,7 @@ [b]Note:[/b] This setting is only effective when using the Compatibility rendering method, not Forward+ and Mobile. </member> <member name="rendering/limits/spatial_indexer/threaded_cull_minimum_instances" type="int" setter="" getter="" default="1000"> + The minimum number of instances that must be present in a scene to enable culling computations on multiple threads. If a scene has fewer instances than this number, culling is done on a single thread. </member> <member name="rendering/limits/spatial_indexer/update_iterations_per_frame" type="int" setter="" getter="" default="10"> </member> diff --git a/doc/classes/RandomNumberGenerator.xml b/doc/classes/RandomNumberGenerator.xml index 54f18a1ab4..2b6e6af596 100644 --- a/doc/classes/RandomNumberGenerator.xml +++ b/doc/classes/RandomNumberGenerator.xml @@ -6,7 +6,7 @@ <description> RandomNumberGenerator is a class for generating pseudo-random numbers. It currently uses [url=https://www.pcg-random.org/]PCG32[/url]. [b]Note:[/b] The underlying algorithm is an implementation detail and should not be depended upon. - To generate a random float number (within a given range) based on a time-dependant seed: + To generate a random float number (within a given range) based on a time-dependent seed: [codeblock] var rng = RandomNumberGenerator.new() func _ready(): diff --git a/doc/classes/ResourceImporterOBJ.xml b/doc/classes/ResourceImporterOBJ.xml index fa964e5016..55043a311c 100644 --- a/doc/classes/ResourceImporterOBJ.xml +++ b/doc/classes/ResourceImporterOBJ.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="ResourceImporterOBJ" inherits="ResourceImporter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Imports an OBJ 3D model as a standalone [Mesh] or scene. + Imports an OBJ 3D model as an independent [Mesh] or scene. </brief_description> <description> Unlike [ResourceImporterScene], [ResourceImporterOBJ] will import a single [Mesh] resource by default instead of importing a [PackedScene]. This makes it easier to use the [Mesh] resource in nodes that expect direct [Mesh] resources, such as [GridMap], [GPUParticles3D] or [CPUParticles3D]. Note that it is still possible to save mesh resources from 3D scenes using the [b]Advanced Import Settings[/b] dialog, regardless of the source format. diff --git a/doc/classes/ResourceImporterScene.xml b/doc/classes/ResourceImporterScene.xml index 1769da9f24..6a88adf421 100644 --- a/doc/classes/ResourceImporterScene.xml +++ b/doc/classes/ResourceImporterScene.xml @@ -4,7 +4,7 @@ Imports a glTF, FBX, Collada or Blender 3D scene. </brief_description> <description> - See also [ResourceImporterOBJ], which is used for OBJ models that can be imported as a standalone [Mesh] or a scene. + See also [ResourceImporterOBJ], which is used for OBJ models that can be imported as an independent [Mesh] or a scene. Additional options (such as extracting individual meshes or materials to files) are available in the [b]Advanced Import Settings[/b] dialog. This dialog can be accessed by double-clicking a 3D scene in the FileSystem dock or by selecting a 3D scene in the FileSystem dock, going to the Import dock and choosing [b]Advanced[/b]. [b]Note:[/b] [ResourceImporterScene] is [i]not[/i] used for [PackedScene]s, such as [code].tscn[/code] and [code].scn[/code] files. </description> diff --git a/doc/classes/SoftBody3D.xml b/doc/classes/SoftBody3D.xml index b5202bd4e3..a4d80a7c3e 100644 --- a/doc/classes/SoftBody3D.xml +++ b/doc/classes/SoftBody3D.xml @@ -41,6 +41,7 @@ <method name="get_physics_rid" qualifiers="const"> <return type="RID" /> <description> + Returns the internal [RID] used by the [PhysicsServer3D] for this body. </description> </method> <method name="get_point_transform"> @@ -100,11 +101,14 @@ [b]Note:[/b] Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> <member name="damping_coefficient" type="float" setter="set_damping_coefficient" getter="get_damping_coefficient" default="0.01"> + The body's damping coefficient. Higher values will slow down the body more noticeably when forces are applied. </member> <member name="disable_mode" type="int" setter="set_disable_mode" getter="get_disable_mode" enum="SoftBody3D.DisableMode" default="0"> Defines the behavior in physics when [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED]. See [enum DisableMode] for more details about the different modes. </member> <member name="drag_coefficient" type="float" setter="set_drag_coefficient" getter="get_drag_coefficient" default="0.0"> + The body's drag coefficient. Higher values increase this body's air resistance. + [b]Note:[/b] This value is currently unused by Godot's default physics implementation. </member> <member name="linear_stiffness" type="float" setter="set_linear_stiffness" getter="get_linear_stiffness" default="0.5"> Higher values will result in a stiffer body, while lower values will increase the body's ability to bend. The value can be between [code]0.0[/code] and [code]1.0[/code] (inclusive). @@ -113,6 +117,7 @@ [NodePath] to a [CollisionObject3D] this SoftBody3D should avoid clipping. </member> <member name="pressure_coefficient" type="float" setter="set_pressure_coefficient" getter="get_pressure_coefficient" default="0.0"> + The pressure coefficient of this soft body. Simulate pressure build-up from inside this body. Higher values increase the strength of this effect. </member> <member name="ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable" default="true"> If [code]true[/code], the [SoftBody3D] will respond to [RayCast3D]s. diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 5562342eac..32c5f8dff7 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -125,7 +125,7 @@ <param index="1" name="target_index_count" type="int" default="3" /> <description> Generates a LOD for a given [param nd_threshold] in linear units (square root of quadric error metric), using at most [param target_index_count] indices. - [i]Deprecated.[/i] Unused internally and neglects to preserve normals or UVs. Consider using [method ImporterMesh.generate_lods] instead. + [i]Deprecated.[/i] Unused internally and fails to preserve normals or UVs. Consider using [method ImporterMesh.generate_lods] instead. </description> </method> <method name="generate_normals"> diff --git a/doc/classes/SystemFont.xml b/doc/classes/SystemFont.xml index 239bcc257c..fe93571fbe 100644 --- a/doc/classes/SystemFont.xml +++ b/doc/classes/SystemFont.xml @@ -7,7 +7,7 @@ [SystemFont] loads a font from a system font with the first matching name from [member font_names]. It will attempt to match font style, but it's not guaranteed. The returned font might be part of a font collection or be a variable font with OpenType "weight", "width" and/or "italic" features set. - You can create [FontVariation] of the system font for fine control over its features. + You can create [FontVariation] of the system font for precise control over its features. [b]Note:[/b] This class is implemented on iOS, Linux, macOS and Windows, on other platforms it will fallback to default theme font. </description> <tutorials> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 4148c4eb09..ea8185fff4 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -1106,7 +1106,7 @@ </member> <member name="caret_move_on_right_click" type="bool" setter="set_move_caret_on_right_click_enabled" getter="is_move_caret_on_right_click_enabled" default="true"> If [code]true[/code], a right-click moves the caret at the mouse position before displaying the context menu. - If [code]false[/code], the context menu disregards mouse location. + If [code]false[/code], the context menu ignores mouse location. </member> <member name="caret_multiple" type="bool" setter="set_multiple_carets_enabled" getter="is_multiple_carets_enabled" default="true"> Sets if multiple carets are allowed. diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index 0ecfe53123..b265f8ba11 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -5,7 +5,7 @@ </brief_description> <description> Tweens are mostly useful for animations requiring a numerical property to be interpolated over a range of values. The name [i]tween[/i] comes from [i]in-betweening[/i], an animation technique where you specify [i]keyframes[/i] and the computer interpolates the frames that appear between them. Animating something with a [Tween] is called tweening. - [Tween] is more suited than [AnimationPlayer] for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a [Tween]; it would be difficult to do the same thing with an [AnimationPlayer] node. Tweens are also more light-weight than [AnimationPlayer], so they are very much suited for simple animations or general tasks that don't require visual tweaking provided by the editor. They can be used in a fire-and-forget manner for some logic that normally would be done by code. You can e.g. make something shoot periodically by using a looped [CallbackTweener] with a delay. + [Tween] is more suited than [AnimationPlayer] for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a [Tween]; it would be difficult to do the same thing with an [AnimationPlayer] node. Tweens are also more light-weight than [AnimationPlayer], so they are very much suited for simple animations or general tasks that don't require visual tweaking provided by the editor. They can be used in a "fire-and-forget" manner for some logic that normally would be done by code. You can e.g. make something shoot periodically by using a looped [CallbackTweener] with a delay. A [Tween] can be created by using either [method SceneTree.create_tween] or [method Node.create_tween]. [Tween]s created manually (i.e. by using [code]Tween.new()[/code]) are invalid and can't be used for tweening values. A tween animation is created by adding [Tweener]s to the [Tween] object, using [method tween_property], [method tween_interval], [method tween_callback] or [method tween_method]: [codeblocks] diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index 5f6b1960b7..618a774aae 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -357,10 +357,11 @@ Centers a native window on the current screen and an embedded window on its embedder [Viewport]. </description> </method> - <method name="move_to_foreground"> + <method name="move_to_foreground" is_deprecated="true"> <return type="void" /> <description> Moves the [Window] on top of other windows and focuses it. + [i]Deprecated.[/i] Use [method Window.grab_focus] instead. </description> </method> <method name="popup"> @@ -668,6 +669,9 @@ If [code]true[/code], the [Window] is transient, i.e. it's considered a child of another [Window]. The transient window will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can't enter full-screen mode. Note that behavior might be different depending on the platform. </member> + <member name="transient_to_focused" type="bool" setter="set_transient_to_focused" getter="is_transient_to_focused" default="false"> + If [code]true[/code], and the [Window] is [member transient], this window will (at the time of becoming visible) become transient to the currently focused window instead of the immediate parent window in the hierarchy. Note that the transient parent is assigned at the time this window becomes visible, so changing it afterwards has no effect until re-shown. + </member> <member name="transparent" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], the [Window]'s background can be transparent. This is best used with embedded windows. [b]Note:[/b] Transparency support is implemented on Linux, macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities. diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index df3e928538..4435d52527 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -68,6 +68,8 @@ BASE_STRINGS = [ "This value is an integer composed as a bitmask of the following flags.", "There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!", "There is currently no description for this signal. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!", + "There is currently no description for this enum. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!", + "There is currently no description for this constant. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!", "There is currently no description for this annotation. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!", "There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!", "There is currently no description for this constructor. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!", @@ -141,6 +143,9 @@ class State: self.classes: OrderedDict[str, ClassDef] = OrderedDict() self.current_class: str = "" + # Additional content and structure checks and validators. + self.script_language_parity_check: ScriptLanguageParityCheck = ScriptLanguageParityCheck() + def parse_class(self, class_root: ET.Element, filepath: str) -> None: class_name = class_root.attrib["name"] self.current_class = class_name @@ -543,6 +548,9 @@ class ClassDef(DefinitionBase): def __init__(self, name: str) -> None: super().__init__("class", name) + self.class_group = "variant" + self.editor_class = self._is_editor_class() + self.constants: OrderedDict[str, ConstantDef] = OrderedDict() self.enums: OrderedDict[str, EnumDef] = OrderedDict() self.properties: OrderedDict[str, PropertyDef] = OrderedDict() @@ -560,6 +568,65 @@ class ClassDef(DefinitionBase): # Used to match the class with XML source for output filtering purposes. self.filepath: str = "" + def _is_editor_class(self) -> bool: + if self.name.startswith("Editor"): + return True + if self.name in EDITOR_CLASSES: + return True + + return False + + def update_class_group(self, state: State) -> None: + group_name = "variant" + + if self.name.startswith("@"): + group_name = "global" + elif self.inherits: + inherits = self.inherits.strip() + + while inherits in state.classes: + if inherits == "Node": + group_name = "node" + break + if inherits == "Resource": + group_name = "resource" + break + if inherits == "Object": + group_name = "object" + break + + inode = state.classes[inherits].inherits + if inode: + inherits = inode.strip() + else: + break + + self.class_group = group_name + + +# Checks if code samples have both GDScript and C# variations. +# For simplicity we assume that a GDScript example is always present, and ignore contexts +# which don't necessarily need C# examples. +class ScriptLanguageParityCheck: + def __init__(self) -> None: + self.hit_map: OrderedDict[str, List[Tuple[DefinitionBase, str]]] = OrderedDict() + self.hit_count = 0 + + def add_hit(self, class_name: str, context: DefinitionBase, error: str, state: State) -> None: + if class_name in ["@GDScript", "@GlobalScope"]: + return # We don't expect these contexts to have parity. + + class_def = state.classes[class_name] + if class_def.class_group == "variant" and class_def.name != "Object": + return # Variant types are replaced with native types in C#, we don't expect parity. + + self.hit_count += 1 + + if class_name not in self.hit_map: + self.hit_map[class_name] = [] + + self.hit_map[class_name].append((context, error)) + # Entry point for the RST generator. def main() -> None: @@ -590,6 +657,11 @@ def main() -> None: action="store_true", help="If passed, no output will be generated and XML files are only checked for errors.", ) + parser.add_argument( + "--verbose", + action="store_true", + help="If passed, enables verbose printing.", + ) args = parser.parse_args() should_color = args.color or (hasattr(sys.stdout, "isatty") and sys.stdout.isatty()) @@ -684,15 +756,15 @@ def main() -> None: if args.filter and not pattern.search(class_def.filepath): continue state.current_class = class_name - make_rst_class(class_def, state, args.dry_run, args.output) - group_name = get_class_group(class_def, state) + class_def.update_class_group(state) + make_rst_class(class_def, state, args.dry_run, args.output) - if group_name not in grouped_classes: - grouped_classes[group_name] = [] - grouped_classes[group_name].append(class_name) + if class_def.class_group not in grouped_classes: + grouped_classes[class_def.class_group] = [] + grouped_classes[class_def.class_group].append(class_name) - if is_editor_class(class_def): + if class_def.editor_class: if "editor" not in grouped_classes: grouped_classes["editor"] = [] grouped_classes["editor"].append(class_name) @@ -704,6 +776,26 @@ def main() -> None: print("") + # Print out checks. + + if state.script_language_parity_check.hit_count > 0: + if not args.verbose: + print( + f'{STYLES["yellow"]}{state.script_language_parity_check.hit_count} code samples failed parity check. Use --verbose to get more information.{STYLES["reset"]}' + ) + else: + print( + f'{STYLES["yellow"]}{state.script_language_parity_check.hit_count} code samples failed parity check:{STYLES["reset"]}' + ) + + for class_name in state.script_language_parity_check.hit_map.keys(): + class_hits = state.script_language_parity_check.hit_map[class_name] + print(f'{STYLES["yellow"]}- {len(class_hits)} hits in class "{class_name}"{STYLES["reset"]}') + + for context, error in class_hits: + print(f" - {error} in {format_context_name(context)}") + print("") + # Print out warnings and errors, or lack thereof, and exit with an appropriate code. if state.num_warnings >= 2: @@ -760,46 +852,6 @@ def get_git_branch() -> str: return "master" -def get_class_group(class_def: ClassDef, state: State) -> str: - group_name = "variant" - class_name = class_def.name - - if class_name.startswith("@"): - group_name = "global" - elif class_def.inherits: - inherits = class_def.inherits.strip() - - while inherits in state.classes: - if inherits == "Node": - group_name = "node" - break - if inherits == "Resource": - group_name = "resource" - break - if inherits == "Object": - group_name = "object" - break - - inode = state.classes[inherits].inherits - if inode: - inherits = inode.strip() - else: - break - - return group_name - - -def is_editor_class(class_def: ClassDef) -> bool: - class_name = class_def.name - - if class_name.startswith("Editor"): - return True - if class_name in EDITOR_CLASSES: - return True - - return False - - # Generator methods. @@ -1052,6 +1104,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if value.text is not None and value.text.strip() != "": f.write(f"{format_text_block(value.text.strip(), value, state)}") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this enum. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!" + ) + + "\n\n" + ) f.write("\n\n") @@ -1075,6 +1135,14 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: if constant.text is not None and constant.text.strip() != "": f.write(f"{format_text_block(constant.text.strip(), constant, state)}") + else: + f.write(".. container:: contribute\n\n\t") + f.write( + translate( + "There is currently no description for this constant. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!" + ) + + "\n\n" + ) f.write("\n\n") @@ -1642,7 +1710,7 @@ def parse_link_target(link_target: str, state: State, context_name: str) -> List def format_text_block( text: str, - context: Union[DefinitionBase, None], + context: DefinitionBase, state: State, ) -> str: # Linebreak + tabs in the XML should become two line breaks unless in a "codeblock" @@ -1691,6 +1759,10 @@ def format_text_block( inside_code_tag = "" inside_code_tabs = False ignore_code_warnings = False + code_warning_if_intended_string = "If this is intended, use [code skip-lint]...[/code]." + + has_codeblocks_gdscript = False + has_codeblocks_csharp = False pos = 0 tag_depth = 0 @@ -1749,7 +1821,7 @@ def format_text_block( else: if not ignore_code_warnings and tag_state.closing: print_warning( - f'{state.current_class}.xml: Found a code string that looks like a closing tag "[{tag_state.raw}]" in {context_name}.', + f'{state.current_class}.xml: Found a code string that looks like a closing tag "[{tag_state.raw}]" in {context_name}. {code_warning_if_intended_string}', state, ) @@ -1759,6 +1831,17 @@ def format_text_block( elif tag_state.name == "codeblocks": if tag_state.closing: + if not has_codeblocks_gdscript or not has_codeblocks_csharp: + state.script_language_parity_check.add_hit( + state.current_class, + context, + "Only one script language sample found in [codeblocks]", + state, + ) + + has_codeblocks_gdscript = False + has_codeblocks_csharp = False + tag_depth -= 1 tag_text = "" inside_code_tabs = False @@ -1776,6 +1859,8 @@ def format_text_block( f"{state.current_class}.xml: GDScript code block is used outside of [codeblocks] in {context_name}.", state, ) + else: + has_codeblocks_gdscript = True tag_text = "\n .. code-tab:: gdscript\n" elif tag_state.name == "csharp": if not inside_code_tabs: @@ -1783,8 +1868,17 @@ def format_text_block( f"{state.current_class}.xml: C# code block is used outside of [codeblocks] in {context_name}.", state, ) + else: + has_codeblocks_csharp = True tag_text = "\n .. code-tab:: csharp\n" else: + state.script_language_parity_check.add_hit( + state.current_class, + context, + "Code sample is formatted with [codeblock] where [codeblocks] should be used", + state, + ) + tag_text = "\n::\n" inside_code = True @@ -1816,7 +1910,7 @@ def format_text_block( if inside_code_text in state.classes: print_warning( - f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches one of the known classes in {context_name}.', + f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches one of the known classes in {context_name}. {code_warning_if_intended_string}', state, ) @@ -1826,49 +1920,49 @@ def format_text_block( if target_name in class_def.methods: print_warning( - f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} method in {context_name}.', + f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} method in {context_name}. {code_warning_if_intended_string}', state, ) elif target_name in class_def.constructors: print_warning( - f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} constructor in {context_name}.', + f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} constructor in {context_name}. {code_warning_if_intended_string}', state, ) elif target_name in class_def.operators: print_warning( - f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} operator in {context_name}.', + f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} operator in {context_name}. {code_warning_if_intended_string}', state, ) elif target_name in class_def.properties: print_warning( - f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} member in {context_name}.', + f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} member in {context_name}. {code_warning_if_intended_string}', state, ) elif target_name in class_def.signals: print_warning( - f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} signal in {context_name}.', + f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} signal in {context_name}. {code_warning_if_intended_string}', state, ) elif target_name in class_def.annotations: print_warning( - f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} annotation in {context_name}.', + f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} annotation in {context_name}. {code_warning_if_intended_string}', state, ) elif target_name in class_def.theme_items: print_warning( - f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} theme item in {context_name}.', + f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} theme item in {context_name}. {code_warning_if_intended_string}', state, ) elif target_name in class_def.constants: print_warning( - f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} constant in {context_name}.', + f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} constant in {context_name}. {code_warning_if_intended_string}', state, ) @@ -1876,7 +1970,7 @@ def format_text_block( for enum in class_def.enums.values(): if target_name in enum.values: print_warning( - f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} enum value in {context_name}.', + f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches the {target_class_name}.{target_name} enum value in {context_name}. {code_warning_if_intended_string}', state, ) break @@ -1887,7 +1981,7 @@ def format_text_block( for param_def in context_params: if param_def.name == inside_code_text: print_warning( - f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches one of the parameters in {context_name}.', + f'{state.current_class}.xml: Found a code string "{inside_code_text}" that matches one of the parameters in {context_name}. {code_warning_if_intended_string}', state, ) break diff --git a/drivers/d3d12/d3d12_context.cpp b/drivers/d3d12/d3d12_context.cpp index 37066a811d..0ba3f59119 100644 --- a/drivers/d3d12/d3d12_context.cpp +++ b/drivers/d3d12/d3d12_context.cpp @@ -55,12 +55,11 @@ #include <guiddef.h> #include <dxguids.h> -#ifndef CLSID_D3D12DeviceFactory -// Note: symbol is not available in MinGW import library. -const CLSID CLSID_D3D12DeviceFactory = __uuidof(ID3D12DeviceFactory); -#endif #endif +// Note: symbol is not available in MinGW and old MSVC import libraries. +const CLSID CLSID_D3D12DeviceFactoryGodot = __uuidof(ID3D12DeviceFactory); + extern "C" { char godot_nir_arch_name[32]; } @@ -825,9 +824,9 @@ void D3D12Context::_init_device_factory() { ID3D12SDKConfiguration1 *sdk_config1 = nullptr; if (SUCCEEDED(sdk_config->QueryInterface(&sdk_config1))) { if (SUCCEEDED(sdk_config1->CreateDeviceFactory(agility_sdk_version, agility_sdk_path.ascii().get_data(), IID_PPV_ARGS(device_factory.GetAddressOf())))) { - d3d_D3D12GetInterface(CLSID_D3D12DeviceFactory, IID_PPV_ARGS(device_factory.GetAddressOf())); + d3d_D3D12GetInterface(CLSID_D3D12DeviceFactoryGodot, IID_PPV_ARGS(device_factory.GetAddressOf())); } else if (SUCCEEDED(sdk_config1->CreateDeviceFactory(agility_sdk_version, ".\\", IID_PPV_ARGS(device_factory.GetAddressOf())))) { - d3d_D3D12GetInterface(CLSID_D3D12DeviceFactory, IID_PPV_ARGS(device_factory.GetAddressOf())); + d3d_D3D12GetInterface(CLSID_D3D12DeviceFactoryGodot, IID_PPV_ARGS(device_factory.GetAddressOf())); } sdk_config1->Release(); } diff --git a/drivers/d3d12/rendering_device_driver_d3d12.cpp b/drivers/d3d12/rendering_device_driver_d3d12.cpp index d3a7344c9d..aed82b4ce8 100644 --- a/drivers/d3d12/rendering_device_driver_d3d12.cpp +++ b/drivers/d3d12/rendering_device_driver_d3d12.cpp @@ -78,6 +78,17 @@ extern "C" { #undef UNUSED #endif +#ifdef PIX_ENABLED +#if defined(__GNUC__) +#define _MSC_VER 1800 +#endif +#define USE_PIX +#include "WinPixEventRuntime/pix3.h" +#if defined(__GNUC__) +#undef _MSC_VER +#endif +#endif + static const D3D12_RANGE VOID_RANGE = {}; static const uint32_t ROOT_CONSTANT_SPACE = RDD::MAX_UNIFORM_SETS + 1; @@ -5159,7 +5170,7 @@ void RenderingDeviceDriverD3D12::command_timestamp_write(CommandBufferID p_cmd_b TimestampQueryPoolInfo *tqp_info = (TimestampQueryPoolInfo *)p_pool_id.id; ID3D12Resource *results_buffer = tqp_info->results_buffer_allocation->GetResource(); cmd_buf_info->cmd_list->EndQuery(tqp_info->query_heap.Get(), D3D12_QUERY_TYPE_TIMESTAMP, p_index); - cmd_buf_info->cmd_list->ResolveQueryData(tqp_info->query_heap.Get(), D3D12_QUERY_TYPE_TIMESTAMP, p_index, tqp_info->query_count, results_buffer, p_index * sizeof(uint64_t)); + cmd_buf_info->cmd_list->ResolveQueryData(tqp_info->query_heap.Get(), D3D12_QUERY_TYPE_TIMESTAMP, p_index, 1, results_buffer, p_index * sizeof(uint64_t)); } void RenderingDeviceDriverD3D12::command_begin_label(CommandBufferID p_cmd_buffer, const char *p_label_name, const Color &p_color) { diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 5d6cef6e05..fe16d8838b 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -2295,14 +2295,18 @@ void RasterizerCanvasGLES3::_prepare_canvas_texture(RID p_texture, RS::CanvasIte GLES3::Texture *texture = texture_storage->get_texture(ct->diffuse); Size2i size_cache; + + // Cache default white resource ID. + const RID default_texture_id = texture_storage->texture_gl_get_default(GLES3::DEFAULT_GL_TEXTURE_WHITE); + + // If no texture is assigned, assign default white. if (!texture) { - ct->diffuse = texture_storage->texture_gl_get_default(GLES3::DEFAULT_GL_TEXTURE_WHITE); - GLES3::Texture *tex = texture_storage->get_texture(ct->diffuse); - size_cache = Size2i(tex->width, tex->height); - } else { - size_cache = Size2i(texture->width, texture->height); + ct->diffuse = default_texture_id; } + // Enforce a 1x1 size if default white texture. + size_cache = ct->diffuse == default_texture_id ? Size2i(1, 1) : Size2i(texture->width, texture->height); + GLES3::Texture *normal_map = texture_storage->get_texture(ct->normal_map); if (ct->specular_color.a < 0.999) { diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp index 8b5aaa6b8d..27402da7c8 100644 --- a/drivers/gles3/shader_gles3.cpp +++ b/drivers/gles3/shader_gles3.cpp @@ -611,6 +611,7 @@ void ShaderGLES3::_save_to_cache(Version *p_version) { #ifdef WEB_ENABLED // not supported in webgl return; #else + ERR_FAIL_COND(!shader_cache_dir_valid); #if !defined(ANDROID_ENABLED) && !defined(IOS_ENABLED) if (RasterizerGLES3::is_gles_over_gl() && (glGetProgramBinary == NULL)) { // ARB_get_program_binary extension not available. return; diff --git a/drivers/gles3/shader_gles3.h b/drivers/gles3/shader_gles3.h index 0cb53da316..8968e76c12 100644 --- a/drivers/gles3/shader_gles3.h +++ b/drivers/gles3/shader_gles3.h @@ -209,7 +209,9 @@ protected: _compile_specialization(s, p_variant, version, p_specialization); version->variants[p_variant].insert(p_specialization, s); spec = version->variants[p_variant].lookup_ptr(p_specialization); - _save_to_cache(version); + if (shader_cache_dir_valid) { + _save_to_cache(version); + } } } else if (spec->build_queued) { // Still queued, wait diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 51ea9234d4..8126f74332 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -153,7 +153,9 @@ int OS_Unix::unix_initialize_audio(int p_audio_driver) { } void OS_Unix::initialize_core() { +#ifdef THREADS_ENABLED init_thread_posix(); +#endif FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_RESOURCES); FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_USERDATA); diff --git a/drivers/vulkan/rendering_device_driver_vulkan.cpp b/drivers/vulkan/rendering_device_driver_vulkan.cpp index 34acc0cc15..8378e26666 100644 --- a/drivers/vulkan/rendering_device_driver_vulkan.cpp +++ b/drivers/vulkan/rendering_device_driver_vulkan.cpp @@ -808,8 +808,11 @@ void RenderingDeviceDriverVulkan::texture_get_copyable_layout(TextureID p_textur h = MAX(1u, h >> 1); d = MAX(1u, d >> 1); } - r_layout->size = get_image_format_required_size(tex_info->rd_format, w, h, d, 1); - r_layout->row_pitch = r_layout->size / (h * d); + uint32_t bw = 0, bh = 0; + get_compressed_image_format_block_dimensions(tex_info->rd_format, bw, bh); + uint32_t sbw = 0, sbh = 0; + r_layout->size = get_image_format_required_size(tex_info->rd_format, w, h, d, 1, &sbw, &sbh); + r_layout->row_pitch = r_layout->size / ((sbh / bh) * d); r_layout->depth_pitch = r_layout->size / d; r_layout->layer_pitch = r_layout->size / tex_info->vk_create_info.arrayLayers; } diff --git a/editor/SCsub b/editor/SCsub index b1a47dae45..5b36bca81a 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -104,19 +104,6 @@ if env.editor_build: env.Run(editor_builders.make_doc_translations_header, "Generating translations header."), ) - # Fonts - flist = glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.ttf") - flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.otf")) - flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.woff")) - flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.woff2")) - flist.sort() - env.Depends("#editor/builtin_fonts.gen.h", flist) - env.CommandNoCache( - "#editor/builtin_fonts.gen.h", - flist, - env.Run(editor_builders.make_fonts_header, "Generating builtin fonts header."), - ) - env.add_source_files(env.editor_sources, "*.cpp") env.add_source_files(env.editor_sources, "register_exporters.gen.cpp") @@ -126,6 +113,7 @@ if env.editor_build: SConscript("icons/SCsub") SConscript("import/SCsub") SConscript("plugins/SCsub") + SConscript("themes/SCsub") lib = env.add_library("editor", env.editor_sources) env.Prepend(LIBS=[lib]) diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index 7bb6ec0d5d..5154d2e0e0 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -30,12 +30,13 @@ #include "editor/action_map_editor.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/event_listener_line_edit.h" #include "editor/input_event_configuration_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/check_button.h" +#include "scene/gui/separator.h" #include "scene/gui/tree.h" #include "scene/scene_string_names.h" @@ -357,6 +358,7 @@ void ActionMapEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { action_list_search->set_right_icon(get_editor_theme_icon(SNAME("Search"))); + add_button->set_icon(get_editor_theme_icon(SNAME("Add"))); if (!actions_cache.is_empty()) { update_action_list(); } @@ -570,6 +572,8 @@ ActionMapEditor::ActionMapEditor() { // Disable the button and set its tooltip. _add_edit_text_changed(add_edit->get_text()); + add_hbox->add_child(memnew(VSeparator)); + show_builtin_actions_checkbutton = memnew(CheckButton); show_builtin_actions_checkbutton->set_text(TTR("Show Built-in Actions")); show_builtin_actions_checkbutton->connect("toggled", callable_mp(this, &ActionMapEditor::set_show_builtin_actions)); diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 4849a6824c..f29b851673 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -31,10 +31,10 @@ #include "animation_bezier_editor.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/view_panner.h" #include "scene/resources/text_line.h" @@ -334,7 +334,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { } } - Color dc = get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)); + Color dc = get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor)); Ref<Texture2D> remove = get_editor_theme_icon(SNAME("Remove")); float remove_hpos = limit - hsep - remove->get_width(); diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 41a6d77860..3c704b3473 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -35,7 +35,6 @@ #include "core/input/input.h" #include "editor/animation_bezier_editor.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" @@ -43,6 +42,7 @@ #include "editor/gui/scene_tree_editor.h" #include "editor/inspector_dock.h" #include "editor/plugins/animation_player_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/animation/animation_player.h" #include "scene/animation/tween.h" #include "scene/gui/check_box.h" @@ -1921,7 +1921,7 @@ void AnimationTrackEdit::_notification(int p_what) { Color linecolor = color; linecolor.a = 0.2; - Color dc = get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)); + Color dc = get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor)); // NAMES AND ICONS // diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index 390b722b7b..7a53f4dded 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -32,9 +32,9 @@ #include "editor/audio_stream_preview.h" #include "editor/editor_resource_preview.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" +#include "editor/themes/editor_scale.h" #include "scene/2d/animated_sprite_2d.h" #include "scene/2d/sprite_2d.h" #include "scene/3d/sprite_3d.h" diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index d9101466fc..76d0d40110 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -34,10 +34,10 @@ #include "core/os/keyboard.h" #include "core/string/string_builder.h" #include "core/templates/pair.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/font.h" void GotoLineDialog::popup_find_line(CodeEdit *p_edit) { diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 69908af47d..0285692ab7 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -35,13 +35,13 @@ #include "editor/editor_help.h" #include "editor/editor_inspector.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/scene_tree_editor.h" #include "editor/node_dock.h" #include "editor/scene_tree_dock.h" +#include "editor/themes/editor_scale.h" #include "plugins/script_editor_plugin.h" #include "scene/gui/button.h" #include "scene/gui/check_box.h" @@ -1202,7 +1202,22 @@ void ConnectionsDock::_slot_menu_about_to_popup() { slot_menu->set_item_disabled(slot_menu->get_item_index(SLOT_MENU_DISCONNECT), connection_is_inherited); } -void ConnectionsDock::_rmb_pressed(const Ref<InputEvent> &p_event) { +void ConnectionsDock::_tree_gui_input(const Ref<InputEvent> &p_event) { + // Handle Delete press. + if (ED_IS_SHORTCUT("connections_editor/disconnect", p_event)) { + TreeItem *item = tree->get_selected(); + if (item && _get_item_type(*item) == TREE_ITEM_TYPE_CONNECTION) { + Connection connection = item->get_metadata(0); + _disconnect(connection); + update_tree(); + + // Stop the Delete input from propagating elsewhere. + accept_event(); + return; + } + } + + // Handle RMB press. const Ref<InputEventMouseButton> &mb_event = p_event; if (mb_event.is_null() || !mb_event->is_pressed() || mb_event->get_button_index() != MouseButton::RIGHT) { return; @@ -1536,13 +1551,13 @@ ConnectionsDock::ConnectionsDock() { slot_menu->connect("about_to_popup", callable_mp(this, &ConnectionsDock::_slot_menu_about_to_popup)); slot_menu->add_item(TTR("Edit..."), SLOT_MENU_EDIT); slot_menu->add_item(TTR("Go to Method"), SLOT_MENU_GO_TO_METHOD); - slot_menu->add_item(TTR("Disconnect"), SLOT_MENU_DISCONNECT); + slot_menu->add_shortcut(ED_SHORTCUT("connections_editor/disconnect", TTR("Disconnect"), Key::KEY_DELETE), SLOT_MENU_DISCONNECT); add_child(slot_menu); connect_dialog->connect("connected", callable_mp(this, &ConnectionsDock::_make_or_edit_connection)); tree->connect("item_selected", callable_mp(this, &ConnectionsDock::_tree_item_selected)); tree->connect("item_activated", callable_mp(this, &ConnectionsDock::_tree_item_activated)); - tree->connect("gui_input", callable_mp(this, &ConnectionsDock::_rmb_pressed)); + tree->connect("gui_input", callable_mp(this, &ConnectionsDock::_tree_gui_input)); add_theme_constant_override("separation", 3 * EDSCALE); } diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h index 2fd4778389..a99f0dd0fe 100644 --- a/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -252,7 +252,7 @@ class ConnectionsDock : public VBoxContainer { void _signal_menu_about_to_popup(); void _handle_slot_menu_option(int p_option); void _slot_menu_about_to_popup(); - void _rmb_pressed(const Ref<InputEvent> &p_event); + void _tree_gui_input(const Ref<InputEvent> &p_event); void _close(); protected: diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 49d997fc6a..da0182b176 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -35,9 +35,9 @@ #include "editor/editor_feature_profile.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const String &p_current_type, const String &p_current_name) { _fill_type_list(); @@ -306,7 +306,7 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type)); if (!instantiable) { - r_item->set_custom_color(0, search_options->get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + r_item->set_custom_color(0, search_options->get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); } HashMap<String, DocData::ClassDoc>::Iterator class_doc = EditorHelp::get_doc_data()->class_list.find(p_type); diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 372d558aab..6471bd449e 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -593,9 +593,15 @@ void EditorDebuggerNode::set_breakpoints(const String &p_path, Array p_lines) { } } -void EditorDebuggerNode::reload_scripts() { +void EditorDebuggerNode::reload_all_scripts() { _for_all(tabs, [&](ScriptEditorDebugger *dbg) { - dbg->reload_scripts(); + dbg->reload_all_scripts(); + }); +} + +void EditorDebuggerNode::reload_scripts(const Vector<String> &p_script_paths) { + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->reload_scripts(p_script_paths); }); } diff --git a/editor/debugger/editor_debugger_node.h b/editor/debugger/editor_debugger_node.h index 4338f144b8..d30f29c7c6 100644 --- a/editor/debugger/editor_debugger_node.h +++ b/editor/debugger/editor_debugger_node.h @@ -187,7 +187,8 @@ public: bool is_skip_breakpoints() const; void set_breakpoint(const String &p_path, int p_line, bool p_enabled); void set_breakpoints(const String &p_path, Array p_lines); - void reload_scripts(); + void reload_all_scripts(); + void reload_scripts(const Vector<String> &p_script_paths); // Remote inspector/edit. void request_remote_tree(); diff --git a/editor/debugger/editor_performance_profiler.cpp b/editor/debugger/editor_performance_profiler.cpp index e93369179c..af723cc731 100644 --- a/editor/debugger/editor_performance_profiler.cpp +++ b/editor/debugger/editor_performance_profiler.cpp @@ -31,9 +31,9 @@ #include "editor_performance_profiler.h" #include "editor/editor_property_name_processor.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "main/performance.h" EditorPerformanceProfiler::Monitor::Monitor() {} diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index d54fd62e8c..2809b873b1 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -31,9 +31,9 @@ #include "editor_profiler.h" #include "core/os/os.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/image_texture.h" void EditorProfiler::_make_metric_ptrs(Metric &m) { diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 7df942e288..4ebed726c5 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -31,9 +31,9 @@ #include "editor_visual_profiler.h" #include "core/os/os.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/image_texture.h" void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) { diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index d926bd0f12..3c863bdc19 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -44,7 +44,6 @@ #include "editor/editor_log.h" #include "editor/editor_node.h" #include "editor/editor_property_name_processor.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" @@ -52,6 +51,7 @@ #include "editor/plugins/canvas_item_editor_plugin.h" #include "editor/plugins/editor_debugger_plugin.h" #include "editor/plugins/node_3d_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "main/performance.h" #include "scene/3d/camera_3d.h" #include "scene/debugger/scene_debugger.h" @@ -1518,8 +1518,12 @@ void ScriptEditorDebugger::set_breakpoint(const String &p_path, int p_line, bool } } -void ScriptEditorDebugger::reload_scripts() { - _put_msg("reload_scripts", Array(), debugging_thread_id != Thread::UNASSIGNED_ID ? debugging_thread_id : Thread::MAIN_ID); +void ScriptEditorDebugger::reload_all_scripts() { + _put_msg("reload_all_scripts", Array(), debugging_thread_id != Thread::UNASSIGNED_ID ? debugging_thread_id : Thread::MAIN_ID); +} + +void ScriptEditorDebugger::reload_scripts(const Vector<String> &p_script_paths) { + _put_msg("reload_scripts", Variant(p_script_paths).operator Array(), debugging_thread_id != Thread::UNASSIGNED_ID ? debugging_thread_id : Thread::MAIN_ID); } bool ScriptEditorDebugger::is_skip_breakpoints() { diff --git a/editor/debugger/script_editor_debugger.h b/editor/debugger/script_editor_debugger.h index 79224061ff..589e82ef25 100644 --- a/editor/debugger/script_editor_debugger.h +++ b/editor/debugger/script_editor_debugger.h @@ -300,7 +300,8 @@ public: void update_live_edit_root(); - void reload_scripts(); + void reload_all_scripts(); + void reload_scripts(const Vector<String> &p_script_paths); bool is_skip_breakpoints(); diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index a891491339..4be6afbcff 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -35,9 +35,9 @@ #include "core/io/resource_loader.h" #include "editor/editor_file_system.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/margin_container.h" void DependencyEditor::_searched(const String &p_path) { diff --git a/editor/directory_create_dialog.cpp b/editor/directory_create_dialog.cpp index aacd718fde..6f9b91731b 100644 --- a/editor/directory_create_dialog.cpp +++ b/editor/directory_create_dialog.cpp @@ -32,8 +32,8 @@ #include "core/io/dir_access.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/gui/editor_validation_panel.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/label.h" #include "scene/gui/line_edit.h" diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp index 9c1fc2a8bf..44f6444a31 100644 --- a/editor/doc_tools.cpp +++ b/editor/doc_tools.cpp @@ -307,21 +307,21 @@ void DocTools::merge_from(const DocTools &p_data) { } } -void DocTools::remove_from(const DocTools &p_data) { - for (const KeyValue<String, DocData::ClassDoc> &E : p_data.class_list) { - if (class_list.has(E.key)) { - class_list.erase(E.key); - } - } -} - void DocTools::add_doc(const DocData::ClassDoc &p_class_doc) { ERR_FAIL_COND(p_class_doc.name.is_empty()); class_list[p_class_doc.name] = p_class_doc; + inheriting[p_class_doc.inherits].insert(p_class_doc.name); } void DocTools::remove_doc(const String &p_class_name) { ERR_FAIL_COND(p_class_name.is_empty() || !class_list.has(p_class_name)); + const String &inherits = class_list[p_class_name].inherits; + if (inheriting.has(inherits)) { + inheriting[inherits].erase(p_class_name); + if (inheriting[inherits].is_empty()) { + inheriting.erase(inherits); + } + } class_list.erase(p_class_name); } @@ -391,6 +391,8 @@ void DocTools::generate(BitField<GenerateFlags> p_flags) { c.name = cname; c.inherits = ClassDB::get_parent_class(name); + inheriting[c.inherits].insert(cname); + List<PropertyInfo> properties; List<PropertyInfo> own_properties; @@ -692,6 +694,7 @@ void DocTools::generate(BitField<GenerateFlags> p_flags) { // it's not a ClassDB-exposed class. class_list["Variant"] = DocData::ClassDoc(); class_list["Variant"].name = "Variant"; + inheriting[""].insert("Variant"); } // Add Variant data types. @@ -709,6 +712,8 @@ void DocTools::generate(BitField<GenerateFlags> p_flags) { DocData::ClassDoc &c = class_list[cname]; c.name = cname; + inheriting[""].insert(cname); + Callable::CallError cerror; Variant v; Variant::construct(Variant::Type(i), v, nullptr, 0, cerror); @@ -870,6 +875,8 @@ void DocTools::generate(BitField<GenerateFlags> p_flags) { DocData::ClassDoc &c = class_list[cname]; c.name = cname; + inheriting[""].insert(cname); + // Global constants. for (int i = 0; i < CoreConstants::get_global_constant_count(); i++) { DocData::ConstantDoc cd; @@ -953,6 +960,8 @@ void DocTools::generate(BitField<GenerateFlags> p_flags) { DocData::ClassDoc c; c.name = cname; + inheriting[""].insert(cname); + // Get functions. List<MethodInfo> minfo; lang->get_public_functions(&minfo); @@ -1195,6 +1204,8 @@ Error DocTools::_load(Ref<XMLParser> parser) { c.inherits = parser->get_named_attribute_value("inherits"); } + inheriting[c.inherits].insert(name); + if (parser->has_attribute("is_deprecated")) { c.is_deprecated = parser->get_named_attribute_value("is_deprecated").to_lower() == "true"; } diff --git a/editor/doc_tools.h b/editor/doc_tools.h index 5fffb6be38..7f29cc238a 100644 --- a/editor/doc_tools.h +++ b/editor/doc_tools.h @@ -32,16 +32,17 @@ #define DOC_TOOLS_H #include "core/doc_data.h" +#include "core/templates/rb_set.h" class DocTools { public: String version; HashMap<String, DocData::ClassDoc> class_list; + HashMap<String, RBSet<String, NaturalNoCaseComparator>> inheriting; static Error erase_classes(const String &p_dir); void merge_from(const DocTools &p_data); - void remove_from(const DocTools &p_data); void add_doc(const DocData::ClassDoc &p_class_doc); void remove_doc(const String &p_class_name); bool has_doc(const String &p_class_name); diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index 1f9911f31e..6c859ce236 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -35,6 +35,7 @@ #include "core/license.gen.h" #include "core/version.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" // The metadata key used to store and retrieve the version text to copy to the clipboard. const String EditorAbout::META_TEXT_TO_COPY = "text_to_copy"; diff --git a/editor/editor_about.h b/editor/editor_about.h index 22b5f3ded0..639dc6cc3f 100644 --- a/editor/editor_about.h +++ b/editor/editor_about.h @@ -42,8 +42,6 @@ #include "scene/gui/texture_rect.h" #include "scene/gui/tree.h" -#include "editor/editor_scale.h" - /** * NOTE: Do not assume the EditorNode singleton to be available in this class' methods. * EditorAbout is also used from the project manager where EditorNode isn't initialized. diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index b609de9f67..ab0816805f 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -35,11 +35,11 @@ #include "core/io/zip_io.h" #include "editor/editor_file_system.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" #include "editor/gui/editor_toaster.h" #include "editor/progress_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/check_box.h" #include "scene/gui/label.h" #include "scene/gui/link_button.h" diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index c1183c8d66..50845b4458 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -35,12 +35,12 @@ #include "core/io/resource_saver.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/filesystem_dock.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/separator.h" #include "scene/resources/font.h" #include "servers/audio_server.h" diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index 6a167e4368..4d5393299c 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -33,12 +33,12 @@ #include "core/config/project_settings.h" #include "core/core_constants.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/filesystem_dock.h" #include "editor/gui/editor_file_dialog.h" #include "editor/project_settings_editor.h" +#include "editor/themes/editor_scale.h" #include "scene/main/window.h" #include "scene/resources/packed_scene.h" @@ -65,6 +65,7 @@ void EditorAutoloadSettings::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { browse_button->set_icon(get_editor_theme_icon(SNAME("Folder"))); + add_autoload->set_icon(get_editor_theme_icon(SNAME("Add"))); } break; case NOTIFICATION_VISIBILITY_CHANGED: { diff --git a/editor/editor_build_profile.cpp b/editor/editor_build_profile.cpp index 8ab8bc4a52..3d10b7949e 100644 --- a/editor/editor_build_profile.cpp +++ b/editor/editor_build_profile.cpp @@ -36,10 +36,10 @@ #include "editor/editor_node.h" #include "editor/editor_paths.h" #include "editor/editor_property_name_processor.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" const char *EditorBuildProfile::build_option_identifiers[BUILD_OPTION_MAX] = { // This maps to SCons build options. @@ -601,7 +601,7 @@ void EditorBuildProfileManager::_fill_classes_from(TreeItem *p_parent, const Str bool disabled = edited->is_class_disabled(p_class); if (disabled) { - class_item->set_custom_color(0, class_list->get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + class_item->set_custom_color(0, class_list->get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); } class_item->set_text(0, text); diff --git a/editor/editor_builders.py b/editor/editor_builders.py index 90ecccbf30..25004da877 100644 --- a/editor/editor_builders.py +++ b/editor/editor_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os import os.path import shutil @@ -49,34 +50,6 @@ def make_doc_header(target, source, env): g.close() -def make_fonts_header(target, source, env): - dst = target[0] - - g = open(dst, "w", encoding="utf-8") - - g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") - g.write("#ifndef _EDITOR_FONTS_H\n") - g.write("#define _EDITOR_FONTS_H\n") - - # Saving uncompressed, since FreeType will reference from memory pointer. - for i in range(len(source)): - with open(source[i], "rb") as f: - buf = f.read() - - name = os.path.splitext(os.path.basename(source[i]))[0] - - g.write("static const int _font_" + name + "_size = " + str(len(buf)) + ";\n") - g.write("static const unsigned char _font_" + name + "[] = {\n") - for j in range(len(buf)): - g.write("\t" + str(buf[j]) + ",\n") - - g.write("};\n") - - g.write("#endif") - - g.close() - - def make_translations_header(target, source, env, category): dst = target[0] diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp index ce5d8619e1..567b686b85 100644 --- a/editor/editor_command_palette.cpp +++ b/editor/editor_command_palette.cpp @@ -31,10 +31,10 @@ #include "editor/editor_command_palette.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_toaster.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/control.h" #include "scene/gui/tree.h" diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 5f77959127..794d1b3e10 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -37,10 +37,10 @@ #include "core/io/resource_loader.h" #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "editor/editor_scale.h" #include "editor/editor_undo_redo_manager.h" #include "editor/multi_node_edit.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/packed_scene.h" void EditorSelectionHistory::cleanup_history() { diff --git a/editor/editor_dock_manager.cpp b/editor/editor_dock_manager.cpp new file mode 100644 index 0000000000..dfe9504706 --- /dev/null +++ b/editor/editor_dock_manager.cpp @@ -0,0 +1,716 @@ +/**************************************************************************/ +/* editor_dock_manager.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "editor_dock_manager.h" + +#include "scene/gui/box_container.h" +#include "scene/gui/button.h" +#include "scene/gui/label.h" +#include "scene/gui/popup.h" +#include "scene/gui/split_container.h" +#include "scene/gui/tab_container.h" +#include "scene/main/window.h" + +#include "editor/editor_node.h" +#include "editor/editor_settings.h" +#include "editor/editor_string_names.h" +#include "editor/filesystem_dock.h" +#include "editor/themes/editor_scale.h" +#include "editor/window_wrapper.h" + +EditorDockManager *EditorDockManager::singleton = nullptr; + +void DockSplitContainer::_update_visibility() { + if (is_updating) { + return; + } + is_updating = true; + bool any_visible = false; + for (int i = 0; i < 2; i++) { + Control *split = get_containable_child(i); + if (split && split->is_visible()) { + any_visible = true; + break; + } + } + set_visible(any_visible); + is_updating = false; +} + +void DockSplitContainer::add_child_notify(Node *p_child) { + SplitContainer::add_child_notify(p_child); + + Control *child_control = nullptr; + for (int i = 0; i < 2; i++) { + Control *split = get_containable_child(i); + if (p_child == split) { + child_control = split; + break; + } + } + if (!child_control) { + return; + } + + child_control->connect("visibility_changed", callable_mp(this, &DockSplitContainer::_update_visibility)); + _update_visibility(); +} + +void DockSplitContainer::remove_child_notify(Node *p_child) { + SplitContainer::remove_child_notify(p_child); + + Control *child_control = nullptr; + for (int i = 0; i < 2; i++) { + Control *split = get_containable_child(i); + if (p_child == split) { + child_control = split; + break; + } + } + if (!child_control) { + return; + } + + child_control->disconnect("visibility_changed", callable_mp(this, &DockSplitContainer::_update_visibility)); + _update_visibility(); +} + +void EditorDockManager::_dock_select_popup_theme_changed() { + if (dock_float) { + dock_float->set_icon(dock_select_popup->get_editor_theme_icon(SNAME("MakeFloating"))); + } + if (dock_select_popup->is_layout_rtl()) { + dock_tab_move_left->set_icon(dock_select_popup->get_editor_theme_icon(SNAME("Forward"))); + dock_tab_move_right->set_icon(dock_select_popup->get_editor_theme_icon(SNAME("Back"))); + } else { + dock_tab_move_left->set_icon(dock_select_popup->get_editor_theme_icon(SNAME("Back"))); + dock_tab_move_right->set_icon(dock_select_popup->get_editor_theme_icon(SNAME("Forward"))); + } +} + +void EditorDockManager::_dock_popup_exit() { + dock_select_rect_over_idx = -1; + dock_select->queue_redraw(); +} + +void EditorDockManager::_dock_pre_popup(int p_dock_slot) { + dock_popup_selected_idx = p_dock_slot; +} + +void EditorDockManager::_dock_move_left() { + if (dock_popup_selected_idx < 0 || dock_popup_selected_idx >= DOCK_SLOT_MAX) { + return; + } + Control *current_ctl = dock_slot[dock_popup_selected_idx]->get_tab_control(dock_slot[dock_popup_selected_idx]->get_current_tab()); + Control *prev_ctl = dock_slot[dock_popup_selected_idx]->get_tab_control(dock_slot[dock_popup_selected_idx]->get_current_tab() - 1); + if (!current_ctl || !prev_ctl) { + return; + } + dock_slot[dock_popup_selected_idx]->move_child(current_ctl, prev_ctl->get_index(false)); + dock_select->queue_redraw(); + _edit_current(); + emit_signal(SNAME("layout_changed")); +} + +void EditorDockManager::_dock_move_right() { + if (dock_popup_selected_idx < 0 || dock_popup_selected_idx >= DOCK_SLOT_MAX) { + return; + } + Control *current_ctl = dock_slot[dock_popup_selected_idx]->get_tab_control(dock_slot[dock_popup_selected_idx]->get_current_tab()); + Control *next_ctl = dock_slot[dock_popup_selected_idx]->get_tab_control(dock_slot[dock_popup_selected_idx]->get_current_tab() + 1); + if (!current_ctl || !next_ctl) { + return; + } + dock_slot[dock_popup_selected_idx]->move_child(next_ctl, current_ctl->get_index(false)); + dock_select->queue_redraw(); + _edit_current(); + emit_signal(SNAME("layout_changed")); +} + +void EditorDockManager::_dock_select_input(const Ref<InputEvent> &p_input) { + Ref<InputEventMouse> me = p_input; + + if (me.is_valid()) { + Vector2 point = me->get_position(); + + int nrect = -1; + for (int i = 0; i < DOCK_SLOT_MAX; i++) { + if (dock_select_rect[i].has_point(point)) { + nrect = i; + break; + } + } + + if (nrect != dock_select_rect_over_idx) { + dock_select->queue_redraw(); + dock_select_rect_over_idx = nrect; + } + + if (nrect == -1) { + return; + } + + Ref<InputEventMouseButton> mb = me; + + if (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && mb->is_pressed() && dock_popup_selected_idx != nrect) { + dock_slot[nrect]->move_tab_from_tab_container(dock_slot[dock_popup_selected_idx], dock_slot[dock_popup_selected_idx]->get_current_tab(), dock_slot[nrect]->get_tab_count()); + + if (dock_slot[dock_popup_selected_idx]->get_tab_count() == 0) { + dock_slot[dock_popup_selected_idx]->hide(); + } else { + dock_slot[dock_popup_selected_idx]->set_current_tab(0); + } + + dock_popup_selected_idx = nrect; + dock_slot[nrect]->show(); + dock_select->queue_redraw(); + + update_dock_slots_visibility(true); + + _edit_current(); + emit_signal(SNAME("layout_changed")); + } + } +} + +void EditorDockManager::_dock_select_draw() { + Size2 s = dock_select->get_size(); + s.y /= 2.0; + s.x /= 6.0; + + Color used = Color(0.6, 0.6, 0.6, 0.8); + Color used_selected = Color(0.8, 0.8, 0.8, 0.8); + Color tab_selected = dock_select->get_theme_color(SNAME("mono_color"), EditorStringName(Editor)); + Color unused = used; + unused.a = 0.4; + Color unusable = unused; + unusable.a = 0.1; + + Rect2 unr(s.x * 2, 0, s.x * 2, s.y * 2); + unr.position += Vector2(2, 5); + unr.size -= Vector2(4, 7); + + dock_select->draw_rect(unr, unusable); + + dock_tab_move_left->set_disabled(true); + dock_tab_move_right->set_disabled(true); + + if (dock_popup_selected_idx != -1 && dock_slot[dock_popup_selected_idx]->get_tab_count()) { + dock_tab_move_left->set_disabled(dock_slot[dock_popup_selected_idx]->get_current_tab() == 0); + dock_tab_move_right->set_disabled(dock_slot[dock_popup_selected_idx]->get_current_tab() >= dock_slot[dock_popup_selected_idx]->get_tab_count() - 1); + } + + for (int i = 0; i < DOCK_SLOT_MAX; i++) { + Vector2 ofs; + + switch (i) { + case DOCK_SLOT_LEFT_UL: { + } break; + case DOCK_SLOT_LEFT_BL: { + ofs.y += s.y; + } break; + case DOCK_SLOT_LEFT_UR: { + ofs.x += s.x; + } break; + case DOCK_SLOT_LEFT_BR: { + ofs += s; + } break; + case DOCK_SLOT_RIGHT_UL: { + ofs.x += s.x * 4; + } break; + case DOCK_SLOT_RIGHT_BL: { + ofs.x += s.x * 4; + ofs.y += s.y; + + } break; + case DOCK_SLOT_RIGHT_UR: { + ofs.x += s.x * 4; + ofs.x += s.x; + + } break; + case DOCK_SLOT_RIGHT_BR: { + ofs.x += s.x * 4; + ofs += s; + + } break; + } + + Rect2 r(ofs, s); + dock_select_rect[i] = r; + r.position += Vector2(2, 5); + r.size -= Vector2(4, 7); + + if (i == dock_select_rect_over_idx) { + dock_select->draw_rect(r, used_selected); + } else if (dock_slot[i]->get_tab_count() == 0) { + dock_select->draw_rect(r, unused); + } else { + dock_select->draw_rect(r, used); + } + + for (int j = 0; j < MIN(3, dock_slot[i]->get_tab_count()); j++) { + int xofs = (r.size.width / 3) * j; + Color c = used; + if (i == dock_popup_selected_idx && (dock_slot[i]->get_current_tab() > 3 || dock_slot[i]->get_current_tab() == j)) { + c = tab_selected; + } + dock_select->draw_rect(Rect2(2 + ofs.x + xofs, ofs.y, r.size.width / 3 - 1, 3), c); + } + } +} + +void EditorDockManager::_dock_split_dragged(int p_offset) { + EditorNode::get_singleton()->save_editor_layout_delayed(); +} + +void EditorDockManager::_dock_tab_changed(int p_tab) { + // Update visibility but don't set current tab. + update_dock_slots_visibility(true); +} + +void EditorDockManager::_edit_current() { + EditorNode::get_singleton()->edit_current(); +} + +void EditorDockManager::_dock_floating_close_request(WindowWrapper *p_wrapper) { + int dock_slot_num = p_wrapper->get_meta("dock_slot"); + int dock_slot_index = p_wrapper->get_meta("dock_index"); + + // Give back the dock to the original owner. + Control *dock = p_wrapper->release_wrapped_control(); + + int target_index = MIN(dock_slot_index, dock_slot[dock_slot_num]->get_tab_count()); + dock_slot[dock_slot_num]->add_child(dock); + dock_slot[dock_slot_num]->move_child(dock, target_index); + dock_slot[dock_slot_num]->set_current_tab(target_index); + + floating_docks.erase(p_wrapper); + p_wrapper->queue_free(); + + update_dock_slots_visibility(true); + + _edit_current(); +} + +void EditorDockManager::_dock_make_selected_float() { + Control *dock = dock_slot[dock_popup_selected_idx]->get_current_tab_control(); + _dock_make_float(dock, dock_popup_selected_idx); + + dock_select_popup->hide(); + _edit_current(); +} + +void EditorDockManager::_dock_make_float(Control *p_dock, int p_slot_index, bool p_show_window) { + ERR_FAIL_NULL(p_dock); + + Size2 borders = Size2(4, 4) * EDSCALE; + // Remember size and position before removing it from the main window. + Size2 dock_size = p_dock->get_size() + borders * 2; + Point2 dock_screen_pos = p_dock->get_screen_position(); + + int dock_index = p_dock->get_index() - 1; + dock_slot[p_slot_index]->remove_child(p_dock); + + WindowWrapper *wrapper = memnew(WindowWrapper); + wrapper->set_window_title(vformat(TTR("%s - Godot Engine"), p_dock->get_name())); + wrapper->set_margins_enabled(true); + + EditorNode::get_singleton()->get_gui_base()->add_child(wrapper); + + wrapper->set_wrapped_control(p_dock); + wrapper->set_meta("dock_slot", p_slot_index); + wrapper->set_meta("dock_index", dock_index); + wrapper->set_meta("dock_name", p_dock->get_name().operator String()); + p_dock->show(); + + wrapper->connect("window_close_requested", callable_mp(this, &EditorDockManager::_dock_floating_close_request).bind(wrapper)); + + dock_select_popup->hide(); + + if (p_show_window) { + wrapper->restore_window(Rect2i(dock_screen_pos, dock_size), EditorNode::get_singleton()->get_gui_base()->get_window()->get_current_screen()); + } + + update_dock_slots_visibility(true); + + floating_docks.push_back(wrapper); + + _edit_current(); +} + +void EditorDockManager::_restore_floating_dock(const Dictionary &p_dock_dump, Control *p_dock, int p_slot_index) { + WindowWrapper *wrapper = Object::cast_to<WindowWrapper>(p_dock); + if (!wrapper) { + _dock_make_float(p_dock, p_slot_index, false); + wrapper = floating_docks[floating_docks.size() - 1]; + } + + wrapper->restore_window_from_saved_position( + p_dock_dump.get("window_rect", Rect2i()), + p_dock_dump.get("window_screen", -1), + p_dock_dump.get("window_screen_rect", Rect2i())); +} + +void EditorDockManager::save_docks_to_config(Ref<ConfigFile> p_layout, const String &p_section) const { + for (int i = 0; i < DOCK_SLOT_MAX; i++) { + String names; + for (int j = 0; j < dock_slot[i]->get_tab_count(); j++) { + String name = dock_slot[i]->get_tab_control(j)->get_name(); + if (!names.is_empty()) { + names += ","; + } + names += name; + } + + String config_key = "dock_" + itos(i + 1); + + if (p_layout->has_section_key(p_section, config_key)) { + p_layout->erase_section_key(p_section, config_key); + } + + if (!names.is_empty()) { + p_layout->set_value(p_section, config_key, names); + } + + int selected_tab_idx = dock_slot[i]->get_current_tab(); + if (selected_tab_idx >= 0) { + p_layout->set_value(p_section, "dock_" + itos(i + 1) + "_selected_tab_idx", selected_tab_idx); + } + } + + Dictionary floating_docks_dump; + + for (WindowWrapper *wrapper : floating_docks) { + Control *dock = wrapper->get_wrapped_control(); + + Dictionary dock_dump; + dock_dump["window_rect"] = wrapper->get_window_rect(); + + int screen = wrapper->get_window_screen(); + dock_dump["window_screen"] = wrapper->get_window_screen(); + dock_dump["window_screen_rect"] = DisplayServer::get_singleton()->screen_get_usable_rect(screen); + + String name = dock->get_name(); + floating_docks_dump[name] = dock_dump; + + int dock_slot_id = wrapper->get_meta("dock_slot"); + String config_key = "dock_" + itos(dock_slot_id + 1); + + String names = p_layout->get_value(p_section, config_key, ""); + if (names.is_empty()) { + names = name; + } else { + names += "," + name; + } + p_layout->set_value(p_section, config_key, names); + } + + p_layout->set_value(p_section, "dock_floating", floating_docks_dump); + + for (int i = 0; i < vsplits.size(); i++) { + if (vsplits[i]->is_visible_in_tree()) { + p_layout->set_value(p_section, "dock_split_" + itos(i + 1), vsplits[i]->get_split_offset()); + } + } + + for (int i = 0; i < hsplits.size(); i++) { + p_layout->set_value(p_section, "dock_hsplit_" + itos(i + 1), hsplits[i]->get_split_offset()); + } + + FileSystemDock::get_singleton()->save_layout_to_config(p_layout, p_section); +} + +void EditorDockManager::load_docks_from_config(Ref<ConfigFile> p_layout, const String &p_section) { + Dictionary floating_docks_dump = p_layout->get_value(p_section, "dock_floating", Dictionary()); + + bool restore_window_on_load = EDITOR_GET("interface/multi_window/restore_windows_on_load"); + + for (int i = 0; i < DOCK_SLOT_MAX; i++) { + if (!p_layout->has_section_key(p_section, "dock_" + itos(i + 1))) { + continue; + } + + Vector<String> names = String(p_layout->get_value(p_section, "dock_" + itos(i + 1))).split(","); + + for (int j = names.size() - 1; j >= 0; j--) { + String name = names[j]; + + // FIXME: Find it, in a horribly inefficient way. + int atidx = -1; + Control *node = nullptr; + for (int k = 0; k < DOCK_SLOT_MAX; k++) { + if (!dock_slot[k]->has_node(name)) { + continue; + } + node = Object::cast_to<Control>(dock_slot[k]->get_node(name)); + if (!node) { + continue; + } + atidx = k; + break; + } + + if (atidx == -1) { + // Try floating docks. + for (WindowWrapper *wrapper : floating_docks) { + if (wrapper->get_meta("dock_name") == name) { + if (restore_window_on_load && floating_docks_dump.has(name)) { + _restore_floating_dock(floating_docks_dump[name], wrapper, i); + } else { + atidx = wrapper->get_meta("dock_slot"); + node = wrapper->get_wrapped_control(); + wrapper->set_window_enabled(false); + } + break; + } + } + } + if (!node) { + // Well, it's not anywhere. + continue; + } + + if (atidx == i) { + dock_slot[i]->move_child(node, 0); + } else if (atidx != -1) { + dock_slot[i]->set_block_signals(true); + dock_slot[atidx]->set_block_signals(true); + dock_slot[i]->move_tab_from_tab_container(dock_slot[atidx], dock_slot[atidx]->get_tab_idx_from_control(node), 0); + dock_slot[i]->set_block_signals(false); + dock_slot[atidx]->set_block_signals(false); + } + + WindowWrapper *wrapper = Object::cast_to<WindowWrapper>(node); + if (restore_window_on_load && floating_docks_dump.has(name)) { + if (!dock_slot[i]->is_tab_hidden(dock_slot[i]->get_tab_idx_from_control(node))) { + _restore_floating_dock(floating_docks_dump[name], node, i); + } + } else if (wrapper) { + wrapper->set_window_enabled(false); + } + } + + if (!p_layout->has_section_key(p_section, "dock_" + itos(i + 1) + "_selected_tab_idx")) { + continue; + } + + int selected_tab_idx = p_layout->get_value(p_section, "dock_" + itos(i + 1) + "_selected_tab_idx"); + if (selected_tab_idx >= 0 && selected_tab_idx < dock_slot[i]->get_tab_count()) { + callable_mp(dock_slot[i], &TabContainer::set_current_tab).call_deferred(selected_tab_idx); + } + } + + for (int i = 0; i < vsplits.size(); i++) { + if (!p_layout->has_section_key(p_section, "dock_split_" + itos(i + 1))) { + continue; + } + + int ofs = p_layout->get_value(p_section, "dock_split_" + itos(i + 1)); + vsplits[i]->set_split_offset(ofs); + } + + for (int i = 0; i < hsplits.size(); i++) { + if (!p_layout->has_section_key(p_section, "dock_hsplit_" + itos(i + 1))) { + continue; + } + int ofs = p_layout->get_value(p_section, "dock_hsplit_" + itos(i + 1)); + hsplits[i]->set_split_offset(ofs); + } + + update_dock_slots_visibility(false); + + FileSystemDock::get_singleton()->load_layout_from_config(p_layout, p_section); +} + +void EditorDockManager::update_dock_slots_visibility(bool p_keep_selected_tabs) { + if (!docks_visible) { + for (int i = 0; i < DOCK_SLOT_MAX; i++) { + dock_slot[i]->hide(); + } + } else { + for (int i = 0; i < DOCK_SLOT_MAX; i++) { + int first_tab_visible = -1; + for (int j = 0; j < dock_slot[i]->get_tab_count(); j++) { + if (!dock_slot[i]->is_tab_hidden(j)) { + first_tab_visible = j; + break; + } + } + if (first_tab_visible >= 0) { + dock_slot[i]->show(); + if (p_keep_selected_tabs) { + int current_tab = dock_slot[i]->get_current_tab(); + if (dock_slot[i]->is_tab_hidden(current_tab)) { + dock_slot[i]->set_block_signals(true); + dock_slot[i]->select_next_available(); + dock_slot[i]->set_block_signals(false); + } + } else { + dock_slot[i]->set_block_signals(true); + dock_slot[i]->set_current_tab(first_tab_visible); + dock_slot[i]->set_block_signals(false); + } + } else { + dock_slot[i]->hide(); + } + } + } +} + +void EditorDockManager::close_all_floating_docks() { + for (WindowWrapper *wrapper : floating_docks) { + wrapper->set_window_enabled(false); + } +} + +void EditorDockManager::add_control_to_dock(DockSlot p_slot, Control *p_control, const String &p_name) { + ERR_FAIL_INDEX(p_slot, DOCK_SLOT_MAX); + dock_slot[p_slot]->add_child(p_control); + if (!p_name.is_empty()) { + dock_slot[p_slot]->set_tab_title(dock_slot[p_slot]->get_tab_idx_from_control(p_control), p_name); + } +} + +void EditorDockManager::remove_control_from_dock(Control *p_control) { + // If the dock is floating, close it first. + for (WindowWrapper *wrapper : floating_docks) { + if (p_control == wrapper->get_wrapped_control()) { + wrapper->set_window_enabled(false); + break; + } + } + + Control *dock = nullptr; + for (int i = 0; i < DOCK_SLOT_MAX; i++) { + if (p_control->get_parent() == dock_slot[i]) { + dock = dock_slot[i]; + break; + } + } + + ERR_FAIL_NULL_MSG(dock, "Control is not in a dock."); + + dock->remove_child(p_control); + update_dock_slots_visibility(); +} + +void EditorDockManager::set_docks_visible(bool p_show) { + docks_visible = p_show; + update_dock_slots_visibility(true); +} + +bool EditorDockManager::are_docks_visible() const { + return docks_visible; +} + +void EditorDockManager::add_vsplit(DockSplitContainer *p_split) { + vsplits.push_back(p_split); + p_split->connect("dragged", callable_mp(this, &EditorDockManager::_dock_split_dragged)); +} + +void EditorDockManager::add_hsplit(DockSplitContainer *p_split) { + hsplits.push_back(p_split); + p_split->connect("dragged", callable_mp(this, &EditorDockManager::_dock_split_dragged)); +} + +void EditorDockManager::register_dock_slot(DockSlot p_dock_slot, TabContainer *p_tab_container) { + ERR_FAIL_NULL(p_tab_container); + ERR_FAIL_INDEX(p_dock_slot, DOCK_SLOT_MAX); + + dock_slot[p_dock_slot] = p_tab_container; + + p_tab_container->set_custom_minimum_size(Size2(170, 0) * EDSCALE); + p_tab_container->set_v_size_flags(Control::SIZE_EXPAND_FILL); + p_tab_container->set_popup(dock_select_popup); + p_tab_container->connect("pre_popup_pressed", callable_mp(this, &EditorDockManager::_dock_pre_popup).bind(p_dock_slot)); + p_tab_container->set_drag_to_rearrange_enabled(true); + p_tab_container->set_tabs_rearrange_group(1); + p_tab_container->connect("tab_changed", callable_mp(this, &EditorDockManager::_dock_tab_changed)); + p_tab_container->set_use_hidden_tabs_for_min_size(true); +} + +int EditorDockManager::get_vsplit_count() const { + return vsplits.size(); +} + +void EditorDockManager::_bind_methods() { + ADD_SIGNAL(MethodInfo("layout_changed")); +} + +EditorDockManager::EditorDockManager() { + singleton = this; + + dock_select_popup = memnew(PopupPanel); + EditorNode::get_singleton()->get_gui_base()->add_child(dock_select_popup); + VBoxContainer *dock_vb = memnew(VBoxContainer); + dock_select_popup->add_child(dock_vb); + dock_select_popup->connect("theme_changed", callable_mp(this, &EditorDockManager::_dock_select_popup_theme_changed)); + + HBoxContainer *dock_hb = memnew(HBoxContainer); + dock_tab_move_left = memnew(Button); + dock_tab_move_left->set_flat(true); + dock_tab_move_left->set_focus_mode(Control::FOCUS_NONE); + dock_tab_move_left->connect("pressed", callable_mp(this, &EditorDockManager::_dock_move_left)); + dock_hb->add_child(dock_tab_move_left); + + Label *dock_label = memnew(Label); + dock_label->set_text(TTR("Dock Position")); + dock_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); + dock_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + dock_hb->add_child(dock_label); + + dock_tab_move_right = memnew(Button); + dock_tab_move_right->set_flat(true); + dock_tab_move_right->set_focus_mode(Control::FOCUS_NONE); + dock_tab_move_right->connect("pressed", callable_mp(this, &EditorDockManager::_dock_move_right)); + + dock_hb->add_child(dock_tab_move_right); + dock_vb->add_child(dock_hb); + + dock_select = memnew(Control); + dock_select->set_custom_minimum_size(Size2(128, 64) * EDSCALE); + dock_select->connect("gui_input", callable_mp(this, &EditorDockManager::_dock_select_input)); + dock_select->connect("draw", callable_mp(this, &EditorDockManager::_dock_select_draw)); + dock_select->connect("mouse_exited", callable_mp(this, &EditorDockManager::_dock_popup_exit)); + dock_select->set_v_size_flags(Control::SIZE_EXPAND_FILL); + dock_vb->add_child(dock_select); + + if (!SceneTree::get_singleton()->get_root()->is_embedding_subwindows() && !EDITOR_GET("interface/editor/single_window_mode") && EDITOR_GET("interface/multi_window/enable")) { + dock_float = memnew(Button); + dock_float->set_text(TTR("Make Floating")); + dock_float->set_focus_mode(Control::FOCUS_NONE); + dock_float->set_h_size_flags(Control::SIZE_SHRINK_CENTER); + dock_float->connect("pressed", callable_mp(this, &EditorDockManager::_dock_make_selected_float)); + + dock_vb->add_child(dock_float); + } + + dock_select_popup->reset_size(); +} diff --git a/editor/editor_dock_manager.h b/editor/editor_dock_manager.h new file mode 100644 index 0000000000..e685fe1380 --- /dev/null +++ b/editor/editor_dock_manager.h @@ -0,0 +1,135 @@ +/**************************************************************************/ +/* editor_dock_manager.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#ifndef EDITOR_DOCK_MANAGER_H +#define EDITOR_DOCK_MANAGER_H + +#include "scene/gui/split_container.h" + +class Button; +class ConfigFile; +class Control; +class PopupPanel; +class TabContainer; +class WindowWrapper; + +class DockSplitContainer : public SplitContainer { + GDCLASS(DockSplitContainer, SplitContainer); + +private: + bool is_updating = false; + +protected: + void _update_visibility(); + + virtual void add_child_notify(Node *p_child) override; + virtual void remove_child_notify(Node *p_child) override; +}; + +class EditorDockManager : public Object { + GDCLASS(EditorDockManager, Object); + +public: + enum DockSlot { + DOCK_SLOT_LEFT_UL, + DOCK_SLOT_LEFT_BL, + DOCK_SLOT_LEFT_UR, + DOCK_SLOT_LEFT_BR, + DOCK_SLOT_RIGHT_UL, + DOCK_SLOT_RIGHT_BL, + DOCK_SLOT_RIGHT_UR, + DOCK_SLOT_RIGHT_BR, + DOCK_SLOT_MAX + }; + +private: + static EditorDockManager *singleton; + + // To access splits easily by index. + Vector<DockSplitContainer *> vsplits; + Vector<DockSplitContainer *> hsplits; + + Vector<WindowWrapper *> floating_docks; + TabContainer *dock_slot[DOCK_SLOT_MAX]; + bool docks_visible = true; + + PopupPanel *dock_select_popup = nullptr; + Button *dock_float = nullptr; + Button *dock_tab_move_left = nullptr; + Button *dock_tab_move_right = nullptr; + Control *dock_select = nullptr; + Rect2 dock_select_rect[DOCK_SLOT_MAX]; + int dock_select_rect_over_idx = -1; + int dock_popup_selected_idx = -1; + + void _dock_select_popup_theme_changed(); + void _dock_popup_exit(); + void _dock_pre_popup(int p_dock_slot); + void _dock_move_left(); + void _dock_move_right(); + void _dock_select_input(const Ref<InputEvent> &p_input); + void _dock_select_draw(); + void _dock_split_dragged(int p_offset); + + void _dock_tab_changed(int p_tab); + void _edit_current(); + + void _dock_floating_close_request(WindowWrapper *p_wrapper); + void _dock_make_selected_float(); + void _dock_make_float(Control *p_control, int p_slot_index, bool p_show_window = true); + void _restore_floating_dock(const Dictionary &p_dock_dump, Control *p_wrapper, int p_slot_index); + +protected: + static void _bind_methods(); + +public: + static EditorDockManager *get_singleton() { return singleton; } + + void add_vsplit(DockSplitContainer *p_split); + void add_hsplit(DockSplitContainer *p_split); + void register_dock_slot(DockSlot p_dock_slot, TabContainer *p_tab_container); + int get_vsplit_count() const; + + void save_docks_to_config(Ref<ConfigFile> p_layout, const String &p_section) const; + void load_docks_from_config(Ref<ConfigFile> p_layout, const String &p_section); + void update_dock_slots_visibility(bool p_keep_selected_tabs = false); + + void close_all_floating_docks(); + + void set_docks_visible(bool p_show); + bool are_docks_visible() const; + + void add_control_to_dock(DockSlot p_slot, Control *p_control, const String &p_name = ""); + void remove_control_from_dock(Control *p_control); + + EditorDockManager(); +}; + +#endif // EDITOR_DOCK_MANAGER_H diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 5a44ae1aba..aa44ea380b 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -35,10 +35,10 @@ #include "editor/editor_node.h" #include "editor/editor_paths.h" #include "editor/editor_property_name_processor.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" const char *EditorFeatureProfile::feature_names[FEATURE_MAX] = { TTRC("3D Editor"), @@ -503,7 +503,7 @@ void EditorFeatureProfileManager::_fill_classes_from(TreeItem *p_parent, const S bool disabled_editor = edited->is_class_editor_disabled(p_class); bool disabled_properties = edited->has_class_properties_disabled(p_class); if (disabled) { - class_item->set_custom_color(0, class_list->get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + class_item->set_custom_color(0, class_list->get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); } else if (disabled_editor && disabled_properties) { text += " " + TTR("(Editor Disabled, Properties Disabled)"); } else if (disabled_properties) { diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index aab433ac27..9fbe7ba655 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -2354,7 +2354,11 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) { reimport_files.sort(); +#ifdef THREADS_ENABLED bool use_multiple_threads = GLOBAL_GET("editor/import/use_multiple_threads"); +#else + bool use_multiple_threads = false; +#endif int from = 0; for (int i = 0; i < reimport_files.size(); i++) { @@ -2680,6 +2684,10 @@ void EditorFileSystem::remove_import_format_support_query(Ref<EditorFileSystemIm } EditorFileSystem::EditorFileSystem() { +#ifdef THREADS_ENABLED + use_threads = true; +#endif + ResourceLoader::import = _resource_import; reimport_on_missing_imported_files = GLOBAL_GET("editor/import/reimport_missing_imported_files"); singleton = this; diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h index 2a34c06b0d..2f5cd88a55 100644 --- a/editor/editor_file_system.h +++ b/editor/editor_file_system.h @@ -165,7 +165,7 @@ class EditorFileSystem : public Node { EditorFileSystemDirectory::FileInfo *new_file = nullptr; }; - bool use_threads = true; + bool use_threads = false; Thread thread; static void _thread_func(void *_userdata); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 6e448d8866..f0f7f87711 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -35,14 +35,14 @@ #include "core/object/script_language.h" #include "core/os/keyboard.h" #include "core/version.h" -#include "doc_data_compressed.gen.h" +#include "editor/doc_data_compressed.gen.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" #include "editor/editor_property_name_processor.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/line_edit.h" #define CONTRIBUTE_URL vformat("%s/contributing/documentation/updating_the_class_reference.html", VERSION_DOCS_URL) @@ -812,35 +812,25 @@ void EditorHelp::_update_doc() { class_desc->add_newline(); } - // Descendents - if (cd.is_script_doc || ClassDB::class_exists(cd.name)) { - bool found = false; - bool prev = false; - + // Descendants + if ((cd.is_script_doc || ClassDB::class_exists(cd.name)) && doc->inheriting.has(cd.name)) { _push_normal_font(); - for (const KeyValue<String, DocData::ClassDoc> &E : doc->class_list) { - if (E.value.inherits == cd.name) { - if (!found) { - class_desc->push_color(theme_cache.title_color); - class_desc->add_text(TTR("Inherited by:") + " "); - found = true; - } + class_desc->push_color(theme_cache.title_color); + class_desc->add_text(TTR("Inherited by:") + " "); - if (prev) { - class_desc->add_text(" , "); - } - _add_type_icon(E.value.name, theme_cache.doc_font_size, "ArrowRight"); - class_desc->add_text(non_breaking_space); // Otherwise icon borrows hyperlink from _add_type(). - _add_type(E.value.name); - prev = true; + for (RBSet<String, NaturalNoCaseComparator>::Element *itr = doc->inheriting[cd.name].front(); itr; itr = itr->next()) { + if (itr->prev()) { + class_desc->add_text(" , "); } + + _add_type_icon(itr->get(), theme_cache.doc_font_size, "ArrowRight"); + class_desc->add_text(non_breaking_space); // Otherwise icon borrows hyperlink from _add_type(). + _add_type(itr->get()); } _pop_normal_font(); - if (found) { - class_desc->pop(); - class_desc->add_newline(); - } + class_desc->pop(); + class_desc->add_newline(); } // Note if deprecated. diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 64bd209d4d..229eb79e11 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -33,9 +33,9 @@ #include "core/os/keyboard.h" #include "editor/editor_feature_profile.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" void EditorHelpSearch::_update_results() { String term = search_box->get_text(); @@ -48,7 +48,7 @@ void EditorHelpSearch::_update_results() { search_flags |= SEARCH_SHOW_HIERARCHY; } - search = Ref<Runner>(memnew(Runner(results_tree, results_tree, term, search_flags))); + search = Ref<Runner>(memnew(Runner(results_tree, results_tree, &tree_cache, term, search_flags))); set_process(true); } @@ -96,6 +96,7 @@ void EditorHelpSearch::_notification(int p_what) { switch (p_what) { case NOTIFICATION_VISIBILITY_CHANGED: { if (!is_visible()) { + tree_cache.clear(); callable_mp(results_tree, &Tree::clear).call_deferred(); // Wait for the Tree's mouse event propagation. get_ok_button()->set_disabled(true); EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "search_help", Rect2(get_position(), get_size())); @@ -258,6 +259,13 @@ EditorHelpSearch::EditorHelpSearch() { vbox->add_child(results_tree, true); } +void EditorHelpSearch::TreeCache::clear() { + for (const KeyValue<String, TreeItem *> &E : item_cache) { + memdelete(E.value); + } + item_cache.clear(); +} + bool EditorHelpSearch::Runner::_is_class_disabled_by_feature_profile(const StringName &p_class) { Ref<EditorFeatureProfile> profile = EditorFeatureProfileManager::get_singleton()->get_current_profile(); if (profile.is_null()) { @@ -317,7 +325,13 @@ bool EditorHelpSearch::Runner::_slice() { } bool EditorHelpSearch::Runner::_phase_match_classes_init() { - iterator_doc = EditorHelp::get_doc_data()->class_list.begin(); + iterator_doc = nullptr; + iterator_stack.clear(); + if (search_flags & SEARCH_SHOW_HIERARCHY) { + iterator_stack.push_back(EditorHelp::get_doc_data()->inheriting[""].front()); + } else { + iterator_doc = EditorHelp::get_doc_data()->class_list.begin(); + } matches.clear(); matched_item = nullptr; match_highest_score = 0; @@ -331,88 +345,141 @@ bool EditorHelpSearch::Runner::_phase_match_classes_init() { } bool EditorHelpSearch::Runner::_phase_match_classes() { - if (!iterator_doc) { + if (!iterator_doc && iterator_stack.is_empty()) { return true; } - DocData::ClassDoc &class_doc = iterator_doc->value; - if (class_doc.name.is_empty()) { - ++iterator_doc; - return false; + DocData::ClassDoc *class_doc = nullptr; + if (iterator_doc) { + class_doc = &iterator_doc->value; + } else if (!iterator_stack.is_empty() && iterator_stack[iterator_stack.size() - 1]) { + class_doc = EditorHelp::get_doc_data()->class_list.getptr(iterator_stack[iterator_stack.size() - 1]->get()); + } + + if (class_doc && class_doc->name.is_empty()) { + class_doc = nullptr; } - if (!_is_class_disabled_by_feature_profile(class_doc.name)) { + if (class_doc && !_is_class_disabled_by_feature_profile(class_doc->name)) { ClassMatch match; - match.doc = &class_doc; + match.doc = class_doc; // Match class name. if (search_flags & SEARCH_CLASSES) { // If the search term is empty, add any classes which are not script docs or which don't start with // a double-quotation. This will ensure that only C++ classes and explicitly named classes will // be added. - match.name = (term.is_empty() && (!class_doc.is_script_doc || class_doc.name[0] != '\"')) || _match_string(term, class_doc.name); + match.name = (term.is_empty() && (!class_doc->is_script_doc || class_doc->name[0] != '\"')) || _match_string(term, class_doc->name); } // Match members only if the term is long enough, to avoid slow performance from building a large tree. // Make an exception for annotations, since there are not that many of them. if (term.length() > 1 || term == "@") { if (search_flags & SEARCH_CONSTRUCTORS) { - _match_method_name_and_push_back(class_doc.constructors, &match.constructors); + _match_method_name_and_push_back(class_doc->constructors, &match.constructors); } if (search_flags & SEARCH_METHODS) { - _match_method_name_and_push_back(class_doc.methods, &match.methods); + _match_method_name_and_push_back(class_doc->methods, &match.methods); } if (search_flags & SEARCH_OPERATORS) { - _match_method_name_and_push_back(class_doc.operators, &match.operators); + _match_method_name_and_push_back(class_doc->operators, &match.operators); } if (search_flags & SEARCH_SIGNALS) { - for (int i = 0; i < class_doc.signals.size(); i++) { - if (_all_terms_in_name(class_doc.signals[i].name)) { - match.signals.push_back(const_cast<DocData::MethodDoc *>(&class_doc.signals[i])); + for (int i = 0; i < class_doc->signals.size(); i++) { + if (_all_terms_in_name(class_doc->signals[i].name)) { + match.signals.push_back(const_cast<DocData::MethodDoc *>(&class_doc->signals[i])); } } } if (search_flags & SEARCH_CONSTANTS) { - for (int i = 0; i < class_doc.constants.size(); i++) { - if (_all_terms_in_name(class_doc.constants[i].name)) { - match.constants.push_back(const_cast<DocData::ConstantDoc *>(&class_doc.constants[i])); + for (int i = 0; i < class_doc->constants.size(); i++) { + if (_all_terms_in_name(class_doc->constants[i].name)) { + match.constants.push_back(const_cast<DocData::ConstantDoc *>(&class_doc->constants[i])); } } } if (search_flags & SEARCH_PROPERTIES) { - for (int i = 0; i < class_doc.properties.size(); i++) { - if (_all_terms_in_name(class_doc.properties[i].name)) { - match.properties.push_back(const_cast<DocData::PropertyDoc *>(&class_doc.properties[i])); + for (int i = 0; i < class_doc->properties.size(); i++) { + if (_all_terms_in_name(class_doc->properties[i].name)) { + match.properties.push_back(const_cast<DocData::PropertyDoc *>(&class_doc->properties[i])); } } } if (search_flags & SEARCH_THEME_ITEMS) { - for (int i = 0; i < class_doc.theme_properties.size(); i++) { - if (_all_terms_in_name(class_doc.theme_properties[i].name)) { - match.theme_properties.push_back(const_cast<DocData::ThemeItemDoc *>(&class_doc.theme_properties[i])); + for (int i = 0; i < class_doc->theme_properties.size(); i++) { + if (_all_terms_in_name(class_doc->theme_properties[i].name)) { + match.theme_properties.push_back(const_cast<DocData::ThemeItemDoc *>(&class_doc->theme_properties[i])); } } } if (search_flags & SEARCH_ANNOTATIONS) { - for (int i = 0; i < class_doc.annotations.size(); i++) { - if (_match_string(term, class_doc.annotations[i].name)) { - match.annotations.push_back(const_cast<DocData::MethodDoc *>(&class_doc.annotations[i])); + for (int i = 0; i < class_doc->annotations.size(); i++) { + if (_match_string(term, class_doc->annotations[i].name)) { + match.annotations.push_back(const_cast<DocData::MethodDoc *>(&class_doc->annotations[i])); } } } } - matches[class_doc.name] = match; + matches[class_doc->name] = match; } - ++iterator_doc; - return !iterator_doc; + if (iterator_doc) { + ++iterator_doc; + return !iterator_doc; + } + + if (!iterator_stack.is_empty()) { + if (iterator_stack[iterator_stack.size() - 1]) { + iterator_stack[iterator_stack.size() - 1] = iterator_stack[iterator_stack.size() - 1]->next(); + } + if (!iterator_stack[iterator_stack.size() - 1]) { + iterator_stack.resize(iterator_stack.size() - 1); + } + } + + if (class_doc && EditorHelp::get_doc_data()->inheriting.has(class_doc->name)) { + iterator_stack.push_back(EditorHelp::get_doc_data()->inheriting[class_doc->name].front()); + } + + return iterator_stack.is_empty(); +} + +void EditorHelpSearch::Runner::_populate_cache() { + root_item = results_tree->get_root(); + + if (root_item) { + LocalVector<TreeItem *> stack; + + // Add children of root item to stack. + for (TreeItem *child = root_item->get_first_child(); child; child = child->get_next()) { + stack.push_back(child); + } + + // Traverse stack and cache items. + while (!stack.is_empty()) { + TreeItem *cur_item = stack[stack.size() - 1]; + stack.resize(stack.size() - 1); + + // Add to the cache. + tree_cache->item_cache.insert(cur_item->get_metadata(0).operator String(), cur_item); + + // Add any children to the stack. + for (TreeItem *child = cur_item->get_first_child(); child; child = child->get_next()) { + stack.push_back(child); + } + + // Remove from parent. + cur_item->get_parent()->remove_child(cur_item); + } + } else { + root_item = results_tree->create_item(); + } } bool EditorHelpSearch::Runner::_phase_class_items_init() { iterator_match = matches.begin(); - results_tree->clear(); - root_item = results_tree->create_item(); + _populate_cache(); class_items.clear(); return true; @@ -590,27 +657,54 @@ TreeItem *EditorHelpSearch::Runner::_create_class_hierarchy(const ClassMatch &p_ return class_item; } +bool EditorHelpSearch::Runner::_find_or_create_item(TreeItem *p_parent, const String &p_item_meta, TreeItem *&r_item) { + // Attempt to find in cache. + if (tree_cache->item_cache.has(p_item_meta)) { + r_item = tree_cache->item_cache[p_item_meta]; + + // Remove from cache. + tree_cache->item_cache.erase(p_item_meta); + + // Add to tree. + p_parent->add_child(r_item); + + return false; + } else { + // Otherwise create item. + r_item = results_tree->create_item(p_parent); + + return true; + } +} + TreeItem *EditorHelpSearch::Runner::_create_class_item(TreeItem *p_parent, const DocData::ClassDoc *p_doc, bool p_gray) { String tooltip = DTR(p_doc->brief_description.strip_edges()); - TreeItem *item = results_tree->create_item(p_parent); - item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_doc->name)); - item->set_text(0, p_doc->name); - item->set_text(1, TTR("Class")); - item->set_tooltip_text(0, tooltip); - item->set_tooltip_text(1, tooltip); - item->set_metadata(0, "class_name:" + p_doc->name); + const String item_meta = "class_name:" + p_doc->name; + + TreeItem *item = nullptr; + if (_find_or_create_item(p_parent, item_meta, item)) { + item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_doc->name)); + item->set_text(0, p_doc->name); + item->set_text(1, TTR("Class")); + item->set_tooltip_text(0, tooltip); + item->set_tooltip_text(1, tooltip); + item->set_metadata(0, item_meta); + if (p_doc->is_deprecated) { + Ref<Texture2D> error_icon = ui_service->get_editor_theme_icon(SNAME("StatusError")); + item->add_button(0, error_icon, 0, false, TTR("This class is marked as deprecated.")); + } else if (p_doc->is_experimental) { + Ref<Texture2D> warning_icon = ui_service->get_editor_theme_icon(SNAME("NodeWarning")); + item->add_button(0, warning_icon, 0, false, TTR("This class is marked as experimental.")); + } + } + if (p_gray) { item->set_custom_color(0, disabled_color); item->set_custom_color(1, disabled_color); - } - - if (p_doc->is_deprecated) { - Ref<Texture2D> error_icon = ui_service->get_editor_theme_icon("StatusError"); - item->add_button(0, error_icon, 0, false, TTR("This class is marked as deprecated.")); - } else if (p_doc->is_experimental) { - Ref<Texture2D> warning_icon = ui_service->get_editor_theme_icon("NodeWarning"); - item->add_button(0, warning_icon, 0, false, TTR("This class is marked as experimental.")); + } else { + item->clear_custom_color(0); + item->clear_custom_color(1); } _match_item(item, p_doc->name); @@ -651,30 +745,29 @@ TreeItem *EditorHelpSearch::Runner::_create_theme_property_item(TreeItem *p_pare } TreeItem *EditorHelpSearch::Runner::_create_member_item(TreeItem *p_parent, const String &p_class_name, const String &p_icon, const String &p_name, const String &p_text, const String &p_type, const String &p_metatype, const String &p_tooltip, bool is_deprecated, bool is_experimental) { - Ref<Texture2D> icon; - String text; - if (search_flags & SEARCH_SHOW_HIERARCHY) { - icon = ui_service->get_editor_theme_icon(p_icon); - text = p_text; - } else { - icon = ui_service->get_editor_theme_icon(p_icon); - text = p_class_name + "." + p_text; + const String item_meta = "class_" + p_metatype + ":" + p_class_name + ":" + p_name; + + TreeItem *item = nullptr; + if (_find_or_create_item(p_parent, item_meta, item)) { + item->set_icon(0, ui_service->get_editor_theme_icon(p_icon)); + item->set_text(1, TTRGET(p_type)); + item->set_tooltip_text(0, p_tooltip); + item->set_tooltip_text(1, p_tooltip); + item->set_metadata(0, item_meta); + + if (is_deprecated) { + Ref<Texture2D> error_icon = ui_service->get_editor_theme_icon(SNAME("StatusError")); + item->add_button(0, error_icon, 0, false, TTR("This member is marked as deprecated.")); + } else if (is_experimental) { + Ref<Texture2D> warning_icon = ui_service->get_editor_theme_icon(SNAME("NodeWarning")); + item->add_button(0, warning_icon, 0, false, TTR("This member is marked as experimental.")); + } } - TreeItem *item = results_tree->create_item(p_parent); - item->set_icon(0, icon); - item->set_text(0, text); - item->set_text(1, TTRGET(p_type)); - item->set_tooltip_text(0, p_tooltip); - item->set_tooltip_text(1, p_tooltip); - item->set_metadata(0, "class_" + p_metatype + ":" + p_class_name + ":" + p_name); - - if (is_deprecated) { - Ref<Texture2D> error_icon = ui_service->get_editor_theme_icon("StatusError"); - item->add_button(0, error_icon, 0, false, TTR("This member is marked as deprecated.")); - } else if (is_experimental) { - Ref<Texture2D> warning_icon = ui_service->get_editor_theme_icon("NodeWarning"); - item->add_button(0, warning_icon, 0, false, TTR("This member is marked as experimental.")); + if (search_flags & SEARCH_SHOW_HIERARCHY) { + item->set_text(0, p_text); + } else { + item->set_text(0, p_class_name + "." + p_text); } _match_item(item, p_name); @@ -693,10 +786,11 @@ bool EditorHelpSearch::Runner::work(uint64_t slot) { return true; } -EditorHelpSearch::Runner::Runner(Control *p_icon_service, Tree *p_results_tree, const String &p_term, int p_search_flags) : +EditorHelpSearch::Runner::Runner(Control *p_icon_service, Tree *p_results_tree, TreeCache *p_tree_cache, const String &p_term, int p_search_flags) : ui_service(p_icon_service), results_tree(p_results_tree), + tree_cache(p_tree_cache), term((p_search_flags & SEARCH_CASE_SENSITIVE) == 0 ? p_term.strip_edges().to_lower() : p_term.strip_edges()), search_flags(p_search_flags), - disabled_color(ui_service->get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))) { + disabled_color(ui_service->get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))) { } diff --git a/editor/editor_help_search.h b/editor/editor_help_search.h index 30a783a628..e4980d6ff7 100644 --- a/editor/editor_help_search.h +++ b/editor/editor_help_search.h @@ -67,6 +67,16 @@ class EditorHelpSearch : public ConfirmationDialog { class Runner; Ref<Runner> search; + struct TreeCache { + HashMap<String, TreeItem *> item_cache; + + void clear(); + + ~TreeCache() { + clear(); + } + } tree_cache; + void _update_results(); void _search_box_gui_input(const Ref<InputEvent> &p_event); @@ -117,6 +127,7 @@ class EditorHelpSearch::Runner : public RefCounted { Control *ui_service = nullptr; Tree *results_tree = nullptr; + TreeCache *tree_cache = nullptr; String term; Vector<String> terms; int search_flags; @@ -124,6 +135,7 @@ class EditorHelpSearch::Runner : public RefCounted { Color disabled_color; HashMap<String, DocData::ClassDoc>::Iterator iterator_doc; + LocalVector<RBSet<String, NaturalNoCaseComparator>::Element *> iterator_stack; HashMap<String, ClassMatch> matches; HashMap<String, ClassMatch>::Iterator iterator_match; TreeItem *root_item = nullptr; @@ -133,6 +145,9 @@ class EditorHelpSearch::Runner : public RefCounted { bool _is_class_disabled_by_feature_profile(const StringName &p_class); + void _populate_cache(); + bool _find_or_create_item(TreeItem *p_parent, const String &p_item_meta, TreeItem *&r_item); + bool _slice(); bool _phase_match_classes_init(); bool _phase_match_classes(); @@ -161,7 +176,7 @@ class EditorHelpSearch::Runner : public RefCounted { public: bool work(uint64_t slot = 100000); - Runner(Control *p_icon_service, Tree *p_results_tree, const String &p_term, int p_search_flags); + Runner(Control *p_icon_service, Tree *p_results_tree, TreeCache *p_tree_cache, const String &p_term, int p_search_flags); }; #endif // EDITOR_HELP_SEARCH_H diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 6809739dc1..a3530fc9ab 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -35,14 +35,14 @@ #include "editor/editor_feature_profile.h" #include "editor/editor_node.h" #include "editor/editor_property_name_processor.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_validation_panel.h" #include "editor/inspector_dock.h" +#include "editor/multi_node_edit.h" #include "editor/plugins/script_editor_plugin.h" -#include "multi_node_edit.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/spin_box.h" #include "scene/gui/texture_rect.h" #include "scene/property_utils.h" @@ -1357,7 +1357,7 @@ void EditorInspectorSection::_notification(int p_what) { Ref<Font> light_font = get_theme_font(SNAME("main"), EditorStringName(EditorFonts)); int light_font_size = get_theme_font_size(SNAME("main_size"), EditorStringName(EditorFonts)); - Color light_font_color = get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor)); + Color light_font_color = get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor)); // Can we fit the long version of the revertable count text? num_revertable_str = vformat(TTRN("(%d change)", "(%d changes)", revertable_properties.size()), revertable_properties.size()); diff --git a/editor/editor_interface.cpp b/editor/editor_interface.cpp index b007f6d530..bad28ff43d 100644 --- a/editor/editor_interface.cpp +++ b/editor/editor_interface.cpp @@ -35,13 +35,13 @@ #include "editor/editor_node.h" #include "editor/editor_paths.h" #include "editor/editor_resource_preview.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/filesystem_dock.h" #include "editor/gui/editor_run_bar.h" #include "editor/inspector_dock.h" #include "editor/plugins/node_3d_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "main/main.h" #include "scene/gui/box_container.h" #include "scene/gui/control.h" diff --git a/editor/editor_layouts_dialog.cpp b/editor/editor_layouts_dialog.cpp index c6f518d4c1..e1b370f44a 100644 --- a/editor/editor_layouts_dialog.cpp +++ b/editor/editor_layouts_dialog.cpp @@ -33,8 +33,8 @@ #include "core/io/config_file.h" #include "core/object/class_db.h" #include "core/os/keyboard.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/item_list.h" #include "scene/gui/line_edit.h" diff --git a/editor/editor_locale_dialog.cpp b/editor/editor_locale_dialog.cpp index 13b4a8c128..f1d82557fd 100644 --- a/editor/editor_locale_dialog.cpp +++ b/editor/editor_locale_dialog.cpp @@ -31,8 +31,8 @@ #include "editor_locale_dialog.h" #include "core/config/project_settings.h" -#include "editor/editor_scale.h" #include "editor/editor_undo_redo_manager.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/check_button.h" #include "scene/gui/line_edit.h" #include "scene/gui/option_button.h" diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index c58a0a7572..c0c26bbfeb 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -35,9 +35,9 @@ #include "core/version.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/center_container.h" #include "scene/gui/separator.h" #include "scene/resources/font.h" @@ -192,6 +192,10 @@ void EditorLog::_load_state() { is_loading_state = false; } +void EditorLog::_meta_clicked(const String &p_meta) { + OS::get_singleton()->shell_open(p_meta); +} + void EditorLog::_clear_request() { log->clear(); messages.clear(); @@ -407,6 +411,7 @@ EditorLog::EditorLog() { log->set_v_size_flags(SIZE_EXPAND_FILL); log->set_h_size_flags(SIZE_EXPAND_FILL); log->set_deselect_on_focus_loss_enabled(false); + log->connect("meta_clicked", callable_mp(this, &EditorLog::_meta_clicked)); vb_left->add_child(log); // Search box diff --git a/editor/editor_log.h b/editor/editor_log.h index 07f3a25c3e..03a0a071c6 100644 --- a/editor/editor_log.h +++ b/editor/editor_log.h @@ -157,6 +157,7 @@ private: Thread::ID current; //void _dragged(const Point2& p_ofs); + void _meta_clicked(const String &p_meta); void _clear_request(); void _copy_request(); static void _undo_redo_cbk(void *p_self, const String &p_name); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 0e295dabd4..521477d470 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -79,6 +79,7 @@ #include "editor/editor_build_profile.h" #include "editor/editor_command_palette.h" #include "editor/editor_data.h" +#include "editor/editor_dock_manager.h" #include "editor/editor_feature_profile.h" #include "editor/editor_folding.h" #include "editor/editor_help.h" @@ -95,10 +96,8 @@ #include "editor/editor_resource_preview.h" #include "editor/editor_run.h" #include "editor/editor_run_native.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_settings_dialog.h" -#include "editor/editor_themes.h" #include "editor/editor_translation_parser.h" #include "editor/editor_undo_redo_manager.h" #include "editor/export/editor_export.h" @@ -157,6 +156,8 @@ #include "editor/register_exporters.h" #include "editor/scene_tree_dock.h" #include "editor/surface_upgrade_tool.h" +#include "editor/themes/editor_scale.h" +#include "editor/themes/editor_theme_manager.h" #include "editor/window_wrapper.h" #include <stdio.h> @@ -468,7 +469,7 @@ void EditorNode::_select_default_main_screen_plugin() { void EditorNode::_update_theme(bool p_skip_creation) { if (!p_skip_creation) { - theme = create_custom_theme(theme); + theme = EditorThemeManager::generate_theme(theme); DisplayServer::set_early_window_clear_color_override(true, theme->get_color(SNAME("background"), EditorStringName(Editor))); } @@ -507,14 +508,6 @@ void EditorNode::_update_theme(bool p_skip_creation) { distraction_free->set_icon(theme->get_icon(SNAME("DistractionFree"), EditorStringName(EditorIcons))); bottom_panel_raise->set_icon(theme->get_icon(SNAME("ExpandBottomDock"), EditorStringName(EditorIcons))); - if (gui_base->is_layout_rtl()) { - dock_tab_move_left->set_icon(theme->get_icon(SNAME("Forward"), EditorStringName(EditorIcons))); - dock_tab_move_right->set_icon(theme->get_icon(SNAME("Back"), EditorStringName(EditorIcons))); - } else { - dock_tab_move_left->set_icon(theme->get_icon(SNAME("Back"), EditorStringName(EditorIcons))); - dock_tab_move_right->set_icon(theme->get_icon(SNAME("Forward"), EditorStringName(EditorIcons))); - } - help_menu->set_item_icon(help_menu->get_item_index(HELP_SEARCH), theme->get_icon(SNAME("HelpSearch"), EditorStringName(EditorIcons))); help_menu->set_item_icon(help_menu->get_item_index(HELP_DOCS), theme->get_icon(SNAME("ExternalLink"), EditorStringName(EditorIcons))); help_menu->set_item_icon(help_menu->get_item_index(HELP_QA), theme->get_icon(SNAME("ExternalLink"), EditorStringName(EditorIcons))); @@ -771,19 +764,7 @@ void EditorNode::_notification(int p_what) { EditorFileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files")); EditorFileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EDITOR_GET("filesystem/file_dialog/display_mode").operator int()); - bool theme_changed = - EditorSettings::get_singleton()->check_changed_settings_in_group("interface/theme") || - EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/font") || - EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/main_font") || - EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/code_font") || - EditorSettings::get_singleton()->check_changed_settings_in_group("text_editor/theme") || - EditorSettings::get_singleton()->check_changed_settings_in_group("text_editor/help/help") || - EditorSettings::get_singleton()->check_changed_settings_in_group("filesystem/file_dialog/thumbnail_size") || - EditorSettings::get_singleton()->check_changed_settings_in_group("run/output/font_size") || - EditorSettings::get_singleton()->check_changed_settings_in_group("interface/touchscreen/increase_scrollbar_touch_area") || - EditorSettings::get_singleton()->check_changed_settings_in_group("interface/touchscreen/scale_gizmo_handles"); - - if (theme_changed) { + if (EditorThemeManager::is_generated_theme_outdated()) { _update_theme(); } @@ -2095,7 +2076,7 @@ void EditorNode::_dialog_action(String p_file) { return; } - _save_docks_to_config(config, p_file); + editor_dock_manager->save_docks_to_config(config, p_file); config->save(EditorSettings::get_singleton()->get_editor_layouts_config()); @@ -4738,240 +4719,6 @@ void EditorNode::_copy_warning(const String &p_str) { DisplayServer::get_singleton()->clipboard_set(warning->get_text()); } -void EditorNode::_dock_floating_close_request(WindowWrapper *p_wrapper) { - int dock_slot_num = p_wrapper->get_meta("dock_slot"); - int dock_slot_index = p_wrapper->get_meta("dock_index"); - - // Give back the dock to the original owner. - Control *dock = p_wrapper->release_wrapped_control(); - - int target_index = MIN(dock_slot_index, dock_slot[dock_slot_num]->get_tab_count()); - dock_slot[dock_slot_num]->add_child(dock); - dock_slot[dock_slot_num]->move_child(dock, target_index); - dock_slot[dock_slot_num]->set_current_tab(target_index); - - floating_docks.erase(p_wrapper); - p_wrapper->queue_free(); - - _update_dock_slots_visibility(true); - - _edit_current(); -} - -void EditorNode::_dock_make_selected_float() { - Control *dock = dock_slot[dock_popup_selected_idx]->get_current_tab_control(); - _dock_make_float(dock, dock_popup_selected_idx); - - dock_select_popup->hide(); - _edit_current(); -} - -void EditorNode::_dock_make_float(Control *p_dock, int p_slot_index, bool p_show_window) { - ERR_FAIL_NULL(p_dock); - - Size2 borders = Size2(4, 4) * EDSCALE; - // Remember size and position before removing it from the main window. - Size2 dock_size = p_dock->get_size() + borders * 2; - Point2 dock_screen_pos = p_dock->get_screen_position(); - - int dock_index = p_dock->get_index() - 1; - dock_slot[p_slot_index]->remove_child(p_dock); - - WindowWrapper *wrapper = memnew(WindowWrapper); - wrapper->set_window_title(vformat(TTR("%s - Godot Engine"), p_dock->get_name())); - wrapper->set_margins_enabled(true); - - gui_base->add_child(wrapper); - - wrapper->set_wrapped_control(p_dock); - wrapper->set_meta("dock_slot", p_slot_index); - wrapper->set_meta("dock_index", dock_index); - wrapper->set_meta("dock_name", p_dock->get_name().operator String()); - p_dock->show(); - - wrapper->connect("window_close_requested", callable_mp(this, &EditorNode::_dock_floating_close_request).bind(wrapper)); - - dock_select_popup->hide(); - - if (p_show_window) { - wrapper->restore_window(Rect2i(dock_screen_pos, dock_size), get_window()->get_current_screen()); - } - - _update_dock_slots_visibility(true); - - floating_docks.push_back(wrapper); - - _edit_current(); -} - -void EditorNode::_dock_select_input(const Ref<InputEvent> &p_input) { - Ref<InputEventMouse> me = p_input; - - if (me.is_valid()) { - Vector2 point = me->get_position(); - - int nrect = -1; - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - if (dock_select_rect[i].has_point(point)) { - nrect = i; - break; - } - } - - if (nrect != dock_select_rect_over_idx) { - dock_select->queue_redraw(); - dock_select_rect_over_idx = nrect; - } - - if (nrect == -1) { - return; - } - - Ref<InputEventMouseButton> mb = me; - - if (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && mb->is_pressed() && dock_popup_selected_idx != nrect) { - dock_slot[nrect]->move_tab_from_tab_container(dock_slot[dock_popup_selected_idx], dock_slot[dock_popup_selected_idx]->get_current_tab(), dock_slot[nrect]->get_tab_count()); - - if (dock_slot[dock_popup_selected_idx]->get_tab_count() == 0) { - dock_slot[dock_popup_selected_idx]->hide(); - } else { - dock_slot[dock_popup_selected_idx]->set_current_tab(0); - } - - dock_popup_selected_idx = nrect; - dock_slot[nrect]->show(); - dock_select->queue_redraw(); - - _update_dock_slots_visibility(true); - - _edit_current(); - _save_editor_layout(); - } - } -} - -void EditorNode::_dock_popup_exit() { - dock_select_rect_over_idx = -1; - dock_select->queue_redraw(); -} - -void EditorNode::_dock_pre_popup(int p_which) { - dock_popup_selected_idx = p_which; -} - -void EditorNode::_dock_move_left() { - if (dock_popup_selected_idx < 0 || dock_popup_selected_idx >= DOCK_SLOT_MAX) { - return; - } - Control *current_ctl = dock_slot[dock_popup_selected_idx]->get_tab_control(dock_slot[dock_popup_selected_idx]->get_current_tab()); - Control *prev_ctl = dock_slot[dock_popup_selected_idx]->get_tab_control(dock_slot[dock_popup_selected_idx]->get_current_tab() - 1); - if (!current_ctl || !prev_ctl) { - return; - } - dock_slot[dock_popup_selected_idx]->move_child(current_ctl, prev_ctl->get_index(false)); - dock_select->queue_redraw(); - _edit_current(); - _save_editor_layout(); -} - -void EditorNode::_dock_move_right() { - Control *current_ctl = dock_slot[dock_popup_selected_idx]->get_tab_control(dock_slot[dock_popup_selected_idx]->get_current_tab()); - Control *next_ctl = dock_slot[dock_popup_selected_idx]->get_tab_control(dock_slot[dock_popup_selected_idx]->get_current_tab() + 1); - if (!current_ctl || !next_ctl) { - return; - } - dock_slot[dock_popup_selected_idx]->move_child(next_ctl, current_ctl->get_index(false)); - dock_select->queue_redraw(); - _edit_current(); - _save_editor_layout(); -} - -void EditorNode::_dock_select_draw() { - Size2 s = dock_select->get_size(); - s.y /= 2.0; - s.x /= 6.0; - - Color used = Color(0.6, 0.6, 0.6, 0.8); - Color used_selected = Color(0.8, 0.8, 0.8, 0.8); - Color tab_selected = theme->get_color(SNAME("mono_color"), EditorStringName(Editor)); - Color unused = used; - unused.a = 0.4; - Color unusable = unused; - unusable.a = 0.1; - - Rect2 unr(s.x * 2, 0, s.x * 2, s.y * 2); - unr.position += Vector2(2, 5); - unr.size -= Vector2(4, 7); - - dock_select->draw_rect(unr, unusable); - - dock_tab_move_left->set_disabled(true); - dock_tab_move_right->set_disabled(true); - - if (dock_popup_selected_idx != -1 && dock_slot[dock_popup_selected_idx]->get_tab_count()) { - dock_tab_move_left->set_disabled(dock_slot[dock_popup_selected_idx]->get_current_tab() == 0); - dock_tab_move_right->set_disabled(dock_slot[dock_popup_selected_idx]->get_current_tab() >= dock_slot[dock_popup_selected_idx]->get_tab_count() - 1); - } - - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - Vector2 ofs; - - switch (i) { - case DOCK_SLOT_LEFT_UL: { - } break; - case DOCK_SLOT_LEFT_BL: { - ofs.y += s.y; - } break; - case DOCK_SLOT_LEFT_UR: { - ofs.x += s.x; - } break; - case DOCK_SLOT_LEFT_BR: { - ofs += s; - } break; - case DOCK_SLOT_RIGHT_UL: { - ofs.x += s.x * 4; - } break; - case DOCK_SLOT_RIGHT_BL: { - ofs.x += s.x * 4; - ofs.y += s.y; - - } break; - case DOCK_SLOT_RIGHT_UR: { - ofs.x += s.x * 4; - ofs.x += s.x; - - } break; - case DOCK_SLOT_RIGHT_BR: { - ofs.x += s.x * 4; - ofs += s; - - } break; - } - - Rect2 r(ofs, s); - dock_select_rect[i] = r; - r.position += Vector2(2, 5); - r.size -= Vector2(4, 7); - - if (i == dock_select_rect_over_idx) { - dock_select->draw_rect(r, used_selected); - } else if (dock_slot[i]->get_tab_count() == 0) { - dock_select->draw_rect(r, unused); - } else { - dock_select->draw_rect(r, used); - } - - for (int j = 0; j < MIN(3, dock_slot[i]->get_tab_count()); j++) { - int xofs = (r.size.width / 3) * j; - Color c = used; - if (i == dock_popup_selected_idx && (dock_slot[i]->get_current_tab() > 3 || dock_slot[i]->get_current_tab() == j)) { - c = tab_selected; - } - dock_select->draw_rect(Rect2(2 + ofs.x + xofs, ofs.y, r.size.width / 3 - 1, 3), c); - } - } -} - void EditorNode::_save_editor_layout() { if (waiting_for_first_scan) { return; // Scanning, do not touch docks. @@ -4981,7 +4728,7 @@ void EditorNode::_save_editor_layout() { // Load and amend existing config if it exists. config->load(EditorPaths::get_singleton()->get_project_settings_dir().path_join("editor_layout.cfg")); - _save_docks_to_config(config, "docks"); + editor_dock_manager->save_docks_to_config(config, "docks"); _save_open_scenes_to_config(config); _save_central_editor_layout_to_config(config); editor_data.get_plugin_window_layout(config); @@ -4989,85 +4736,6 @@ void EditorNode::_save_editor_layout() { config->save(EditorPaths::get_singleton()->get_project_settings_dir().path_join("editor_layout.cfg")); } -void EditorNode::_save_docks_to_config(Ref<ConfigFile> p_layout, const String &p_section) { - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - String names; - for (int j = 0; j < dock_slot[i]->get_tab_count(); j++) { - String name = dock_slot[i]->get_tab_control(j)->get_name(); - if (!names.is_empty()) { - names += ","; - } - names += name; - } - - String config_key = "dock_" + itos(i + 1); - - if (p_layout->has_section_key(p_section, config_key)) { - p_layout->erase_section_key(p_section, config_key); - } - - if (!names.is_empty()) { - p_layout->set_value(p_section, config_key, names); - } - - int selected_tab_idx = dock_slot[i]->get_current_tab(); - if (selected_tab_idx >= 0) { - p_layout->set_value(p_section, "dock_" + itos(i + 1) + "_selected_tab_idx", selected_tab_idx); - } - } - - Dictionary floating_docks_dump; - - for (WindowWrapper *wrapper : floating_docks) { - Control *dock = wrapper->get_wrapped_control(); - - Dictionary dock_dump; - dock_dump["window_rect"] = wrapper->get_window_rect(); - - int screen = wrapper->get_window_screen(); - dock_dump["window_screen"] = wrapper->get_window_screen(); - dock_dump["window_screen_rect"] = DisplayServer::get_singleton()->screen_get_usable_rect(screen); - - String name = dock->get_name(); - floating_docks_dump[name] = dock_dump; - - int dock_slot_id = wrapper->get_meta("dock_slot"); - String config_key = "dock_" + itos(dock_slot_id + 1); - - String names = p_layout->get_value(p_section, config_key, ""); - if (names.is_empty()) { - names = name; - } else { - names += "," + name; - } - p_layout->set_value(p_section, config_key, names); - } - - p_layout->set_value(p_section, "dock_floating", floating_docks_dump); - - for (int i = 0; i < vsplits.size(); i++) { - if (vsplits[i]->is_visible_in_tree()) { - p_layout->set_value(p_section, "dock_split_" + itos(i + 1), vsplits[i]->get_split_offset()); - } - } - - for (int i = 0; i < hsplits.size(); i++) { - p_layout->set_value(p_section, "dock_hsplit_" + itos(i + 1), hsplits[i]->get_split_offset()); - } - - // Save FileSystemDock state. - - p_layout->set_value(p_section, "dock_filesystem_h_split_offset", FileSystemDock::get_singleton()->get_h_split_offset()); - p_layout->set_value(p_section, "dock_filesystem_v_split_offset", FileSystemDock::get_singleton()->get_v_split_offset()); - p_layout->set_value(p_section, "dock_filesystem_display_mode", FileSystemDock::get_singleton()->get_display_mode()); - p_layout->set_value(p_section, "dock_filesystem_file_sort", FileSystemDock::get_singleton()->get_file_sort()); - p_layout->set_value(p_section, "dock_filesystem_file_list_display_mode", FileSystemDock::get_singleton()->get_file_list_display_mode()); - PackedStringArray selected_files = FileSystemDock::get_singleton()->get_selected_paths(); - p_layout->set_value(p_section, "dock_filesystem_selected_paths", selected_files); - Vector<String> uncollapsed_paths = FileSystemDock::get_singleton()->get_uncollapsed_paths(); - p_layout->set_value(p_section, "dock_filesystem_uncollapsed_paths", uncollapsed_paths); -} - void EditorNode::_save_open_scenes_to_config(Ref<ConfigFile> p_layout) { PackedStringArray scenes; for (int i = 0; i < editor_data.get_edited_scene_count(); i++) { @@ -5087,10 +4755,6 @@ void EditorNode::save_editor_layout_delayed() { editor_layout_save_delay_timer->start(); } -void EditorNode::_dock_split_dragged(int ofs) { - editor_layout_save_delay_timer->start(); -} - void EditorNode::_load_editor_layout() { Ref<ConfigFile> config; config.instantiate(); @@ -5113,227 +4777,13 @@ void EditorNode::_load_editor_layout() { return; } - _load_docks_from_config(config, "docks"); + editor_dock_manager->load_docks_from_config(config, "docks"); _load_open_scenes_from_config(config); _load_central_editor_layout_from_config(config); editor_data.set_plugin_window_layout(config); } -void EditorNode::_update_dock_slots_visibility(bool p_keep_selected_tabs) { - if (!docks_visible) { - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - dock_slot[i]->hide(); - } - - for (int i = 0; i < vsplits.size(); i++) { - vsplits[i]->hide(); - } - - right_hsplit->hide(); - } else { - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - int first_tab_visible = -1; - for (int j = 0; j < dock_slot[i]->get_tab_count(); j++) { - if (!dock_slot[i]->is_tab_hidden(j)) { - first_tab_visible = j; - break; - } - } - if (first_tab_visible >= 0) { - dock_slot[i]->show(); - if (p_keep_selected_tabs) { - int current_tab = dock_slot[i]->get_current_tab(); - if (dock_slot[i]->is_tab_hidden(current_tab)) { - dock_slot[i]->set_block_signals(true); - dock_slot[i]->select_next_available(); - dock_slot[i]->set_block_signals(false); - } - } else { - dock_slot[i]->set_block_signals(true); - dock_slot[i]->set_current_tab(first_tab_visible); - dock_slot[i]->set_block_signals(false); - } - } else { - dock_slot[i]->hide(); - } - } - - for (int i = 0; i < vsplits.size(); i++) { - bool in_use = dock_slot[i * 2 + 0]->is_visible() || dock_slot[i * 2 + 1]->is_visible(); - vsplits[i]->set_visible(in_use); - } - - right_hsplit->set_visible(right_l_vsplit->is_visible() || right_r_vsplit->is_visible()); - } -} - -void EditorNode::_dock_tab_changed(int p_tab) { - // Update visibility but don't set current tab. - _update_dock_slots_visibility(true); -} - -void EditorNode::_restore_floating_dock(const Dictionary &p_dock_dump, Control *p_dock, int p_slot_index) { - WindowWrapper *wrapper = Object::cast_to<WindowWrapper>(p_dock); - if (!wrapper) { - _dock_make_float(p_dock, p_slot_index, false); - wrapper = floating_docks[floating_docks.size() - 1]; - } - - wrapper->restore_window_from_saved_position( - p_dock_dump.get("window_rect", Rect2i()), - p_dock_dump.get("window_screen", -1), - p_dock_dump.get("window_screen_rect", Rect2i())); -} - -void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String &p_section) { - Dictionary floating_docks_dump = p_layout->get_value(p_section, "dock_floating", Dictionary()); - - bool restore_window_on_load = EDITOR_GET("interface/multi_window/restore_windows_on_load"); - - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - if (!p_layout->has_section_key(p_section, "dock_" + itos(i + 1))) { - continue; - } - - Vector<String> names = String(p_layout->get_value(p_section, "dock_" + itos(i + 1))).split(","); - - for (int j = names.size() - 1; j >= 0; j--) { - const String &name = names[j]; - - // FIXME: Find it, in a horribly inefficient way. - int atidx = -1; - Control *node = nullptr; - for (int k = 0; k < DOCK_SLOT_MAX; k++) { - if (!dock_slot[k]->has_node(name)) { - continue; - } - node = Object::cast_to<Control>(dock_slot[k]->get_node(name)); - if (!node) { - continue; - } - atidx = k; - break; - } - - if (atidx == -1) { - // Try floating docks. - for (WindowWrapper *wrapper : floating_docks) { - if (wrapper->get_meta("dock_name") == name) { - if (restore_window_on_load && floating_docks_dump.has(name)) { - _restore_floating_dock(floating_docks_dump[name], wrapper, i); - } else { - atidx = wrapper->get_meta("dock_slot"); - node = wrapper->get_wrapped_control(); - wrapper->set_window_enabled(false); - } - break; - } - } - } - if (!node) { - // Well, it's not anywhere. - continue; - } - - if (atidx == i) { - dock_slot[i]->move_child(node, 0); - } else if (atidx != -1) { - dock_slot[i]->move_tab_from_tab_container(dock_slot[atidx], dock_slot[atidx]->get_tab_idx_from_control(node), 0); - } - - WindowWrapper *wrapper = Object::cast_to<WindowWrapper>(node); - if (restore_window_on_load && floating_docks_dump.has(name)) { - if (!dock_slot[i]->is_tab_hidden(dock_slot[i]->get_tab_idx_from_control(node))) { - _restore_floating_dock(floating_docks_dump[name], node, i); - } - } else if (wrapper) { - wrapper->set_window_enabled(false); - } - } - - if (!p_layout->has_section_key(p_section, "dock_" + itos(i + 1) + "_selected_tab_idx")) { - continue; - } - - int selected_tab_idx = p_layout->get_value(p_section, "dock_" + itos(i + 1) + "_selected_tab_idx"); - if (selected_tab_idx >= 0 && selected_tab_idx < dock_slot[i]->get_tab_count()) { - callable_mp(dock_slot[i], &TabContainer::set_current_tab).call_deferred(selected_tab_idx); - } - } - - for (int i = 0; i < vsplits.size(); i++) { - if (!p_layout->has_section_key(p_section, "dock_split_" + itos(i + 1))) { - continue; - } - - int ofs = p_layout->get_value(p_section, "dock_split_" + itos(i + 1)); - vsplits[i]->set_split_offset(ofs); - } - - for (int i = 0; i < hsplits.size(); i++) { - if (!p_layout->has_section_key(p_section, "dock_hsplit_" + itos(i + 1))) { - continue; - } - int ofs = p_layout->get_value(p_section, "dock_hsplit_" + itos(i + 1)); - hsplits[i]->set_split_offset(ofs); - } - - _update_dock_slots_visibility(false); - - // FileSystemDock. - - if (p_layout->has_section_key(p_section, "dock_filesystem_h_split_offset")) { - int fs_h_split_ofs = p_layout->get_value(p_section, "dock_filesystem_h_split_offset"); - FileSystemDock::get_singleton()->set_h_split_offset(fs_h_split_ofs); - } - - if (p_layout->has_section_key(p_section, "dock_filesystem_v_split_offset")) { - int fs_v_split_ofs = p_layout->get_value(p_section, "dock_filesystem_v_split_offset"); - FileSystemDock::get_singleton()->set_v_split_offset(fs_v_split_ofs); - } - - if (p_layout->has_section_key(p_section, "dock_filesystem_display_mode")) { - FileSystemDock::DisplayMode dock_filesystem_display_mode = FileSystemDock::DisplayMode(int(p_layout->get_value(p_section, "dock_filesystem_display_mode"))); - FileSystemDock::get_singleton()->set_display_mode(dock_filesystem_display_mode); - } - - if (p_layout->has_section_key(p_section, "dock_filesystem_file_sort")) { - FileSystemDock::FileSortOption dock_filesystem_file_sort = FileSystemDock::FileSortOption(int(p_layout->get_value(p_section, "dock_filesystem_file_sort"))); - FileSystemDock::get_singleton()->set_file_sort(dock_filesystem_file_sort); - } - - if (p_layout->has_section_key(p_section, "dock_filesystem_file_list_display_mode")) { - FileSystemDock::FileListDisplayMode dock_filesystem_file_list_display_mode = FileSystemDock::FileListDisplayMode(int(p_layout->get_value(p_section, "dock_filesystem_file_list_display_mode"))); - FileSystemDock::get_singleton()->set_file_list_display_mode(dock_filesystem_file_list_display_mode); - } - - if (p_layout->has_section_key(p_section, "dock_filesystem_selected_paths")) { - PackedStringArray dock_filesystem_selected_paths = p_layout->get_value(p_section, "dock_filesystem_selected_paths"); - for (int i = 0; i < dock_filesystem_selected_paths.size(); i++) { - FileSystemDock::get_singleton()->select_file(dock_filesystem_selected_paths[i]); - } - } - - // Restore collapsed state of FileSystemDock. - PackedStringArray uncollapsed_tis; - if (p_layout->has_section_key(p_section, "dock_filesystem_uncollapsed_paths")) { - uncollapsed_tis = p_layout->get_value(p_section, "dock_filesystem_uncollapsed_paths"); - } else { - uncollapsed_tis = { "res://" }; - } - - if (!uncollapsed_tis.is_empty()) { - for (int i = 0; i < uncollapsed_tis.size(); i++) { - TreeItem *uncollapsed_ti = FileSystemDock::get_singleton()->get_tree_control()->get_item_with_metadata(uncollapsed_tis[i], 0); - if (uncollapsed_ti) { - uncollapsed_ti->set_collapsed(false); - } - } - FileSystemDock::get_singleton()->get_tree_control()->queue_redraw(); - } -} - void EditorNode::_save_central_editor_layout_to_config(Ref<ConfigFile> p_config_file) { // Bottom panel. @@ -5582,7 +5032,7 @@ void EditorNode::_layout_menu_option(int p_id) { layout_dialog->popup_centered(); } break; case SETTINGS_LAYOUT_DEFAULT: { - _load_docks_from_config(default_layout, "docks"); + editor_dock_manager->load_docks_from_config(default_layout, "docks"); _save_editor_layout(); } break; default: { @@ -5593,7 +5043,7 @@ void EditorNode::_layout_menu_option(int p_id) { return; // No config. } - _load_docks_from_config(config, editor_layouts->get_item_text(p_id)); + editor_dock_manager->load_docks_from_config(config, editor_layouts->get_item_text(p_id)); _save_editor_layout(); } } @@ -5803,15 +5253,6 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) { } } -void EditorNode::set_docks_visible(bool p_show) { - docks_visible = p_show; - _update_dock_slots_visibility(true); -} - -bool EditorNode::get_docks_visible() const { - return docks_visible; -} - void EditorNode::_toggle_distraction_free_mode() { if (EDITOR_GET("interface/editor/separate_distraction_mode")) { int screen = -1; @@ -5838,11 +5279,11 @@ void EditorNode::set_distraction_free_mode(bool p_enter) { distraction_free->set_pressed(p_enter); if (p_enter) { - if (docks_visible) { - set_docks_visible(false); + if (editor_dock_manager->are_docks_visible()) { + editor_dock_manager->set_docks_visible(false); } } else { - set_docks_visible(true); + editor_dock_manager->set_docks_visible(true); } } @@ -5850,35 +5291,6 @@ bool EditorNode::is_distraction_free_mode_enabled() const { return distraction_free->is_pressed(); } -void EditorNode::add_control_to_dock(DockSlot p_slot, Control *p_control) { - ERR_FAIL_INDEX(p_slot, DOCK_SLOT_MAX); - dock_slot[p_slot]->add_child(p_control); - _update_dock_slots_visibility(); -} - -void EditorNode::remove_control_from_dock(Control *p_control) { - // If the dock is floating, close it first. - for (WindowWrapper *wrapper : floating_docks) { - if (p_control == wrapper->get_wrapped_control()) { - wrapper->set_window_enabled(false); - break; - } - } - - Control *dock = nullptr; - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - if (p_control->get_parent() == dock_slot[i]) { - dock = dock_slot[i]; - break; - } - } - - ERR_FAIL_NULL_MSG(dock, "Control was not in dock."); - - dock->remove_child(p_control); - _update_dock_slots_visibility(); -} - Variant EditorNode::drag_resource(const Ref<Resource> &p_res, Control *p_from) { Control *drag_control = memnew(Control); TextureRect *drag_preview = memnew(TextureRect); @@ -6566,6 +5978,7 @@ void EditorNode::_bottom_panel_raise_toggled(bool p_pressed) { void EditorNode::_update_renderer_color() { String rendering_method = renderer->get_selected_metadata(); + // TODO: Use theme colors instead of hardcoded values. if (rendering_method == "forward_plus") { renderer->add_theme_color_override("font_color", Color::hex(0x5d8c3fff)); } @@ -6632,9 +6045,7 @@ void EditorNode::_resource_loaded(Ref<Resource> p_resource, const String &p_path void EditorNode::_feature_profile_changed() { Ref<EditorFeatureProfile> profile = feature_profile_manager->get_current_profile(); // FIXME: Close all floating docks to avoid crash. - for (WindowWrapper *wrapper : floating_docks) { - wrapper->set_window_enabled(false); - } + editor_dock_manager->close_all_floating_docks(); TabContainer *import_tabs = cast_to<TabContainer>(ImportDock::get_singleton()->get_parent()); TabContainer *node_tabs = cast_to<TabContainer>(NodeDock::get_singleton()->get_parent()); TabContainer *fs_tabs = cast_to<TabContainer>(FileSystemDock::get_singleton()->get_parent()); @@ -6669,7 +6080,7 @@ void EditorNode::_feature_profile_changed() { } } - _update_dock_slots_visibility(); + editor_dock_manager->update_dock_slots_visibility(); } void EditorNode::_bind_methods() { @@ -7016,9 +6427,8 @@ EditorNode::EditorNode() { add_child(editor_export); // Exporters might need the theme. - EditorColorMap::create(); - EditorTheme::initialize(); - theme = create_custom_theme(); + EditorThemeManager::initialize(); + theme = EditorThemeManager::generate_theme(); DisplayServer::set_early_window_clear_color_override(true, theme->get_color(SNAME("background"), EditorStringName(Editor))); register_exporters(); @@ -7079,127 +6489,96 @@ EditorNode::EditorNode() { title_bar = memnew(EditorTitleBar); main_vbox->add_child(title_bar); - left_l_hsplit = memnew(HSplitContainer); + left_l_hsplit = memnew(DockSplitContainer); + left_l_hsplit->set_name("DockHSplitLeftL"); main_vbox->add_child(left_l_hsplit); left_l_hsplit->set_v_size_flags(Control::SIZE_EXPAND_FILL); - left_l_vsplit = memnew(VSplitContainer); + left_l_vsplit = memnew(DockSplitContainer); + left_l_vsplit->set_name("DockVSplitLeftL"); + left_l_vsplit->set_vertical(true); left_l_hsplit->add_child(left_l_vsplit); - dock_slot[DOCK_SLOT_LEFT_UL] = memnew(TabContainer); - left_l_vsplit->add_child(dock_slot[DOCK_SLOT_LEFT_UL]); - dock_slot[DOCK_SLOT_LEFT_BL] = memnew(TabContainer); - left_l_vsplit->add_child(dock_slot[DOCK_SLOT_LEFT_BL]); - left_r_hsplit = memnew(HSplitContainer); + TabContainer *dock_slot[EditorDockManager::DOCK_SLOT_MAX]; + dock_slot[EditorDockManager::DOCK_SLOT_LEFT_UL] = memnew(TabContainer); + dock_slot[EditorDockManager::DOCK_SLOT_LEFT_UL]->set_name("DockSlotLeftUL"); + left_l_vsplit->add_child(dock_slot[EditorDockManager::DOCK_SLOT_LEFT_UL]); + dock_slot[EditorDockManager::DOCK_SLOT_LEFT_BL] = memnew(TabContainer); + dock_slot[EditorDockManager::DOCK_SLOT_LEFT_BL]->set_name("DockSlotLeftBL"); + left_l_vsplit->add_child(dock_slot[EditorDockManager::DOCK_SLOT_LEFT_BL]); + + left_r_hsplit = memnew(DockSplitContainer); + left_r_hsplit->set_name("DockHSplitLeftR"); left_l_hsplit->add_child(left_r_hsplit); - left_r_vsplit = memnew(VSplitContainer); + left_r_vsplit = memnew(DockSplitContainer); + left_r_vsplit->set_name("DockVSplitLeftR"); + left_r_vsplit->set_vertical(true); left_r_hsplit->add_child(left_r_vsplit); - dock_slot[DOCK_SLOT_LEFT_UR] = memnew(TabContainer); - left_r_vsplit->add_child(dock_slot[DOCK_SLOT_LEFT_UR]); - dock_slot[DOCK_SLOT_LEFT_BR] = memnew(TabContainer); - left_r_vsplit->add_child(dock_slot[DOCK_SLOT_LEFT_BR]); - - main_hsplit = memnew(HSplitContainer); + dock_slot[EditorDockManager::DOCK_SLOT_LEFT_UR] = memnew(TabContainer); + dock_slot[EditorDockManager::DOCK_SLOT_LEFT_UR]->set_name("DockSlotLeftUR"); + left_r_vsplit->add_child(dock_slot[EditorDockManager::DOCK_SLOT_LEFT_UR]); + dock_slot[EditorDockManager::DOCK_SLOT_LEFT_BR] = memnew(TabContainer); + dock_slot[EditorDockManager::DOCK_SLOT_LEFT_BR]->set_name("DockSlotLeftBR"); + left_r_vsplit->add_child(dock_slot[EditorDockManager::DOCK_SLOT_LEFT_BR]); + + main_hsplit = memnew(DockSplitContainer); + main_hsplit->set_name("DockHSplitMain"); left_r_hsplit->add_child(main_hsplit); VBoxContainer *center_vb = memnew(VBoxContainer); main_hsplit->add_child(center_vb); + center_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); - center_split = memnew(VSplitContainer); + center_split = memnew(DockSplitContainer); + center_split->set_name("DockVSplitCenter"); + center_split->set_vertical(true); center_split->set_v_size_flags(Control::SIZE_EXPAND_FILL); center_split->set_collapsed(false); center_vb->add_child(center_split); - right_hsplit = memnew(HSplitContainer); + right_hsplit = memnew(DockSplitContainer); + right_hsplit->set_name("DockHSplitRight"); main_hsplit->add_child(right_hsplit); - right_l_vsplit = memnew(VSplitContainer); + right_l_vsplit = memnew(DockSplitContainer); + right_l_vsplit->set_name("DockVSplitRightL"); + right_l_vsplit->set_vertical(true); right_hsplit->add_child(right_l_vsplit); - dock_slot[DOCK_SLOT_RIGHT_UL] = memnew(TabContainer); - right_l_vsplit->add_child(dock_slot[DOCK_SLOT_RIGHT_UL]); - dock_slot[DOCK_SLOT_RIGHT_BL] = memnew(TabContainer); - right_l_vsplit->add_child(dock_slot[DOCK_SLOT_RIGHT_BL]); - - right_r_vsplit = memnew(VSplitContainer); + dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_UL] = memnew(TabContainer); + dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_UL]->set_name("DockSlotRightUL"); + right_l_vsplit->add_child(dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_UL]); + dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_BL] = memnew(TabContainer); + dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_BL]->set_name("DockSlotRightBL"); + right_l_vsplit->add_child(dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_BL]); + + right_r_vsplit = memnew(DockSplitContainer); + right_r_vsplit->set_name("DockVSplitRightR"); + right_r_vsplit->set_vertical(true); right_hsplit->add_child(right_r_vsplit); - dock_slot[DOCK_SLOT_RIGHT_UR] = memnew(TabContainer); - right_r_vsplit->add_child(dock_slot[DOCK_SLOT_RIGHT_UR]); - dock_slot[DOCK_SLOT_RIGHT_BR] = memnew(TabContainer); - right_r_vsplit->add_child(dock_slot[DOCK_SLOT_RIGHT_BR]); - - // Store them for easier access. - vsplits.push_back(left_l_vsplit); - vsplits.push_back(left_r_vsplit); - vsplits.push_back(right_l_vsplit); - vsplits.push_back(right_r_vsplit); - - hsplits.push_back(left_l_hsplit); - hsplits.push_back(left_r_hsplit); - hsplits.push_back(main_hsplit); - hsplits.push_back(right_hsplit); - - for (int i = 0; i < vsplits.size(); i++) { - vsplits[i]->connect("dragged", callable_mp(this, &EditorNode::_dock_split_dragged)); - hsplits[i]->connect("dragged", callable_mp(this, &EditorNode::_dock_split_dragged)); - } - - dock_select_popup = memnew(PopupPanel); - gui_base->add_child(dock_select_popup); - VBoxContainer *dock_vb = memnew(VBoxContainer); - dock_select_popup->add_child(dock_vb); - - HBoxContainer *dock_hb = memnew(HBoxContainer); - dock_tab_move_left = memnew(Button); - dock_tab_move_left->set_flat(true); - dock_tab_move_left->set_focus_mode(Control::FOCUS_NONE); - dock_tab_move_left->connect("pressed", callable_mp(this, &EditorNode::_dock_move_left)); - dock_hb->add_child(dock_tab_move_left); - - Label *dock_label = memnew(Label); - dock_label->set_text(TTR("Dock Position")); - dock_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); - dock_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); - dock_hb->add_child(dock_label); - - dock_tab_move_right = memnew(Button); - dock_tab_move_right->set_flat(true); - dock_tab_move_right->set_focus_mode(Control::FOCUS_NONE); - dock_tab_move_right->connect("pressed", callable_mp(this, &EditorNode::_dock_move_right)); - - dock_hb->add_child(dock_tab_move_right); - dock_vb->add_child(dock_hb); - - dock_select = memnew(Control); - dock_select->set_custom_minimum_size(Size2(128, 64) * EDSCALE); - dock_select->connect("gui_input", callable_mp(this, &EditorNode::_dock_select_input)); - dock_select->connect("draw", callable_mp(this, &EditorNode::_dock_select_draw)); - dock_select->connect("mouse_exited", callable_mp(this, &EditorNode::_dock_popup_exit)); - dock_select->set_v_size_flags(Control::SIZE_EXPAND_FILL); - dock_vb->add_child(dock_select); - - if (!SceneTree::get_singleton()->get_root()->is_embedding_subwindows() && !EDITOR_GET("interface/editor/single_window_mode") && EDITOR_GET("interface/multi_window/enable")) { - dock_float = memnew(Button); - dock_float->set_icon(theme->get_icon("MakeFloating", EditorStringName(EditorIcons))); - dock_float->set_text(TTR("Make Floating")); - dock_float->set_focus_mode(Control::FOCUS_NONE); - dock_float->set_h_size_flags(Control::SIZE_SHRINK_CENTER); - dock_float->connect("pressed", callable_mp(this, &EditorNode::_dock_make_selected_float)); - - dock_vb->add_child(dock_float); - } - - dock_select_popup->reset_size(); - - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - dock_slot[i]->set_custom_minimum_size(Size2(170, 0) * EDSCALE); - dock_slot[i]->set_v_size_flags(Control::SIZE_EXPAND_FILL); - dock_slot[i]->set_popup(dock_select_popup); - dock_slot[i]->connect("pre_popup_pressed", callable_mp(this, &EditorNode::_dock_pre_popup).bind(i)); - dock_slot[i]->set_drag_to_rearrange_enabled(true); - dock_slot[i]->set_tabs_rearrange_group(1); - dock_slot[i]->connect("tab_changed", callable_mp(this, &EditorNode::_dock_tab_changed)); - dock_slot[i]->set_use_hidden_tabs_for_min_size(true); + dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_UR] = memnew(TabContainer); + dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_UR]->set_name("DockSlotRightUR"); + right_r_vsplit->add_child(dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_UR]); + dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_BR] = memnew(TabContainer); + dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_BR]->set_name("DockSlotRightBR"); + right_r_vsplit->add_child(dock_slot[EditorDockManager::DOCK_SLOT_RIGHT_BR]); + + editor_dock_manager = memnew(EditorDockManager); + editor_dock_manager->connect("layout_changed", callable_mp(this, &EditorNode::_save_editor_layout)); + + // Save the splits for easier access. + editor_dock_manager->add_vsplit(left_l_vsplit); + editor_dock_manager->add_vsplit(left_r_vsplit); + editor_dock_manager->add_vsplit(right_l_vsplit); + editor_dock_manager->add_vsplit(right_r_vsplit); + + editor_dock_manager->add_hsplit(left_l_hsplit); + editor_dock_manager->add_hsplit(left_r_hsplit); + editor_dock_manager->add_hsplit(main_hsplit); + editor_dock_manager->add_hsplit(right_hsplit); + + for (int i = 0; i < EditorDockManager::DOCK_SLOT_MAX; i++) { + editor_dock_manager->register_dock_slot((EditorDockManager::DockSlot)i, dock_slot[i]); } editor_layout_save_delay_timer = memnew(Timer); @@ -7642,37 +7021,22 @@ EditorNode::EditorNode() { history_dock = memnew(HistoryDock); // Scene: Top left. - dock_slot[DOCK_SLOT_LEFT_UR]->add_child(SceneTreeDock::get_singleton()); - dock_slot[DOCK_SLOT_LEFT_UR]->set_tab_title(dock_slot[DOCK_SLOT_LEFT_UR]->get_tab_idx_from_control(SceneTreeDock::get_singleton()), TTR("Scene")); + editor_dock_manager->add_control_to_dock(EditorDockManager::DOCK_SLOT_LEFT_UR, SceneTreeDock::get_singleton(), TTR("Scene")); // Import: Top left, behind Scene. - dock_slot[DOCK_SLOT_LEFT_UR]->add_child(ImportDock::get_singleton()); - dock_slot[DOCK_SLOT_LEFT_UR]->set_tab_title(dock_slot[DOCK_SLOT_LEFT_UR]->get_tab_idx_from_control(ImportDock::get_singleton()), TTR("Import")); + editor_dock_manager->add_control_to_dock(EditorDockManager::DOCK_SLOT_LEFT_UR, ImportDock::get_singleton(), TTR("Import")); // FileSystem: Bottom left. - dock_slot[DOCK_SLOT_LEFT_BR]->add_child(FileSystemDock::get_singleton()); - dock_slot[DOCK_SLOT_LEFT_BR]->set_tab_title(dock_slot[DOCK_SLOT_LEFT_BR]->get_tab_idx_from_control(FileSystemDock::get_singleton()), TTR("FileSystem")); + editor_dock_manager->add_control_to_dock(EditorDockManager::DOCK_SLOT_LEFT_BR, FileSystemDock::get_singleton(), TTR("FileSystem")); // Inspector: Full height right. - dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(InspectorDock::get_singleton()); - dock_slot[DOCK_SLOT_RIGHT_UL]->set_tab_title(dock_slot[DOCK_SLOT_RIGHT_UL]->get_tab_idx_from_control(InspectorDock::get_singleton()), TTR("Inspector")); + editor_dock_manager->add_control_to_dock(EditorDockManager::DOCK_SLOT_RIGHT_UL, InspectorDock::get_singleton(), TTR("Inspector")); // Node: Full height right, behind Inspector. - dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(NodeDock::get_singleton()); - dock_slot[DOCK_SLOT_RIGHT_UL]->set_tab_title(dock_slot[DOCK_SLOT_RIGHT_UL]->get_tab_idx_from_control(NodeDock::get_singleton()), TTR("Node")); + editor_dock_manager->add_control_to_dock(EditorDockManager::DOCK_SLOT_RIGHT_UL, NodeDock::get_singleton(), TTR("Node")); // History: Full height right, behind Node. - dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(history_dock); - dock_slot[DOCK_SLOT_RIGHT_UL]->set_tab_title(dock_slot[DOCK_SLOT_RIGHT_UL]->get_tab_idx_from_control(history_dock), TTR("History")); - - // Hide unused dock slots and vsplits. - dock_slot[DOCK_SLOT_LEFT_UL]->hide(); - dock_slot[DOCK_SLOT_LEFT_BL]->hide(); - dock_slot[DOCK_SLOT_RIGHT_BL]->hide(); - dock_slot[DOCK_SLOT_RIGHT_UR]->hide(); - dock_slot[DOCK_SLOT_RIGHT_BR]->hide(); - left_l_vsplit->hide(); - right_r_vsplit->hide(); + editor_dock_manager->add_control_to_dock(EditorDockManager::DOCK_SLOT_RIGHT_UL, history_dock, TTR("History")); // Add some offsets to left_r and main hsplits to make LEFT_R and RIGHT_L docks wider than minsize. left_r_hsplit->set_split_offset(270 * EDSCALE); @@ -7687,7 +7051,8 @@ EditorNode::EditorNode() { default_layout->set_value(docks_section, "dock_4", "FileSystem"); default_layout->set_value(docks_section, "dock_5", "Inspector,Node,History"); - for (int i = 0; i < vsplits.size(); i++) { + // There are 4 vsplits and 4 hsplits. + for (int i = 0; i < editor_dock_manager->get_vsplit_count(); i++) { default_layout->set_value(docks_section, "dock_split_" + itos(i + 1), 0); } default_layout->set_value(docks_section, "dock_hsplit_1", 0); @@ -7817,6 +7182,7 @@ EditorNode::EditorNode() { file = memnew(EditorFileDialog); gui_base->add_child(file); file->set_current_dir("res://"); + file->set_transient_to_focused(true); file_export_lib = memnew(EditorFileDialog); file_export_lib->set_title(TTR("Export Library")); @@ -8119,10 +7485,10 @@ EditorNode::~EditorNode() { memdelete(editor_plugins_force_input_forwarding); memdelete(progress_hb); memdelete(surface_upgrade_tool); + memdelete(editor_dock_manager); EditorSettings::destroy(); - EditorColorMap::finish(); - EditorTheme::finalize(); + EditorThemeManager::finalize(); GDExtensionEditorPlugins::editor_node_add_plugin = nullptr; GDExtensionEditorPlugins::editor_node_remove_plugin = nullptr; diff --git a/editor/editor_node.h b/editor/editor_node.h index c72a8f9324..f1dea0c11e 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -73,10 +73,12 @@ class AudioStreamPreviewGenerator; class BackgroundProgress; class DependencyEditor; class DependencyErrorDialog; +class DockSplitContainer; class DynamicFontImportSettingsDialog; class EditorAbout; class EditorBuildProfileManager; class EditorCommandPalette; +class EditorDockManager; class EditorExport; class EditorExtensionManager; class EditorFeatureProfileManager; @@ -121,18 +123,6 @@ class EditorNode : public Node { GDCLASS(EditorNode, Node); public: - enum DockSlot { - DOCK_SLOT_LEFT_UL, - DOCK_SLOT_LEFT_BL, - DOCK_SLOT_LEFT_UR, - DOCK_SLOT_LEFT_BR, - DOCK_SLOT_RIGHT_UL, - DOCK_SLOT_RIGHT_BL, - DOCK_SLOT_RIGHT_UR, - DOCK_SLOT_RIGHT_BR, - DOCK_SLOT_MAX - }; - enum EditorTable { EDITOR_2D = 0, EDITOR_3D, @@ -310,18 +300,15 @@ private: String renderer_request; // Split containers. - HSplitContainer *left_l_hsplit = nullptr; - VSplitContainer *left_l_vsplit = nullptr; - HSplitContainer *left_r_hsplit = nullptr; - VSplitContainer *left_r_vsplit = nullptr; - HSplitContainer *main_hsplit = nullptr; - HSplitContainer *right_hsplit = nullptr; - VSplitContainer *right_l_vsplit = nullptr; - VSplitContainer *right_r_vsplit = nullptr; - VSplitContainer *center_split = nullptr; - // To access those easily by index. - Vector<VSplitContainer *> vsplits; - Vector<HSplitContainer *> hsplits; + DockSplitContainer *left_l_hsplit = nullptr; + DockSplitContainer *left_l_vsplit = nullptr; + DockSplitContainer *left_r_hsplit = nullptr; + DockSplitContainer *left_r_vsplit = nullptr; + DockSplitContainer *main_hsplit = nullptr; + DockSplitContainer *right_hsplit = nullptr; + DockSplitContainer *right_l_vsplit = nullptr; + DockSplitContainer *right_r_vsplit = nullptr; + DockSplitContainer *center_split = nullptr; // Main tabs. EditorSceneTabs *scene_tabs = nullptr; @@ -426,20 +413,8 @@ private: Button *new_inherited_button = nullptr; String open_import_request; - Vector<WindowWrapper *> floating_docks; - - Button *dock_float = nullptr; - Button *dock_tab_move_left = nullptr; - Button *dock_tab_move_right = nullptr; - Control *dock_select = nullptr; - PopupPanel *dock_select_popup = nullptr; - Rect2 dock_select_rect[DOCK_SLOT_MAX]; - TabContainer *dock_slot[DOCK_SLOT_MAX]; + EditorDockManager *editor_dock_manager = nullptr; Timer *editor_layout_save_delay_timer = nullptr; - bool docks_visible = true; - int dock_popup_selected_idx = -1; - int dock_select_rect_over_idx = -1; - Button *distraction_free = nullptr; Vector<BottomPanelItem> bottom_panel_items; @@ -634,17 +609,6 @@ private: bool _find_scene_in_use(Node *p_node, const String &p_path) const; - void _dock_select_input(const Ref<InputEvent> &p_input); - void _dock_move_left(); - void _dock_move_right(); - void _dock_select_draw(); - void _dock_pre_popup(int p_which); - void _dock_split_dragged(int ofs); - void _dock_popup_exit(); - void _dock_floating_close_request(WindowWrapper *p_wrapper); - void _dock_make_selected_float(); - void _dock_make_float(Control *p_control, int p_slot_index, bool p_show_window = true); - void _proceed_closing_scene_tabs(); bool _is_closing_editor() const; @@ -655,11 +619,6 @@ private: void _save_editor_layout(); void _load_editor_layout(); - void _save_docks_to_config(Ref<ConfigFile> p_layout, const String &p_section); - void _restore_floating_dock(const Dictionary &p_dock_dump, Control *p_wrapper, int p_slot_index); - void _load_docks_from_config(Ref<ConfigFile> p_layout, const String &p_section); - void _update_dock_slots_visibility(bool p_keep_selected_tabs = false); - void _dock_tab_changed(int p_tab); void _save_central_editor_layout_to_config(Ref<ConfigFile> p_config_file); void _load_central_editor_layout_from_config(Ref<ConfigFile> p_config_file); @@ -772,15 +731,9 @@ public: void new_inherited_scene() { _menu_option_confirm(FILE_NEW_INHERITED_SCENE, false); } - void set_docks_visible(bool p_show); - bool get_docks_visible() const; - void set_distraction_free_mode(bool p_enter); bool is_distraction_free_mode_enabled() const; - void add_control_to_dock(DockSlot p_slot, Control *p_control); - void remove_control_from_dock(Control *p_control); - void set_addon_plugin_enabled(const String &p_addon, bool p_enabled, bool p_config_changed = false); bool is_addon_plugin_enabled(const String &p_addon) const; diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 49c62a3a6c..f0044edff2 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -31,6 +31,7 @@ #include "editor_plugin.h" #include "editor/debugger/editor_debugger_node.h" +#include "editor/editor_dock_manager.h" #include "editor/editor_file_system.h" #include "editor/editor_inspector.h" #include "editor/editor_interface.h" @@ -84,12 +85,12 @@ Button *EditorPlugin::add_control_to_bottom_panel(Control *p_control, const Stri void EditorPlugin::add_control_to_dock(DockSlot p_slot, Control *p_control) { ERR_FAIL_NULL(p_control); - EditorNode::get_singleton()->add_control_to_dock(EditorNode::DockSlot(p_slot), p_control); + EditorDockManager::get_singleton()->add_control_to_dock(EditorDockManager::DockSlot(p_slot), p_control); } void EditorPlugin::remove_control_from_docks(Control *p_control) { ERR_FAIL_NULL(p_control); - EditorNode::get_singleton()->remove_control_from_dock(p_control); + EditorDockManager::get_singleton()->remove_control_from_dock(p_control); } void EditorPlugin::remove_control_from_bottom_panel(Control *p_control) { diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index 6c38d9de58..d22e60d7b4 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -36,7 +36,7 @@ #include "core/io/file_access.h" #include "core/os/main_loop.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/margin_container.h" #include "scene/gui/tree.h" diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 404f1151f1..f237649c5d 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -37,7 +37,6 @@ #include "editor/editor_properties_array_dict.h" #include "editor/editor_properties_vector.h" #include "editor/editor_resource_picker.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" @@ -48,6 +47,7 @@ #include "editor/project_settings_editor.h" #include "editor/property_selector.h" #include "editor/scene_tree_dock.h" +#include "editor/themes/editor_scale.h" #include "scene/2d/gpu_particles_2d.h" #include "scene/3d/fog_volume.h" #include "scene/3d/gpu_particles_3d.h" @@ -992,12 +992,12 @@ void EditorPropertyLayersGrid::_notification(int p_what) { const int bsize = (grid_size.height * 80 / 100) / 2; const int h = bsize * 2 + 1; - Color color = get_theme_color(read_only ? SNAME("disabled_highlight_color") : SNAME("highlight_color"), EditorStringName(Editor)); + Color color = get_theme_color(read_only ? SNAME("highlight_disabled_color") : SNAME("highlight_color"), EditorStringName(Editor)); - Color text_color = get_theme_color(read_only ? SNAME("disabled_font_color") : SNAME("font_color"), EditorStringName(Editor)); + Color text_color = get_theme_color(read_only ? SNAME("font_disabled_color") : SNAME("font_color"), EditorStringName(Editor)); text_color.a *= 0.5; - Color text_color_on = get_theme_color(read_only ? SNAME("disabled_font_color") : SNAME("font_hover_color"), EditorStringName(Editor)); + Color text_color_on = get_theme_color(read_only ? SNAME("font_disabled_color") : SNAME("font_hover_color"), EditorStringName(Editor)); text_color_on.a *= 0.7; const int vofs = (grid_size.height - h) / 2; @@ -2073,7 +2073,7 @@ void EditorPropertyQuaternion::_notification(int p_what) { euler[i]->add_theme_color_override("label_color", colors[i]); } edit_button->set_icon(get_editor_theme_icon(SNAME("Edit"))); - euler_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("property_color"), EditorStringName(Editor))); + euler_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("property_color"), SNAME("EditorProperty"))); warning->set_icon(get_editor_theme_icon(SNAME("NodeWarning"))); warning->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), EditorStringName(Editor))); } break; diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 7f9d80961b..f5b8d04444 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -34,11 +34,11 @@ #include "core/io/marshalls.h" #include "editor/editor_properties.h" #include "editor/editor_properties_vector.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_spin_slider.h" #include "editor/inspector_dock.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/resources/packed_scene.h" @@ -407,8 +407,8 @@ void EditorPropertyArray::update_property() { new_prop->connect(SNAME("object_id_selected"), callable_mp(this, &EditorPropertyArray::_object_id_selected)); new_prop->set_h_size_flags(SIZE_EXPAND_FILL); new_prop->set_read_only(is_read_only()); - callable_mp((Node *)slot.prop, &Node::add_sibling).call_deferred(new_prop, false); - callable_mp((Node *)slot.prop, &Node::queue_free).call_deferred(); + slot.prop->add_sibling(new_prop, false); + slot.prop->queue_free(); slot.prop = new_prop; slot.set_index(idx); } diff --git a/editor/editor_property_name_processor.cpp b/editor/editor_property_name_processor.cpp index b9144375bc..2c9c2f1ab2 100644 --- a/editor/editor_property_name_processor.cpp +++ b/editor/editor_property_name_processor.cpp @@ -224,6 +224,7 @@ EditorPropertyNameProcessor::EditorPropertyNameProcessor() { //capitalize_string_remaps["msec"] = "(msec)"; // Unit. capitalize_string_remaps["navmesh"] = "NavMesh"; capitalize_string_remaps["nfc"] = "NFC"; + capitalize_string_remaps["oidn"] = "OIDN"; capitalize_string_remaps["ok"] = "OK"; capitalize_string_remaps["opengl"] = "OpenGL"; capitalize_string_remaps["opentype"] = "OpenType"; diff --git a/editor/editor_quick_open.cpp b/editor/editor_quick_open.cpp index 965d0269d6..f39872ba2c 100644 --- a/editor/editor_quick_open.cpp +++ b/editor/editor_quick_open.cpp @@ -32,7 +32,7 @@ #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" Rect2i EditorQuickOpen::prev_rect = Rect2i(); bool EditorQuickOpen::was_showed = false; diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 011cb26621..27ce27591f 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -34,7 +34,6 @@ #include "editor/editor_node.h" #include "editor/editor_quick_open.h" #include "editor/editor_resource_preview.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/filesystem_dock.h" @@ -42,6 +41,7 @@ #include "editor/plugins/editor_resource_conversion_plugin.h" #include "editor/plugins/script_editor_plugin.h" #include "editor/scene_tree_dock.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/gui/texture_rect.h" #include "scene/resources/gradient_texture.h" @@ -487,38 +487,16 @@ void EditorResourcePicker::set_create_options(Object *p_menu_node) { HashSet<StringName> allowed_types; _get_allowed_types(false, &allowed_types); - Vector<EditorData::CustomType> custom_resources; - if (EditorNode::get_editor_data().get_custom_types().has("Resource")) { - custom_resources = EditorNode::get_editor_data().get_custom_types()["Resource"]; - } - for (const StringName &E : allowed_types) { const String &t = E; - bool is_custom_resource = false; - Ref<Texture2D> icon; - if (!custom_resources.is_empty()) { - for (int j = 0; j < custom_resources.size(); j++) { - if (custom_resources[j].name == t) { - is_custom_resource = true; - if (custom_resources[j].icon.is_valid()) { - icon = custom_resources[j].icon; - } - break; - } - } - } - - if (!is_custom_resource && !ClassDB::can_instantiate(t)) { + if (!ClassDB::can_instantiate(t)) { continue; } inheritors_array.push_back(t); - if (!icon.is_valid()) { - icon = get_editor_theme_icon(has_theme_icon(t, EditorStringName(EditorIcons)) ? t : String("Object")); - } - + Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(t, "Object"); int id = TYPE_BASE_ID + idx; edit_menu->add_icon_item(icon, vformat(TTR("New %s"), t), id); @@ -804,7 +782,12 @@ void EditorResourcePicker::_notification(int p_what) { [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { - assign_button->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor))); + const int icon_width = get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor)); + assign_button->add_theme_constant_override("icon_max_width", icon_width); + if (edit_menu) { + edit_menu->add_theme_constant_override("icon_max_width", icon_width); + } + edit_button->set_icon(get_theme_icon(SNAME("select_arrow"), SNAME("Tree"))); } break; @@ -940,6 +923,7 @@ void EditorResourcePicker::_ensure_resource_menu() { return; } edit_menu = memnew(PopupMenu); + edit_menu->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor))); add_child(edit_menu); edit_menu->connect("id_pressed", callable_mp(this, &EditorResourcePicker::_edit_menu_cbk)); edit_menu->connect("popup_hide", callable_mp((BaseButton *)edit_button, &BaseButton::set_pressed).bind(false)); diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index f21f0ac216..1702277ebc 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -37,10 +37,11 @@ #include "core/variant/variant_utility.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/image_texture.h" +#include "servers/rendering/rendering_server_default.h" bool EditorResourcePreviewGenerator::handles(const String &p_type) const { bool success = false; @@ -338,6 +339,20 @@ void EditorResourcePreview::_thread() { exited.set(); } +void EditorResourcePreview::_idle_callback() { + if (!singleton) { + // Just in case the shutdown of the editor involves the deletion of the singleton + // happening while additional idle callbacks can happen. + return; + } + + // Process preview tasks, trying to leave a little bit of responsiveness worst case. + uint64_t start = OS::get_singleton()->get_ticks_msec(); + while (!singleton->queue.is_empty() && OS::get_singleton()->get_ticks_msec() - start < 100) { + singleton->_iterate(); + } +} + void EditorResourcePreview::_update_thumbnail_sizes() { if (small_thumbnail_size == -1) { // Kind of a workaround to retrieve the default icon size. @@ -441,27 +456,36 @@ void EditorResourcePreview::check_for_invalidation(const String &p_path) { } void EditorResourcePreview::start() { - if (DisplayServer::get_singleton()->get_name() != "headless") { + if (DisplayServer::get_singleton()->get_name() == "headless") { + return; + } + + if (RSG::texture_storage->can_create_resources_async()) { ERR_FAIL_COND_MSG(thread.is_started(), "Thread already started."); thread.start(_thread_func, this); + } else { + SceneTree *st = Object::cast_to<SceneTree>(OS::get_singleton()->get_main_loop()); + ERR_FAIL_NULL_MSG(st, "Editor's MainLoop is not a SceneTree. This is a bug."); } } void EditorResourcePreview::stop() { - if (thread.is_started()) { - exiting.set(); - preview_sem.post(); + if (RSG::texture_storage->can_create_resources_async()) { + if (thread.is_started()) { + exiting.set(); + preview_sem.post(); - for (int i = 0; i < preview_generators.size(); i++) { - preview_generators.write[i]->abort(); - } + for (int i = 0; i < preview_generators.size(); i++) { + preview_generators.write[i]->abort(); + } - while (!exited.is_set()) { - OS::get_singleton()->delay_usec(10000); - RenderingServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on rendering server - } + while (!exited.is_set()) { + OS::get_singleton()->delay_usec(10000); + RenderingServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on rendering server + } - thread.wait_to_finish(); + thread.wait_to_finish(); + } } } diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h index 324245ba23..bc99372bc2 100644 --- a/editor/editor_resource_preview.h +++ b/editor/editor_resource_preview.h @@ -103,7 +103,8 @@ class EditorResourcePreview : public Node { int small_thumbnail_size = -1; static void _thread_func(void *ud); - void _thread(); + void _thread(); // For rendering drivers supporting async texture creation. + static void _idle_callback(); // For other rendering drivers (i.e., OpenGL). void _iterate(); void _write_preview_cache(Ref<FileAccess> p_file, int p_thumbnail_size, bool p_has_small_texture, uint64_t p_modified_time, String p_hash, const Dictionary &p_metadata); diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp index 6744e79931..fd6b083c12 100644 --- a/editor/editor_run_native.cpp +++ b/editor/editor_run_native.cpp @@ -31,10 +31,10 @@ #include "editor_run_native.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/export/editor_export.h" #include "editor/export/editor_export_platform.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/image_texture.h" void EditorRunNative::_notification(int p_what) { diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index 7bf88ba94f..8d1f97f6b1 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -31,9 +31,9 @@ #include "editor_sectioned_inspector.h" #include "editor/editor_property_name_processor.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" static bool _property_path_matches(const String &p_property_path, const String &p_filter, EditorPropertyNameProcessor::Style p_style) { if (p_property_path.findn(p_filter) != -1) { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index e6ba39cae7..b565431185 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -460,6 +460,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // Theme EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "interface/theme/preset", "Default", "Default,Breeze Dark,Godot 2,Gray,Light,Solarized (Dark),Solarized (Light),Black (OLED),Custom") + EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "interface/theme/spacing_preset", "Default", "Compact,Default,Spacious,Custom") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/theme/icon_and_font_color", 0, "Auto,Dark,Light") EDITOR_SETTING(Variant::COLOR, PROPERTY_HINT_NONE, "interface/theme/base_color", Color(0.2, 0.23, 0.31), "") EDITOR_SETTING(Variant::COLOR, PROPERTY_HINT_NONE, "interface/theme/accent_color", Color(0.41, 0.61, 0.91), "") @@ -469,7 +470,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/theme/relationship_line_opacity", 0.1, "0.00,1,0.01") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/theme/border_size", 0, "0,2,1") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/theme/corner_radius", 3, "0,6,1") - EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/theme/additional_spacing", 0.0, "0,5,0.1") + EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/theme/base_spacing", 4, "0,8,1") + EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/theme/additional_spacing", 0, "0,8,1") EDITOR_SETTING_USAGE(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "interface/theme/custom_theme", "", "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) // Touchscreen diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index 33a176499d..becc376cd4 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -38,12 +38,12 @@ #include "editor/editor_log.h" #include "editor/editor_node.h" #include "editor/editor_property_name_processor.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/event_listener_line_edit.h" #include "editor/input_event_configuration_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/margin_container.h" void EditorSettingsDialog::ok_pressed() { @@ -62,8 +62,12 @@ void EditorSettingsDialog::_settings_changed() { void EditorSettingsDialog::_settings_property_edited(const String &p_name) { String full_name = inspector->get_full_item_path(p_name); + // Set theme presets to Custom when controlled settings change. + if (full_name == "interface/theme/accent_color" || full_name == "interface/theme/base_color" || full_name == "interface/theme/contrast" || full_name == "interface/theme/draw_extra_borders") { - EditorSettings::get_singleton()->set_manually("interface/theme/preset", "Custom"); // set preset to Custom + EditorSettings::get_singleton()->set_manually("interface/theme/preset", "Custom"); + } else if (full_name == "interface/theme/base_spacing" || full_name == "interface/theme/additional_spacing") { + EditorSettings::get_singleton()->set_manually("interface/theme/spacing_preset", "Custom"); } else if (full_name.begins_with("text_editor/theme/highlighting")) { EditorSettings::get_singleton()->set_manually("text_editor/theme/color_theme", "Custom"); } diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp deleted file mode 100644 index da5eecfb73..0000000000 --- a/editor/editor_themes.cpp +++ /dev/null @@ -1,2402 +0,0 @@ -/**************************************************************************/ -/* editor_themes.cpp */ -/**************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/**************************************************************************/ -/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/**************************************************************************/ - -#include "editor_themes.h" - -#include "core/error/error_macros.h" -#include "core/io/resource_loader.h" -#include "editor/editor_fonts.h" -#include "editor/editor_icons.gen.h" -#include "editor/editor_scale.h" -#include "editor/editor_settings.h" -#include "editor/editor_string_names.h" -#include "scene/resources/image_texture.h" -#include "scene/resources/style_box_flat.h" -#include "scene/resources/style_box_line.h" -#include "scene/resources/style_box_texture.h" -#include "scene/theme/theme_db.h" - -#include "modules/modules_enabled.gen.h" // For svg. -#ifdef MODULE_SVG_ENABLED -#include "modules/svg/image_loader_svg.h" -#endif - -HashMap<Color, Color> EditorColorMap::color_conversion_map; -HashSet<StringName> EditorColorMap::color_conversion_exceptions; - -void EditorColorMap::add_conversion_color_pair(const String p_from_color, const String p_to_color) { - color_conversion_map[Color::html(p_from_color)] = Color::html(p_to_color); -} - -void EditorColorMap::add_conversion_exception(const StringName &p_icon_name) { - color_conversion_exceptions.insert(p_icon_name); -} - -void EditorColorMap::create() { - // Some of the colors below are listed for completeness sake. - // This can be a basis for proper palette validation later. - - // Convert: FROM TO - add_conversion_color_pair("#478cbf", "#478cbf"); // Godot Blue - add_conversion_color_pair("#414042", "#414042"); // Godot Gray - - add_conversion_color_pair("#ffffff", "#414141"); // Pure white - add_conversion_color_pair("#fefefe", "#fefefe"); // Forced light color - add_conversion_color_pair("#000000", "#bfbfbf"); // Pure black - add_conversion_color_pair("#010101", "#010101"); // Forced dark color - - // Keep pure RGB colors as is, but list them for explicitness. - add_conversion_color_pair("#ff0000", "#ff0000"); // Pure red - add_conversion_color_pair("#00ff00", "#00ff00"); // Pure green - add_conversion_color_pair("#0000ff", "#0000ff"); // Pure blue - - // GUI Colors - add_conversion_color_pair("#e0e0e0", "#5a5a5a"); // Common icon color - add_conversion_color_pair("#808080", "#808080"); // GUI disabled color - add_conversion_color_pair("#b3b3b3", "#363636"); // GUI disabled light color - add_conversion_color_pair("#699ce8", "#699ce8"); // GUI highlight color - add_conversion_color_pair("#f9f9f9", "#606060"); // Scrollbar grabber highlight color - - add_conversion_color_pair("#c38ef1", "#a85de9"); // Animation - add_conversion_color_pair("#8da5f3", "#3d64dd"); // 2D - add_conversion_color_pair("#7582a8", "#6d83c8"); // 2D Abstract - add_conversion_color_pair("#fc7f7f", "#cd3838"); // 3D - add_conversion_color_pair("#b56d6d", "#be6a6a"); // 3D Abstract - add_conversion_color_pair("#8eef97", "#2fa139"); // GUI Control - add_conversion_color_pair("#76ad7b", "#64a66a"); // GUI Control Abstract - - add_conversion_color_pair("#5fb2ff", "#0079f0"); // Selection (blue) - add_conversion_color_pair("#003e7a", "#2b74bb"); // Selection (darker blue) - add_conversion_color_pair("#f7f5cf", "#615f3a"); // Gizmo (yellow) - - // Rainbow - add_conversion_color_pair("#ff4545", "#ff2929"); // Red - add_conversion_color_pair("#ffe345", "#ffe337"); // Yellow - add_conversion_color_pair("#80ff45", "#74ff34"); // Green - add_conversion_color_pair("#45ffa2", "#2cff98"); // Aqua - add_conversion_color_pair("#45d7ff", "#22ccff"); // Blue - add_conversion_color_pair("#8045ff", "#702aff"); // Purple - add_conversion_color_pair("#ff4596", "#ff2781"); // Pink - - // Audio gradients - add_conversion_color_pair("#e1da5b", "#d6cf4b"); // Yellow - - add_conversion_color_pair("#62aeff", "#1678e0"); // Frozen gradient top - add_conversion_color_pair("#75d1e6", "#41acc5"); // Frozen gradient middle - add_conversion_color_pair("#84ffee", "#49ccba"); // Frozen gradient bottom - - add_conversion_color_pair("#f70000", "#c91616"); // Color track red - add_conversion_color_pair("#eec315", "#d58c0b"); // Color track orange - add_conversion_color_pair("#dbee15", "#b7d10a"); // Color track yellow - add_conversion_color_pair("#288027", "#218309"); // Color track green - - // Other objects - add_conversion_color_pair("#ffca5f", "#fea900"); // Mesh resource (orange) - add_conversion_color_pair("#2998ff", "#68b6ff"); // Shape resource (blue) - add_conversion_color_pair("#a2d2ff", "#4998e3"); // Shape resource (light blue) - add_conversion_color_pair("#69c4d4", "#29a3cc"); // Input event highlight (light blue) - - // Animation editor tracks - // The property track icon color is set by the common icon color. - add_conversion_color_pair("#ea7940", "#bd5e2c"); // 3D Position track - add_conversion_color_pair("#ff2b88", "#bd165f"); // 3D Rotation track - add_conversion_color_pair("#eac840", "#bd9d1f"); // 3D Scale track - add_conversion_color_pair("#3cf34e", "#16a827"); // Call Method track - add_conversion_color_pair("#2877f6", "#236be6"); // Bezier Curve track - add_conversion_color_pair("#eae440", "#9f9722"); // Audio Playback track - add_conversion_color_pair("#a448f0", "#9853ce"); // Animation Playback track - add_conversion_color_pair("#5ad5c4", "#0a9c88"); // Blend Shape track - - // Control layouts - add_conversion_color_pair("#d6d6d6", "#474747"); // Highlighted part - add_conversion_color_pair("#474747", "#d6d6d6"); // Background part - add_conversion_color_pair("#919191", "#6e6e6e"); // Border part - - // TileSet editor icons - add_conversion_color_pair("#fce00e", "#aa8d24"); // New Single Tile - add_conversion_color_pair("#0e71fc", "#0350bd"); // New Autotile - add_conversion_color_pair("#c6ced4", "#828f9b"); // New Atlas - - // Variant types - add_conversion_color_pair("#41ecad", "#25e3a0"); // Variant - add_conversion_color_pair("#6f91f0", "#6d8eeb"); // bool - add_conversion_color_pair("#5abbef", "#4fb2e9"); // int/uint - add_conversion_color_pair("#35d4f4", "#27ccf0"); // float - add_conversion_color_pair("#4593ec", "#4690e7"); // String - add_conversion_color_pair("#ee5677", "#ee7991"); // AABB - add_conversion_color_pair("#e0e0e0", "#5a5a5a"); // Array - add_conversion_color_pair("#e1ec41", "#b2bb19"); // Basis - add_conversion_color_pair("#54ed9e", "#57e99f"); // Dictionary - add_conversion_color_pair("#417aec", "#6993ec"); // NodePath - add_conversion_color_pair("#55f3e3", "#12d5c3"); // Object - add_conversion_color_pair("#f74949", "#f77070"); // Plane - add_conversion_color_pair("#44bd44", "#46b946"); // Projection - add_conversion_color_pair("#ec418e", "#ec69a3"); // Quaternion - add_conversion_color_pair("#f1738f", "#ee758e"); // Rect2 - add_conversion_color_pair("#41ec80", "#2ce573"); // RID - add_conversion_color_pair("#b9ec41", "#96ce1a"); // Transform2D - add_conversion_color_pair("#f68f45", "#f49047"); // Transform3D - add_conversion_color_pair("#ac73f1", "#ad76ee"); // Vector2 - add_conversion_color_pair("#de66f0", "#dc6aed"); // Vector3 - add_conversion_color_pair("#f066bd", "#ed6abd"); // Vector4 - - // Visual shaders - add_conversion_color_pair("#77ce57", "#67c046"); // Vector funcs - add_conversion_color_pair("#ea686c", "#d95256"); // Vector transforms - add_conversion_color_pair("#eac968", "#d9b64f"); // Textures and cubemaps - add_conversion_color_pair("#cf68ea", "#c050dd"); // Functions and expressions - - // These icons should not be converted. - add_conversion_exception("EditorPivot"); - add_conversion_exception("EditorHandle"); - add_conversion_exception("Editor3DHandle"); - add_conversion_exception("EditorBoneHandle"); - add_conversion_exception("Godot"); - add_conversion_exception("Sky"); - add_conversion_exception("EditorControlAnchor"); - add_conversion_exception("DefaultProjectIcon"); - add_conversion_exception("ZoomMore"); - add_conversion_exception("ZoomLess"); - add_conversion_exception("ZoomReset"); - add_conversion_exception("LockViewport"); - add_conversion_exception("GroupViewport"); - add_conversion_exception("StatusError"); - add_conversion_exception("StatusSuccess"); - add_conversion_exception("StatusWarning"); - add_conversion_exception("OverbrightIndicator"); - add_conversion_exception("MaterialPreviewCube"); - add_conversion_exception("MaterialPreviewSphere"); - add_conversion_exception("MaterialPreviewLight1"); - add_conversion_exception("MaterialPreviewLight2"); - - // GUI - add_conversion_exception("GuiChecked"); - add_conversion_exception("GuiRadioChecked"); - add_conversion_exception("GuiIndeterminate"); - add_conversion_exception("GuiCloseCustomizable"); - add_conversion_exception("GuiGraphNodePort"); - add_conversion_exception("GuiResizer"); - add_conversion_exception("GuiMiniCheckerboard"); - - /// Code Editor. - add_conversion_exception("GuiTab"); - add_conversion_exception("GuiSpace"); - add_conversion_exception("CodeFoldedRightArrow"); - add_conversion_exception("CodeFoldDownArrow"); - add_conversion_exception("CodeRegionFoldedRightArrow"); - add_conversion_exception("CodeRegionFoldDownArrow"); - add_conversion_exception("TextEditorPlay"); - add_conversion_exception("Breakpoint"); -} - -void EditorColorMap::finish() { - color_conversion_map.clear(); - color_conversion_exceptions.clear(); -} - -Vector<StringName> EditorTheme::editor_theme_types; - -// TODO: Refactor these and corresponding Theme methods to use the bool get_xxx(r_value) pattern internally. - -// Keep in sync with Theme::get_color. -Color EditorTheme::get_color(const StringName &p_name, const StringName &p_theme_type) const { - if (color_map.has(p_theme_type) && color_map[p_theme_type].has(p_name)) { - return color_map[p_theme_type][p_name]; - } else { - if (editor_theme_types.has(p_theme_type)) { - WARN_PRINT(vformat("Trying to access a non-existing editor theme color '%s' in '%s'.", p_name, p_theme_type)); - } - return Color(); - } -} - -// Keep in sync with Theme::get_constant. -int EditorTheme::get_constant(const StringName &p_name, const StringName &p_theme_type) const { - if (constant_map.has(p_theme_type) && constant_map[p_theme_type].has(p_name)) { - return constant_map[p_theme_type][p_name]; - } else { - if (editor_theme_types.has(p_theme_type)) { - WARN_PRINT(vformat("Trying to access a non-existing editor theme constant '%s' in '%s'.", p_name, p_theme_type)); - } - return 0; - } -} - -// Keep in sync with Theme::get_font. -Ref<Font> EditorTheme::get_font(const StringName &p_name, const StringName &p_theme_type) const { - if (font_map.has(p_theme_type) && font_map[p_theme_type].has(p_name) && font_map[p_theme_type][p_name].is_valid()) { - return font_map[p_theme_type][p_name]; - } else if (has_default_font()) { - if (editor_theme_types.has(p_theme_type)) { - WARN_PRINT(vformat("Trying to access a non-existing editor theme font '%s' in '%s'.", p_name, p_theme_type)); - } - return default_font; - } else { - if (editor_theme_types.has(p_theme_type)) { - WARN_PRINT(vformat("Trying to access a non-existing editor theme font '%s' in '%s'.", p_name, p_theme_type)); - } - return ThemeDB::get_singleton()->get_fallback_font(); - } -} - -// Keep in sync with Theme::get_font_size. -int EditorTheme::get_font_size(const StringName &p_name, const StringName &p_theme_type) const { - if (font_size_map.has(p_theme_type) && font_size_map[p_theme_type].has(p_name) && (font_size_map[p_theme_type][p_name] > 0)) { - return font_size_map[p_theme_type][p_name]; - } else if (has_default_font_size()) { - if (editor_theme_types.has(p_theme_type)) { - WARN_PRINT(vformat("Trying to access a non-existing editor theme font size '%s' in '%s'.", p_name, p_theme_type)); - } - return default_font_size; - } else { - if (editor_theme_types.has(p_theme_type)) { - WARN_PRINT(vformat("Trying to access a non-existing editor theme font size '%s' in '%s'.", p_name, p_theme_type)); - } - return ThemeDB::get_singleton()->get_fallback_font_size(); - } -} - -// Keep in sync with Theme::get_icon. -Ref<Texture2D> EditorTheme::get_icon(const StringName &p_name, const StringName &p_theme_type) const { - if (icon_map.has(p_theme_type) && icon_map[p_theme_type].has(p_name) && icon_map[p_theme_type][p_name].is_valid()) { - return icon_map[p_theme_type][p_name]; - } else { - if (editor_theme_types.has(p_theme_type)) { - WARN_PRINT(vformat("Trying to access a non-existing editor theme icon '%s' in '%s'.", p_name, p_theme_type)); - } - return ThemeDB::get_singleton()->get_fallback_icon(); - } -} - -// Keep in sync with Theme::get_stylebox. -Ref<StyleBox> EditorTheme::get_stylebox(const StringName &p_name, const StringName &p_theme_type) const { - if (style_map.has(p_theme_type) && style_map[p_theme_type].has(p_name) && style_map[p_theme_type][p_name].is_valid()) { - return style_map[p_theme_type][p_name]; - } else { - if (editor_theme_types.has(p_theme_type)) { - WARN_PRINT(vformat("Trying to access a non-existing editor theme stylebox '%s' in '%s'.", p_name, p_theme_type)); - } - return ThemeDB::get_singleton()->get_fallback_stylebox(); - } -} - -void EditorTheme::initialize() { - editor_theme_types.append(EditorStringName(Editor)); - editor_theme_types.append(EditorStringName(EditorFonts)); - editor_theme_types.append(EditorStringName(EditorIcons)); - editor_theme_types.append(EditorStringName(EditorStyles)); -} - -void EditorTheme::finalize() { - editor_theme_types.clear(); -} - -// Editor theme generatior. - -static Ref<StyleBoxTexture> make_stylebox(Ref<Texture2D> p_texture, float p_left, float p_top, float p_right, float p_bottom, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_bottom = -1, bool p_draw_center = true) { - Ref<StyleBoxTexture> style(memnew(StyleBoxTexture)); - style->set_texture(p_texture); - style->set_texture_margin_individual(p_left * EDSCALE, p_top * EDSCALE, p_right * EDSCALE, p_bottom * EDSCALE); - style->set_content_margin_individual((p_left + p_margin_left) * EDSCALE, (p_top + p_margin_top) * EDSCALE, (p_right + p_margin_right) * EDSCALE, (p_bottom + p_margin_bottom) * EDSCALE); - style->set_draw_center(p_draw_center); - return style; -} - -static Ref<StyleBoxEmpty> make_empty_stylebox(float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_bottom = -1) { - Ref<StyleBoxEmpty> style(memnew(StyleBoxEmpty)); - style->set_content_margin_individual(p_margin_left * EDSCALE, p_margin_top * EDSCALE, p_margin_right * EDSCALE, p_margin_bottom * EDSCALE); - return style; -} - -static Ref<StyleBoxFlat> make_flat_stylebox(Color p_color, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_bottom = -1, int p_corner_width = 0) { - Ref<StyleBoxFlat> style(memnew(StyleBoxFlat)); - style->set_bg_color(p_color); - // Adjust level of detail based on the corners' effective sizes. - style->set_corner_detail(Math::ceil(0.8 * p_corner_width * EDSCALE)); - style->set_corner_radius_all(p_corner_width * EDSCALE); - style->set_content_margin_individual(p_margin_left * EDSCALE, p_margin_top * EDSCALE, p_margin_right * EDSCALE, p_margin_bottom * EDSCALE); - // Work around issue about antialiased edges being blurrier (GH-35279). - style->set_anti_aliased(false); - return style; -} - -static Ref<StyleBoxLine> make_line_stylebox(Color p_color, int p_thickness = 1, float p_grow_begin = 1, float p_grow_end = 1, bool p_vertical = false) { - Ref<StyleBoxLine> style(memnew(StyleBoxLine)); - style->set_color(p_color); - style->set_grow_begin(p_grow_begin); - style->set_grow_end(p_grow_end); - style->set_thickness(p_thickness); - style->set_vertical(p_vertical); - return style; -} - -// See also `generate_icon()` in `scene/theme/default_theme.cpp`. -static Ref<ImageTexture> editor_generate_icon(int p_index, float p_scale, float p_saturation, const HashMap<Color, Color> &p_convert_colors = HashMap<Color, Color>()) { - Ref<Image> img = memnew(Image); - -#ifdef MODULE_SVG_ENABLED - // Upsample icon generation only if the editor scale isn't an integer multiplier. - // Generating upsampled icons is slower, and the benefit is hardly visible - // with integer editor scales. - const bool upsample = !Math::is_equal_approx(Math::round(p_scale), p_scale); - Error err = ImageLoaderSVG::create_image_from_string(img, editor_icons_sources[p_index], p_scale, upsample, p_convert_colors); - ERR_FAIL_COND_V_MSG(err != OK, Ref<ImageTexture>(), "Failed generating icon, unsupported or invalid SVG data in editor theme."); - if (p_saturation != 1.0) { - img->adjust_bcs(1.0, 1.0, p_saturation); - } -#else - // If the SVG module is disabled, we can't really display the UI well, but at least we won't crash. - // 16 pixels is used as it's the most common base size for Godot icons. - img = Image::create_empty(16 * p_scale, 16 * p_scale, false, Image::FORMAT_RGBA8); -#endif - - return ImageTexture::create_from_image(img); -} - -float get_gizmo_handle_scale(const String &gizmo_handle_name = "") { - const float scale_gizmo_handles_for_touch = EDITOR_GET("interface/touchscreen/scale_gizmo_handles"); - if (scale_gizmo_handles_for_touch > 1.0f) { - // The names of the icons that require additional scaling. - static HashSet<StringName> gizmo_to_scale; - if (gizmo_to_scale.is_empty()) { - gizmo_to_scale.insert("EditorHandle"); - gizmo_to_scale.insert("EditorHandleAdd"); - gizmo_to_scale.insert("EditorHandleDisabled"); - gizmo_to_scale.insert("EditorCurveHandle"); - gizmo_to_scale.insert("EditorPathSharpHandle"); - gizmo_to_scale.insert("EditorPathSmoothHandle"); - } - - if (gizmo_to_scale.has(gizmo_handle_name)) { - return EDSCALE * scale_gizmo_handles_for_touch; - } - } - - return EDSCALE; -} - -void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme, float p_icon_saturation, int p_thumb_size, bool p_only_thumbs = false) { - const String benchmark_key = vformat("Generate Icons (%s)", (p_only_thumbs ? "Only Thumbs" : "All")); - OS::get_singleton()->benchmark_begin_measure("EditorTheme", benchmark_key); - - // Before we register the icons, we adjust their colors and saturation. - // Most icons follow the standard rules for color conversion to follow the editor - // theme's polarity (dark/light). We also adjust the saturation for most icons, - // following the editor setting. - // Some icons are excluded from this conversion, and instead use the configured - // accent color to replace their innate accent color to match the editor theme. - // And then some icons are completely excluded from the conversion. - - // Standard color conversion map. - HashMap<Color, Color> color_conversion_map; - // Icons by default are set up for the dark theme, so if the theme is light, - // we apply the dark-to-light color conversion map. - if (!p_dark_theme) { - for (KeyValue<Color, Color> &E : EditorColorMap::get_color_conversion_map()) { - color_conversion_map[E.key] = E.value; - } - } - // These colors should be converted even if we are using a dark theme. - const Color error_color = p_theme->get_color(SNAME("error_color"), EditorStringName(Editor)); - const Color success_color = p_theme->get_color(SNAME("success_color"), EditorStringName(Editor)); - const Color warning_color = p_theme->get_color(SNAME("warning_color"), EditorStringName(Editor)); - color_conversion_map[Color::html("#ff5f5f")] = error_color; - color_conversion_map[Color::html("#5fff97")] = success_color; - color_conversion_map[Color::html("#ffdd65")] = warning_color; - - // The names of the icons to exclude from the standard color conversion. - HashSet<StringName> conversion_exceptions = EditorColorMap::get_color_conversion_exceptions(); - - // The names of the icons to exclude when adjusting for saturation. - HashSet<StringName> saturation_exceptions; - saturation_exceptions.insert("DefaultProjectIcon"); - saturation_exceptions.insert("Godot"); - saturation_exceptions.insert("Logo"); - - // Accent color conversion map. - // It is used on some icons (checkbox, radio, toggle, etc.), regardless of the dark - // or light mode. - HashMap<Color, Color> accent_color_map; - HashSet<StringName> accent_color_icons; - - const Color accent_color = p_theme->get_color(SNAME("accent_color"), EditorStringName(Editor)); - accent_color_map[Color::html("699ce8")] = accent_color; - if (accent_color.get_luminance() > 0.75) { - accent_color_map[Color::html("ffffff")] = Color(0.2, 0.2, 0.2); - } - - accent_color_icons.insert("GuiChecked"); - accent_color_icons.insert("GuiRadioChecked"); - accent_color_icons.insert("GuiIndeterminate"); - accent_color_icons.insert("GuiToggleOn"); - accent_color_icons.insert("GuiToggleOnMirrored"); - accent_color_icons.insert("PlayOverlay"); - - // Generate icons. - if (!p_only_thumbs) { - for (int i = 0; i < editor_icons_count; i++) { - Ref<ImageTexture> icon; - - const String &editor_icon_name = editor_icons_names[i]; - if (accent_color_icons.has(editor_icon_name)) { - icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name), 1.0, accent_color_map); - } else { - float saturation = p_icon_saturation; - if (saturation_exceptions.has(editor_icon_name)) { - saturation = 1.0; - } - - if (conversion_exceptions.has(editor_icon_name)) { - icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name), saturation); - } else { - icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name), saturation, color_conversion_map); - } - } - - p_theme->set_icon(editor_icon_name, EditorStringName(EditorIcons), icon); - } - } - - // Generate thumbnail icons with the given thumbnail size. - // See editor\icons\editor_icons_builders.py for the code that determines which icons are thumbnails. - if (p_thumb_size >= 64) { - const float scale = (float)p_thumb_size / 64.0 * EDSCALE; - for (int i = 0; i < editor_bg_thumbs_count; i++) { - const int index = editor_bg_thumbs_indices[i]; - Ref<ImageTexture> icon; - - if (accent_color_icons.has(editor_icons_names[index])) { - icon = editor_generate_icon(index, scale, 1.0, accent_color_map); - } else { - float saturation = p_icon_saturation; - if (saturation_exceptions.has(editor_icons_names[index])) { - saturation = 1.0; - } - - if (conversion_exceptions.has(editor_icons_names[index])) { - icon = editor_generate_icon(index, scale, saturation); - } else { - icon = editor_generate_icon(index, scale, saturation, color_conversion_map); - } - } - - p_theme->set_icon(editor_icons_names[index], EditorStringName(EditorIcons), icon); - } - } else { - const float scale = (float)p_thumb_size / 32.0 * EDSCALE; - for (int i = 0; i < editor_md_thumbs_count; i++) { - const int index = editor_md_thumbs_indices[i]; - Ref<ImageTexture> icon; - - if (accent_color_icons.has(editor_icons_names[index])) { - icon = editor_generate_icon(index, scale, 1.0, accent_color_map); - } else { - float saturation = p_icon_saturation; - if (saturation_exceptions.has(editor_icons_names[index])) { - saturation = 1.0; - } - - if (conversion_exceptions.has(editor_icons_names[index])) { - icon = editor_generate_icon(index, scale, saturation); - } else { - icon = editor_generate_icon(index, scale, saturation, color_conversion_map); - } - } - - p_theme->set_icon(editor_icons_names[index], EditorStringName(EditorIcons), icon); - } - } - OS::get_singleton()->benchmark_end_measure("EditorTheme", benchmark_key); -} - -Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { - OS::get_singleton()->benchmark_begin_measure("EditorTheme", "Create Editor Theme"); - Ref<EditorTheme> theme = memnew(EditorTheme); - - // Controls may rely on the scale for their internal drawing logic. - theme->set_default_base_scale(EDSCALE); - - // Theme settings - Color accent_color = EDITOR_GET("interface/theme/accent_color"); - Color base_color = EDITOR_GET("interface/theme/base_color"); - float contrast = EDITOR_GET("interface/theme/contrast"); - bool increase_scrollbar_touch_area = EDITOR_GET("interface/touchscreen/increase_scrollbar_touch_area"); - const float gizmo_handle_scale = EDITOR_GET("interface/touchscreen/scale_gizmo_handles"); - bool draw_extra_borders = EDITOR_GET("interface/theme/draw_extra_borders"); - float icon_saturation = EDITOR_GET("interface/theme/icon_saturation"); - float relationship_line_opacity = EDITOR_GET("interface/theme/relationship_line_opacity"); - - String preset = EDITOR_GET("interface/theme/preset"); - - int border_size = EDITOR_GET("interface/theme/border_size"); - int corner_radius = EDITOR_GET("interface/theme/corner_radius"); - - Color preset_accent_color; - Color preset_base_color; - float preset_contrast = 0; - bool preset_draw_extra_borders = false; - - const float default_contrast = 0.3; - - // Please use alphabetical order if you're adding a new theme here - // (after "Custom") - - if (preset == "Custom") { - accent_color = EDITOR_GET("interface/theme/accent_color"); - base_color = EDITOR_GET("interface/theme/base_color"); - contrast = EDITOR_GET("interface/theme/contrast"); - } else if (preset == "Breeze Dark") { - preset_accent_color = Color(0.26, 0.76, 1.00); - preset_base_color = Color(0.24, 0.26, 0.28); - preset_contrast = default_contrast; - } else if (preset == "Godot 2") { - preset_accent_color = Color(0.53, 0.67, 0.89); - preset_base_color = Color(0.24, 0.23, 0.27); - preset_contrast = default_contrast; - } else if (preset == "Gray") { - preset_accent_color = Color(0.44, 0.73, 0.98); - preset_base_color = Color(0.24, 0.24, 0.24); - preset_contrast = default_contrast; - } else if (preset == "Light") { - preset_accent_color = Color(0.18, 0.50, 1.00); - preset_base_color = Color(0.9, 0.9, 0.9); - // A negative contrast rate looks better for light themes, since it better follows the natural order of UI "elevation". - preset_contrast = -0.06; - } else if (preset == "Solarized (Dark)") { - preset_accent_color = Color(0.15, 0.55, 0.82); - preset_base_color = Color(0.04, 0.23, 0.27); - preset_contrast = default_contrast; - } else if (preset == "Solarized (Light)") { - preset_accent_color = Color(0.15, 0.55, 0.82); - preset_base_color = Color(0.89, 0.86, 0.79); - // A negative contrast rate looks better for light themes, since it better follows the natural order of UI "elevation". - preset_contrast = -0.06; - } else if (preset == "Black (OLED)") { - preset_accent_color = Color(0.45, 0.75, 1.0); - preset_base_color = Color(0, 0, 0); - // The contrast rate value is irrelevant on a fully black theme. - preset_contrast = 0.0; - preset_draw_extra_borders = true; - } else { // Default - preset_accent_color = Color(0.44, 0.73, 0.98); - preset_base_color = Color(0.21, 0.24, 0.29); - preset_contrast = default_contrast; - } - - if (preset != "Custom") { - accent_color = preset_accent_color; - base_color = preset_base_color; - contrast = preset_contrast; - draw_extra_borders = preset_draw_extra_borders; - EditorSettings::get_singleton()->set_initial_value("interface/theme/accent_color", accent_color); - EditorSettings::get_singleton()->set_initial_value("interface/theme/base_color", base_color); - EditorSettings::get_singleton()->set_initial_value("interface/theme/contrast", contrast); - EditorSettings::get_singleton()->set_initial_value("interface/theme/draw_extra_borders", draw_extra_borders); - } - - EditorSettings::get_singleton()->set_manually("interface/theme/preset", preset); - EditorSettings::get_singleton()->set_manually("interface/theme/accent_color", accent_color); - EditorSettings::get_singleton()->set_manually("interface/theme/base_color", base_color); - EditorSettings::get_singleton()->set_manually("interface/theme/contrast", contrast); - EditorSettings::get_singleton()->set_manually("interface/theme/draw_extra_borders", draw_extra_borders); - - // Colors - bool dark_theme = EditorSettings::get_singleton()->is_dark_theme(); - -#ifdef MODULE_SVG_ENABLED - if (dark_theme) { - ImageLoaderSVG::set_forced_color_map(HashMap<Color, Color>()); - } else { - ImageLoaderSVG::set_forced_color_map(EditorColorMap::get_color_conversion_map()); - } -#endif - - // Ensure base colors are in the 0..1 luminance range to avoid 8-bit integer overflow or text rendering issues. - // Some places in the editor use 8-bit integer colors. - const Color dark_color_1 = base_color.lerp(Color(0, 0, 0, 1), contrast).clamp(); - const Color dark_color_2 = base_color.lerp(Color(0, 0, 0, 1), contrast * 1.5).clamp(); - const Color dark_color_3 = base_color.lerp(Color(0, 0, 0, 1), contrast * 2).clamp(); - - // Only used when the Draw Extra Borders editor setting is enabled. - const Color extra_border_color_1 = Color(0.5, 0.5, 0.5); - const Color extra_border_color_2 = dark_theme ? Color(0.3, 0.3, 0.3) : Color(0.7, 0.7, 0.7); - - const Color background_color = dark_color_2; - - // White (dark theme) or black (light theme), will be used to generate the rest of the colors - const Color mono_color = dark_theme ? Color(1, 1, 1) : Color(0, 0, 0); - - const Color contrast_color_1 = base_color.lerp(mono_color, MAX(contrast, default_contrast)); - const Color contrast_color_2 = base_color.lerp(mono_color, MAX(contrast * 1.5, default_contrast * 1.5)); - - const Color font_color = mono_color.lerp(base_color, 0.25); - const Color font_hover_color = mono_color.lerp(base_color, 0.125); - const Color font_focus_color = mono_color.lerp(base_color, 0.125); - const Color font_hover_pressed_color = font_hover_color.lerp(accent_color, 0.74); - const Color font_disabled_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.35); - const Color font_readonly_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.65); - const Color font_placeholder_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.6); - const Color font_outline_color = Color(0, 0, 0, 0); - const Color selection_color = accent_color * Color(1, 1, 1, 0.4); - const Color disabled_color = mono_color.inverted().lerp(base_color, 0.7); - const Color disabled_bg_color = mono_color.inverted().lerp(base_color, 0.9); - - const Color icon_normal_color = Color(1, 1, 1); - Color icon_hover_color = icon_normal_color * (dark_theme ? 1.15 : 1.45); - icon_hover_color.a = 1.0; - Color icon_focus_color = icon_hover_color; - Color icon_disabled_color = Color(icon_normal_color, 0.4); - // Make the pressed icon color overbright because icons are not completely white on a dark theme. - // On a light theme, icons are dark, so we need to modulate them with an even brighter color. - Color icon_pressed_color = accent_color * (dark_theme ? 1.15 : 3.5); - icon_pressed_color.a = 1.0; - - const Color separator_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.1); - const Color highlight_color = Color(accent_color.r, accent_color.g, accent_color.b, 0.275); - const Color disabled_highlight_color = highlight_color.lerp(dark_theme ? Color(0, 0, 0) : Color(1, 1, 1), 0.5); - - // Can't save single float in theme, so using Color. - theme->set_color("icon_saturation", EditorStringName(Editor), Color(icon_saturation, icon_saturation, icon_saturation)); - theme->set_color("accent_color", EditorStringName(Editor), accent_color); - theme->set_color("highlight_color", EditorStringName(Editor), highlight_color); - theme->set_color("disabled_highlight_color", EditorStringName(Editor), disabled_highlight_color); - theme->set_color("base_color", EditorStringName(Editor), base_color); - theme->set_color("dark_color_1", EditorStringName(Editor), dark_color_1); - theme->set_color("dark_color_2", EditorStringName(Editor), dark_color_2); - theme->set_color("dark_color_3", EditorStringName(Editor), dark_color_3); - theme->set_color("contrast_color_1", EditorStringName(Editor), contrast_color_1); - theme->set_color("contrast_color_2", EditorStringName(Editor), contrast_color_2); - theme->set_color("box_selection_fill_color", EditorStringName(Editor), accent_color * Color(1, 1, 1, 0.3)); - theme->set_color("box_selection_stroke_color", EditorStringName(Editor), accent_color * Color(1, 1, 1, 0.8)); - - theme->set_color("axis_x_color", EditorStringName(Editor), Color(0.96, 0.20, 0.32)); - theme->set_color("axis_y_color", EditorStringName(Editor), Color(0.53, 0.84, 0.01)); - theme->set_color("axis_z_color", EditorStringName(Editor), Color(0.16, 0.55, 0.96)); - theme->set_color("axis_w_color", EditorStringName(Editor), Color(0.55, 0.55, 0.55)); - - const float prop_color_saturation = accent_color.get_s() * 0.75; - const float prop_color_value = accent_color.get_v(); - - theme->set_color("property_color_x", EditorStringName(Editor), Color().from_hsv(0.0 / 3.0 + 0.05, prop_color_saturation, prop_color_value)); - theme->set_color("property_color_y", EditorStringName(Editor), Color().from_hsv(1.0 / 3.0 + 0.05, prop_color_saturation, prop_color_value)); - theme->set_color("property_color_z", EditorStringName(Editor), Color().from_hsv(2.0 / 3.0 + 0.05, prop_color_saturation, prop_color_value)); - theme->set_color("property_color_w", EditorStringName(Editor), Color().from_hsv(1.5 / 3.0 + 0.05, prop_color_saturation, prop_color_value)); - - theme->set_color("font_color", EditorStringName(Editor), font_color); - theme->set_color("highlighted_font_color", EditorStringName(Editor), font_hover_color); - theme->set_color("disabled_font_color", EditorStringName(Editor), font_disabled_color); - theme->set_color("readonly_font_color", EditorStringName(Editor), font_readonly_color); - - theme->set_color("mono_color", EditorStringName(Editor), mono_color); - - Color success_color = Color(0.45, 0.95, 0.5); - Color warning_color = Color(1, 0.87, 0.4); - Color error_color = Color(1, 0.47, 0.42); - Color property_color = font_color.lerp(Color(0.5, 0.5, 0.5), 0.5); - Color readonly_color = property_color.lerp(dark_theme ? Color(0, 0, 0) : Color(1, 1, 1), 0.25); - Color readonly_warning_color = error_color.lerp(dark_theme ? Color(0, 0, 0) : Color(1, 1, 1), 0.25); - - if (!dark_theme) { - // Darken some colors to be readable on a light background. - success_color = success_color.lerp(mono_color, 0.35); - warning_color = warning_color.lerp(mono_color, 0.35); - error_color = error_color.lerp(mono_color, 0.25); - } - - theme->set_color("success_color", EditorStringName(Editor), success_color); - theme->set_color("warning_color", EditorStringName(Editor), warning_color); - theme->set_color("error_color", EditorStringName(Editor), error_color); - theme->set_color("property_color", EditorStringName(Editor), property_color); - theme->set_color("readonly_color", EditorStringName(Editor), readonly_color); - - if (!dark_theme) { - theme->set_color("highend_color", EditorStringName(Editor), Color::hex(0xad1128ff)); - } else { - theme->set_color("highend_color", EditorStringName(Editor), Color(1.0, 0.0, 0.0)); - } - - const int thumb_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); - theme->set_constant("scale", EditorStringName(Editor), EDSCALE); - theme->set_constant("thumb_size", EditorStringName(Editor), thumb_size); - theme->set_constant("class_icon_size", EditorStringName(Editor), 16 * EDSCALE); - theme->set_constant("dark_theme", EditorStringName(Editor), dark_theme); - theme->set_constant("color_picker_button_height", EditorStringName(Editor), 28 * EDSCALE); - theme->set_constant("gizmo_handle_scale", EditorStringName(Editor), gizmo_handle_scale); - theme->set_constant("window_border_margin", EditorStringName(Editor), 8); - theme->set_constant("top_bar_separation", EditorStringName(Editor), 8 * EDSCALE); - - // Register editor icons. - // If the settings are comparable to the old theme, then just copy them over. - // Otherwise, regenerate them. Also check if we need to regenerate "thumb" icons. - bool keep_old_icons = false; - bool regenerate_thumb_icons = true; - if (p_theme != nullptr) { - // We check editor scale, theme dark/light mode, icon saturation, and accent color. - - // That doesn't really work as expected, since theme constants are integers, and scales are floats. - // So this check will never work when changing between 100-199% values. - const float prev_scale = (float)p_theme->get_constant(SNAME("scale"), EditorStringName(Editor)); - const bool prev_dark_theme = (bool)p_theme->get_constant(SNAME("dark_theme"), EditorStringName(Editor)); - const Color prev_accent_color = p_theme->get_color(SNAME("accent_color"), EditorStringName(Editor)); - const float prev_icon_saturation = p_theme->get_color(SNAME("icon_saturation"), EditorStringName(Editor)).r; - const float prev_gizmo_handle_scale = (float)p_theme->get_constant(SNAME("gizmo_handle_scale"), EditorStringName(Editor)); - - keep_old_icons = (Math::is_equal_approx(prev_scale, EDSCALE) && - Math::is_equal_approx(prev_gizmo_handle_scale, gizmo_handle_scale) && - prev_dark_theme == dark_theme && - prev_accent_color == accent_color && - prev_icon_saturation == icon_saturation); - - const double prev_thumb_size = (double)p_theme->get_constant(SNAME("thumb_size"), EditorStringName(Editor)); - - regenerate_thumb_icons = !Math::is_equal_approx(prev_thumb_size, thumb_size); - } - -#ifndef MODULE_SVG_ENABLED - WARN_PRINT("SVG support disabled, editor icons won't be rendered."); -#endif - - if (keep_old_icons) { - for (int i = 0; i < editor_icons_count; i++) { - theme->set_icon(editor_icons_names[i], EditorStringName(EditorIcons), p_theme->get_icon(editor_icons_names[i], EditorStringName(EditorIcons))); - } - } else { - editor_register_and_generate_icons(theme, dark_theme, icon_saturation, thumb_size, false); - } - if (regenerate_thumb_icons) { - editor_register_and_generate_icons(theme, dark_theme, icon_saturation, thumb_size, true); - } - - // Register editor fonts. - editor_register_fonts(theme); - - // Ensure borders are visible when using an editor scale below 100%. - const int border_width = CLAMP(border_size, 0, 2) * MAX(1, EDSCALE); - const int corner_width = CLAMP(corner_radius, 0, 6); - const int default_margin_size = 4; - const int margin_size_extra = default_margin_size + CLAMP(border_size, 0, 2); - - // Styleboxes - // This is the most commonly used stylebox, variations should be made as duplicate of this - Ref<StyleBoxFlat> style_default = make_flat_stylebox(base_color, default_margin_size, default_margin_size, default_margin_size, default_margin_size, corner_width); - style_default->set_border_width_all(border_width); - style_default->set_border_color(base_color); - - // Button and widgets - const float extra_spacing = EDITOR_GET("interface/theme/additional_spacing"); - - const Vector2 widget_default_margin = Vector2(extra_spacing + 6, extra_spacing + default_margin_size + 1) * EDSCALE; - - Ref<StyleBoxFlat> style_widget = style_default->duplicate(); - style_widget->set_content_margin_individual(widget_default_margin.x, widget_default_margin.y, widget_default_margin.x, widget_default_margin.y); - style_widget->set_bg_color(dark_color_1); - if (draw_extra_borders) { - style_widget->set_border_width_all(Math::round(EDSCALE)); - style_widget->set_border_color(extra_border_color_1); - } else { - style_widget->set_border_color(dark_color_2); - } - - Ref<StyleBoxFlat> style_widget_disabled = style_widget->duplicate(); - if (draw_extra_borders) { - style_widget_disabled->set_border_color(extra_border_color_2); - } else { - style_widget_disabled->set_border_color(disabled_color); - } - style_widget_disabled->set_bg_color(disabled_bg_color); - - Ref<StyleBoxFlat> style_widget_focus = style_widget->duplicate(); - style_widget_focus->set_draw_center(false); - style_widget_focus->set_border_width_all(Math::round(2 * MAX(1, EDSCALE))); - style_widget_focus->set_border_color(accent_color); - - Ref<StyleBoxFlat> style_widget_pressed = style_widget->duplicate(); - style_widget_pressed->set_bg_color(dark_color_1.darkened(0.125)); - - Ref<StyleBoxFlat> style_widget_hover = style_widget->duplicate(); - style_widget_hover->set_bg_color(mono_color * Color(1, 1, 1, 0.11)); - if (draw_extra_borders) { - style_widget_hover->set_border_color(extra_border_color_1); - } else { - style_widget_hover->set_border_color(mono_color * Color(1, 1, 1, 0.05)); - } - - // Style for windows, popups, etc.. - Ref<StyleBoxFlat> style_popup = style_default->duplicate(); - const int popup_margin_size = default_margin_size * EDSCALE * 3; - style_popup->set_content_margin_all(popup_margin_size); - style_popup->set_border_color(contrast_color_1); - const Color shadow_color = Color(0, 0, 0, dark_theme ? 0.3 : 0.1); - style_popup->set_shadow_color(shadow_color); - style_popup->set_shadow_size(4 * EDSCALE); - // Popups are separate windows by default in the editor. Windows currently don't support per-pixel transparency - // in 4.0, and even if it was, it may not always work in practice (e.g. running with compositing disabled). - style_popup->set_corner_radius_all(0); - - Ref<StyleBoxLine> style_popup_separator(memnew(StyleBoxLine)); - style_popup_separator->set_color(separator_color); - style_popup_separator->set_grow_begin(popup_margin_size - MAX(Math::round(EDSCALE), border_width)); - style_popup_separator->set_grow_end(popup_margin_size - MAX(Math::round(EDSCALE), border_width)); - style_popup_separator->set_thickness(MAX(Math::round(EDSCALE), border_width)); - - Ref<StyleBoxLine> style_popup_labeled_separator_left(memnew(StyleBoxLine)); - style_popup_labeled_separator_left->set_grow_begin(popup_margin_size - MAX(Math::round(EDSCALE), border_width)); - style_popup_labeled_separator_left->set_color(separator_color); - style_popup_labeled_separator_left->set_thickness(MAX(Math::round(EDSCALE), border_width)); - - Ref<StyleBoxLine> style_popup_labeled_separator_right(memnew(StyleBoxLine)); - style_popup_labeled_separator_right->set_grow_end(popup_margin_size - MAX(Math::round(EDSCALE), border_width)); - style_popup_labeled_separator_right->set_color(separator_color); - style_popup_labeled_separator_right->set_thickness(MAX(Math::round(EDSCALE), border_width)); - - Ref<StyleBoxEmpty> style_empty = make_empty_stylebox(default_margin_size, default_margin_size, default_margin_size, default_margin_size); - - // TabBar - - Ref<StyleBoxFlat> style_tab_base = style_widget->duplicate(); - - style_tab_base->set_border_width_all(0); - // Don't round the top corners to avoid creating a small blank space between the tabs and the main panel. - // This also makes the top highlight look better. - style_tab_base->set_corner_radius(CORNER_BOTTOM_LEFT, 0); - style_tab_base->set_corner_radius(CORNER_BOTTOM_RIGHT, 0); - - // When using a border width greater than 0, visually line up the left of the selected tab with the underlying panel. - style_tab_base->set_expand_margin(SIDE_LEFT, -border_width); - - style_tab_base->set_content_margin(SIDE_LEFT, widget_default_margin.x + 5 * EDSCALE); - style_tab_base->set_content_margin(SIDE_RIGHT, widget_default_margin.x + 5 * EDSCALE); - style_tab_base->set_content_margin(SIDE_BOTTOM, widget_default_margin.y); - style_tab_base->set_content_margin(SIDE_TOP, widget_default_margin.y); - - Ref<StyleBoxFlat> style_tab_selected = style_tab_base->duplicate(); - - style_tab_selected->set_bg_color(base_color); - // Add a highlight line at the top of the selected tab. - style_tab_selected->set_border_width(SIDE_TOP, Math::round(2 * EDSCALE)); - // Make the highlight line prominent, but not too prominent as to not be distracting. - Color tab_highlight = dark_color_2.lerp(accent_color, 0.75); - style_tab_selected->set_border_color(tab_highlight); - style_tab_selected->set_corner_radius_all(0); - - Ref<StyleBoxFlat> style_tab_hovered = style_tab_base->duplicate(); - - style_tab_hovered->set_bg_color(dark_color_1.lerp(base_color, 0.4)); - // Hovered tab has a subtle highlight between normal and selected states. - style_tab_hovered->set_corner_radius_all(0); - - Ref<StyleBoxFlat> style_tab_unselected = style_tab_base->duplicate(); - style_tab_unselected->set_expand_margin(SIDE_BOTTOM, 0); - style_tab_unselected->set_bg_color(dark_color_1); - // Add some spacing between unselected tabs to make them easier to distinguish from each other - style_tab_unselected->set_border_color(Color(0, 0, 0, 0)); - - Ref<StyleBoxFlat> style_tab_disabled = style_tab_base->duplicate(); - style_tab_disabled->set_expand_margin(SIDE_BOTTOM, 0); - style_tab_disabled->set_bg_color(disabled_bg_color); - style_tab_disabled->set_border_color(disabled_bg_color); - - Ref<StyleBoxFlat> style_tab_focus = style_widget_focus->duplicate(); - - // Editor background - Color background_color_opaque = background_color; - background_color_opaque.a = 1.0; - theme->set_color("background", EditorStringName(Editor), background_color_opaque); - theme->set_stylebox("Background", EditorStringName(EditorStyles), make_flat_stylebox(background_color_opaque, default_margin_size, default_margin_size, default_margin_size, default_margin_size)); - - // Focus - theme->set_stylebox("Focus", EditorStringName(EditorStyles), style_widget_focus); - // Use a less opaque color to be less distracting for the 2D and 3D editor viewports. - Ref<StyleBoxFlat> style_widget_focus_viewport = style_widget_focus->duplicate(); - style_widget_focus_viewport->set_border_color(accent_color * Color(1, 1, 1, 0.5)); - theme->set_stylebox("FocusViewport", EditorStringName(EditorStyles), style_widget_focus_viewport); - - // Menu - Ref<StyleBoxFlat> style_menu = style_widget->duplicate(); - style_menu->set_draw_center(false); - style_menu->set_border_width_all(0); - theme->set_stylebox("panel", "PanelContainer", style_menu); - theme->set_stylebox("MenuPanel", EditorStringName(EditorStyles), style_menu); - - // CanvasItem Editor - Ref<StyleBoxFlat> style_canvas_editor_info = make_flat_stylebox(Color(0.0, 0.0, 0.0, 0.2)); - style_canvas_editor_info->set_expand_margin_all(4 * EDSCALE); - theme->set_stylebox("CanvasItemInfoOverlay", EditorStringName(EditorStyles), style_canvas_editor_info); - - // 2D and 3D contextual toolbar. - // Use a custom stylebox to make contextual menu items stand out from the rest. - // This helps with editor usability as contextual menu items change when selecting nodes, - // even though it may not be immediately obvious at first. - Ref<StyleBoxFlat> toolbar_stylebox = memnew(StyleBoxFlat); - toolbar_stylebox->set_bg_color(accent_color * Color(1, 1, 1, 0.1)); - toolbar_stylebox->set_anti_aliased(false); - // Add an underline to the StyleBox, but prevent its minimum vertical size from changing. - toolbar_stylebox->set_border_color(accent_color); - toolbar_stylebox->set_border_width(SIDE_BOTTOM, Math::round(2 * EDSCALE)); - toolbar_stylebox->set_content_margin(SIDE_BOTTOM, 0); - toolbar_stylebox->set_expand_margin_individual(4 * EDSCALE, 2 * EDSCALE, 4 * EDSCALE, 4 * EDSCALE); - theme->set_stylebox("ContextualToolbar", EditorStringName(EditorStyles), toolbar_stylebox); - - // Script Editor - theme->set_stylebox("ScriptEditorPanel", EditorStringName(EditorStyles), make_empty_stylebox(default_margin_size, 0, default_margin_size, default_margin_size)); - theme->set_stylebox("ScriptEditorPanelFloating", EditorStringName(EditorStyles), make_empty_stylebox(0, 0, 0, 0)); - - theme->set_stylebox("ScriptEditor", EditorStringName(EditorStyles), make_empty_stylebox(0, 0, 0, 0)); - - // Launch Pad and Play buttons - Ref<StyleBoxFlat> style_launch_pad = make_flat_stylebox(dark_color_1, 2 * EDSCALE, 0, 2 * EDSCALE, 0, corner_width); - style_launch_pad->set_corner_radius_all(corner_radius * EDSCALE); - theme->set_stylebox("LaunchPadNormal", EditorStringName(EditorStyles), style_launch_pad); - Ref<StyleBoxFlat> style_launch_pad_movie = style_launch_pad->duplicate(); - style_launch_pad_movie->set_bg_color(accent_color * Color(1, 1, 1, 0.1)); - style_launch_pad_movie->set_border_color(accent_color); - style_launch_pad_movie->set_border_width_all(Math::round(2 * EDSCALE)); - theme->set_stylebox("LaunchPadMovieMode", EditorStringName(EditorStyles), style_launch_pad_movie); - - theme->set_stylebox("MovieWriterButtonNormal", EditorStringName(EditorStyles), make_empty_stylebox(0, 0, 0, 0)); - Ref<StyleBoxFlat> style_write_movie_button = style_widget_pressed->duplicate(); - style_write_movie_button->set_bg_color(accent_color); - style_write_movie_button->set_corner_radius_all(corner_radius * EDSCALE); - style_write_movie_button->set_content_margin(SIDE_TOP, 0); - style_write_movie_button->set_content_margin(SIDE_BOTTOM, 0); - style_write_movie_button->set_content_margin(SIDE_LEFT, 0); - style_write_movie_button->set_content_margin(SIDE_RIGHT, 0); - style_write_movie_button->set_expand_margin(SIDE_RIGHT, 2 * EDSCALE); - theme->set_stylebox("MovieWriterButtonPressed", EditorStringName(EditorStyles), style_write_movie_button); - - // MenuButton - theme->set_stylebox("normal", "MenuButton", style_menu); - theme->set_stylebox("hover", "MenuButton", style_widget_hover); - theme->set_stylebox("pressed", "MenuButton", style_menu); - theme->set_stylebox("focus", "MenuButton", style_menu); - theme->set_stylebox("disabled", "MenuButton", style_menu); - - theme->set_color("font_color", "MenuButton", font_color); - theme->set_color("font_hover_color", "MenuButton", font_hover_color); - theme->set_color("font_hover_pressed_color", "MenuButton", font_hover_pressed_color); - theme->set_color("font_focus_color", "MenuButton", font_focus_color); - theme->set_color("font_outline_color", "MenuButton", font_outline_color); - - theme->set_constant("outline_size", "MenuButton", 0); - - theme->set_stylebox("MenuHover", EditorStringName(EditorStyles), style_widget_hover); - - // Buttons - theme->set_stylebox("normal", "Button", style_widget); - theme->set_stylebox("hover", "Button", style_widget_hover); - theme->set_stylebox("pressed", "Button", style_widget_pressed); - theme->set_stylebox("focus", "Button", style_widget_focus); - theme->set_stylebox("disabled", "Button", style_widget_disabled); - - theme->set_color("font_color", "Button", font_color); - theme->set_color("font_hover_color", "Button", font_hover_color); - theme->set_color("font_hover_pressed_color", "Button", font_hover_pressed_color); - theme->set_color("font_focus_color", "Button", font_focus_color); - theme->set_color("font_pressed_color", "Button", accent_color); - theme->set_color("font_disabled_color", "Button", font_disabled_color); - theme->set_color("font_outline_color", "Button", font_outline_color); - - theme->set_color("icon_normal_color", "Button", icon_normal_color); - theme->set_color("icon_hover_color", "Button", icon_hover_color); - theme->set_color("icon_focus_color", "Button", icon_focus_color); - theme->set_color("icon_pressed_color", "Button", icon_pressed_color); - theme->set_color("icon_disabled_color", "Button", icon_disabled_color); - - theme->set_constant("h_separation", "Button", 4 * EDSCALE); - theme->set_constant("outline_size", "Button", 0); - - // Flat button variations. - - Ref<StyleBoxEmpty> style_flat_button = make_empty_stylebox(); - for (int i = 0; i < 4; i++) { - style_flat_button->set_content_margin((Side)i, style_widget->get_margin((Side)i) + style_widget->get_border_width((Side)i)); - } - - Ref<StyleBoxFlat> style_flat_button_pressed = style_widget_pressed->duplicate(); - Color flat_pressed_color = dark_color_1.lightened(0.24).lerp(accent_color, 0.2) * Color(0.8, 0.8, 0.8, 0.85); - if (dark_theme) { - flat_pressed_color = dark_color_1.lerp(accent_color, 0.12) * Color(0.6, 0.6, 0.6, 0.85); - } - style_flat_button_pressed->set_bg_color(flat_pressed_color); - - theme->set_stylebox("normal", "FlatButton", style_flat_button); - theme->set_stylebox("hover", "FlatButton", style_flat_button); - theme->set_stylebox("pressed", "FlatButton", style_flat_button_pressed); - theme->set_stylebox("disabled", "FlatButton", style_flat_button); - - theme->set_stylebox("normal", "FlatMenuButton", style_flat_button); - theme->set_stylebox("hover", "FlatMenuButton", style_flat_button); - theme->set_stylebox("pressed", "FlatMenuButton", style_flat_button_pressed); - theme->set_stylebox("disabled", "FlatMenuButton", style_flat_button); - - const float ACTION_BUTTON_EXTRA_MARGIN = 32 * EDSCALE; - - theme->set_type_variation("InspectorActionButton", "Button"); - Color color_inspector_action = dark_color_1.lerp(mono_color, 0.12); - color_inspector_action.a = 0.5; - Ref<StyleBoxFlat> style_inspector_action = style_widget->duplicate(); - style_inspector_action->set_bg_color(color_inspector_action); - style_inspector_action->set_content_margin(SIDE_RIGHT, ACTION_BUTTON_EXTRA_MARGIN); - theme->set_stylebox("normal", "InspectorActionButton", style_inspector_action); - style_inspector_action = style_widget_hover->duplicate(); - style_inspector_action->set_content_margin(SIDE_RIGHT, ACTION_BUTTON_EXTRA_MARGIN); - theme->set_stylebox("hover", "InspectorActionButton", style_inspector_action); - style_inspector_action = style_widget_pressed->duplicate(); - style_inspector_action->set_content_margin(SIDE_RIGHT, ACTION_BUTTON_EXTRA_MARGIN); - theme->set_stylebox("pressed", "InspectorActionButton", style_inspector_action); - style_inspector_action = style_widget_disabled->duplicate(); - style_inspector_action->set_content_margin(SIDE_RIGHT, ACTION_BUTTON_EXTRA_MARGIN); - theme->set_stylebox("disabled", "InspectorActionButton", style_inspector_action); - theme->set_constant("h_separation", "InspectorActionButton", ACTION_BUTTON_EXTRA_MARGIN); - - // Variation for Editor Log filter buttons - theme->set_type_variation("EditorLogFilterButton", "Button"); - // When pressed, don't tint the icons with the accent color, just leave them normal. - theme->set_color("icon_pressed_color", "EditorLogFilterButton", icon_normal_color); - // When unpressed, dim the icons. - theme->set_color("icon_normal_color", "EditorLogFilterButton", icon_disabled_color); - // When pressed, add a small bottom border to the buttons to better show their active state, - // similar to active tabs. - - Ref<StyleBoxFlat> editor_log_button_pressed = style_flat_button_pressed->duplicate(); - editor_log_button_pressed->set_border_width(SIDE_BOTTOM, 2 * EDSCALE); - editor_log_button_pressed->set_border_color(accent_color); - theme->set_stylebox("pressed", "EditorLogFilterButton", editor_log_button_pressed); - - // Buttons in material previews - const Color dim_light_color = icon_normal_color.darkened(0.24); - const Color dim_light_highlighted_color = icon_normal_color.darkened(0.18); - Ref<StyleBox> sb_empty_borderless = make_empty_stylebox(); - - theme->set_type_variation("PreviewLightButton", "Button"); - // When pressed, don't use the accent color tint. When unpressed, dim the icon. - theme->set_color("icon_normal_color", "PreviewLightButton", dim_light_color); - theme->set_color("icon_focus_color", "PreviewLightButton", dim_light_color); - theme->set_color("icon_pressed_color", "PreviewLightButton", icon_normal_color); - theme->set_color("icon_hover_pressed_color", "PreviewLightButton", icon_normal_color); - // Unpressed icon is dim, so use a dim highlight. - theme->set_color("icon_hover_color", "PreviewLightButton", dim_light_highlighted_color); - - theme->set_stylebox("normal", "PreviewLightButton", sb_empty_borderless); - theme->set_stylebox("hover", "PreviewLightButton", sb_empty_borderless); - theme->set_stylebox("focus", "PreviewLightButton", sb_empty_borderless); - theme->set_stylebox("pressed", "PreviewLightButton", sb_empty_borderless); - - // ProjectTag - { - theme->set_type_variation("ProjectTag", "Button"); - - Ref<StyleBoxFlat> tag = style_widget->duplicate(); - tag->set_bg_color(dark_theme ? tag->get_bg_color().lightened(0.2) : tag->get_bg_color().darkened(0.2)); - tag->set_corner_radius(CORNER_TOP_LEFT, 0); - tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0); - tag->set_corner_radius(CORNER_TOP_RIGHT, 4); - tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4); - theme->set_stylebox("normal", "ProjectTag", tag); - - tag = style_widget_hover->duplicate(); - tag->set_corner_radius(CORNER_TOP_LEFT, 0); - tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0); - tag->set_corner_radius(CORNER_TOP_RIGHT, 4); - tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4); - theme->set_stylebox("hover", "ProjectTag", tag); - - tag = style_widget_pressed->duplicate(); - tag->set_corner_radius(CORNER_TOP_LEFT, 0); - tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0); - tag->set_corner_radius(CORNER_TOP_RIGHT, 4); - tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4); - theme->set_stylebox("pressed", "ProjectTag", tag); - } - - // MenuBar - theme->set_stylebox("normal", "MenuBar", style_widget); - theme->set_stylebox("hover", "MenuBar", style_widget_hover); - theme->set_stylebox("pressed", "MenuBar", style_widget_pressed); - theme->set_stylebox("disabled", "MenuBar", style_widget_disabled); - - theme->set_color("font_color", "MenuBar", font_color); - theme->set_color("font_hover_color", "MenuBar", font_hover_color); - theme->set_color("font_hover_pressed_color", "MenuBar", font_hover_pressed_color); - theme->set_color("font_focus_color", "MenuBar", font_focus_color); - theme->set_color("font_pressed_color", "MenuBar", accent_color); - theme->set_color("font_disabled_color", "MenuBar", font_disabled_color); - theme->set_color("font_outline_color", "MenuBar", font_outline_color); - - theme->set_color("icon_normal_color", "MenuBar", icon_normal_color); - theme->set_color("icon_hover_color", "MenuBar", icon_hover_color); - theme->set_color("icon_focus_color", "MenuBar", icon_focus_color); - theme->set_color("icon_pressed_color", "MenuBar", icon_pressed_color); - theme->set_color("icon_disabled_color", "MenuBar", icon_disabled_color); - - theme->set_constant("h_separation", "MenuBar", 4 * EDSCALE); - theme->set_constant("outline_size", "MenuBar", 0); - - // OptionButton - Ref<StyleBoxFlat> style_option_button_focus = style_widget_focus->duplicate(); - Ref<StyleBoxFlat> style_option_button_normal = style_widget->duplicate(); - Ref<StyleBoxFlat> style_option_button_hover = style_widget_hover->duplicate(); - Ref<StyleBoxFlat> style_option_button_pressed = style_widget_pressed->duplicate(); - Ref<StyleBoxFlat> style_option_button_disabled = style_widget_disabled->duplicate(); - - style_option_button_focus->set_content_margin(SIDE_RIGHT, 4 * EDSCALE); - style_option_button_normal->set_content_margin(SIDE_RIGHT, 4 * EDSCALE); - style_option_button_hover->set_content_margin(SIDE_RIGHT, 4 * EDSCALE); - style_option_button_pressed->set_content_margin(SIDE_RIGHT, 4 * EDSCALE); - style_option_button_disabled->set_content_margin(SIDE_RIGHT, 4 * EDSCALE); - - theme->set_stylebox("focus", "OptionButton", style_option_button_focus); - theme->set_stylebox("normal", "OptionButton", style_widget); - theme->set_stylebox("hover", "OptionButton", style_widget_hover); - theme->set_stylebox("pressed", "OptionButton", style_widget_pressed); - theme->set_stylebox("disabled", "OptionButton", style_widget_disabled); - - theme->set_stylebox("normal_mirrored", "OptionButton", style_option_button_normal); - theme->set_stylebox("hover_mirrored", "OptionButton", style_option_button_hover); - theme->set_stylebox("pressed_mirrored", "OptionButton", style_option_button_pressed); - theme->set_stylebox("disabled_mirrored", "OptionButton", style_option_button_disabled); - - theme->set_color("font_color", "OptionButton", font_color); - theme->set_color("font_hover_color", "OptionButton", font_hover_color); - theme->set_color("font_hover_pressed_color", "OptionButton", font_hover_pressed_color); - theme->set_color("font_focus_color", "OptionButton", font_focus_color); - theme->set_color("font_pressed_color", "OptionButton", accent_color); - theme->set_color("font_disabled_color", "OptionButton", font_disabled_color); - theme->set_color("font_outline_color", "OptionButton", font_outline_color); - - theme->set_color("icon_normal_color", "OptionButton", icon_normal_color); - theme->set_color("icon_hover_color", "OptionButton", icon_hover_color); - theme->set_color("icon_focus_color", "OptionButton", icon_focus_color); - theme->set_color("icon_pressed_color", "OptionButton", icon_pressed_color); - theme->set_color("icon_disabled_color", "OptionButton", icon_disabled_color); - - theme->set_icon("arrow", "OptionButton", theme->get_icon(SNAME("GuiOptionArrow"), EditorStringName(EditorIcons))); - theme->set_constant("arrow_margin", "OptionButton", widget_default_margin.x - 2 * EDSCALE); - theme->set_constant("modulate_arrow", "OptionButton", true); - theme->set_constant("h_separation", "OptionButton", 4 * EDSCALE); - theme->set_constant("outline_size", "OptionButton", 0); - - // CheckButton - theme->set_stylebox("normal", "CheckButton", style_menu); - theme->set_stylebox("pressed", "CheckButton", style_menu); - theme->set_stylebox("disabled", "CheckButton", style_menu); - theme->set_stylebox("hover", "CheckButton", style_menu); - theme->set_stylebox("hover_pressed", "CheckButton", style_menu); - - theme->set_icon("checked", "CheckButton", theme->get_icon(SNAME("GuiToggleOn"), EditorStringName(EditorIcons))); - theme->set_icon("checked_disabled", "CheckButton", theme->get_icon(SNAME("GuiToggleOnDisabled"), EditorStringName(EditorIcons))); - theme->set_icon("unchecked", "CheckButton", theme->get_icon(SNAME("GuiToggleOff"), EditorStringName(EditorIcons))); - theme->set_icon("unchecked_disabled", "CheckButton", theme->get_icon(SNAME("GuiToggleOffDisabled"), EditorStringName(EditorIcons))); - - theme->set_icon("checked_mirrored", "CheckButton", theme->get_icon(SNAME("GuiToggleOnMirrored"), EditorStringName(EditorIcons))); - theme->set_icon("checked_disabled_mirrored", "CheckButton", theme->get_icon(SNAME("GuiToggleOnDisabledMirrored"), EditorStringName(EditorIcons))); - theme->set_icon("unchecked_mirrored", "CheckButton", theme->get_icon(SNAME("GuiToggleOffMirrored"), EditorStringName(EditorIcons))); - theme->set_icon("unchecked_disabled_mirrored", "CheckButton", theme->get_icon(SNAME("GuiToggleOffDisabledMirrored"), EditorStringName(EditorIcons))); - - theme->set_color("font_color", "CheckButton", font_color); - theme->set_color("font_hover_color", "CheckButton", font_hover_color); - theme->set_color("font_hover_pressed_color", "CheckButton", font_hover_pressed_color); - theme->set_color("font_focus_color", "CheckButton", font_focus_color); - theme->set_color("font_pressed_color", "CheckButton", accent_color); - theme->set_color("font_disabled_color", "CheckButton", font_disabled_color); - theme->set_color("font_outline_color", "CheckButton", font_outline_color); - - theme->set_color("icon_normal_color", "CheckButton", icon_normal_color); - theme->set_color("icon_hover_color", "CheckButton", icon_hover_color); - theme->set_color("icon_focus_color", "CheckButton", icon_focus_color); - theme->set_color("icon_pressed_color", "CheckButton", icon_pressed_color); - theme->set_color("icon_disabled_color", "CheckButton", icon_disabled_color); - - theme->set_constant("h_separation", "CheckButton", 8 * EDSCALE); - theme->set_constant("check_v_offset", "CheckButton", 0); - theme->set_constant("outline_size", "CheckButton", 0); - - // Checkbox - Ref<StyleBoxFlat> sb_checkbox = style_menu->duplicate(); - sb_checkbox->set_content_margin_all(default_margin_size * EDSCALE); - - theme->set_stylebox("normal", "CheckBox", sb_checkbox); - theme->set_stylebox("pressed", "CheckBox", sb_checkbox); - theme->set_stylebox("disabled", "CheckBox", sb_checkbox); - theme->set_stylebox("hover", "CheckBox", sb_checkbox); - theme->set_stylebox("hover_pressed", "CheckBox", sb_checkbox); - theme->set_icon("checked", "CheckBox", theme->get_icon(SNAME("GuiChecked"), EditorStringName(EditorIcons))); - theme->set_icon("unchecked", "CheckBox", theme->get_icon(SNAME("GuiUnchecked"), EditorStringName(EditorIcons))); - theme->set_icon("radio_checked", "CheckBox", theme->get_icon(SNAME("GuiRadioChecked"), EditorStringName(EditorIcons))); - theme->set_icon("radio_unchecked", "CheckBox", theme->get_icon(SNAME("GuiRadioUnchecked"), EditorStringName(EditorIcons))); - theme->set_icon("checked_disabled", "CheckBox", theme->get_icon(SNAME("GuiCheckedDisabled"), EditorStringName(EditorIcons))); - theme->set_icon("unchecked_disabled", "CheckBox", theme->get_icon(SNAME("GuiUncheckedDisabled"), EditorStringName(EditorIcons))); - theme->set_icon("radio_checked_disabled", "CheckBox", theme->get_icon(SNAME("GuiRadioCheckedDisabled"), EditorStringName(EditorIcons))); - theme->set_icon("radio_unchecked_disabled", "CheckBox", theme->get_icon(SNAME("GuiRadioUncheckedDisabled"), EditorStringName(EditorIcons))); - - theme->set_color("font_color", "CheckBox", font_color); - theme->set_color("font_hover_color", "CheckBox", font_hover_color); - theme->set_color("font_hover_pressed_color", "CheckBox", font_hover_pressed_color); - theme->set_color("font_focus_color", "CheckBox", font_focus_color); - theme->set_color("font_pressed_color", "CheckBox", accent_color); - theme->set_color("font_disabled_color", "CheckBox", font_disabled_color); - theme->set_color("font_outline_color", "CheckBox", font_outline_color); - - theme->set_color("icon_normal_color", "CheckBox", icon_normal_color); - theme->set_color("icon_hover_color", "CheckBox", icon_hover_color); - theme->set_color("icon_focus_color", "CheckBox", icon_focus_color); - theme->set_color("icon_pressed_color", "CheckBox", icon_pressed_color); - theme->set_color("icon_disabled_color", "CheckBox", icon_disabled_color); - - theme->set_constant("h_separation", "CheckBox", 8 * EDSCALE); - theme->set_constant("check_v_offset", "CheckBox", 0); - theme->set_constant("outline_size", "CheckBox", 0); - - // PopupDialog - theme->set_stylebox("panel", "PopupDialog", style_popup); - - // PopupMenu - Ref<StyleBoxFlat> style_popup_menu = style_popup->duplicate(); - // Use 1 pixel for the sides, since if 0 is used, the highlight of hovered items is drawn - // on top of the popup border. This causes a 'gap' in the panel border when an item is highlighted, - // and it looks weird. 1px solves this. - style_popup_menu->set_content_margin_individual(EDSCALE, 2 * EDSCALE, EDSCALE, 2 * EDSCALE); - // Always display a border for PopupMenus so they can be distinguished from their background. - style_popup_menu->set_border_width_all(EDSCALE); - if (draw_extra_borders) { - style_popup_menu->set_border_color(extra_border_color_2); - } else { - style_popup_menu->set_border_color(dark_color_2); - } - theme->set_stylebox("panel", "PopupMenu", style_popup_menu); - - Ref<StyleBoxFlat> style_menu_hover = style_widget_hover->duplicate(); - // Don't use rounded corners for hover highlights since the StyleBox touches the PopupMenu's edges. - style_menu_hover->set_corner_radius_all(0); - theme->set_stylebox("hover", "PopupMenu", style_menu_hover); - - theme->set_stylebox("separator", "PopupMenu", style_popup_separator); - theme->set_stylebox("labeled_separator_left", "PopupMenu", style_popup_labeled_separator_left); - theme->set_stylebox("labeled_separator_right", "PopupMenu", style_popup_labeled_separator_right); - - theme->set_color("font_color", "PopupMenu", font_color); - theme->set_color("font_hover_color", "PopupMenu", font_hover_color); - theme->set_color("font_accelerator_color", "PopupMenu", font_disabled_color); - theme->set_color("font_disabled_color", "PopupMenu", font_disabled_color); - theme->set_color("font_separator_color", "PopupMenu", font_disabled_color); - theme->set_color("font_outline_color", "PopupMenu", font_outline_color); - theme->set_icon("checked", "PopupMenu", theme->get_icon(SNAME("GuiChecked"), EditorStringName(EditorIcons))); - theme->set_icon("unchecked", "PopupMenu", theme->get_icon(SNAME("GuiUnchecked"), EditorStringName(EditorIcons))); - theme->set_icon("radio_checked", "PopupMenu", theme->get_icon(SNAME("GuiRadioChecked"), EditorStringName(EditorIcons))); - theme->set_icon("radio_unchecked", "PopupMenu", theme->get_icon(SNAME("GuiRadioUnchecked"), EditorStringName(EditorIcons))); - theme->set_icon("checked_disabled", "PopupMenu", theme->get_icon(SNAME("GuiCheckedDisabled"), EditorStringName(EditorIcons))); - theme->set_icon("unchecked_disabled", "PopupMenu", theme->get_icon(SNAME("GuiUncheckedDisabled"), EditorStringName(EditorIcons))); - theme->set_icon("radio_checked_disabled", "PopupMenu", theme->get_icon(SNAME("GuiRadioCheckedDisabled"), EditorStringName(EditorIcons))); - theme->set_icon("radio_unchecked_disabled", "PopupMenu", theme->get_icon(SNAME("GuiRadioUncheckedDisabled"), EditorStringName(EditorIcons))); - theme->set_icon("submenu", "PopupMenu", theme->get_icon(SNAME("ArrowRight"), EditorStringName(EditorIcons))); - theme->set_icon("submenu_mirrored", "PopupMenu", theme->get_icon(SNAME("ArrowLeft"), EditorStringName(EditorIcons))); - theme->set_icon("visibility_hidden", "PopupMenu", theme->get_icon(SNAME("GuiVisibilityHidden"), EditorStringName(EditorIcons))); - theme->set_icon("visibility_visible", "PopupMenu", theme->get_icon(SNAME("GuiVisibilityVisible"), EditorStringName(EditorIcons))); - theme->set_icon("visibility_xray", "PopupMenu", theme->get_icon(SNAME("GuiVisibilityXray"), EditorStringName(EditorIcons))); - - // Force the v_separation to be even so that the spacing on top and bottom is even. - // If the vsep is odd and cannot be split into 2 even groups (of pixels), then it will be lopsided. - // We add 2 to the vsep to give it some extra spacing which looks a bit more modern (see Windows, for example). - const int vsep_base = extra_spacing + default_margin_size + 6; - const int force_even_vsep = vsep_base + (vsep_base % 2); - theme->set_constant("v_separation", "PopupMenu", force_even_vsep * EDSCALE); - theme->set_constant("outline_size", "PopupMenu", 0); - theme->set_constant("item_start_padding", "PopupMenu", default_margin_size * 1.5 * EDSCALE); - theme->set_constant("item_end_padding", "PopupMenu", default_margin_size * 1.5 * EDSCALE); - - // Sub-inspectors - for (int i = 0; i < 16; i++) { - Color si_base_color = accent_color; - - float hue_rotate = (i * 2 % 16) / 16.0; - si_base_color.set_hsv(Math::fmod(float(si_base_color.get_h() + hue_rotate), float(1.0)), si_base_color.get_s(), si_base_color.get_v()); - si_base_color = accent_color.lerp(si_base_color, float(EDITOR_GET("docks/property_editor/subresource_hue_tint"))); - - // Sub-inspector background. - Ref<StyleBoxFlat> sub_inspector_bg = style_default->duplicate(); - sub_inspector_bg->set_bg_color(dark_color_1.lerp(si_base_color, 0.08)); - sub_inspector_bg->set_border_width_all(2 * EDSCALE); - sub_inspector_bg->set_border_color(si_base_color * Color(0.7, 0.7, 0.7, 0.8)); - sub_inspector_bg->set_content_margin_all(4 * EDSCALE); - sub_inspector_bg->set_corner_radius(CORNER_TOP_LEFT, 0); - sub_inspector_bg->set_corner_radius(CORNER_TOP_RIGHT, 0); - - theme->set_stylebox("sub_inspector_bg" + itos(i), EditorStringName(Editor), sub_inspector_bg); - - // EditorProperty background while it has a sub-inspector open. - Ref<StyleBoxFlat> bg_color = make_flat_stylebox(si_base_color * Color(0.7, 0.7, 0.7, 0.8), 0, 0, 0, 0, corner_radius); - bg_color->set_anti_aliased(false); - bg_color->set_corner_radius(CORNER_BOTTOM_LEFT, 0); - bg_color->set_corner_radius(CORNER_BOTTOM_RIGHT, 0); - - theme->set_stylebox("sub_inspector_property_bg" + itos(i), EditorStringName(Editor), bg_color); - } - - theme->set_color("sub_inspector_property_color", EditorStringName(Editor), dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1)); - - // EditorSpinSlider. - theme->set_color("label_color", "EditorSpinSlider", font_color); - theme->set_color("read_only_label_color", "EditorSpinSlider", font_readonly_color); - - Ref<StyleBoxFlat> editor_spin_label_bg = style_default->duplicate(); - editor_spin_label_bg->set_bg_color(dark_color_3); - editor_spin_label_bg->set_border_width_all(0); - theme->set_stylebox("label_bg", "EditorSpinSlider", editor_spin_label_bg); - - // EditorProperty - Ref<StyleBoxFlat> style_property_bg = style_default->duplicate(); - style_property_bg->set_bg_color(highlight_color); - style_property_bg->set_border_width_all(0); - - Ref<StyleBoxFlat> style_property_child_bg = style_default->duplicate(); - style_property_child_bg->set_bg_color(dark_color_2); - style_property_child_bg->set_border_width_all(0); - - theme->set_constant("font_offset", "EditorProperty", 8 * EDSCALE); - theme->set_stylebox("bg_selected", "EditorProperty", style_property_bg); - theme->set_stylebox("bg", "EditorProperty", Ref<StyleBoxEmpty>(memnew(StyleBoxEmpty))); - theme->set_stylebox("child_bg", "EditorProperty", style_property_child_bg); - theme->set_constant("v_separation", "EditorProperty", (extra_spacing + default_margin_size) * EDSCALE); - theme->set_color("warning_color", "EditorProperty", warning_color); - theme->set_color("property_color", "EditorProperty", property_color); - theme->set_color("readonly_color", "EditorProperty", readonly_color); - theme->set_color("readonly_warning_color", "EditorProperty", readonly_warning_color); - - Ref<StyleBoxFlat> style_property_group_note = style_default->duplicate(); - Color property_group_note_color = accent_color; - property_group_note_color.a = 0.1; - style_property_group_note->set_bg_color(property_group_note_color); - theme->set_stylebox("bg_group_note", "EditorProperty", style_property_group_note); - - // EditorInspectorSection - Color inspector_section_color = font_color.lerp(Color(0.5, 0.5, 0.5), 0.35); - theme->set_color("font_color", "EditorInspectorSection", inspector_section_color); - - Color inspector_indent_color = accent_color; - inspector_indent_color.a = 0.2; - Ref<StyleBoxFlat> inspector_indent_style = make_flat_stylebox(inspector_indent_color, 2.0 * EDSCALE, 0, 2.0 * EDSCALE, 0); - theme->set_stylebox("indent_box", "EditorInspectorSection", inspector_indent_style); - theme->set_constant("indent_size", "EditorInspectorSection", 6.0 * EDSCALE); - - theme->set_constant("inspector_margin", EditorStringName(Editor), 12 * EDSCALE); - - // Tree & ItemList background - Ref<StyleBoxFlat> style_tree_bg = style_default->duplicate(); - // Make Trees easier to distinguish from other controls by using a darker background color. - style_tree_bg->set_bg_color(dark_color_1.lerp(dark_color_2, 0.5)); - if (draw_extra_borders) { - style_tree_bg->set_border_width_all(Math::round(EDSCALE)); - style_tree_bg->set_border_color(extra_border_color_2); - } else { - style_tree_bg->set_border_color(dark_color_3); - } - - theme->set_stylebox("panel", "Tree", style_tree_bg); - theme->set_stylebox("panel", "EditorValidationPanel", style_tree_bg); - - // Tree - theme->set_icon("checked", "Tree", theme->get_icon(SNAME("GuiChecked"), EditorStringName(EditorIcons))); - theme->set_icon("checked_disabled", "Tree", theme->get_icon(SNAME("GuiCheckedDisabled"), EditorStringName(EditorIcons))); - theme->set_icon("indeterminate", "Tree", theme->get_icon(SNAME("GuiIndeterminate"), EditorStringName(EditorIcons))); - theme->set_icon("indeterminate_disabled", "Tree", theme->get_icon(SNAME("GuiIndeterminateDisabled"), EditorStringName(EditorIcons))); - theme->set_icon("unchecked", "Tree", theme->get_icon(SNAME("GuiUnchecked"), EditorStringName(EditorIcons))); - theme->set_icon("unchecked_disabled", "Tree", theme->get_icon(SNAME("GuiUncheckedDisabled"), EditorStringName(EditorIcons))); - theme->set_icon("arrow", "Tree", theme->get_icon(SNAME("GuiTreeArrowDown"), EditorStringName(EditorIcons))); - theme->set_icon("arrow_collapsed", "Tree", theme->get_icon(SNAME("GuiTreeArrowRight"), EditorStringName(EditorIcons))); - theme->set_icon("arrow_collapsed_mirrored", "Tree", theme->get_icon(SNAME("GuiTreeArrowLeft"), EditorStringName(EditorIcons))); - theme->set_icon("updown", "Tree", theme->get_icon(SNAME("GuiTreeUpdown"), EditorStringName(EditorIcons))); - theme->set_icon("select_arrow", "Tree", theme->get_icon(SNAME("GuiDropdown"), EditorStringName(EditorIcons))); - theme->set_stylebox("focus", "Tree", style_widget_focus); - theme->set_stylebox("custom_button", "Tree", make_empty_stylebox()); - theme->set_stylebox("custom_button_pressed", "Tree", make_empty_stylebox()); - theme->set_stylebox("custom_button_hover", "Tree", style_widget); - theme->set_color("custom_button_font_highlight", "Tree", font_hover_color); - theme->set_color("font_color", "Tree", font_color); - theme->set_color("font_selected_color", "Tree", mono_color); - theme->set_color("font_disabled_color", "Tree", font_disabled_color); - theme->set_color("font_outline_color", "Tree", font_outline_color); - theme->set_color("title_button_color", "Tree", font_color); - theme->set_color("drop_position_color", "Tree", accent_color); - theme->set_constant("v_separation", "Tree", widget_default_margin.y - EDSCALE); - theme->set_constant("h_separation", "Tree", 6 * EDSCALE); - theme->set_constant("guide_width", "Tree", border_width); - theme->set_constant("item_margin", "Tree", 3 * default_margin_size * EDSCALE); - theme->set_constant("inner_item_margin_bottom", "Tree", (default_margin_size + extra_spacing) * EDSCALE); - theme->set_constant("inner_item_margin_left", "Tree", (default_margin_size + extra_spacing) * EDSCALE); - theme->set_constant("inner_item_margin_right", "Tree", (default_margin_size + extra_spacing) * EDSCALE); - theme->set_constant("inner_item_margin_top", "Tree", (default_margin_size + extra_spacing) * EDSCALE); - theme->set_constant("button_margin", "Tree", default_margin_size * EDSCALE); - theme->set_constant("scroll_border", "Tree", 40 * EDSCALE); - theme->set_constant("scroll_speed", "Tree", 12); - theme->set_constant("outline_size", "Tree", 0); - theme->set_constant("scrollbar_margin_left", "Tree", 0); - theme->set_constant("scrollbar_margin_top", "Tree", 0); - theme->set_constant("scrollbar_margin_right", "Tree", 0); - theme->set_constant("scrollbar_margin_bottom", "Tree", 0); - theme->set_constant("scrollbar_h_separation", "Tree", 1 * EDSCALE); - theme->set_constant("scrollbar_v_separation", "Tree", 1 * EDSCALE); - - const Color guide_color = mono_color * Color(1, 1, 1, 0.05); - Color relationship_line_color = mono_color * Color(1, 1, 1, relationship_line_opacity); - - theme->set_constant("draw_guides", "Tree", relationship_line_opacity < 0.01); - theme->set_color("guide_color", "Tree", guide_color); - - int relationship_line_width = 1; - Color parent_line_color = mono_color * Color(1, 1, 1, CLAMP(relationship_line_opacity + 0.45, 0.0, 1.0)); - Color children_line_color = mono_color * Color(1, 1, 1, CLAMP(relationship_line_opacity + 0.25, 0.0, 1.0)); - theme->set_constant("draw_relationship_lines", "Tree", relationship_line_opacity >= 0.01); - theme->set_constant("relationship_line_width", "Tree", relationship_line_width); - theme->set_constant("parent_hl_line_width", "Tree", relationship_line_width * 2); - theme->set_constant("children_hl_line_width", "Tree", relationship_line_width); - theme->set_constant("parent_hl_line_margin", "Tree", relationship_line_width * 3); - theme->set_color("relationship_line_color", "Tree", relationship_line_color); - theme->set_color("parent_hl_line_color", "Tree", parent_line_color); - theme->set_color("children_hl_line_color", "Tree", children_line_color); - - Ref<StyleBoxFlat> style_tree_btn = style_default->duplicate(); - style_tree_btn->set_bg_color(highlight_color); - style_tree_btn->set_border_width_all(0); - theme->set_stylebox("button_pressed", "Tree", style_tree_btn); - - Ref<StyleBoxFlat> style_tree_hover = style_default->duplicate(); - style_tree_hover->set_bg_color(highlight_color * Color(1, 1, 1, 0.4)); - style_tree_hover->set_border_width_all(0); - theme->set_stylebox("hover", "Tree", style_tree_hover); - - Ref<StyleBoxFlat> style_tree_focus = style_default->duplicate(); - style_tree_focus->set_bg_color(highlight_color); - style_tree_focus->set_border_width_all(0); - theme->set_stylebox("selected_focus", "Tree", style_tree_focus); - - Ref<StyleBoxFlat> style_tree_selected = style_tree_focus->duplicate(); - theme->set_stylebox("selected", "Tree", style_tree_selected); - - Ref<StyleBoxFlat> style_tree_cursor = style_default->duplicate(); - style_tree_cursor->set_draw_center(false); - style_tree_cursor->set_border_width_all(MAX(1, border_width)); - style_tree_cursor->set_border_color(contrast_color_1); - - Ref<StyleBoxFlat> style_tree_title = style_default->duplicate(); - style_tree_title->set_bg_color(dark_color_3); - style_tree_title->set_border_width_all(0); - theme->set_stylebox("cursor", "Tree", style_tree_cursor); - theme->set_stylebox("cursor_unfocused", "Tree", style_tree_cursor); - theme->set_stylebox("title_button_normal", "Tree", style_tree_title); - theme->set_stylebox("title_button_hover", "Tree", style_tree_title); - theme->set_stylebox("title_button_pressed", "Tree", style_tree_title); - - Color prop_category_color = dark_color_1.lerp(mono_color, 0.12); - Color prop_section_color = dark_color_1.lerp(mono_color, 0.09); - Color prop_subsection_color = dark_color_1.lerp(mono_color, 0.06); - theme->set_color("prop_category", EditorStringName(Editor), prop_category_color); - theme->set_color("prop_section", EditorStringName(Editor), prop_section_color); - theme->set_color("prop_subsection", EditorStringName(Editor), prop_subsection_color); - theme->set_color("drop_position_color", "Tree", accent_color); - - // EditorInspectorCategory - Ref<StyleBoxFlat> category_bg = style_default->duplicate(); - category_bg->set_bg_color(prop_category_color); - category_bg->set_border_color(prop_category_color); - theme->set_stylebox("bg", "EditorInspectorCategory", category_bg); - - // ItemList - Ref<StyleBoxFlat> style_itemlist_bg = style_default->duplicate(); - style_itemlist_bg->set_bg_color(dark_color_1); - - if (draw_extra_borders) { - style_itemlist_bg->set_border_width_all(Math::round(EDSCALE)); - style_itemlist_bg->set_border_color(extra_border_color_2); - } else { - style_itemlist_bg->set_border_width_all(border_width); - style_itemlist_bg->set_border_color(dark_color_3); - } - - Ref<StyleBoxFlat> style_itemlist_cursor = style_default->duplicate(); - style_itemlist_cursor->set_draw_center(false); - style_itemlist_cursor->set_border_width_all(border_width); - style_itemlist_cursor->set_border_color(highlight_color); - - Ref<StyleBoxFlat> style_itemlist_hover = style_tree_selected->duplicate(); - style_itemlist_hover->set_bg_color(highlight_color * Color(1, 1, 1, 0.3)); - style_itemlist_hover->set_border_width_all(0); - - theme->set_stylebox("panel", "ItemList", style_itemlist_bg); - theme->set_stylebox("focus", "ItemList", style_widget_focus); - theme->set_stylebox("cursor", "ItemList", style_itemlist_cursor); - theme->set_stylebox("cursor_unfocused", "ItemList", style_itemlist_cursor); - theme->set_stylebox("selected_focus", "ItemList", style_tree_focus); - theme->set_stylebox("selected", "ItemList", style_tree_selected); - theme->set_stylebox("hovered", "ItemList", style_itemlist_hover); - theme->set_color("font_color", "ItemList", font_color); - theme->set_color("font_hovered_color", "ItemList", mono_color); - theme->set_color("font_selected_color", "ItemList", mono_color); - theme->set_color("font_outline_color", "ItemList", font_outline_color); - theme->set_color("guide_color", "ItemList", guide_color); - theme->set_constant("v_separation", "ItemList", force_even_vsep * 0.5 * EDSCALE); - theme->set_constant("h_separation", "ItemList", 6 * EDSCALE); - theme->set_constant("icon_margin", "ItemList", 6 * EDSCALE); - theme->set_constant("line_separation", "ItemList", 3 * EDSCALE); - theme->set_constant("outline_size", "ItemList", 0); - - // TabBar & TabContainer - Ref<StyleBoxFlat> style_tabbar_background = make_flat_stylebox(dark_color_1, 0, 0, 0, 0, corner_radius * EDSCALE); - style_tabbar_background->set_corner_radius(CORNER_BOTTOM_LEFT, 0); - style_tabbar_background->set_corner_radius(CORNER_BOTTOM_RIGHT, 0); - theme->set_stylebox("tabbar_background", "TabContainer", style_tabbar_background); - - theme->set_stylebox("tab_selected", "TabContainer", style_tab_selected); - theme->set_stylebox("tab_hovered", "TabContainer", style_tab_hovered); - theme->set_stylebox("tab_unselected", "TabContainer", style_tab_unselected); - theme->set_stylebox("tab_disabled", "TabContainer", style_tab_disabled); - theme->set_stylebox("tab_focus", "TabContainer", style_tab_focus); - theme->set_stylebox("tab_selected", "TabBar", style_tab_selected); - theme->set_stylebox("tab_hovered", "TabBar", style_tab_hovered); - theme->set_stylebox("tab_unselected", "TabBar", style_tab_unselected); - theme->set_stylebox("tab_disabled", "TabBar", style_tab_disabled); - theme->set_stylebox("tab_focus", "TabBar", style_tab_focus); - theme->set_stylebox("button_pressed", "TabBar", style_menu); - theme->set_stylebox("button_highlight", "TabBar", style_menu); - theme->set_color("font_selected_color", "TabContainer", font_color); - theme->set_color("font_hovered_color", "TabContainer", font_color); - theme->set_color("font_unselected_color", "TabContainer", font_disabled_color); - theme->set_color("font_outline_color", "TabContainer", font_outline_color); - theme->set_color("font_selected_color", "TabBar", font_color); - theme->set_color("font_hovered_color", "TabBar", font_color); - theme->set_color("font_unselected_color", "TabBar", font_disabled_color); - theme->set_color("font_outline_color", "TabBar", font_outline_color); - theme->set_color("drop_mark_color", "TabContainer", tab_highlight); - theme->set_color("drop_mark_color", "TabBar", tab_highlight); - theme->set_icon("menu", "TabContainer", theme->get_icon(SNAME("GuiTabMenu"), EditorStringName(EditorIcons))); - theme->set_icon("menu_highlight", "TabContainer", theme->get_icon(SNAME("GuiTabMenuHl"), EditorStringName(EditorIcons))); - theme->set_icon("close", "TabBar", theme->get_icon(SNAME("GuiClose"), EditorStringName(EditorIcons))); - theme->set_icon("increment", "TabContainer", theme->get_icon(SNAME("GuiScrollArrowRight"), EditorStringName(EditorIcons))); - theme->set_icon("decrement", "TabContainer", theme->get_icon(SNAME("GuiScrollArrowLeft"), EditorStringName(EditorIcons))); - theme->set_icon("increment", "TabBar", theme->get_icon(SNAME("GuiScrollArrowRight"), EditorStringName(EditorIcons))); - theme->set_icon("decrement", "TabBar", theme->get_icon(SNAME("GuiScrollArrowLeft"), EditorStringName(EditorIcons))); - theme->set_icon("increment_highlight", "TabBar", theme->get_icon(SNAME("GuiScrollArrowRightHl"), EditorStringName(EditorIcons))); - theme->set_icon("decrement_highlight", "TabBar", theme->get_icon(SNAME("GuiScrollArrowLeftHl"), EditorStringName(EditorIcons))); - theme->set_icon("increment_highlight", "TabContainer", theme->get_icon(SNAME("GuiScrollArrowRightHl"), EditorStringName(EditorIcons))); - theme->set_icon("decrement_highlight", "TabContainer", theme->get_icon(SNAME("GuiScrollArrowLeftHl"), EditorStringName(EditorIcons))); - theme->set_icon("drop_mark", "TabContainer", theme->get_icon(SNAME("GuiTabDropMark"), EditorStringName(EditorIcons))); - theme->set_icon("drop_mark", "TabBar", theme->get_icon(SNAME("GuiTabDropMark"), EditorStringName(EditorIcons))); - theme->set_constant("side_margin", "TabContainer", 0); - theme->set_constant("outline_size", "TabContainer", 0); - theme->set_constant("h_separation", "TabBar", 4 * EDSCALE); - theme->set_constant("outline_size", "TabBar", 0); - - // Content of each tab. - Ref<StyleBoxFlat> style_content_panel = style_default->duplicate(); - style_content_panel->set_border_color(dark_color_3); - style_content_panel->set_border_width_all(border_width); - style_content_panel->set_border_width(Side::SIDE_TOP, 0); - style_content_panel->set_corner_radius(CORNER_TOP_LEFT, 0); - style_content_panel->set_corner_radius(CORNER_TOP_RIGHT, 0); - // Compensate for the border. - style_content_panel->set_content_margin_individual(margin_size_extra * EDSCALE, (2 + margin_size_extra) * EDSCALE, margin_size_extra * EDSCALE, margin_size_extra * EDSCALE); - theme->set_stylebox("panel", "TabContainer", style_content_panel); - - // Bottom panel. - Ref<StyleBoxFlat> style_bottom_panel = style_content_panel->duplicate(); - style_bottom_panel->set_corner_radius_all(corner_radius * EDSCALE); - theme->set_stylebox("BottomPanel", EditorStringName(EditorStyles), style_bottom_panel); - - // TabContainerOdd can be used on tabs against the base color background (e.g. nested tabs). - theme->set_type_variation("TabContainerOdd", "TabContainer"); - - Ref<StyleBoxFlat> style_tab_selected_odd = style_tab_selected->duplicate(); - style_tab_selected_odd->set_bg_color(disabled_bg_color); - theme->set_stylebox("tab_selected", "TabContainerOdd", style_tab_selected_odd); - - Ref<StyleBoxFlat> style_content_panel_odd = style_content_panel->duplicate(); - style_content_panel_odd->set_bg_color(disabled_bg_color); - theme->set_stylebox("panel", "TabContainerOdd", style_content_panel_odd); - - // This stylebox is used in 3d and 2d viewports (no borders). - Ref<StyleBoxFlat> style_content_panel_vp = style_content_panel->duplicate(); - style_content_panel_vp->set_content_margin_individual(border_width * 2, default_margin_size * EDSCALE, border_width * 2, border_width * 2); - theme->set_stylebox("Content", EditorStringName(EditorStyles), style_content_panel_vp); - - // This stylebox is used by preview tabs in the Theme Editor. - Ref<StyleBoxFlat> style_theme_preview_tab = style_tab_selected_odd->duplicate(); - style_theme_preview_tab->set_expand_margin(SIDE_BOTTOM, 5 * EDSCALE); - theme->set_stylebox("ThemeEditorPreviewFG", EditorStringName(EditorStyles), style_theme_preview_tab); - Ref<StyleBoxFlat> style_theme_preview_bg_tab = style_tab_unselected->duplicate(); - style_theme_preview_bg_tab->set_expand_margin(SIDE_BOTTOM, 2 * EDSCALE); - theme->set_stylebox("ThemeEditorPreviewBG", EditorStringName(EditorStyles), style_theme_preview_bg_tab); - - Ref<StyleBoxFlat> style_texture_region_bg = style_tree_bg->duplicate(); - style_texture_region_bg->set_content_margin_all(0); - theme->set_stylebox("TextureRegionPreviewBG", EditorStringName(EditorStyles), style_texture_region_bg); - theme->set_stylebox("TextureRegionPreviewFG", EditorStringName(EditorStyles), make_empty_stylebox(0, 0, 0, 0)); - - // Separators - theme->set_stylebox("separator", "HSeparator", make_line_stylebox(separator_color, MAX(Math::round(EDSCALE), border_width))); - theme->set_stylebox("separator", "VSeparator", make_line_stylebox(separator_color, MAX(Math::round(EDSCALE), border_width), 0, 0, true)); - - // Debugger - - Ref<StyleBoxFlat> style_panel_debugger = style_content_panel->duplicate(); - style_panel_debugger->set_border_width(SIDE_BOTTOM, 0); - theme->set_stylebox("DebuggerPanel", EditorStringName(EditorStyles), style_panel_debugger); - - Ref<StyleBoxFlat> style_panel_invisible_top = style_content_panel->duplicate(); - int stylebox_offset = theme->get_font(SNAME("tab_selected"), SNAME("TabContainer"))->get_height(theme->get_font_size(SNAME("tab_selected"), SNAME("TabContainer"))) + theme->get_stylebox(SNAME("tab_selected"), SNAME("TabContainer"))->get_minimum_size().height + theme->get_stylebox(SNAME("panel"), SNAME("TabContainer"))->get_content_margin(SIDE_TOP); - style_panel_invisible_top->set_expand_margin(SIDE_TOP, -stylebox_offset); - style_panel_invisible_top->set_content_margin(SIDE_TOP, 0); - theme->set_stylebox("BottomPanelDebuggerOverride", EditorStringName(EditorStyles), style_panel_invisible_top); - - // LineEdit - - Ref<StyleBoxFlat> style_line_edit = style_widget->duplicate(); - // The original style_widget style has an extra 1 pixel offset that makes LineEdits not align with Buttons, - // so this compensates for that. - style_line_edit->set_content_margin(SIDE_TOP, style_line_edit->get_content_margin(SIDE_TOP) - 1 * EDSCALE); - - // Don't round the bottom corners to make the line look sharper. - style_line_edit->set_corner_radius(CORNER_BOTTOM_LEFT, 0); - style_line_edit->set_corner_radius(CORNER_BOTTOM_RIGHT, 0); - - if (draw_extra_borders) { - style_line_edit->set_border_width_all(Math::round(EDSCALE)); - style_line_edit->set_border_color(extra_border_color_1); - } else { - // Add a bottom line to make LineEdits more visible, especially in sectioned inspectors - // such as the Project Settings. - style_line_edit->set_border_width(SIDE_BOTTOM, Math::round(2 * EDSCALE)); - style_line_edit->set_border_color(dark_color_2); - } - - Ref<StyleBoxFlat> style_line_edit_disabled = style_line_edit->duplicate(); - style_line_edit_disabled->set_border_color(disabled_color); - style_line_edit_disabled->set_bg_color(disabled_bg_color); - - theme->set_stylebox("normal", "LineEdit", style_line_edit); - theme->set_stylebox("focus", "LineEdit", style_widget_focus); - theme->set_stylebox("read_only", "LineEdit", style_line_edit_disabled); - theme->set_icon("clear", "LineEdit", theme->get_icon(SNAME("GuiClose"), EditorStringName(EditorIcons))); - theme->set_color("font_color", "LineEdit", font_color); - theme->set_color("font_selected_color", "LineEdit", mono_color); - theme->set_color("font_uneditable_color", "LineEdit", font_readonly_color); - theme->set_color("font_placeholder_color", "LineEdit", font_placeholder_color); - theme->set_color("font_outline_color", "LineEdit", font_outline_color); - theme->set_color("caret_color", "LineEdit", font_color); - theme->set_color("selection_color", "LineEdit", selection_color); - theme->set_color("clear_button_color", "LineEdit", font_color); - theme->set_color("clear_button_color_pressed", "LineEdit", accent_color); - - theme->set_constant("minimum_character_width", "LineEdit", 4); - theme->set_constant("outline_size", "LineEdit", 0); - theme->set_constant("caret_width", "LineEdit", 1); - - // TextEdit - theme->set_stylebox("normal", "TextEdit", style_line_edit); - theme->set_stylebox("focus", "TextEdit", style_widget_focus); - theme->set_stylebox("read_only", "TextEdit", style_line_edit_disabled); - theme->set_icon("tab", "TextEdit", theme->get_icon(SNAME("GuiTab"), EditorStringName(EditorIcons))); - theme->set_icon("space", "TextEdit", theme->get_icon(SNAME("GuiSpace"), EditorStringName(EditorIcons))); - theme->set_color("font_color", "TextEdit", font_color); - theme->set_color("font_readonly_color", "TextEdit", font_readonly_color); - theme->set_color("font_placeholder_color", "TextEdit", font_placeholder_color); - theme->set_color("font_outline_color", "TextEdit", font_outline_color); - theme->set_color("caret_color", "TextEdit", font_color); - theme->set_color("selection_color", "TextEdit", selection_color); - theme->set_color("background_color", "TextEdit", Color(0, 0, 0, 0)); - - theme->set_constant("line_spacing", "TextEdit", 4 * EDSCALE); - theme->set_constant("outline_size", "TextEdit", 0); - theme->set_constant("caret_width", "TextEdit", 1); - - theme->set_icon("h_grabber", "SplitContainer", theme->get_icon(SNAME("GuiHsplitter"), EditorStringName(EditorIcons))); - theme->set_icon("v_grabber", "SplitContainer", theme->get_icon(SNAME("GuiVsplitter"), EditorStringName(EditorIcons))); - theme->set_icon("grabber", "VSplitContainer", theme->get_icon(SNAME("GuiVsplitter"), EditorStringName(EditorIcons))); - theme->set_icon("grabber", "HSplitContainer", theme->get_icon(SNAME("GuiHsplitter"), EditorStringName(EditorIcons))); - - theme->set_constant("separation", "SplitContainer", default_margin_size * 2 * EDSCALE); - theme->set_constant("separation", "HSplitContainer", default_margin_size * 2 * EDSCALE); - theme->set_constant("separation", "VSplitContainer", default_margin_size * 2 * EDSCALE); - - theme->set_constant("minimum_grab_thickness", "SplitContainer", 6 * EDSCALE); - theme->set_constant("minimum_grab_thickness", "HSplitContainer", 6 * EDSCALE); - theme->set_constant("minimum_grab_thickness", "VSplitContainer", 6 * EDSCALE); - - // Containers - theme->set_constant("separation", "BoxContainer", default_margin_size * EDSCALE); - theme->set_constant("separation", "HBoxContainer", default_margin_size * EDSCALE); - theme->set_constant("separation", "VBoxContainer", default_margin_size * EDSCALE); - theme->set_constant("margin_left", "MarginContainer", 0); - theme->set_constant("margin_top", "MarginContainer", 0); - theme->set_constant("margin_right", "MarginContainer", 0); - theme->set_constant("margin_bottom", "MarginContainer", 0); - theme->set_constant("h_separation", "GridContainer", default_margin_size * EDSCALE); - theme->set_constant("v_separation", "GridContainer", default_margin_size * EDSCALE); - theme->set_constant("h_separation", "FlowContainer", default_margin_size * EDSCALE); - theme->set_constant("v_separation", "FlowContainer", default_margin_size * EDSCALE); - theme->set_constant("h_separation", "HFlowContainer", default_margin_size * EDSCALE); - theme->set_constant("v_separation", "HFlowContainer", default_margin_size * EDSCALE); - theme->set_constant("h_separation", "VFlowContainer", default_margin_size * EDSCALE); - theme->set_constant("v_separation", "VFlowContainer", default_margin_size * EDSCALE); - - // Custom theme type for MarginContainer with 4px margins. - theme->set_type_variation("MarginContainer4px", "MarginContainer"); - theme->set_constant("margin_left", "MarginContainer4px", 4 * EDSCALE); - theme->set_constant("margin_top", "MarginContainer4px", 4 * EDSCALE); - theme->set_constant("margin_right", "MarginContainer4px", 4 * EDSCALE); - theme->set_constant("margin_bottom", "MarginContainer4px", 4 * EDSCALE); - - // Window - - // Prevent corner artifacts between window title and body. - Ref<StyleBoxFlat> style_window_title = style_default->duplicate(); - style_window_title->set_corner_radius(CORNER_TOP_LEFT, 0); - style_window_title->set_corner_radius(CORNER_TOP_RIGHT, 0); - // Prevent visible line between window title and body. - style_window_title->set_expand_margin(SIDE_BOTTOM, 2 * EDSCALE); - - Ref<StyleBoxFlat> style_window = style_popup->duplicate(); - style_window->set_border_color(base_color); - style_window->set_border_width(SIDE_TOP, 24 * EDSCALE); - style_window->set_expand_margin(SIDE_TOP, 24 * EDSCALE); - theme->set_stylebox("embedded_border", "Window", style_window); - theme->set_stylebox("embedded_unfocused_border", "Window", style_window); - - theme->set_color("title_color", "Window", font_color); - theme->set_icon("close", "Window", theme->get_icon(SNAME("GuiClose"), EditorStringName(EditorIcons))); - theme->set_icon("close_pressed", "Window", theme->get_icon(SNAME("GuiClose"), EditorStringName(EditorIcons))); - theme->set_constant("close_h_offset", "Window", 22 * EDSCALE); - theme->set_constant("close_v_offset", "Window", 20 * EDSCALE); - theme->set_constant("title_height", "Window", 24 * EDSCALE); - theme->set_constant("resize_margin", "Window", 4 * EDSCALE); - theme->set_font("title_font", "Window", theme->get_font(SNAME("title"), EditorStringName(EditorFonts))); - theme->set_font_size("title_font_size", "Window", theme->get_font_size(SNAME("title_size"), EditorStringName(EditorFonts))); - - // Complex window (currently only Editor Settings and Project Settings) - Ref<StyleBoxFlat> style_complex_window = style_window->duplicate(); - style_complex_window->set_bg_color(dark_color_2); - style_complex_window->set_border_color(dark_color_2); - theme->set_stylebox("panel", "EditorSettingsDialog", style_complex_window); - theme->set_stylebox("panel", "ProjectSettingsEditor", style_complex_window); - theme->set_stylebox("panel", "EditorAbout", style_complex_window); - - // AcceptDialog - theme->set_stylebox("panel", "AcceptDialog", style_window_title); - theme->set_constant("buttons_separation", "AcceptDialog", 8 * EDSCALE); - - // HScrollBar - Ref<Texture2D> empty_icon = memnew(ImageTexture); - - if (increase_scrollbar_touch_area) { - theme->set_stylebox("scroll", "HScrollBar", make_line_stylebox(separator_color, 50)); - } else { - theme->set_stylebox("scroll", "HScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), EditorStringName(EditorIcons)), 5, 5, 5, 5, -5, 1, -5, 1)); - } - theme->set_stylebox("scroll_focus", "HScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), EditorStringName(EditorIcons)), 5, 5, 5, 5, 1, 1, 1, 1)); - theme->set_stylebox("grabber", "HScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabber"), EditorStringName(EditorIcons)), 6, 6, 6, 6, 1, 1, 1, 1)); - theme->set_stylebox("grabber_highlight", "HScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberHl"), EditorStringName(EditorIcons)), 5, 5, 5, 5, 1, 1, 1, 1)); - theme->set_stylebox("grabber_pressed", "HScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberPressed"), EditorStringName(EditorIcons)), 6, 6, 6, 6, 1, 1, 1, 1)); - - theme->set_icon("increment", "HScrollBar", empty_icon); - theme->set_icon("increment_highlight", "HScrollBar", empty_icon); - theme->set_icon("increment_pressed", "HScrollBar", empty_icon); - theme->set_icon("decrement", "HScrollBar", empty_icon); - theme->set_icon("decrement_highlight", "HScrollBar", empty_icon); - theme->set_icon("decrement_pressed", "HScrollBar", empty_icon); - - // VScrollBar - if (increase_scrollbar_touch_area) { - theme->set_stylebox("scroll", "VScrollBar", make_line_stylebox(separator_color, 50, 1, 1, true)); - } else { - theme->set_stylebox("scroll", "VScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), EditorStringName(EditorIcons)), 5, 5, 5, 5, 1, -5, 1, -5)); - } - theme->set_stylebox("scroll_focus", "VScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), EditorStringName(EditorIcons)), 5, 5, 5, 5, 1, 1, 1, 1)); - theme->set_stylebox("grabber", "VScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabber"), EditorStringName(EditorIcons)), 6, 6, 6, 6, 1, 1, 1, 1)); - theme->set_stylebox("grabber_highlight", "VScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberHl"), EditorStringName(EditorIcons)), 5, 5, 5, 5, 1, 1, 1, 1)); - theme->set_stylebox("grabber_pressed", "VScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberPressed"), EditorStringName(EditorIcons)), 6, 6, 6, 6, 1, 1, 1, 1)); - - theme->set_icon("increment", "VScrollBar", empty_icon); - theme->set_icon("increment_highlight", "VScrollBar", empty_icon); - theme->set_icon("increment_pressed", "VScrollBar", empty_icon); - theme->set_icon("decrement", "VScrollBar", empty_icon); - theme->set_icon("decrement_highlight", "VScrollBar", empty_icon); - theme->set_icon("decrement_pressed", "VScrollBar", empty_icon); - - // HSlider - theme->set_icon("grabber_highlight", "HSlider", theme->get_icon(SNAME("GuiSliderGrabberHl"), EditorStringName(EditorIcons))); - theme->set_icon("grabber", "HSlider", theme->get_icon(SNAME("GuiSliderGrabber"), EditorStringName(EditorIcons))); - theme->set_stylebox("slider", "HSlider", make_flat_stylebox(dark_color_3, 0, default_margin_size / 2, 0, default_margin_size / 2, corner_width)); - theme->set_stylebox("grabber_area", "HSlider", make_flat_stylebox(contrast_color_1, 0, default_margin_size / 2, 0, default_margin_size / 2, corner_width)); - theme->set_stylebox("grabber_area_highlight", "HSlider", make_flat_stylebox(contrast_color_1, 0, default_margin_size / 2, 0, default_margin_size / 2)); - theme->set_constant("center_grabber", "HSlider", 0); - theme->set_constant("grabber_offset", "HSlider", 0); - - // VSlider - theme->set_icon("grabber", "VSlider", theme->get_icon(SNAME("GuiSliderGrabber"), EditorStringName(EditorIcons))); - theme->set_icon("grabber_highlight", "VSlider", theme->get_icon(SNAME("GuiSliderGrabberHl"), EditorStringName(EditorIcons))); - theme->set_stylebox("slider", "VSlider", make_flat_stylebox(dark_color_3, default_margin_size / 2, 0, default_margin_size / 2, 0, corner_width)); - theme->set_stylebox("grabber_area", "VSlider", make_flat_stylebox(contrast_color_1, default_margin_size / 2, 0, default_margin_size / 2, 0, corner_width)); - theme->set_stylebox("grabber_area_highlight", "VSlider", make_flat_stylebox(contrast_color_1, default_margin_size / 2, 0, default_margin_size / 2, 0)); - theme->set_constant("center_grabber", "VSlider", 0); - theme->set_constant("grabber_offset", "VSlider", 0); - - // RichTextLabel - theme->set_color("default_color", "RichTextLabel", font_color); - theme->set_color("font_shadow_color", "RichTextLabel", Color(0, 0, 0, 0)); - theme->set_color("font_outline_color", "RichTextLabel", font_outline_color); - theme->set_color("selection_color", "RichTextLabel", selection_color); - theme->set_constant("shadow_offset_x", "RichTextLabel", 1 * EDSCALE); - theme->set_constant("shadow_offset_y", "RichTextLabel", 1 * EDSCALE); - theme->set_constant("shadow_outline_size", "RichTextLabel", 1 * EDSCALE); - theme->set_constant("outline_size", "RichTextLabel", 0); - theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox()); - theme->set_stylebox("normal", "RichTextLabel", style_tree_bg); - - // Editor help. - Ref<StyleBoxFlat> style_editor_help = style_default->duplicate(); - style_editor_help->set_bg_color(dark_color_2); - style_editor_help->set_border_color(dark_color_3); - theme->set_stylebox("background", "EditorHelp", style_editor_help); - - theme->set_color("title_color", "EditorHelp", accent_color); - theme->set_color("headline_color", "EditorHelp", mono_color); - theme->set_color("text_color", "EditorHelp", font_color); - theme->set_color("comment_color", "EditorHelp", font_color * Color(1, 1, 1, 0.6)); - theme->set_color("symbol_color", "EditorHelp", font_color * Color(1, 1, 1, 0.6)); - theme->set_color("value_color", "EditorHelp", font_color * Color(1, 1, 1, 0.6)); - theme->set_color("qualifier_color", "EditorHelp", font_color * Color(1, 1, 1, 0.8)); - theme->set_color("type_color", "EditorHelp", accent_color.lerp(font_color, 0.5)); - theme->set_color("selection_color", "EditorHelp", selection_color); - theme->set_color("link_color", "EditorHelp", accent_color.lerp(mono_color, 0.8)); - theme->set_color("code_color", "EditorHelp", accent_color.lerp(mono_color, 0.6)); - theme->set_color("kbd_color", "EditorHelp", accent_color.lerp(property_color, 0.6)); - theme->set_color("code_bg_color", "EditorHelp", dark_color_3); - theme->set_color("kbd_bg_color", "EditorHelp", dark_color_1); - theme->set_color("param_bg_color", "EditorHelp", dark_color_1); - theme->set_constant("line_separation", "EditorHelp", Math::round(6 * EDSCALE)); - theme->set_constant("table_h_separation", "EditorHelp", 16 * EDSCALE); - theme->set_constant("table_v_separation", "EditorHelp", 6 * EDSCALE); - theme->set_constant("text_highlight_h_padding", "EditorHelp", 1 * EDSCALE); - theme->set_constant("text_highlight_v_padding", "EditorHelp", 2 * EDSCALE); - - // Panel - theme->set_stylebox("panel", "Panel", make_flat_stylebox(dark_color_1, 6, 4, 6, 4, corner_width)); - theme->set_stylebox("PanelForeground", EditorStringName(EditorStyles), style_default); - - // Label - theme->set_stylebox("normal", "Label", style_empty); - theme->set_color("font_color", "Label", font_color); - theme->set_color("font_shadow_color", "Label", Color(0, 0, 0, 0)); - theme->set_color("font_outline_color", "Label", font_outline_color); - theme->set_constant("shadow_offset_x", "Label", 1 * EDSCALE); - theme->set_constant("shadow_offset_y", "Label", 1 * EDSCALE); - theme->set_constant("shadow_outline_size", "Label", 1 * EDSCALE); - theme->set_constant("line_spacing", "Label", 3 * EDSCALE); - theme->set_constant("outline_size", "Label", 0); - - // LinkButton - theme->set_stylebox("focus", "LinkButton", style_empty); - theme->set_color("font_color", "LinkButton", font_color); - theme->set_color("font_hover_color", "LinkButton", font_hover_color); - theme->set_color("font_hover_pressed_color", "LinkButton", font_hover_pressed_color); - theme->set_color("font_focus_color", "LinkButton", font_focus_color); - theme->set_color("font_pressed_color", "LinkButton", accent_color); - theme->set_color("font_disabled_color", "LinkButton", font_disabled_color); - theme->set_color("font_outline_color", "LinkButton", font_outline_color); - - theme->set_constant("outline_size", "LinkButton", 0); - - theme->set_type_variation("HeaderSmallLink", "LinkButton"); - theme->set_font("font", "HeaderSmallLink", theme->get_font(SNAME("font"), SNAME("HeaderSmall"))); - theme->set_font_size("font_size", "HeaderSmallLink", theme->get_font_size(SNAME("font_size"), SNAME("HeaderSmall"))); - - // TooltipPanel + TooltipLabel - // TooltipPanel is also used for custom tooltips, while TooltipLabel - // is only relevant for default tooltips. - Ref<StyleBoxFlat> style_tooltip = style_popup->duplicate(); - style_tooltip->set_shadow_size(0); - style_tooltip->set_content_margin_all(default_margin_size * EDSCALE * 0.5); - style_tooltip->set_bg_color(dark_color_3 * Color(0.8, 0.8, 0.8, 0.9)); - style_tooltip->set_border_width_all(0); - theme->set_color("font_color", "TooltipLabel", font_hover_color); - theme->set_color("font_shadow_color", "TooltipLabel", Color(0, 0, 0, 0)); - theme->set_stylebox("panel", "TooltipPanel", style_tooltip); - - // PopupPanel - theme->set_stylebox("panel", "PopupPanel", style_popup); - - Ref<StyleBoxFlat> control_editor_popup_style = style_popup->duplicate(); - control_editor_popup_style->set_shadow_size(0); - control_editor_popup_style->set_content_margin(SIDE_LEFT, default_margin_size * EDSCALE); - control_editor_popup_style->set_content_margin(SIDE_TOP, default_margin_size * EDSCALE); - control_editor_popup_style->set_content_margin(SIDE_RIGHT, default_margin_size * EDSCALE); - control_editor_popup_style->set_content_margin(SIDE_BOTTOM, default_margin_size * EDSCALE); - control_editor_popup_style->set_border_width_all(0); - - theme->set_stylebox("panel", "ControlEditorPopupPanel", control_editor_popup_style); - theme->set_type_variation("ControlEditorPopupPanel", "PopupPanel"); - - // SpinBox - theme->set_icon("updown", "SpinBox", theme->get_icon(SNAME("GuiSpinboxUpdown"), EditorStringName(EditorIcons))); - theme->set_icon("updown_disabled", "SpinBox", theme->get_icon(SNAME("GuiSpinboxUpdownDisabled"), EditorStringName(EditorIcons))); - - // ProgressBar - theme->set_stylebox("background", "ProgressBar", make_stylebox(theme->get_icon(SNAME("GuiProgressBar"), EditorStringName(EditorIcons)), 4, 4, 4, 4, 0, 0, 0, 0)); - theme->set_stylebox("fill", "ProgressBar", make_stylebox(theme->get_icon(SNAME("GuiProgressFill"), EditorStringName(EditorIcons)), 6, 6, 6, 6, 2, 1, 2, 1)); - theme->set_color("font_color", "ProgressBar", font_color); - theme->set_color("font_outline_color", "ProgressBar", font_outline_color); - theme->set_constant("outline_size", "ProgressBar", 0); - - // GraphEdit - theme->set_stylebox("panel", "GraphEdit", style_tree_bg); - Ref<StyleBoxFlat> graph_toolbar_style = make_flat_stylebox(dark_color_1 * Color(1, 1, 1, 0.6), 4, 2, 4, 2, 3); - theme->set_stylebox("menu_panel", "GraphEdit", graph_toolbar_style); - - if (dark_theme) { - theme->set_color("grid_major", "GraphEdit", Color(1.0, 1.0, 1.0, 0.1)); - theme->set_color("grid_minor", "GraphEdit", Color(1.0, 1.0, 1.0, 0.05)); - } else { - theme->set_color("grid_major", "GraphEdit", Color(0.0, 0.0, 0.0, 0.15)); - theme->set_color("grid_minor", "GraphEdit", Color(0.0, 0.0, 0.0, 0.07)); - } - theme->set_color("selection_fill", "GraphEdit", theme->get_color(SNAME("box_selection_fill_color"), EditorStringName(Editor))); - theme->set_color("selection_stroke", "GraphEdit", theme->get_color(SNAME("box_selection_stroke_color"), EditorStringName(Editor))); - theme->set_color("activity", "GraphEdit", accent_color); - - theme->set_icon("zoom_out", "GraphEdit", theme->get_icon(SNAME("ZoomLess"), EditorStringName(EditorIcons))); - theme->set_icon("zoom_in", "GraphEdit", theme->get_icon(SNAME("ZoomMore"), EditorStringName(EditorIcons))); - theme->set_icon("zoom_reset", "GraphEdit", theme->get_icon(SNAME("ZoomReset"), EditorStringName(EditorIcons))); - theme->set_icon("grid_toggle", "GraphEdit", theme->get_icon(SNAME("GridToggle"), EditorStringName(EditorIcons))); - theme->set_icon("minimap_toggle", "GraphEdit", theme->get_icon(SNAME("GridMinimap"), EditorStringName(EditorIcons))); - theme->set_icon("snapping_toggle", "GraphEdit", theme->get_icon(SNAME("SnapGrid"), EditorStringName(EditorIcons))); - theme->set_icon("layout", "GraphEdit", theme->get_icon(SNAME("GridLayout"), EditorStringName(EditorIcons))); - - // GraphEditMinimap - Ref<StyleBoxFlat> style_minimap_bg = make_flat_stylebox(dark_color_1, 0, 0, 0, 0); - style_minimap_bg->set_border_color(dark_color_3); - style_minimap_bg->set_border_width_all(1); - theme->set_stylebox("panel", "GraphEditMinimap", style_minimap_bg); - - Ref<StyleBoxFlat> style_minimap_camera; - Ref<StyleBoxFlat> style_minimap_node; - if (dark_theme) { - style_minimap_camera = make_flat_stylebox(Color(0.65, 0.65, 0.65, 0.2), 0, 0, 0, 0); - style_minimap_camera->set_border_color(Color(0.65, 0.65, 0.65, 0.45)); - style_minimap_node = make_flat_stylebox(Color(1, 1, 1), 0, 0, 0, 0); - } else { - style_minimap_camera = make_flat_stylebox(Color(0.38, 0.38, 0.38, 0.2), 0, 0, 0, 0); - style_minimap_camera->set_border_color(Color(0.38, 0.38, 0.38, 0.45)); - style_minimap_node = make_flat_stylebox(Color(0, 0, 0), 0, 0, 0, 0); - } - style_minimap_camera->set_border_width_all(1); - style_minimap_node->set_anti_aliased(false); - theme->set_stylebox("camera", "GraphEditMinimap", style_minimap_camera); - theme->set_stylebox("node", "GraphEditMinimap", style_minimap_node); - - Color minimap_resizer_color; - if (dark_theme) { - minimap_resizer_color = Color(1, 1, 1, 0.65); - } else { - minimap_resizer_color = Color(0, 0, 0, 0.65); - } - theme->set_icon("resizer", "GraphEditMinimap", theme->get_icon(SNAME("GuiResizerTopLeft"), EditorStringName(EditorIcons))); - theme->set_color("resizer_color", "GraphEditMinimap", minimap_resizer_color); - - // GraphNode - - const int gn_margin_top = 2; - const int gn_margin_side = 2; - const int gn_margin_bottom = 2; - - Color graphnode_bg = dark_color_3; - if (!dark_theme) { - graphnode_bg = prop_section_color; - } - const Color graph_node_selected_border_color = graphnode_bg.lerp(accent_color, 0.275); - - const Color graphnode_frame_bg = graphnode_bg.lerp(style_tree_bg->get_bg_color(), 0.3); - - Ref<StyleBoxFlat> graphn_sb_panel = make_flat_stylebox(graphnode_frame_bg, gn_margin_side, gn_margin_top, gn_margin_side, gn_margin_bottom, corner_width); - graphn_sb_panel->set_border_width_all(border_width); - graphn_sb_panel->set_border_color(graphnode_bg); - graphn_sb_panel->set_corner_radius_individual(0, 0, corner_radius * EDSCALE, corner_radius * EDSCALE); - graphn_sb_panel->set_expand_margin(SIDE_TOP, 17 * EDSCALE); - - Ref<StyleBoxFlat> graphn_sb_panel_selected = make_flat_stylebox(graphnode_frame_bg, gn_margin_side, gn_margin_top, gn_margin_side, gn_margin_bottom, corner_width); - graphn_sb_panel_selected->set_border_width_all(2 * EDSCALE + border_width); - graphn_sb_panel_selected->set_border_color(graph_node_selected_border_color); - graphn_sb_panel_selected->set_corner_radius_individual(0, 0, corner_radius * EDSCALE, corner_radius * EDSCALE); - graphn_sb_panel_selected->set_expand_margin(SIDE_TOP, 17 * EDSCALE); - - const int gn_titlebar_margin_left = 12; - const int gn_titlebar_margin_right = 4; // The rest is for the close button. - Ref<StyleBoxFlat> graphn_sb_titlebar = make_flat_stylebox(graphnode_bg, gn_titlebar_margin_left, gn_margin_top, gn_titlebar_margin_right, 0, corner_width); - graphn_sb_titlebar->set_expand_margin(SIDE_TOP, 2 * EDSCALE); - graphn_sb_titlebar->set_corner_radius_individual(corner_radius * EDSCALE, corner_radius * EDSCALE, 0, 0); - - Ref<StyleBoxFlat> graphn_sb_titlebar_selected = make_flat_stylebox(graph_node_selected_border_color, gn_titlebar_margin_left, gn_margin_top, gn_titlebar_margin_right, 0, corner_width); - graphn_sb_titlebar_selected->set_corner_radius_individual(corner_radius * EDSCALE, corner_radius * EDSCALE, 0, 0); - graphn_sb_titlebar_selected->set_expand_margin(SIDE_TOP, 2 * EDSCALE); - Ref<StyleBoxEmpty> graphn_sb_slot = make_empty_stylebox(12, 0, 12, 0); - - theme->set_stylebox("panel", "GraphElement", graphn_sb_panel); - theme->set_stylebox("panel_selected", "GraphElement", graphn_sb_panel_selected); - theme->set_stylebox("titlebar", "GraphElement", graphn_sb_titlebar); - theme->set_stylebox("titlebar_selected", "GraphElement", graphn_sb_titlebar_selected); - - // GraphNode's title Label. - theme->set_type_variation("GraphNodeTitleLabel", "Label"); - - theme->set_stylebox("normal", "GraphNodeTitleLabel", make_empty_stylebox(0, 0, 0, 0)); - theme->set_color("font_color", "GraphNodeTitleLabel", font_color); - theme->set_constant("line_spacing", "GraphNodeTitleLabel", 3 * EDSCALE); - - Color graphnode_decoration_color = dark_color_1.inverted(); - - theme->set_color("resizer_color", "GraphElement", graphnode_decoration_color); - theme->set_icon("resizer", "GraphElement", theme->get_icon(SNAME("GuiResizer"), EditorStringName(EditorIcons))); - - // GraphNode. - theme->set_stylebox("panel", "GraphNode", graphn_sb_panel); - theme->set_stylebox("panel_selected", "GraphNode", graphn_sb_panel_selected); - theme->set_stylebox("titlebar", "GraphNode", graphn_sb_titlebar); - theme->set_stylebox("titlebar_selected", "GraphNode", graphn_sb_titlebar_selected); - theme->set_stylebox("slot", "GraphNode", graphn_sb_slot); - - theme->set_color("resizer_color", "GraphNode", graphnode_decoration_color); - - theme->set_constant("port_h_offset", "GraphNode", 0); - theme->set_constant("separation", "GraphNode", 1 * EDSCALE); - - Ref<ImageTexture> port_icon = theme->get_icon(SNAME("GuiGraphNodePort"), EditorStringName(EditorIcons)); - // The true size is 24x24 This is necessary for sharp port icons at high zoom levels in GraphEdit (up to ~200%). - port_icon->set_size_override(Size2(12, 12)); - theme->set_icon("port", "GraphNode", port_icon); - - // StateMachine graph - theme->set_stylebox("panel", "GraphStateMachine", style_tree_bg); - theme->set_stylebox("error_panel", "GraphStateMachine", style_tree_bg); - theme->set_color("error_color", "GraphStateMachine", error_color); - - const int sm_margin_side = 10 * EDSCALE; - - Ref<StyleBoxFlat> sm_node_style = make_flat_stylebox(dark_color_3 * Color(1, 1, 1, 0.7), sm_margin_side, 24 * EDSCALE, sm_margin_side, gn_margin_bottom, corner_width); - sm_node_style->set_border_width_all(border_width); - sm_node_style->set_border_color(graphnode_bg); - - Ref<StyleBoxFlat> sm_node_selected_style = make_flat_stylebox(graphnode_bg * Color(1, 1, 1, 0.9), sm_margin_side, 24 * EDSCALE, sm_margin_side, gn_margin_bottom, corner_width); - sm_node_selected_style->set_border_width_all(2 * EDSCALE + border_width); - sm_node_selected_style->set_border_color(accent_color * Color(1, 1, 1, 0.9)); - sm_node_selected_style->set_shadow_size(8 * EDSCALE); - sm_node_selected_style->set_shadow_color(shadow_color); - - Ref<StyleBoxFlat> sm_node_playing_style = sm_node_selected_style->duplicate(); - sm_node_playing_style->set_border_color(warning_color); - sm_node_playing_style->set_shadow_color(warning_color * Color(1, 1, 1, 0.2)); - - theme->set_stylebox("node_frame", "GraphStateMachine", sm_node_style); - theme->set_stylebox("node_frame_selected", "GraphStateMachine", sm_node_selected_style); - theme->set_stylebox("node_frame_playing", "GraphStateMachine", sm_node_playing_style); - - Ref<StyleBoxFlat> sm_node_start_style = sm_node_style->duplicate(); - sm_node_start_style->set_border_width_all(1 * EDSCALE); - sm_node_start_style->set_border_color(success_color.lightened(0.24)); - theme->set_stylebox("node_frame_start", "GraphStateMachine", sm_node_start_style); - - Ref<StyleBoxFlat> sm_node_end_style = sm_node_style->duplicate(); - sm_node_end_style->set_border_width_all(1 * EDSCALE); - sm_node_end_style->set_border_color(error_color); - theme->set_stylebox("node_frame_end", "GraphStateMachine", sm_node_end_style); - - theme->set_font("node_title_font", "GraphStateMachine", theme->get_font(SNAME("font"), SNAME("Label"))); - theme->set_font_size("node_title_font_size", "GraphStateMachine", theme->get_font_size(SNAME("font_size"), SNAME("Label"))); - theme->set_color("node_title_font_color", "GraphStateMachine", font_color); - - theme->set_color("transition_color", "GraphStateMachine", font_color); - theme->set_color("transition_disabled_color", "GraphStateMachine", font_color * Color(1, 1, 1, 0.2)); - theme->set_color("transition_icon_color", "GraphStateMachine", Color(1, 1, 1)); - theme->set_color("transition_icon_disabled_color", "GraphStateMachine", Color(1, 1, 1, 0.2)); - theme->set_color("highlight_color", "GraphStateMachine", accent_color); - theme->set_color("highlight_disabled_color", "GraphStateMachine", accent_color * Color(1, 1, 1, 0.6)); - theme->set_color("guideline_color", "GraphStateMachine", font_color * Color(1, 1, 1, 0.3)); - - theme->set_color("playback_color", "GraphStateMachine", font_color); - theme->set_color("playback_background_color", "GraphStateMachine", font_color * Color(1, 1, 1, 0.3)); - - // GridContainer - theme->set_constant("v_separation", "GridContainer", Math::round(widget_default_margin.y - 2 * EDSCALE)); - - // FileDialog - theme->set_icon("folder", "FileDialog", theme->get_icon(SNAME("Folder"), EditorStringName(EditorIcons))); - theme->set_icon("parent_folder", "FileDialog", theme->get_icon(SNAME("ArrowUp"), EditorStringName(EditorIcons))); - theme->set_icon("back_folder", "FileDialog", theme->get_icon(SNAME("Back"), EditorStringName(EditorIcons))); - theme->set_icon("forward_folder", "FileDialog", theme->get_icon(SNAME("Forward"), EditorStringName(EditorIcons))); - theme->set_icon("reload", "FileDialog", theme->get_icon(SNAME("Reload"), EditorStringName(EditorIcons))); - theme->set_icon("toggle_hidden", "FileDialog", theme->get_icon(SNAME("GuiVisibilityVisible"), EditorStringName(EditorIcons))); - // Use a different color for folder icons to make them easier to distinguish from files. - // On a light theme, the icon will be dark, so we need to lighten it before blending it with the accent color. - theme->set_color("folder_icon_color", "FileDialog", (dark_theme ? Color(1, 1, 1) : Color(4.25, 4.25, 4.25)).lerp(accent_color, 0.7)); - theme->set_color("files_disabled", "FileDialog", font_disabled_color); - - // ColorPicker - theme->set_constant("margin", "ColorPicker", default_margin_size); - theme->set_constant("sv_width", "ColorPicker", 256 * EDSCALE); - theme->set_constant("sv_height", "ColorPicker", 256 * EDSCALE); - theme->set_constant("h_width", "ColorPicker", 30 * EDSCALE); - theme->set_constant("label_width", "ColorPicker", 10 * EDSCALE); - theme->set_constant("center_slider_grabbers", "ColorPicker", 1); - theme->set_icon("screen_picker", "ColorPicker", theme->get_icon(SNAME("ColorPick"), EditorStringName(EditorIcons))); - theme->set_icon("shape_circle", "ColorPicker", theme->get_icon(SNAME("PickerShapeCircle"), EditorStringName(EditorIcons))); - theme->set_icon("shape_rect", "ColorPicker", theme->get_icon(SNAME("PickerShapeRectangle"), EditorStringName(EditorIcons))); - theme->set_icon("shape_rect_wheel", "ColorPicker", theme->get_icon(SNAME("PickerShapeRectangleWheel"), EditorStringName(EditorIcons))); - theme->set_icon("add_preset", "ColorPicker", theme->get_icon(SNAME("Add"), EditorStringName(EditorIcons))); - theme->set_icon("sample_bg", "ColorPicker", theme->get_icon(SNAME("GuiMiniCheckerboard"), EditorStringName(EditorIcons))); - theme->set_icon("sample_revert", "ColorPicker", theme->get_icon(SNAME("Reload"), EditorStringName(EditorIcons))); - theme->set_icon("overbright_indicator", "ColorPicker", theme->get_icon(SNAME("OverbrightIndicator"), EditorStringName(EditorIcons))); - theme->set_icon("bar_arrow", "ColorPicker", theme->get_icon(SNAME("ColorPickerBarArrow"), EditorStringName(EditorIcons))); - theme->set_icon("picker_cursor", "ColorPicker", theme->get_icon(SNAME("PickerCursor"), EditorStringName(EditorIcons))); - - // ColorPickerButton - theme->set_icon("bg", "ColorPickerButton", theme->get_icon(SNAME("GuiMiniCheckerboard"), EditorStringName(EditorIcons))); - - // ColorPresetButton - Ref<StyleBoxFlat> preset_sb = make_flat_stylebox(Color(1, 1, 1), 2, 2, 2, 2, 2); - theme->set_stylebox("preset_fg", "ColorPresetButton", preset_sb); - theme->set_icon("preset_bg", "ColorPresetButton", theme->get_icon(SNAME("GuiMiniCheckerboard"), EditorStringName(EditorIcons))); - theme->set_icon("overbright_indicator", "ColorPresetButton", theme->get_icon(SNAME("OverbrightIndicator"), EditorStringName(EditorIcons))); - - // Information on 3D viewport - Ref<StyleBoxFlat> style_info_3d_viewport = style_default->duplicate(); - style_info_3d_viewport->set_bg_color(style_info_3d_viewport->get_bg_color() * Color(1, 1, 1, 0.5)); - style_info_3d_viewport->set_border_width_all(0); - theme->set_stylebox("Information3dViewport", EditorStringName(EditorStyles), style_info_3d_viewport); - - // Asset Library. - theme->set_stylebox("bg", "AssetLib", style_empty); - theme->set_stylebox("panel", "AssetLib", style_content_panel); - theme->set_color("status_color", "AssetLib", Color(0.5, 0.5, 0.5)); - theme->set_icon("dismiss", "AssetLib", theme->get_icon(SNAME("Close"), EditorStringName(EditorIcons))); - - // Theme editor. - theme->set_color("preview_picker_overlay_color", "ThemeEditor", Color(0.1, 0.1, 0.1, 0.25)); - Color theme_preview_picker_bg_color = accent_color; - theme_preview_picker_bg_color.a = 0.2; - Ref<StyleBoxFlat> theme_preview_picker_sb = make_flat_stylebox(theme_preview_picker_bg_color, 0, 0, 0, 0); - theme_preview_picker_sb->set_border_color(accent_color); - theme_preview_picker_sb->set_border_width_all(1.0 * EDSCALE); - theme->set_stylebox("preview_picker_overlay", "ThemeEditor", theme_preview_picker_sb); - Color theme_preview_picker_label_bg_color = accent_color; - theme_preview_picker_label_bg_color.set_v(0.5); - Ref<StyleBoxFlat> theme_preview_picker_label_sb = make_flat_stylebox(theme_preview_picker_label_bg_color, 4.0, 1.0, 4.0, 3.0); - theme->set_stylebox("preview_picker_label", "ThemeEditor", theme_preview_picker_label_sb); - - // Dictionary editor add item. - // Expand to the left and right by 4px to compensate for the dictionary editor margins. - Ref<StyleBoxFlat> style_dictionary_add_item = make_flat_stylebox(prop_subsection_color, 0, 4, 0, 4, corner_radius); - style_dictionary_add_item->set_expand_margin(SIDE_LEFT, 4 * EDSCALE); - style_dictionary_add_item->set_expand_margin(SIDE_RIGHT, 4 * EDSCALE); - theme->set_stylebox("DictionaryAddItem", EditorStringName(EditorStyles), style_dictionary_add_item); - - Ref<StyleBoxEmpty> vshader_label_style = make_empty_stylebox(2, 1, 2, 1); - theme->set_stylebox("label_style", "VShaderEditor", vshader_label_style); - - // Project manager. - theme->set_stylebox("search_panel", "ProjectManager", style_tree_bg); - theme->set_constant("sidebar_button_icon_separation", "ProjectManager", int(6 * EDSCALE)); - - // adaptive script theme constants - // for comments and elements with lower relevance - const Color dim_color = Color(font_color, 0.5); - - const float mono_value = mono_color.r; - const Color alpha1 = Color(mono_value, mono_value, mono_value, 0.07); - const Color alpha2 = Color(mono_value, mono_value, mono_value, 0.14); - const Color alpha3 = Color(mono_value, mono_value, mono_value, 0.27); - - const Color symbol_color = dark_theme ? Color(0.67, 0.79, 1) : Color(0, 0, 0.61); - const Color keyword_color = dark_theme ? Color(1.0, 0.44, 0.52) : Color(0.9, 0.135, 0.51); - const Color control_flow_keyword_color = dark_theme ? Color(1.0, 0.55, 0.8) : Color(0.743, 0.12, 0.8); - const Color base_type_color = dark_theme ? Color(0.26, 1.0, 0.76) : Color(0, 0.6, 0.2); - const Color engine_type_color = dark_theme ? Color(0.56, 1, 0.86) : Color(0.11, 0.55, 0.4); - const Color user_type_color = dark_theme ? Color(0.78, 1, 0.93) : Color(0.18, 0.45, 0.4); - const Color comment_color = dark_theme ? dim_color : Color(0.08, 0.08, 0.08, 0.5); - const Color doc_comment_color = dark_theme ? Color(0.6, 0.7, 0.8, 0.8) : Color(0.15, 0.15, 0.4, 0.7); - const Color string_color = dark_theme ? Color(1, 0.93, 0.63) : Color(0.6, 0.42, 0); - - // Use the brightest background color on a light theme (which generally uses a negative contrast rate). - const Color te_background_color = dark_theme ? background_color : dark_color_3; - const Color completion_background_color = dark_theme ? base_color : background_color; - const Color completion_selected_color = alpha1; - const Color completion_existing_color = alpha2; - // Same opacity as the scroll grabber editor icon. - const Color completion_scroll_color = Color(mono_value, mono_value, mono_value, 0.29); - const Color completion_scroll_hovered_color = Color(mono_value, mono_value, mono_value, 0.4); - const Color completion_font_color = font_color; - const Color text_color = font_color; - const Color line_number_color = dim_color; - const Color safe_line_number_color = dark_theme ? (dim_color * Color(1, 1.2, 1, 1.5)) : Color(0, 0.4, 0, 0.75); - const Color caret_color = mono_color; - const Color caret_background_color = mono_color.inverted(); - const Color text_selected_color = Color(0, 0, 0, 0); - const Color brace_mismatch_color = dark_theme ? error_color : Color(1, 0.08, 0, 1); - const Color current_line_color = alpha1; - const Color line_length_guideline_color = dark_theme ? base_color : background_color; - const Color word_highlighted_color = alpha1; - const Color number_color = dark_theme ? Color(0.63, 1, 0.88) : Color(0, 0.55, 0.28, 1); - const Color function_color = dark_theme ? Color(0.34, 0.7, 1.0) : Color(0, 0.225, 0.9, 1); - const Color member_variable_color = dark_theme ? Color(0.34, 0.7, 1.0).lerp(mono_color, 0.6) : Color(0, 0.4, 0.68, 1); - const Color mark_color = Color(error_color.r, error_color.g, error_color.b, 0.3); - const Color bookmark_color = Color(0.08, 0.49, 0.98); - const Color breakpoint_color = dark_theme ? error_color : Color(1, 0.27, 0.2, 1); - const Color executing_line_color = Color(0.98, 0.89, 0.27); - const Color code_folding_color = alpha3; - const Color folded_code_region_color = Color(0.68, 0.46, 0.77, 0.2); - const Color search_result_color = alpha1; - const Color search_result_border_color = dark_theme ? Color(0.41, 0.61, 0.91, 0.38) : Color(0, 0.4, 1, 0.38); - - EditorSettings *setting = EditorSettings::get_singleton(); - String text_editor_color_theme = setting->get("text_editor/theme/color_theme"); - if (text_editor_color_theme == "Default") { - setting->set_initial_value("text_editor/theme/highlighting/symbol_color", symbol_color, true); - setting->set_initial_value("text_editor/theme/highlighting/keyword_color", keyword_color, true); - setting->set_initial_value("text_editor/theme/highlighting/control_flow_keyword_color", control_flow_keyword_color, true); - setting->set_initial_value("text_editor/theme/highlighting/base_type_color", base_type_color, true); - setting->set_initial_value("text_editor/theme/highlighting/engine_type_color", engine_type_color, true); - setting->set_initial_value("text_editor/theme/highlighting/user_type_color", user_type_color, true); - setting->set_initial_value("text_editor/theme/highlighting/comment_color", comment_color, true); - setting->set_initial_value("text_editor/theme/highlighting/doc_comment_color", doc_comment_color, true); - setting->set_initial_value("text_editor/theme/highlighting/string_color", string_color, true); - setting->set_initial_value("text_editor/theme/highlighting/background_color", te_background_color, true); - setting->set_initial_value("text_editor/theme/highlighting/completion_background_color", completion_background_color, true); - setting->set_initial_value("text_editor/theme/highlighting/completion_selected_color", completion_selected_color, true); - setting->set_initial_value("text_editor/theme/highlighting/completion_existing_color", completion_existing_color, true); - setting->set_initial_value("text_editor/theme/highlighting/completion_scroll_color", completion_scroll_color, true); - setting->set_initial_value("text_editor/theme/highlighting/completion_scroll_hovered_color", completion_scroll_hovered_color, true); - setting->set_initial_value("text_editor/theme/highlighting/completion_font_color", completion_font_color, true); - setting->set_initial_value("text_editor/theme/highlighting/text_color", text_color, true); - setting->set_initial_value("text_editor/theme/highlighting/line_number_color", line_number_color, true); - setting->set_initial_value("text_editor/theme/highlighting/safe_line_number_color", safe_line_number_color, true); - setting->set_initial_value("text_editor/theme/highlighting/caret_color", caret_color, true); - setting->set_initial_value("text_editor/theme/highlighting/caret_background_color", caret_background_color, true); - setting->set_initial_value("text_editor/theme/highlighting/text_selected_color", text_selected_color, true); - setting->set_initial_value("text_editor/theme/highlighting/selection_color", selection_color, true); - setting->set_initial_value("text_editor/theme/highlighting/brace_mismatch_color", brace_mismatch_color, true); - setting->set_initial_value("text_editor/theme/highlighting/current_line_color", current_line_color, true); - setting->set_initial_value("text_editor/theme/highlighting/line_length_guideline_color", line_length_guideline_color, true); - setting->set_initial_value("text_editor/theme/highlighting/word_highlighted_color", word_highlighted_color, true); - setting->set_initial_value("text_editor/theme/highlighting/number_color", number_color, true); - setting->set_initial_value("text_editor/theme/highlighting/function_color", function_color, true); - setting->set_initial_value("text_editor/theme/highlighting/member_variable_color", member_variable_color, true); - setting->set_initial_value("text_editor/theme/highlighting/mark_color", mark_color, true); - setting->set_initial_value("text_editor/theme/highlighting/bookmark_color", bookmark_color, true); - setting->set_initial_value("text_editor/theme/highlighting/breakpoint_color", breakpoint_color, true); - setting->set_initial_value("text_editor/theme/highlighting/executing_line_color", executing_line_color, true); - setting->set_initial_value("text_editor/theme/highlighting/code_folding_color", code_folding_color, true); - setting->set_initial_value("text_editor/theme/highlighting/folded_code_region_color", folded_code_region_color, true); - setting->set_initial_value("text_editor/theme/highlighting/search_result_color", search_result_color, true); - setting->set_initial_value("text_editor/theme/highlighting/search_result_border_color", search_result_border_color, true); - } else if (text_editor_color_theme == "Godot 2") { - setting->load_text_editor_theme(); - } - - // Now theme is loaded, apply it to CodeEdit. - theme->set_font("font", "CodeEdit", theme->get_font(SNAME("source"), EditorStringName(EditorFonts))); - theme->set_font_size("font_size", "CodeEdit", theme->get_font_size(SNAME("source_size"), EditorStringName(EditorFonts))); - - Ref<StyleBoxFlat> code_edit_stylebox = make_flat_stylebox(EDITOR_GET("text_editor/theme/highlighting/background_color"), widget_default_margin.x, widget_default_margin.y, widget_default_margin.x, widget_default_margin.y, corner_radius); - theme->set_stylebox("normal", "CodeEdit", code_edit_stylebox); - theme->set_stylebox("read_only", "CodeEdit", code_edit_stylebox); - theme->set_stylebox("focus", "CodeEdit", Ref<StyleBoxEmpty>(memnew(StyleBoxEmpty))); - - theme->set_icon("tab", "CodeEdit", theme->get_icon(SNAME("GuiTab"), EditorStringName(EditorIcons))); - theme->set_icon("space", "CodeEdit", theme->get_icon(SNAME("GuiSpace"), EditorStringName(EditorIcons))); - theme->set_icon("folded", "CodeEdit", theme->get_icon(SNAME("CodeFoldedRightArrow"), EditorStringName(EditorIcons))); - theme->set_icon("can_fold", "CodeEdit", theme->get_icon(SNAME("CodeFoldDownArrow"), EditorStringName(EditorIcons))); - theme->set_icon("folded_code_region", "CodeEdit", theme->get_icon(SNAME("CodeRegionFoldedRightArrow"), EditorStringName(EditorIcons))); - theme->set_icon("can_fold_code_region", "CodeEdit", theme->get_icon(SNAME("CodeRegionFoldDownArrow"), EditorStringName(EditorIcons))); - theme->set_icon("executing_line", "CodeEdit", theme->get_icon(SNAME("TextEditorPlay"), EditorStringName(EditorIcons))); - theme->set_icon("breakpoint", "CodeEdit", theme->get_icon(SNAME("Breakpoint"), EditorStringName(EditorIcons))); - - theme->set_constant("line_spacing", "CodeEdit", EDITOR_GET("text_editor/appearance/whitespace/line_spacing")); - - theme->set_color("background_color", "CodeEdit", Color(0, 0, 0, 0)); - theme->set_color("completion_background_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_background_color")); - theme->set_color("completion_selected_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_selected_color")); - theme->set_color("completion_existing_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_existing_color")); - theme->set_color("completion_scroll_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_scroll_color")); - theme->set_color("completion_scroll_hovered_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_scroll_hovered_color")); - theme->set_color("font_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/text_color")); - theme->set_color("line_number_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/line_number_color")); - theme->set_color("caret_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/caret_color")); - theme->set_color("font_selected_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/text_selected_color")); - theme->set_color("selection_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/selection_color")); - theme->set_color("brace_mismatch_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/brace_mismatch_color")); - theme->set_color("current_line_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/current_line_color")); - theme->set_color("line_length_guideline_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/line_length_guideline_color")); - theme->set_color("word_highlighted_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/word_highlighted_color")); - theme->set_color("bookmark_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/bookmark_color")); - theme->set_color("breakpoint_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/breakpoint_color")); - theme->set_color("executing_line_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/executing_line_color")); - theme->set_color("code_folding_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/code_folding_color")); - theme->set_color("folded_code_region_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/folded_code_region_color")); - theme->set_color("search_result_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/search_result_color")); - theme->set_color("search_result_border_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/search_result_border_color")); - - OS::get_singleton()->benchmark_end_measure("EditorTheme", "Create Editor Theme"); - - return theme; -} - -Ref<Theme> create_custom_theme(const Ref<Theme> p_theme) { - Ref<Theme> theme = create_editor_theme(p_theme); - - OS::get_singleton()->benchmark_begin_measure("EditorTheme", "Create Custom Theme"); - - const String custom_theme_path = EDITOR_GET("interface/theme/custom_theme"); - if (!custom_theme_path.is_empty()) { - Ref<Theme> custom_theme = ResourceLoader::load(custom_theme_path); - if (custom_theme.is_valid()) { - theme->merge_with(custom_theme); - } - } - - OS::get_singleton()->benchmark_end_measure("EditorTheme", "Create Custom Theme"); - return theme; -} - -/** - * Returns the SVG code for the default project icon. - */ -String get_default_project_icon() { - for (int i = 0; i < editor_icons_count; i++) { - if (strcmp(editor_icons_names[i], "DefaultProjectIcon") == 0) { - return String(editor_icons_sources[i]); - } - } - return String(); -} diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index 855d610d72..ee25893a30 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -40,11 +40,11 @@ #include "editor/editor_file_system.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/export/editor_export.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "editor_export_plugin.h" #include "scene/resources/image_texture.h" #include "scene/resources/packed_scene.h" diff --git a/editor/export/export_template_manager.cpp b/editor/export/export_template_manager.cpp index 26ed7c46fb..69ad076f8a 100644 --- a/editor/export/export_template_manager.cpp +++ b/editor/export/export_template_manager.cpp @@ -36,10 +36,10 @@ #include "core/version.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/progress_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/file_dialog.h" #include "scene/gui/menu_button.h" #include "scene/gui/separator.h" @@ -758,7 +758,7 @@ void ExportTemplateManager::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { current_value->add_theme_font_override("font", get_theme_font(SNAME("main"), EditorStringName(EditorFonts))); current_missing_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor))); - current_installed_label->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + current_installed_label->add_theme_color_override("font_color", get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); mirror_options_button->set_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl"))); } break; diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index b22f70b0fa..63bd87e6cc 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -35,12 +35,12 @@ #include "editor/editor_file_system.h" #include "editor/editor_node.h" #include "editor/editor_properties.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/export/editor_export.h" #include "editor/gui/editor_file_dialog.h" #include "editor/import/resource_importer_texture_settings.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/check_box.h" #include "scene/gui/check_button.h" #include "scene/gui/item_list.h" @@ -824,7 +824,7 @@ void ProjectExportDialog::_setup_item_for_file_mode(TreeItem *p_item, EditorExpo p_item->set_cell_mode(1, TreeItem::CELL_MODE_STRING); p_item->set_editable(1, false); p_item->set_selectable(1, false); - p_item->set_custom_color(1, get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + p_item->set_custom_color(1, get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); } else { p_item->set_checked(0, true); p_item->set_cell_mode(1, TreeItem::CELL_MODE_CUSTOM); @@ -1277,6 +1277,7 @@ ProjectExportDialog::ProjectExportDialog() { server_strip_message = memnew(Label); server_strip_message->set_visible(false); server_strip_message->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + server_strip_message->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); resources_vb->add_child(server_strip_message); { @@ -1395,12 +1396,14 @@ ProjectExportDialog::ProjectExportDialog() { set_cancel_button_text(TTR("Close")); set_ok_button_text(TTR("Export PCK/ZIP...")); + get_ok_button()->set_tooltip_text(TTR("Export the project resources as a PCK or ZIP package. This is not a playable build, only the project data without a Godot executable.")); get_ok_button()->set_disabled(true); #ifdef ANDROID_ENABLED export_button = memnew(Button); export_button->hide(); #else export_button = add_button(TTR("Export Project..."), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "export"); + export_button->set_tooltip_text(TTR("Export the project as a playable build (Godot executable and project data) for the selected preset.")); #endif export_button->connect("pressed", callable_mp(this, &ProjectExportDialog::_export_project)); // Disable initially before we select a valid preset diff --git a/editor/fbx_importer_manager.cpp b/editor/fbx_importer_manager.cpp index 5922cbf312..7199ef3842 100644 --- a/editor/fbx_importer_manager.cpp +++ b/editor/fbx_importer_manager.cpp @@ -32,9 +32,9 @@ #include "core/config/project_settings.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/link_button.h" void FBXImporterManager::_notification(int p_what) { diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 4e94ff1129..0aa9a3bfee 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -42,7 +42,6 @@ #include "editor/editor_feature_profile.h" #include "editor/editor_node.h" #include "editor/editor_resource_preview.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_dir_dialog.h" @@ -53,6 +52,7 @@ #include "editor/scene_create_dialog.h" #include "editor/scene_tree_dock.h" #include "editor/shader_create_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/item_list.h" #include "scene/gui/label.h" #include "scene/gui/line_edit.h" @@ -765,7 +765,7 @@ void FileSystemDock::navigate_to_path(const String &p_path) { } void FileSystemDock::_file_list_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata) { - if ((file_list_vb->is_visible_in_tree() || current_path == p_path.get_base_dir()) && p_preview.is_valid()) { + if ((file_list_vb->is_visible_in_tree() || current_path.trim_suffix("/") == p_path.get_base_dir()) && p_preview.is_valid()) { Array uarr = p_udata; int idx = uarr[0]; String file = uarr[1]; @@ -865,18 +865,7 @@ void FileSystemDock::_search(EditorFileSystemDirectory *p_path, List<FileInfo> * struct FileSystemDock::FileInfoTypeComparator { bool operator()(const FileInfo &p_a, const FileInfo &p_b) const { - // Uses the extension, then the icon name to distinguish file types. - String icon_path_a = ""; - String icon_path_b = ""; - Ref<Texture2D> icon_a = EditorNode::get_singleton()->get_class_icon(p_a.type); - if (icon_a.is_valid()) { - icon_path_a = icon_a->get_name(); - } - Ref<Texture2D> icon_b = EditorNode::get_singleton()->get_class_icon(p_b.type); - if (icon_b.is_valid()) { - icon_path_b = icon_b->get_name(); - } - return NaturalNoCaseComparator()(p_a.name.get_extension() + icon_path_a + p_a.name.get_basename(), p_b.name.get_extension() + icon_path_b + p_b.name.get_basename()); + return NaturalNoCaseComparator()(p_a.name.get_extension() + p_a.type + p_a.name.get_basename(), p_b.name.get_extension() + p_b.type + p_b.name.get_basename()); } }; @@ -3665,6 +3654,70 @@ void FileSystemDock::_bind_methods() { ADD_SIGNAL(MethodInfo("display_mode_changed")); } +void FileSystemDock::save_layout_to_config(Ref<ConfigFile> p_layout, const String &p_section) const { + p_layout->set_value(p_section, "dock_filesystem_h_split_offset", get_h_split_offset()); + p_layout->set_value(p_section, "dock_filesystem_v_split_offset", get_v_split_offset()); + p_layout->set_value(p_section, "dock_filesystem_display_mode", get_display_mode()); + p_layout->set_value(p_section, "dock_filesystem_file_sort", get_file_sort()); + p_layout->set_value(p_section, "dock_filesystem_file_list_display_mode", get_file_list_display_mode()); + PackedStringArray selected_files = get_selected_paths(); + p_layout->set_value(p_section, "dock_filesystem_selected_paths", selected_files); + Vector<String> uncollapsed_paths = get_uncollapsed_paths(); + p_layout->set_value(p_section, "dock_filesystem_uncollapsed_paths", uncollapsed_paths); +} + +void FileSystemDock::load_layout_from_config(Ref<ConfigFile> p_layout, const String &p_section) { + if (p_layout->has_section_key(p_section, "dock_filesystem_h_split_offset")) { + int fs_h_split_ofs = p_layout->get_value(p_section, "dock_filesystem_h_split_offset"); + set_h_split_offset(fs_h_split_ofs); + } + + if (p_layout->has_section_key(p_section, "dock_filesystem_v_split_offset")) { + int fs_v_split_ofs = p_layout->get_value(p_section, "dock_filesystem_v_split_offset"); + set_v_split_offset(fs_v_split_ofs); + } + + if (p_layout->has_section_key(p_section, "dock_filesystem_display_mode")) { + DisplayMode dock_filesystem_display_mode = DisplayMode(int(p_layout->get_value(p_section, "dock_filesystem_display_mode"))); + set_display_mode(dock_filesystem_display_mode); + } + + if (p_layout->has_section_key(p_section, "dock_filesystem_file_sort")) { + FileSortOption dock_filesystem_file_sort = FileSortOption(int(p_layout->get_value(p_section, "dock_filesystem_file_sort"))); + set_file_sort(dock_filesystem_file_sort); + } + + if (p_layout->has_section_key(p_section, "dock_filesystem_file_list_display_mode")) { + FileListDisplayMode dock_filesystem_file_list_display_mode = FileListDisplayMode(int(p_layout->get_value(p_section, "dock_filesystem_file_list_display_mode"))); + set_file_list_display_mode(dock_filesystem_file_list_display_mode); + } + + if (p_layout->has_section_key(p_section, "dock_filesystem_selected_paths")) { + PackedStringArray dock_filesystem_selected_paths = p_layout->get_value(p_section, "dock_filesystem_selected_paths"); + for (int i = 0; i < dock_filesystem_selected_paths.size(); i++) { + select_file(dock_filesystem_selected_paths[i]); + } + } + + // Restore collapsed state. + PackedStringArray uncollapsed_tis; + if (p_layout->has_section_key(p_section, "dock_filesystem_uncollapsed_paths")) { + uncollapsed_tis = p_layout->get_value(p_section, "dock_filesystem_uncollapsed_paths"); + } else { + uncollapsed_tis = { "res://" }; + } + + if (!uncollapsed_tis.is_empty()) { + for (int i = 0; i < uncollapsed_tis.size(); i++) { + TreeItem *uncollapsed_ti = get_tree_control()->get_item_with_metadata(uncollapsed_tis[i], 0); + if (uncollapsed_ti) { + uncollapsed_ti->set_collapsed(false); + } + } + get_tree_control()->queue_redraw(); + } +} + FileSystemDock::FileSystemDock() { singleton = this; set_name("FileSystem"); diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 5fe1389e2a..6c69acb953 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -394,13 +394,13 @@ public: void select_file(const String &p_file); void set_display_mode(DisplayMode p_display_mode); - DisplayMode get_display_mode() { return display_mode; } + DisplayMode get_display_mode() const { return display_mode; } void set_file_sort(FileSortOption p_file_sort); - FileSortOption get_file_sort() { return file_sort; } + FileSortOption get_file_sort() const { return file_sort; } void set_file_list_display_mode(FileListDisplayMode p_mode); - FileListDisplayMode get_file_list_display_mode() { return file_list_display_mode; }; + FileListDisplayMode get_file_list_display_mode() const { return file_list_display_mode; }; Tree *get_tree_control() { return tree; } @@ -408,6 +408,9 @@ public: void remove_resource_tooltip_plugin(const Ref<EditorResourceTooltipPlugin> &p_plugin); Control *create_tooltip_for_path(const String &p_path) const; + void save_layout_to_config(Ref<ConfigFile> p_layout, const String &p_section) const; + void load_layout_from_config(Ref<ConfigFile> p_layout, const String &p_section); + FileSystemDock(); ~FileSystemDock(); }; diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index a81aa971f3..c708e77719 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -34,8 +34,8 @@ #include "core/io/dir_access.h" #include "core/os/os.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/check_box.h" diff --git a/editor/group_settings_editor.cpp b/editor/group_settings_editor.cpp index a91154ae36..634192ab50 100644 --- a/editor/group_settings_editor.cpp +++ b/editor/group_settings_editor.cpp @@ -31,13 +31,13 @@ #include "group_settings_editor.h" #include "core/config/project_settings.h" -#include "editor/editor_scale.h" +#include "editor/editor_file_system.h" +#include "editor/editor_node.h" #include "editor/editor_undo_redo_manager.h" #include "editor/filesystem_dock.h" #include "editor/gui/editor_validation_panel.h" #include "editor/scene_tree_dock.h" -#include "editor_file_system.h" -#include "editor_node.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/packed_scene.h" void GroupSettingsEditor::_notification(int p_what) { @@ -45,6 +45,9 @@ void GroupSettingsEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { update_groups(); } break; + case NOTIFICATION_THEME_CHANGED: { + add_button->set_icon(get_editor_theme_icon(SNAME("Add"))); + } break; } } diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index 77a867f34b..723a7c8901 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -31,12 +31,12 @@ #include "groups_editor.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_validation_panel.h" #include "editor/project_settings_editor.h" #include "editor/scene_tree_dock.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/check_button.h" #include "scene/gui/grid_container.h" diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp index 9764574d04..4d1fd1f7b7 100644 --- a/editor/gui/editor_file_dialog.cpp +++ b/editor/gui/editor_file_dialog.cpp @@ -38,9 +38,9 @@ #include "editor/editor_file_system.h" #include "editor/editor_node.h" #include "editor/editor_resource_preview.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/filesystem_dock.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/center_container.h" #include "scene/gui/label.h" #include "scene/gui/margin_container.h" diff --git a/editor/gui/editor_object_selector.cpp b/editor/gui/editor_object_selector.cpp index 9acd38bcf4..c97d68fb35 100644 --- a/editor/gui/editor_object_selector.cpp +++ b/editor/gui/editor_object_selector.cpp @@ -32,9 +32,9 @@ #include "editor/editor_data.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/multi_node_edit.h" +#include "editor/themes/editor_scale.h" Size2 EditorObjectSelector::get_minimum_size() const { Ref<Font> font = get_theme_font(SNAME("font")); diff --git a/editor/gui/editor_scene_tabs.cpp b/editor/gui/editor_scene_tabs.cpp index 7f8f2fd8a3..915b161372 100644 --- a/editor/gui/editor_scene_tabs.cpp +++ b/editor/gui/editor_scene_tabs.cpp @@ -32,11 +32,11 @@ #include "editor/editor_node.h" #include "editor/editor_resource_preview.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/inspector_dock.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/panel.h" diff --git a/editor/gui/editor_spin_slider.cpp b/editor/gui/editor_spin_slider.cpp index 051e4340bc..8401f08391 100644 --- a/editor/gui/editor_spin_slider.cpp +++ b/editor/gui/editor_spin_slider.cpp @@ -33,8 +33,8 @@ #include "core/input/input.h" #include "core/math/expression.h" #include "core/os/keyboard.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/themes/editor_scale.h" String EditorSpinSlider::get_tooltip(const Point2 &p_pos) const { if (grabber->is_visible()) { diff --git a/editor/gui/editor_toaster.cpp b/editor/gui/editor_toaster.cpp index ac54a5a371..48e1c56e83 100644 --- a/editor/gui/editor_toaster.cpp +++ b/editor/gui/editor_toaster.cpp @@ -30,9 +30,9 @@ #include "editor_toaster.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/gui/label.h" #include "scene/gui/panel_container.h" diff --git a/editor/gui/editor_validation_panel.cpp b/editor/gui/editor_validation_panel.cpp index 14fe05e906..c08af1915f 100644 --- a/editor/gui/editor_validation_panel.cpp +++ b/editor/gui/editor_validation_panel.cpp @@ -30,8 +30,8 @@ #include "editor_validation_panel.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/label.h" diff --git a/editor/gui/editor_zoom_widget.cpp b/editor/gui/editor_zoom_widget.cpp index 7d522761f3..6db4c5047e 100644 --- a/editor/gui/editor_zoom_widget.cpp +++ b/editor/gui/editor_zoom_widget.cpp @@ -31,8 +31,8 @@ #include "editor_zoom_widget.h" #include "core/os/keyboard.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/themes/editor_scale.h" void EditorZoomWidget::_update_zoom_label() { String zoom_text; diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp index 766a507260..7a9df26fa7 100644 --- a/editor/gui/scene_tree_editor.cpp +++ b/editor/gui/scene_tree_editor.cpp @@ -34,7 +34,6 @@ #include "core/object/script_language.h" #include "editor/editor_file_system.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" @@ -42,6 +41,7 @@ #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/canvas_item_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/flow_container.h" #include "scene/gui/label.h" #include "scene/gui/tab_container.h" @@ -235,7 +235,7 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { item->add_button(0, get_editor_theme_icon(SNAME("Script")), BUTTON_SCRIPT); } else { //has no script (or script is a custom type) - _set_item_custom_color(item, get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + _set_item_custom_color(item, get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); item->set_selectable(0, false); if (!scr.is_null()) { // make sure to mark the script if a custom type @@ -267,7 +267,7 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { item->set_selectable(0, marked_selectable); _set_item_custom_color(item, get_theme_color(SNAME("accent_color"), EditorStringName(Editor))); } else if (!p_node->can_process()) { - _set_item_custom_color(item, get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + _set_item_custom_color(item, get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); } else if (!marked_selectable && !marked_children_selectable) { Node *node = p_node; while (node) { @@ -492,7 +492,7 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { } if (!valid) { - _set_item_custom_color(item, get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + _set_item_custom_color(item, get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); item->set_selectable(0, false); } } @@ -718,7 +718,7 @@ bool SceneTreeEditor::_update_filter(TreeItem *p_parent, bool p_scroll_to_select } p_parent->set_selectable(0, true); } else if (keep_for_children) { - p_parent->set_custom_color(0, get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + p_parent->set_custom_color(0, get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); p_parent->set_selectable(0, false); p_parent->deselect(0); } diff --git a/editor/icons/GuiHsplitter.svg b/editor/icons/GuiHsplitter.svg index 6d1f7e785c..cf42f057c6 100644 --- a/editor/icons/GuiHsplitter.svg +++ b/editor/icons/GuiHsplitter.svg @@ -1 +1 @@ -<svg height="64" viewBox="0 0 8 64" width="8" xmlns="http://www.w3.org/2000/svg"><path d="M4 2v60" fill="none" stroke="#fff" stroke-linecap="round" stroke-opacity=".4" stroke-width="2"/></svg> +<svg height="64" viewBox="0 0 2 64" width="2" xmlns="http://www.w3.org/2000/svg"><path d="M1 2v60" fill="none" stroke="#fff" stroke-linecap="round" stroke-opacity=".4" stroke-width="2"/></svg> diff --git a/editor/icons/GuiVsplitter.svg b/editor/icons/GuiVsplitter.svg index cadd231579..b7850e76f0 100644 --- a/editor/icons/GuiVsplitter.svg +++ b/editor/icons/GuiVsplitter.svg @@ -1 +1 @@ -<svg height="8" viewBox="0 0 64 8" width="64" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h60" fill="none" stroke="#fff" stroke-linecap="round" stroke-opacity=".4" stroke-width="2"/></svg> +<svg height="2" viewBox="0 0 64 2" width="64" xmlns="http://www.w3.org/2000/svg"><path d="M2 1h60" fill="none" stroke="#fff" stroke-linecap="round" stroke-opacity=".4" stroke-width="2"/></svg> diff --git a/editor/icons/SCsub b/editor/icons/SCsub index dd4243d750..cbbfe1d7ea 100644 --- a/editor/icons/SCsub +++ b/editor/icons/SCsub @@ -3,7 +3,6 @@ Import("env") import os - import editor_icons_builders @@ -23,4 +22,4 @@ for path in env.module_icons_paths: else: icon_sources += Glob(path + "/*.svg") # Custom. -env.Alias("editor_icons", [env.MakeEditorIconsBuilder("#editor/editor_icons.gen.h", icon_sources)]) +env.Alias("editor_icons", [env.MakeEditorIconsBuilder("#editor/themes/editor_icons.gen.h", icon_sources)]) diff --git a/editor/icons/TileMapLayer.svg b/editor/icons/TileMapLayer.svg new file mode 100644 index 0000000000..1903a87e3b --- /dev/null +++ b/editor/icons/TileMapLayer.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 7v2h2v-2zm3 0v2h2v-2zm3 0v2h2v-2zm3 0v2h2v-2zm3 0v2h2v-2z" fill="#8da5f3"/></svg>
\ No newline at end of file diff --git a/editor/icons/editor_icons_builders.py b/editor/icons/editor_icons_builders.py index 359245b6d7..378eb323db 100644 --- a/editor/icons/editor_icons_builders.py +++ b/editor/icons/editor_icons_builders.py @@ -1,4 +1,5 @@ -"""Functions used to generate source files during build time +""" +Functions used to generate source files during build time All such functions are invoked in a subprocess on Windows to prevent build flakiness. diff --git a/editor/import/3d/scene_import_settings.cpp b/editor/import/3d/scene_import_settings.cpp index 4ecc6dedbd..736f941aa4 100644 --- a/editor/import/3d/scene_import_settings.cpp +++ b/editor/import/3d/scene_import_settings.cpp @@ -34,10 +34,10 @@ #include "editor/editor_file_system.h" #include "editor/editor_inspector.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/3d/importer_mesh_instance_3d.h" #include "scene/animation/animation_player.h" #include "scene/resources/importer_mesh.h" diff --git a/editor/import/audio_stream_import_settings.cpp b/editor/import/audio_stream_import_settings.cpp index bc96191d33..a62ac97244 100644 --- a/editor/import/audio_stream_import_settings.cpp +++ b/editor/import/audio_stream_import_settings.cpp @@ -31,8 +31,8 @@ #include "audio_stream_import_settings.h" #include "editor/audio_stream_preview.h" #include "editor/editor_file_system.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/check_box.h" AudioStreamImportSettingsDialog *AudioStreamImportSettingsDialog::singleton = nullptr; diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp index 5564726594..5e6ed02de9 100644 --- a/editor/import/dynamic_font_import_settings.cpp +++ b/editor/import/dynamic_font_import_settings.cpp @@ -36,10 +36,10 @@ #include "editor/editor_locale_dialog.h" #include "editor/editor_node.h" #include "editor/editor_property_name_processor.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" /*************************************************************************/ /* Settings data */ @@ -1345,6 +1345,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { page2_description->set_text(TTR("Add font size, and variation coordinates, and select glyphs to pre-render:")); page2_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); page2_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + page2_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); page2_vb->add_child(page2_description); HSplitContainer *page2_hb = memnew(HSplitContainer); @@ -1418,6 +1419,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { page2_0_description->set_text(TTR("Select translations to add all required glyphs to pre-render list:")); page2_0_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); page2_0_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + page2_0_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); page2_0_vb->add_child(page2_0_description); locale_tree = memnew(Tree); @@ -1449,6 +1451,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { page2_1_description->set_text(TTR("Enter a text and select OpenType features to shape and add all required glyphs to pre-render list:")); page2_1_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); page2_1_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + page2_1_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); page2_1_vb->add_child(page2_1_description); HSplitContainer *page2_1_hb = memnew(HSplitContainer); @@ -1486,6 +1489,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { page2_2_description->set_text(TTR("Add or remove glyphs from the character map to pre-render list:\nNote: Some stylistic alternatives and glyph variants do not have one-to-one correspondence to character, and not shown in this map, use \"Glyphs from the text\" tab to add these.")); page2_2_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); page2_2_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + page2_2_description->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); page2_2_vb->add_child(page2_2_description); HSplitContainer *glyphs_split = memnew(HSplitContainer); diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 7f27be99f7..cdfc85cf6f 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -36,10 +36,10 @@ #include "core/version.h" #include "editor/editor_file_system.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/gui/editor_toaster.h" #include "editor/import/resource_importer_texture_settings.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/compressed_texture.h" void ResourceImporterTexture::_texture_reimport_roughness(const Ref<CompressedTexture2D> &p_tex, const String &p_normal_path, RS::TextureDetectRoughnessChannel p_channel) { diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 5996b459a5..0ceece263c 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -33,10 +33,10 @@ #include "core/config/project_settings.h" #include "editor/editor_node.h" #include "editor/editor_resource_preview.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" +#include "editor/themes/editor_scale.h" class ImportDockParameters : public Object { GDCLASS(ImportDockParameters, Object); diff --git a/editor/input_event_configuration_dialog.cpp b/editor/input_event_configuration_dialog.cpp index db7922233e..0f483fcaef 100644 --- a/editor/input_event_configuration_dialog.cpp +++ b/editor/input_event_configuration_dialog.cpp @@ -30,9 +30,9 @@ #include "editor/input_event_configuration_dialog.h" #include "core/input/input_map.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/event_listener_line_edit.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/check_box.h" #include "scene/gui/line_edit.h" #include "scene/gui/option_button.h" diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 1b413c0978..e1640af47b 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -31,7 +31,6 @@ #include "inspector_dock.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" @@ -39,6 +38,7 @@ #include "editor/gui/editor_file_dialog.h" #include "editor/gui/editor_object_selector.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/themes/editor_scale.h" InspectorDock *InspectorDock::singleton = nullptr; diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp index 46c6ef5712..8bdd5a3102 100644 --- a/editor/localization_editor.cpp +++ b/editor/localization_editor.cpp @@ -32,12 +32,12 @@ #include "core/config/project_settings.h" #include "core/string/translation.h" -#include "editor/editor_scale.h" #include "editor/editor_translation_parser.h" #include "editor/editor_undo_redo_manager.h" #include "editor/filesystem_dock.h" #include "editor/gui/editor_file_dialog.h" #include "editor/pot_generator.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/control.h" void LocalizationEditor::_notification(int p_what) { diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index db4f5a67e5..1e564f96c0 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -30,9 +30,9 @@ #include "node_dock.h" -#include "connections_dialog.h" +#include "editor/connections_dialog.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" void NodeDock::show_groups() { groups_button->set_pressed(true); diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 041a121a3a..5c2c059c98 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -35,9 +35,9 @@ #include "core/object/script_language.h" #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "editor/editor_scale.h" #include "editor/gui/editor_validation_panel.h" #include "editor/project_settings_editor.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/grid_container.h" void PluginConfigDialog::_clear_fields() { diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index a15875fd93..2c86314ae2 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -34,10 +34,10 @@ #include "core/math/geometry_2d.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/gui/dialogs.h" #include "scene/gui/separator.h" diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index ed1df4b07f..5875b46c19 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -32,11 +32,11 @@ #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/animation/animation_blend_tree.h" #include "scene/gui/button.h" #include "scene/gui/check_box.h" diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index 057170098d..9d922f4608 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -36,11 +36,11 @@ #include "core/math/geometry_2d.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/animation/animation_blend_tree.h" #include "scene/animation/animation_player.h" #include "scene/gui/button.h" diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 5ffb89ac65..8786c4cb20 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -36,11 +36,11 @@ #include "core/os/keyboard.h" #include "editor/editor_inspector.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/3d/skeleton_3d.h" #include "scene/animation/animation_player.h" #include "scene/gui/check_box.h" diff --git a/editor/plugins/animation_library_editor.cpp b/editor/plugins/animation_library_editor.cpp index c302226357..58b1dbde8a 100644 --- a/editor/plugins/animation_library_editor.cpp +++ b/editor/plugins/animation_library_editor.cpp @@ -30,11 +30,11 @@ #include "animation_library_editor.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/animation/animation_mixer.h" void AnimationLibraryEditor::set_animation_mixer(Object *p_mixer) { diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index fe2ce70735..b08d2e966d 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -36,7 +36,6 @@ #include "core/io/resource_saver.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" @@ -44,6 +43,7 @@ #include "editor/plugins/canvas_item_editor_plugin.h" // For onion skinning. #include "editor/plugins/node_3d_editor_plugin.h" // For onion skinning. #include "editor/scene_tree_dock.h" +#include "editor/themes/editor_scale.h" #include "scene/animation/animation_tree.h" #include "scene/gui/separator.h" #include "scene/main/window.h" diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 0e61a7e29f..bbfc1f2f99 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -36,10 +36,10 @@ #include "core/math/geometry_2d.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/animation/animation_blend_tree.h" #include "scene/animation/animation_player.h" #include "scene/gui/menu_button.h" diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index efee22a9a9..7269395baf 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -40,8 +40,8 @@ #include "core/math/delaunay_2d.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/animation/animation_blend_tree.h" #include "scene/animation/animation_player.h" #include "scene/gui/button.h" diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 36a0b46d92..2012955686 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -37,11 +37,11 @@ #include "core/version.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" #include "editor/project_settings_editor.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/menu_button.h" #include "scene/resources/image_texture.h" @@ -417,7 +417,6 @@ void EditorAssetLibraryItemDownload::configure(const String &p_title, int p_asse void EditorAssetLibraryItemDownload::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("AssetLib"))); status->add_theme_color_override("font_color", get_theme_color(SNAME("status_color"), SNAME("AssetLib"))); diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp index 2be9528019..9b3f24c625 100644 --- a/editor/plugins/audio_stream_editor_plugin.cpp +++ b/editor/plugins/audio_stream_editor_plugin.cpp @@ -31,9 +31,9 @@ #include "audio_stream_editor_plugin.h" #include "editor/audio_stream_preview.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/audio_stream_wav.h" // AudioStreamEditor diff --git a/editor/plugins/bit_map_editor_plugin.cpp b/editor/plugins/bit_map_editor_plugin.cpp index f2423cb803..f1d86de537 100644 --- a/editor/plugins/bit_map_editor_plugin.cpp +++ b/editor/plugins/bit_map_editor_plugin.cpp @@ -30,7 +30,7 @@ #include "bit_map_editor_plugin.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/label.h" #include "scene/gui/texture_rect.h" #include "scene/resources/image_texture.h" diff --git a/editor/plugins/bone_map_editor_plugin.cpp b/editor/plugins/bone_map_editor_plugin.cpp index 153f192838..38573fbaa7 100644 --- a/editor/plugins/bone_map_editor_plugin.cpp +++ b/editor/plugins/bone_map_editor_plugin.cpp @@ -30,12 +30,12 @@ #include "bone_map_editor_plugin.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/import/3d/post_import_plugin_skeleton_renamer.h" #include "editor/import/3d/post_import_plugin_skeleton_rest_fixer.h" #include "editor/import/3d/post_import_plugin_skeleton_track_organizer.h" #include "editor/import/3d/scene_import_settings.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/aspect_ratio_container.h" #include "scene/gui/separator.h" #include "scene/gui/texture_rect.h" diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index f16aff555c..6c776ad9b3 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -35,7 +35,6 @@ #include "core/os/keyboard.h" #include "editor/debugger/editor_debugger_node.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" @@ -45,6 +44,7 @@ #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" #include "editor/scene_tree_dock.h" +#include "editor/themes/editor_scale.h" #include "scene/2d/polygon_2d.h" #include "scene/2d/skeleton_2d.h" #include "scene/2d/sprite_2d.h" diff --git a/editor/plugins/control_editor_plugin.cpp b/editor/plugins/control_editor_plugin.cpp index 0688ed959e..5b0831eeb8 100644 --- a/editor/plugins/control_editor_plugin.cpp +++ b/editor/plugins/control_editor_plugin.cpp @@ -31,11 +31,11 @@ #include "control_editor_plugin.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/plugins/canvas_item_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/grid_container.h" #include "scene/gui/separator.h" diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 72f6784836..ea32b659d7 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -36,11 +36,11 @@ #include "core/os/keyboard.h" #include "editor/editor_interface.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_spin_slider.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/flow_container.h" #include "scene/gui/menu_button.h" #include "scene/gui/popup_menu.h" diff --git a/editor/plugins/debugger_editor_plugin.cpp b/editor/plugins/debugger_editor_plugin.cpp index 41eae444f7..b9bde65f94 100644 --- a/editor/plugins/debugger_editor_plugin.cpp +++ b/editor/plugins/debugger_editor_plugin.cpp @@ -35,9 +35,9 @@ #include "editor/debugger/editor_debugger_server.h" #include "editor/debugger/editor_file_server.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/menu_button.h" DebuggerEditorPlugin::DebuggerEditorPlugin(PopupMenu *p_debug_menu) { diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 015a4915a8..90bd117543 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -36,8 +36,8 @@ #include "core/object/script_language.h" #include "core/os/os.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/atlas_texture.h" #include "scene/resources/bit_map.h" #include "scene/resources/font.h" diff --git a/editor/plugins/editor_resource_tooltip_plugins.cpp b/editor/plugins/editor_resource_tooltip_plugins.cpp index 36852e79b5..fab8ee9f59 100644 --- a/editor/plugins/editor_resource_tooltip_plugins.cpp +++ b/editor/plugins/editor_resource_tooltip_plugins.cpp @@ -31,7 +31,7 @@ #include "editor_resource_tooltip_plugins.h" #include "editor/editor_resource_preview.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/label.h" #include "scene/gui/texture_rect.h" diff --git a/editor/plugins/font_config_plugin.cpp b/editor/plugins/font_config_plugin.cpp index a0500bdb48..d719850204 100644 --- a/editor/plugins/font_config_plugin.cpp +++ b/editor/plugins/font_config_plugin.cpp @@ -30,9 +30,9 @@ #include "font_config_plugin.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/import/dynamic_font_import_settings.h" +#include "editor/themes/editor_scale.h" /*************************************************************************/ /* EditorPropertyFontMetaObject */ diff --git a/editor/plugins/gradient_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp index e696b900d0..d8f9664e8d 100644 --- a/editor/plugins/gradient_editor_plugin.cpp +++ b/editor/plugins/gradient_editor_plugin.cpp @@ -30,15 +30,15 @@ #include "gradient_editor_plugin.h" -#include "canvas_item_editor_plugin.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_spin_slider.h" -#include "node_3d_editor_plugin.h" +#include "editor/plugins/canvas_item_editor_plugin.h" +#include "editor/plugins/node_3d_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/color_picker.h" #include "scene/gui/flow_container.h" #include "scene/gui/popup.h" diff --git a/editor/plugins/gradient_texture_2d_editor_plugin.cpp b/editor/plugins/gradient_texture_2d_editor_plugin.cpp index 5952185cc0..bb6096ea34 100644 --- a/editor/plugins/gradient_texture_2d_editor_plugin.cpp +++ b/editor/plugins/gradient_texture_2d_editor_plugin.cpp @@ -31,9 +31,9 @@ #include "gradient_texture_2d_editor_plugin.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_spin_slider.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/flow_container.h" diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index 2a712caf92..b7c4479505 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -32,9 +32,9 @@ #include "core/config/project_settings.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" +#include "editor/themes/editor_scale.h" #include "scene/3d/camera_3d.h" #include "scene/3d/light_3d.h" #include "scene/3d/mesh_instance_3d.h" diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index 729ca5d7f9..0324b1d4f7 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -31,7 +31,7 @@ #include "mesh_editor_plugin.h" #include "core/config/project_settings.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/main/viewport.h" diff --git a/editor/plugins/mesh_instance_3d_editor_plugin.cpp b/editor/plugins/mesh_instance_3d_editor_plugin.cpp index 04be44ffc8..9669f992a8 100644 --- a/editor/plugins/mesh_instance_3d_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_3d_editor_plugin.cpp @@ -31,10 +31,10 @@ #include "mesh_instance_3d_editor_plugin.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/plugins/node_3d_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/3d/collision_shape_3d.h" #include "scene/3d/navigation_region_3d.h" #include "scene/3d/physics_body_3d.h" diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index 0f6ea71571..455376b659 100644 --- a/editor/plugins/node_3d_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -32,8 +32,8 @@ #define NODE_3D_EDITOR_PLUGIN_H #include "editor/editor_plugin.h" -#include "editor/editor_scale.h" #include "editor/plugins/node_3d_editor_gizmos.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/spin_box.h" diff --git a/editor/plugins/packed_scene_translation_parser_plugin.cpp b/editor/plugins/packed_scene_translation_parser_plugin.cpp index 7cb5244af9..c5c791ca8e 100644 --- a/editor/plugins/packed_scene_translation_parser_plugin.cpp +++ b/editor/plugins/packed_scene_translation_parser_plugin.cpp @@ -52,9 +52,11 @@ Error PackedSceneEditorTranslationParserPlugin::parse_file(const String &p_path, Ref<SceneState> state = Ref<PackedScene>(loaded_res)->get_state(); Vector<String> parsed_strings; + List<String> tabcontainer_paths; for (int i = 0; i < state->get_node_count(); i++) { String node_type = state->get_node_type(i); - if (!ClassDB::is_parent_class(node_type, "Control") && !ClassDB::is_parent_class(node_type, "Window")) { + bool is_control = ClassDB::is_parent_class(node_type, "Control"); + if (!is_control && !ClassDB::is_parent_class(node_type, "Window")) { continue; } @@ -66,10 +68,28 @@ Error PackedSceneEditorTranslationParserPlugin::parse_file(const String &p_path, break; } } + + // Parse the names of children of `TabContainer`s, as they are used for tab titles. + if (!tabcontainer_paths.is_empty()) { + String parent_path = state->get_node_path(i, true); + if (!parent_path.begins_with(tabcontainer_paths[tabcontainer_paths.size() - 1])) { + // Switch to the previous `TabContainer` this was nested in, if that was the case. + tabcontainer_paths.pop_back(); + } + + if (is_control && auto_translating && !tabcontainer_paths.is_empty() && parent_path == tabcontainer_paths[tabcontainer_paths.size() - 1]) { + parsed_strings.push_back(state->get_node_name(i)); + } + } + if (!auto_translating) { continue; } + if (node_type == "TabContainer") { + tabcontainer_paths.push_back(state->get_node_path(i)); + } + for (int j = 0; j < state->get_node_property_count(i); j++) { String property_name = state->get_node_property_name(i, j); if (!lookup_properties.has(property_name) || (exception_list.has(node_type) && exception_list[node_type].has(property_name))) { diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index 6f44dfc755..a772dba6ae 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -34,9 +34,9 @@ #include "core/io/file_access.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/dialogs.h" #include "scene/gui/menu_button.h" diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 148ba7d7ca..e56fc94a55 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -33,11 +33,11 @@ #include "core/input/input_event.h" #include "core/math/geometry_2d.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_zoom_widget.h" #include "editor/plugins/canvas_item_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/2d/skeleton_2d.h" #include "scene/gui/check_box.h" #include "scene/gui/dialogs.h" diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index d9f5aee82c..9b31e40e94 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -34,10 +34,10 @@ #include "core/io/resource_loader.h" #include "editor/editor_interface.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" void ResourcePreloaderEditor::_notification(int p_what) { switch (p_what) { diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp index b54a2f717d..13928710bb 100644 --- a/editor/plugins/root_motion_editor_plugin.cpp +++ b/editor/plugins/root_motion_editor_plugin.cpp @@ -31,7 +31,7 @@ #include "root_motion_editor_plugin.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "scene/3d/skeleton_3d.h" #include "scene/animation/animation_mixer.h" #include "scene/gui/button.h" diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 9a8164a3cf..55191f44d4 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -45,7 +45,6 @@ #include "editor/editor_interface.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_script.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" @@ -58,6 +57,7 @@ #include "editor/node_dock.h" #include "editor/plugins/shader_editor_plugin.h" #include "editor/plugins/text_shader_editor.h" +#include "editor/themes/editor_scale.h" #include "editor/window_wrapper.h" #include "scene/main/node.h" #include "scene/main/window.h" @@ -1001,7 +1001,10 @@ void ScriptEditor::_res_saved_callback(const Ref<Resource> &p_res) { } _update_script_names(); - trigger_live_script_reload(); + Ref<Script> scr = p_res; + if (scr.is_valid()) { + trigger_live_script_reload(scr->get_path()); + } } void ScriptEditor::_scene_saved_callback(const String &p_path) { @@ -1029,16 +1032,33 @@ void ScriptEditor::_scene_saved_callback(const String &p_path) { } } -void ScriptEditor::trigger_live_script_reload() { +void ScriptEditor::trigger_live_script_reload(const String &p_script_path) { + if (!script_paths_to_reload.has(p_script_path)) { + script_paths_to_reload.append(p_script_path); + } if (!pending_auto_reload && auto_reload_running_scripts) { callable_mp(this, &ScriptEditor::_live_auto_reload_running_scripts).call_deferred(); pending_auto_reload = true; } } +void ScriptEditor::trigger_live_script_reload_all() { + if (!pending_auto_reload && auto_reload_running_scripts) { + call_deferred(SNAME("_live_auto_reload_running_scripts")); + pending_auto_reload = true; + reload_all_scripts = true; + } +} + void ScriptEditor::_live_auto_reload_running_scripts() { pending_auto_reload = false; - EditorDebuggerNode::get_singleton()->reload_scripts(); + if (reload_all_scripts) { + EditorDebuggerNode::get_singleton()->reload_all_scripts(); + } else { + EditorDebuggerNode::get_singleton()->reload_scripts(script_paths_to_reload); + } + reload_all_scripts = false; + script_paths_to_reload.clear(); } bool ScriptEditor::_test_script_times_on_disk(Ref<Resource> p_for_script) { diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 4a814ea1bc..68eb23c838 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -382,6 +382,8 @@ class ScriptEditor : public PanelContainer { bool pending_auto_reload; bool auto_reload_running_scripts; + bool reload_all_scripts = false; + Vector<String> script_paths_to_reload; void _live_auto_reload_running_scripts(); void _update_selected_editor_menu(); @@ -542,7 +544,8 @@ public: void clear_docs_from_script(const Ref<Script> &p_script); void update_docs_from_script(const Ref<Script> &p_script); - void trigger_live_script_reload(); + void trigger_live_script_reload(const String &p_script_path); + void trigger_live_script_reload_all(); bool can_take_away_focus() const; diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 38f3d865d4..5bd6f83616 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -36,10 +36,10 @@ #include "editor/debugger/editor_debugger_node.h" #include "editor/editor_command_palette.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_toaster.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/rich_text_label.h" #include "scene/gui/split_container.h" @@ -824,7 +824,7 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo scr->set_last_modified_time(rel_scr->get_last_modified_time()); scr->update_exports(); - trigger_live_script_reload(); + trigger_live_script_reload(scr->get_path()); } } } diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 6d6da69405..5798ff9d99 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -32,7 +32,6 @@ #include "editor/editor_command_palette.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/filesystem_dock.h" @@ -40,6 +39,7 @@ #include "editor/plugins/text_shader_editor.h" #include "editor/plugins/visual_shader_editor_plugin.h" #include "editor/shader_create_dialog.h" +#include "editor/themes/editor_scale.h" #include "editor/window_wrapper.h" #include "scene/gui/item_list.h" #include "scene/gui/texture_rect.h" diff --git a/editor/plugins/shader_file_editor_plugin.cpp b/editor/plugins/shader_file_editor_plugin.cpp index d68b3bde14..69ad274114 100644 --- a/editor/plugins/shader_file_editor_plugin.cpp +++ b/editor/plugins/shader_file_editor_plugin.cpp @@ -35,9 +35,9 @@ #include "core/os/keyboard.h" #include "core/os/os.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/item_list.h" #include "scene/gui/split_container.h" #include "servers/display_server.h" diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index c816220bd2..53fdde9e14 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -34,12 +34,12 @@ #include "editor/editor_node.h" #include "editor/editor_properties.h" #include "editor/editor_properties_vector.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/plugins/animation_player_editor_plugin.h" -#include "node_3d_editor_plugin.h" +#include "editor/plugins/node_3d_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/3d/collision_shape_3d.h" #include "scene/3d/joint_3d.h" #include "scene/3d/mesh_instance_3d.h" diff --git a/editor/plugins/sprite_2d_editor_plugin.cpp b/editor/plugins/sprite_2d_editor_plugin.cpp index d343f80420..c1e7070451 100644 --- a/editor/plugins/sprite_2d_editor_plugin.cpp +++ b/editor/plugins/sprite_2d_editor_plugin.cpp @@ -33,11 +33,11 @@ #include "canvas_item_editor_plugin.h" #include "core/math/geometry_2d.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_zoom_widget.h" #include "editor/scene_tree_dock.h" +#include "editor/themes/editor_scale.h" #include "scene/2d/collision_polygon_2d.h" #include "scene/2d/light_occluder_2d.h" #include "scene/2d/mesh_instance_2d.h" diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index f4fa4b14bb..3672142b35 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -35,12 +35,12 @@ #include "core/os/keyboard.h" #include "editor/editor_file_system.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" #include "editor/scene_tree_dock.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/center_container.h" #include "scene/gui/flow_container.h" #include "scene/gui/margin_container.h" diff --git a/editor/plugins/style_box_editor_plugin.cpp b/editor/plugins/style_box_editor_plugin.cpp index 9b1c208a9f..6ecbff3bb4 100644 --- a/editor/plugins/style_box_editor_plugin.cpp +++ b/editor/plugins/style_box_editor_plugin.cpp @@ -30,7 +30,7 @@ #include "style_box_editor_plugin.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/resources/style_box_texture.h" diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp index e5b9e3854f..98d83b6e95 100644 --- a/editor/plugins/text_shader_editor.cpp +++ b/editor/plugins/text_shader_editor.cpp @@ -32,11 +32,11 @@ #include "core/version_generated.gen.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/filesystem_dock.h" #include "editor/project_settings_editor.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/split_container.h" #include "servers/rendering/shader_preprocessor.h" #include "servers/rendering/shader_types.h" diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 9d640bf0dc..38d9bb84f4 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -30,8 +30,8 @@ #include "texture_editor_plugin.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/label.h" #include "scene/gui/texture_rect.h" #include "scene/resources/animated_texture.h" diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 73de15631a..09f6bf884e 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -33,10 +33,10 @@ #include "core/input/input.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/check_box.h" #include "scene/gui/option_button.h" #include "scene/gui/panel_container.h" diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index cbe0f115d3..8c3fe82f36 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -34,12 +34,12 @@ #include "editor/editor_help.h" #include "editor/editor_node.h" #include "editor/editor_resource_picker.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" #include "editor/inspector_dock.h" #include "editor/progress_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/check_button.h" #include "scene/gui/color_picker.h" #include "scene/gui/item_list.h" @@ -852,10 +852,9 @@ bool ThemeItemImportTree::has_selected_items() const { void ThemeItemImportTree::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { select_icons_warning_icon->set_texture(get_editor_theme_icon(SNAME("StatusWarning"))); - select_icons_warning->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + select_icons_warning->add_theme_color_override("font_color", get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); import_items_filter->set_right_icon(get_editor_theme_icon(SNAME("Search"))); @@ -2470,7 +2469,7 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_ item_rename_cancel_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_rename_canceled).bind(p_data_type, p_item_name, item_name_container)); item_rename_cancel_button->hide(); } else { - item_name->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + item_name->add_theme_color_override("font_color", get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); Button *item_override_button = memnew(Button); item_override_button->set_icon(get_editor_theme_icon(SNAME("Add"))); diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp index 9825be9ae8..205a5e8a20 100644 --- a/editor/plugins/theme_editor_preview.cpp +++ b/editor/plugins/theme_editor_preview.cpp @@ -34,8 +34,8 @@ #include "core/input/input.h" #include "core/math/math_funcs.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/gui/check_box.h" #include "scene/gui/check_button.h" diff --git a/editor/plugins/tiles/atlas_merging_dialog.cpp b/editor/plugins/tiles/atlas_merging_dialog.cpp index 62b4993947..d03445b412 100644 --- a/editor/plugins/tiles/atlas_merging_dialog.cpp +++ b/editor/plugins/tiles/atlas_merging_dialog.cpp @@ -31,9 +31,9 @@ #include "atlas_merging_dialog.h" #include "editor/editor_properties_vector.h" -#include "editor/editor_scale.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/control.h" #include "scene/gui/split_container.h" #include "scene/resources/image_texture.h" diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp index 039213e545..721186ef82 100644 --- a/editor/plugins/tiles/tile_atlas_view.cpp +++ b/editor/plugins/tiles/tile_atlas_view.cpp @@ -32,15 +32,14 @@ #include "core/input/input.h" #include "core/os/keyboard.h" +#include "editor/editor_settings.h" +#include "editor/themes/editor_scale.h" #include "scene/2d/tile_map.h" #include "scene/gui/box_container.h" #include "scene/gui/label.h" #include "scene/gui/panel.h" #include "scene/gui/view_panner.h" -#include "editor/editor_scale.h" -#include "editor/editor_settings.h" - void TileAtlasView::gui_input(const Ref<InputEvent> &p_event) { if (panner->gui_input(p_event)) { accept_event(); diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp index 8e4c26bd15..bd44c2965b 100644 --- a/editor/plugins/tiles/tile_data_editors.cpp +++ b/editor/plugins/tiles/tile_data_editors.cpp @@ -37,10 +37,10 @@ #include "editor/editor_node.h" #include "editor/editor_properties.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/control.h" #include "scene/gui/label.h" diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index c0aa5b8efa..c34878b54e 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -34,10 +34,10 @@ #include "editor/editor_node.h" #include "editor/editor_resource_preview.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/plugins/canvas_item_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/2d/camera_2d.h" #include "scene/gui/center_container.h" diff --git a/editor/plugins/tiles/tile_proxies_manager_dialog.cpp b/editor/plugins/tiles/tile_proxies_manager_dialog.cpp index ba431dfa2f..4a0b5e2117 100644 --- a/editor/plugins/tiles/tile_proxies_manager_dialog.cpp +++ b/editor/plugins/tiles/tile_proxies_manager_dialog.cpp @@ -31,9 +31,9 @@ #include "tile_proxies_manager_dialog.h" #include "editor/editor_properties_vector.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/dialogs.h" #include "scene/gui/popup_menu.h" #include "scene/gui/separator.h" diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 10dc20d24f..e3710adc83 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -34,13 +34,13 @@ #include "editor/editor_inspector.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_toaster.h" #include "editor/plugins/tiles/tile_set_editor.h" #include "editor/progress_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" @@ -735,7 +735,7 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() { tile_data_editors["probability"] = tile_data_probability_editor; } - Color disabled_color = get_theme_color("disabled_font_color", EditorStringName(Editor)); + Color disabled_color = get_theme_color("font_disabled_color", EditorStringName(Editor)); // --- Physics --- ADD_TILE_DATA_EDITOR_GROUP(TTR("Physics")); @@ -1869,7 +1869,7 @@ void TileSetAtlasSourceEditor::_tile_atlas_control_unscaled_draw() { for (int i = 0; i < tile_set_atlas_source->get_tiles_count(); i++) { Vector2i coords = tile_set_atlas_source->get_tile_id(i); Rect2i texture_region = tile_set_atlas_source->get_tile_texture_region(coords); - Vector2i position = texture_region.get_center() + tile_set_atlas_source->get_tile_data(coords, 0)->get_texture_origin(); + Vector2 position = ((Rect2)texture_region).get_center() + tile_set_atlas_source->get_tile_data(coords, 0)->get_texture_origin(); Transform2D xform = tile_atlas_control->get_parent_control()->get_transform(); xform.translate_local(position); @@ -1892,7 +1892,7 @@ void TileSetAtlasSourceEditor::_tile_atlas_control_unscaled_draw() { continue; } Rect2i texture_region = tile_set_atlas_source->get_tile_texture_region(E.tile); - Vector2i position = texture_region.get_center() + tile_set_atlas_source->get_tile_data(E.tile, 0)->get_texture_origin(); + Vector2 position = ((Rect2)texture_region).get_center() + tile_set_atlas_source->get_tile_data(E.tile, 0)->get_texture_origin(); Transform2D xform = tile_atlas_control->get_parent_control()->get_transform(); xform.translate_local(position); diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index bdde662ce1..c43995d167 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -36,10 +36,10 @@ #include "editor/editor_file_system.h" #include "editor/editor_inspector.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/control.h" diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp index 7f6616fe34..4895e1d291 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp @@ -33,11 +33,11 @@ #include "editor/editor_file_system.h" #include "editor/editor_node.h" #include "editor/editor_resource_preview.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_file_dialog.h" #include "editor/plugins/tiles/tile_set_editor.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/gui/item_list.h" diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp index e7e94fdefa..057e6443d6 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.cpp +++ b/editor/plugins/tiles/tiles_editor_plugin.cpp @@ -36,10 +36,10 @@ #include "editor/editor_interface.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/plugins/canvas_item_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/2d/tile_map.h" #include "scene/gui/box_container.h" diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index 2fa54ac1dc..d8d70e5b7d 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -33,14 +33,15 @@ #include "core/config/project_settings.h" #include "core/os/keyboard.h" #include "core/os/time.h" +#include "editor/editor_dock_manager.h" #include "editor/editor_file_system.h" #include "editor/editor_interface.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/filesystem_dock.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/separator.h" #define CHECK_PLUGIN_INITIALIZED() \ @@ -909,7 +910,7 @@ void VersionControlEditorPlugin::fetch_available_vcs_plugin_names() { } void VersionControlEditorPlugin::register_editor() { - EditorNode::get_singleton()->add_control_to_dock(EditorNode::DOCK_SLOT_RIGHT_UL, version_commit_dock); + EditorDockManager::get_singleton()->add_control_to_dock(EditorDockManager::DOCK_SLOT_RIGHT_UL, version_commit_dock); version_control_dock_button = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Version Control"), version_control_dock); @@ -929,7 +930,7 @@ void VersionControlEditorPlugin::shut_down() { memdelete(EditorVCSInterface::get_singleton()); EditorVCSInterface::set_singleton(nullptr); - EditorNode::get_singleton()->remove_control_from_dock(version_commit_dock); + EditorDockManager::get_singleton()->remove_control_from_dock(version_commit_dock); EditorNode::get_singleton()->remove_bottom_panel_item(version_control_dock); _set_vcs_ui_state(false); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 24b76526c6..6de37172b3 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -37,7 +37,6 @@ #include "editor/editor_node.h" #include "editor/editor_properties.h" #include "editor/editor_properties_vector.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" @@ -45,6 +44,7 @@ #include "editor/inspector_dock.h" #include "editor/plugins/curve_editor_plugin.h" #include "editor/plugins/shader_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/gui/check_box.h" #include "scene/gui/code_edit.h" diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp index c0dfc18072..ff8343fbeb 100644 --- a/editor/progress_dialog.cpp +++ b/editor/progress_dialog.cpp @@ -33,7 +33,7 @@ #include "core/os/os.h" #include "editor/editor_interface.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "main/main.h" #include "servers/display_server.h" diff --git a/editor/project_converter_3_to_4.cpp b/editor/project_converter_3_to_4.cpp index 2b0f61c1b0..f8161272f6 100644 --- a/editor/project_converter_3_to_4.cpp +++ b/editor/project_converter_3_to_4.cpp @@ -2350,7 +2350,7 @@ void ProjectConverter3To4::process_gdscript_line(String &line, const RegExContai line = line.replace("OS.is_window_focused", "get_window().has_focus"); } if (line.contains("OS.move_window_to_foreground")) { - line = line.replace("OS.move_window_to_foreground", "get_window().move_to_foreground"); + line = line.replace("OS.move_window_to_foreground", "get_window().grab_focus"); } if (line.contains("OS.request_attention")) { line = line.replace("OS.request_attention", "get_window().request_attention"); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index c986ce215a..e7277bad6a 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -42,13 +42,14 @@ #include "core/string/translation.h" #include "core/version.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" -#include "editor/editor_themes.h" #include "editor/editor_vcs_interface.h" #include "editor/gui/editor_file_dialog.h" #include "editor/plugins/asset_library_editor_plugin.h" +#include "editor/themes/editor_icons.h" +#include "editor/themes/editor_scale.h" +#include "editor/themes/editor_theme_manager.h" #include "main/main.h" #include "scene/gui/center_container.h" #include "scene/gui/check_box.h" @@ -2879,9 +2880,8 @@ ProjectManager::ProjectManager() { Control::set_root_layout_direction(pm_root_dir); Window::set_root_layout_direction(pm_root_dir); - EditorColorMap::create(); - EditorTheme::initialize(); - Ref<Theme> theme = create_custom_theme(); + EditorThemeManager::initialize(); + Ref<Theme> theme = EditorThemeManager::generate_theme(); DisplayServer::set_early_window_clear_color_override(true, theme->get_color(SNAME("background"), EditorStringName(Editor))); set_theme(theme); @@ -3317,8 +3317,7 @@ ProjectManager::~ProjectManager() { EditorSettings::destroy(); } - EditorColorMap::finish(); - EditorTheme::finalize(); + EditorThemeManager::finalize(); } void ProjectTag::_notification(int p_what) { diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index b7a5521ffd..e59bb76ff4 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -33,11 +33,11 @@ #include "core/config/project_settings.h" #include "editor/editor_log.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/export/editor_export.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/check_button.h" #include "servers/movie_writer/movie_writer.h" @@ -556,6 +556,8 @@ void ProjectSettingsEditor::_update_action_map_editor() { } void ProjectSettingsEditor::_update_theme() { + add_button->set_icon(get_editor_theme_icon(SNAME("Add"))); + del_button->set_icon(get_editor_theme_icon(SNAME("Remove"))); search_box->set_right_icon(get_editor_theme_icon(SNAME("Search"))); restart_close_button->set_icon(get_editor_theme_icon(SNAME("Close"))); restart_container->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index 87dbbd599d..be5f309704 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -34,7 +34,7 @@ #include "editor/doc_tools.h" #include "editor/editor_help.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/line_edit.h" #include "scene/gui/rich_text_label.h" #include "scene/gui/tree.h" diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index a3a16dccd8..07cb96b9bc 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -35,12 +35,11 @@ #include "core/string/print_string.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" -#include "editor/editor_themes.h" #include "editor/editor_undo_redo_manager.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "modules/regex/regex.h" #include "scene/gui/check_box.h" #include "scene/gui/check_button.h" diff --git a/editor/scene_create_dialog.cpp b/editor/scene_create_dialog.cpp index be558101cf..ef700d8352 100644 --- a/editor/scene_create_dialog.cpp +++ b/editor/scene_create_dialog.cpp @@ -33,9 +33,9 @@ #include "core/io/dir_access.h" #include "editor/create_dialog.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_validation_panel.h" +#include "editor/themes/editor_scale.h" #include "scene/2d/node_2d.h" #include "scene/3d/node_3d.h" #include "scene/gui/box_container.h" diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index c2d0785925..9c7ba827b7 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -40,7 +40,6 @@ #include "editor/editor_node.h" #include "editor/editor_paths.h" #include "editor/editor_quick_open.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" @@ -55,6 +54,7 @@ #include "editor/plugins/script_editor_plugin.h" #include "editor/reparent_dialog.h" #include "editor/shader_create_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/animation/animation_tree.h" #include "scene/gui/check_box.h" #include "scene/main/window.h" @@ -1392,7 +1392,7 @@ void SceneTreeDock::_notification(int p_what) { node_shortcuts_toggle->set_flat(true); node_shortcuts_toggle->set_icon(get_editor_theme_icon(SNAME("Favorites"))); node_shortcuts_toggle->set_toggle_mode(true); - node_shortcuts_toggle->set_tooltip_text(TTR("Switch to Favorite Nodes")); + node_shortcuts_toggle->set_tooltip_text(TTR("Toggle the display of favorite nodes.")); node_shortcuts_toggle->set_pressed(EDITOR_GET("_use_favorites_root_selection")); node_shortcuts_toggle->set_anchors_and_offsets_preset(Control::PRESET_CENTER_RIGHT); node_shortcuts_toggle->connect("pressed", callable_mp(this, &SceneTreeDock::_update_create_root_dialog)); @@ -3998,6 +3998,7 @@ void SceneTreeDock::_list_all_subresources(PopupMenu *p_menu) { } p_menu->add_item(display_text); + p_menu->set_item_tooltip(-1, pair.first->get_path()); p_menu->set_item_metadata(-1, pair.first->get_instance_id()); } } diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 25e17ccd2a..1da8fa49b4 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -38,11 +38,11 @@ #include "editor/editor_file_system.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" #include "editor/gui/editor_validation_panel.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/grid_container.h" #include "scene/gui/line_edit.h" diff --git a/editor/shader_create_dialog.cpp b/editor/shader_create_dialog.cpp index fb91d139a7..8d77b14ab0 100644 --- a/editor/shader_create_dialog.cpp +++ b/editor/shader_create_dialog.cpp @@ -31,9 +31,9 @@ #include "shader_create_dialog.h" #include "core/config/project_settings.h" -#include "editor/editor_scale.h" #include "editor/gui/editor_file_dialog.h" #include "editor/gui/editor_validation_panel.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/shader_include.h" #include "scene/resources/visual_shader.h" #include "servers/rendering/shader_types.h" diff --git a/editor/shader_globals_editor.cpp b/editor/shader_globals_editor.cpp index 2a5290307c..46f520df45 100644 --- a/editor/shader_globals_editor.cpp +++ b/editor/shader_globals_editor.cpp @@ -344,15 +344,29 @@ static Variant create_var(RS::GlobalShaderParameterType p_type) { } } +String ShaderGlobalsEditor::_check_new_variable_name(const String &p_variable_name) { + if (p_variable_name.is_empty()) { + return TTR("Name cannot be empty."); + } + + if (!p_variable_name.is_valid_identifier()) { + return TTR("Name must be a valid identifier."); + } + + return ""; +} + +void ShaderGlobalsEditor::_variable_name_text_changed(const String &p_variable_name) { + const String &warning = _check_new_variable_name(p_variable_name.strip_edges()); + variable_add->set_tooltip_text(warning); + variable_add->set_disabled(!warning.is_empty()); +} + void ShaderGlobalsEditor::_variable_added() { String var = variable_name->get_text().strip_edges(); - if (var.is_empty() || !var.is_valid_identifier()) { - EditorNode::get_singleton()->show_warning(TTR("Please specify a valid shader uniform identifier name.")); - return; - } if (RenderingServer::get_singleton()->global_shader_parameter_get(var).get_type() != Variant::NIL) { - EditorNode::get_singleton()->show_warning(vformat(TTR("Global shader parameter '%s' already exists'"), var)); + EditorNode::get_singleton()->show_warning(vformat(TTR("Global shader parameter '%s' already exists."), var)); return; } @@ -416,6 +430,10 @@ void ShaderGlobalsEditor::_notification(int p_what) { } } break; + case NOTIFICATION_THEME_CHANGED: { + variable_add->set_icon(get_editor_theme_icon(SNAME("Add"))); + } break; + case NOTIFICATION_PREDELETE: { inspector->edit(nullptr); } break; @@ -431,6 +449,9 @@ ShaderGlobalsEditor::ShaderGlobalsEditor() { add_menu_hb->add_child(memnew(Label(TTR("Name:")))); variable_name = memnew(LineEdit); variable_name->set_h_size_flags(SIZE_EXPAND_FILL); + variable_name->set_clear_button_enabled(true); + variable_name->connect("text_changed", callable_mp(this, &ShaderGlobalsEditor::_variable_name_text_changed)); + add_menu_hb->add_child(variable_name); add_menu_hb->add_child(memnew(Label(TTR("Type:")))); @@ -443,6 +464,7 @@ ShaderGlobalsEditor::ShaderGlobalsEditor() { } variable_add = memnew(Button(TTR("Add"))); + variable_add->set_disabled(true); add_menu_hb->add_child(variable_add); variable_add->connect("pressed", callable_mp(this, &ShaderGlobalsEditor::_variable_added)); diff --git a/editor/shader_globals_editor.h b/editor/shader_globals_editor.h index 590da342d4..fc50564aae 100644 --- a/editor/shader_globals_editor.h +++ b/editor/shader_globals_editor.h @@ -49,6 +49,9 @@ class ShaderGlobalsEditor : public VBoxContainer { OptionButton *variable_type = nullptr; Button *variable_add = nullptr; + String _check_new_variable_name(const String &p_variable_name); + + void _variable_name_text_changed(const String &p_variable_name); void _variable_added(); void _variable_deleted(const String &p_variable); void _changed(); diff --git a/editor/surface_upgrade_tool.cpp b/editor/surface_upgrade_tool.cpp index d914303b4e..4edfb92b01 100644 --- a/editor/surface_upgrade_tool.cpp +++ b/editor/surface_upgrade_tool.cpp @@ -33,9 +33,9 @@ #include "editor/editor_file_system.h" #include "editor/editor_log.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/gui/editor_toaster.h" +#include "editor/themes/editor_scale.h" #include "scene/scene_string_names.h" #include "servers/rendering_server.h" diff --git a/editor/themes/SCsub b/editor/themes/SCsub new file mode 100644 index 0000000000..41b20f8a78 --- /dev/null +++ b/editor/themes/SCsub @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +Import("env") + +import glob +import editor_theme_builders + + +# Fonts +flist = glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.ttf") +flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.otf")) +flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.woff")) +flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.woff2")) +flist.sort() +env.Depends("#editor/themes/builtin_fonts.gen.h", flist) +env.CommandNoCache( + "#editor/themes/builtin_fonts.gen.h", + flist, + env.Run(editor_theme_builders.make_fonts_header, "Generating builtin fonts header."), +) + +env.add_source_files(env.editor_sources, "*.cpp") diff --git a/editor/themes/editor_color_map.cpp b/editor/themes/editor_color_map.cpp new file mode 100644 index 0000000000..0b3a237244 --- /dev/null +++ b/editor/themes/editor_color_map.cpp @@ -0,0 +1,204 @@ +/**************************************************************************/ +/* editor_color_map.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "editor_color_map.h" + +HashMap<Color, Color> EditorColorMap::color_conversion_map; +HashSet<StringName> EditorColorMap::color_conversion_exceptions; + +void EditorColorMap::add_conversion_color_pair(const String p_from_color, const String p_to_color) { + color_conversion_map[Color::html(p_from_color)] = Color::html(p_to_color); +} + +void EditorColorMap::add_conversion_exception(const StringName &p_icon_name) { + color_conversion_exceptions.insert(p_icon_name); +} + +void EditorColorMap::create() { + // Some of the colors below are listed for completeness sake. + // This can be a basis for proper palette validation later. + + // Convert: FROM TO + add_conversion_color_pair("#478cbf", "#478cbf"); // Godot Blue + add_conversion_color_pair("#414042", "#414042"); // Godot Gray + + add_conversion_color_pair("#ffffff", "#414141"); // Pure white + add_conversion_color_pair("#fefefe", "#fefefe"); // Forced light color + add_conversion_color_pair("#000000", "#bfbfbf"); // Pure black + add_conversion_color_pair("#010101", "#010101"); // Forced dark color + + // Keep pure RGB colors as is, but list them for explicitness. + add_conversion_color_pair("#ff0000", "#ff0000"); // Pure red + add_conversion_color_pair("#00ff00", "#00ff00"); // Pure green + add_conversion_color_pair("#0000ff", "#0000ff"); // Pure blue + + // GUI Colors + add_conversion_color_pair("#e0e0e0", "#5a5a5a"); // Common icon color + add_conversion_color_pair("#808080", "#808080"); // GUI disabled color + add_conversion_color_pair("#b3b3b3", "#363636"); // GUI disabled light color + add_conversion_color_pair("#699ce8", "#699ce8"); // GUI highlight color + add_conversion_color_pair("#f9f9f9", "#606060"); // Scrollbar grabber highlight color + + add_conversion_color_pair("#c38ef1", "#a85de9"); // Animation + add_conversion_color_pair("#8da5f3", "#3d64dd"); // 2D + add_conversion_color_pair("#7582a8", "#6d83c8"); // 2D Abstract + add_conversion_color_pair("#fc7f7f", "#cd3838"); // 3D + add_conversion_color_pair("#b56d6d", "#be6a6a"); // 3D Abstract + add_conversion_color_pair("#8eef97", "#2fa139"); // GUI Control + add_conversion_color_pair("#76ad7b", "#64a66a"); // GUI Control Abstract + + add_conversion_color_pair("#5fb2ff", "#0079f0"); // Selection (blue) + add_conversion_color_pair("#003e7a", "#2b74bb"); // Selection (darker blue) + add_conversion_color_pair("#f7f5cf", "#615f3a"); // Gizmo (yellow) + + // Rainbow + add_conversion_color_pair("#ff4545", "#ff2929"); // Red + add_conversion_color_pair("#ffe345", "#ffe337"); // Yellow + add_conversion_color_pair("#80ff45", "#74ff34"); // Green + add_conversion_color_pair("#45ffa2", "#2cff98"); // Aqua + add_conversion_color_pair("#45d7ff", "#22ccff"); // Blue + add_conversion_color_pair("#8045ff", "#702aff"); // Purple + add_conversion_color_pair("#ff4596", "#ff2781"); // Pink + + // Audio gradients + add_conversion_color_pair("#e1da5b", "#d6cf4b"); // Yellow + + add_conversion_color_pair("#62aeff", "#1678e0"); // Frozen gradient top + add_conversion_color_pair("#75d1e6", "#41acc5"); // Frozen gradient middle + add_conversion_color_pair("#84ffee", "#49ccba"); // Frozen gradient bottom + + add_conversion_color_pair("#f70000", "#c91616"); // Color track red + add_conversion_color_pair("#eec315", "#d58c0b"); // Color track orange + add_conversion_color_pair("#dbee15", "#b7d10a"); // Color track yellow + add_conversion_color_pair("#288027", "#218309"); // Color track green + + // Other objects + add_conversion_color_pair("#ffca5f", "#fea900"); // Mesh resource (orange) + add_conversion_color_pair("#2998ff", "#68b6ff"); // Shape resource (blue) + add_conversion_color_pair("#a2d2ff", "#4998e3"); // Shape resource (light blue) + add_conversion_color_pair("#69c4d4", "#29a3cc"); // Input event highlight (light blue) + + // Animation editor tracks + // The property track icon color is set by the common icon color. + add_conversion_color_pair("#ea7940", "#bd5e2c"); // 3D Position track + add_conversion_color_pair("#ff2b88", "#bd165f"); // 3D Rotation track + add_conversion_color_pair("#eac840", "#bd9d1f"); // 3D Scale track + add_conversion_color_pair("#3cf34e", "#16a827"); // Call Method track + add_conversion_color_pair("#2877f6", "#236be6"); // Bezier Curve track + add_conversion_color_pair("#eae440", "#9f9722"); // Audio Playback track + add_conversion_color_pair("#a448f0", "#9853ce"); // Animation Playback track + add_conversion_color_pair("#5ad5c4", "#0a9c88"); // Blend Shape track + + // Control layouts + add_conversion_color_pair("#d6d6d6", "#474747"); // Highlighted part + add_conversion_color_pair("#474747", "#d6d6d6"); // Background part + add_conversion_color_pair("#919191", "#6e6e6e"); // Border part + + // TileSet editor icons + add_conversion_color_pair("#fce00e", "#aa8d24"); // New Single Tile + add_conversion_color_pair("#0e71fc", "#0350bd"); // New Autotile + add_conversion_color_pair("#c6ced4", "#828f9b"); // New Atlas + + // Variant types + add_conversion_color_pair("#41ecad", "#25e3a0"); // Variant + add_conversion_color_pair("#6f91f0", "#6d8eeb"); // bool + add_conversion_color_pair("#5abbef", "#4fb2e9"); // int/uint + add_conversion_color_pair("#35d4f4", "#27ccf0"); // float + add_conversion_color_pair("#4593ec", "#4690e7"); // String + add_conversion_color_pair("#ee5677", "#ee7991"); // AABB + add_conversion_color_pair("#e0e0e0", "#5a5a5a"); // Array + add_conversion_color_pair("#e1ec41", "#b2bb19"); // Basis + add_conversion_color_pair("#54ed9e", "#57e99f"); // Dictionary + add_conversion_color_pair("#417aec", "#6993ec"); // NodePath + add_conversion_color_pair("#55f3e3", "#12d5c3"); // Object + add_conversion_color_pair("#f74949", "#f77070"); // Plane + add_conversion_color_pair("#44bd44", "#46b946"); // Projection + add_conversion_color_pair("#ec418e", "#ec69a3"); // Quaternion + add_conversion_color_pair("#f1738f", "#ee758e"); // Rect2 + add_conversion_color_pair("#41ec80", "#2ce573"); // RID + add_conversion_color_pair("#b9ec41", "#96ce1a"); // Transform2D + add_conversion_color_pair("#f68f45", "#f49047"); // Transform3D + add_conversion_color_pair("#ac73f1", "#ad76ee"); // Vector2 + add_conversion_color_pair("#de66f0", "#dc6aed"); // Vector3 + add_conversion_color_pair("#f066bd", "#ed6abd"); // Vector4 + + // Visual shaders + add_conversion_color_pair("#77ce57", "#67c046"); // Vector funcs + add_conversion_color_pair("#ea686c", "#d95256"); // Vector transforms + add_conversion_color_pair("#eac968", "#d9b64f"); // Textures and cubemaps + add_conversion_color_pair("#cf68ea", "#c050dd"); // Functions and expressions + + // These icons should not be converted. + add_conversion_exception("EditorPivot"); + add_conversion_exception("EditorHandle"); + add_conversion_exception("Editor3DHandle"); + add_conversion_exception("EditorBoneHandle"); + add_conversion_exception("Godot"); + add_conversion_exception("Sky"); + add_conversion_exception("EditorControlAnchor"); + add_conversion_exception("DefaultProjectIcon"); + add_conversion_exception("ZoomMore"); + add_conversion_exception("ZoomLess"); + add_conversion_exception("ZoomReset"); + add_conversion_exception("LockViewport"); + add_conversion_exception("GroupViewport"); + add_conversion_exception("StatusError"); + add_conversion_exception("StatusSuccess"); + add_conversion_exception("StatusWarning"); + add_conversion_exception("OverbrightIndicator"); + add_conversion_exception("MaterialPreviewCube"); + add_conversion_exception("MaterialPreviewSphere"); + add_conversion_exception("MaterialPreviewLight1"); + add_conversion_exception("MaterialPreviewLight2"); + + // GUI + add_conversion_exception("GuiChecked"); + add_conversion_exception("GuiRadioChecked"); + add_conversion_exception("GuiIndeterminate"); + add_conversion_exception("GuiCloseCustomizable"); + add_conversion_exception("GuiGraphNodePort"); + add_conversion_exception("GuiResizer"); + add_conversion_exception("GuiMiniCheckerboard"); + + /// Code Editor. + add_conversion_exception("GuiTab"); + add_conversion_exception("GuiSpace"); + add_conversion_exception("CodeFoldedRightArrow"); + add_conversion_exception("CodeFoldDownArrow"); + add_conversion_exception("CodeRegionFoldedRightArrow"); + add_conversion_exception("CodeRegionFoldDownArrow"); + add_conversion_exception("TextEditorPlay"); + add_conversion_exception("Breakpoint"); +} + +void EditorColorMap::finish() { + color_conversion_map.clear(); + color_conversion_exceptions.clear(); +} diff --git a/editor/editor_themes.h b/editor/themes/editor_color_map.h index 7d913ccc40..4debd37faf 100644 --- a/editor/editor_themes.h +++ b/editor/themes/editor_color_map.h @@ -1,5 +1,5 @@ /**************************************************************************/ -/* editor_themes.h */ +/* editor_color_map.h */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,11 +28,13 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#ifndef EDITOR_THEMES_H -#define EDITOR_THEMES_H +#ifndef EDITOR_COLOR_MAP_H +#define EDITOR_COLOR_MAP_H -#include "scene/resources/texture.h" -#include "scene/resources/theme.h" +#include "core/math/color.h" +#include "core/string/string_name.h" +#include "core/templates/hash_map.h" +#include "core/templates/hash_set.h" // The default icon theme is designed to be used for a dark theme. This map stores // Color values to convert to other colors for better readability on a light theme. @@ -55,27 +57,4 @@ public: static void finish(); }; -class EditorTheme : public Theme { - GDCLASS(EditorTheme, Theme); - - static Vector<StringName> editor_theme_types; - -public: - virtual Color get_color(const StringName &p_name, const StringName &p_theme_type) const override; - virtual int get_constant(const StringName &p_name, const StringName &p_theme_type) const override; - virtual Ref<Font> get_font(const StringName &p_name, const StringName &p_theme_type) const override; - virtual int get_font_size(const StringName &p_name, const StringName &p_theme_type) const override; - virtual Ref<Texture2D> get_icon(const StringName &p_name, const StringName &p_theme_type) const override; - virtual Ref<StyleBox> get_stylebox(const StringName &p_name, const StringName &p_theme_type) const override; - - static void initialize(); - static void finalize(); -}; - -Ref<Theme> create_editor_theme(Ref<Theme> p_theme = nullptr); - -Ref<Theme> create_custom_theme(Ref<Theme> p_theme = nullptr); - -String get_default_project_icon(); - -#endif // EDITOR_THEMES_H +#endif // EDITOR_COLOR_MAP_H diff --git a/editor/editor_fonts.cpp b/editor/themes/editor_fonts.cpp index 1e1dff61b9..fc3631653c 100644 --- a/editor/editor_fonts.cpp +++ b/editor/themes/editor_fonts.cpp @@ -30,11 +30,11 @@ #include "editor_fonts.h" -#include "builtin_fonts.gen.h" #include "core/io/dir_access.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/builtin_fonts.gen.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/font.h" Ref<FontFile> load_external_font(const String &p_path, TextServer::Hinting p_hinting, TextServer::FontAntialiasing p_aa, bool p_autohint, TextServer::SubpixelPositioning p_font_subpixel_positioning, bool p_msdf = false, TypedArray<Font> *r_fallbacks = nullptr) { @@ -106,7 +106,7 @@ Ref<FontVariation> make_bold_font(const Ref<Font> &p_font, double p_embolden, Ty return font_var; } -void editor_register_fonts(Ref<Theme> p_theme) { +void editor_register_fonts(const Ref<Theme> &p_theme) { OS::get_singleton()->benchmark_begin_measure("EditorTheme", "Register Fonts"); Ref<DirAccess> dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); diff --git a/editor/editor_fonts.h b/editor/themes/editor_fonts.h index 1705879f59..b612797df1 100644 --- a/editor/editor_fonts.h +++ b/editor/themes/editor_fonts.h @@ -33,6 +33,6 @@ #include "scene/resources/theme.h" -void editor_register_fonts(Ref<Theme> p_theme); +void editor_register_fonts(const Ref<Theme> &p_theme); #endif // EDITOR_FONTS_H diff --git a/editor/themes/editor_icons.cpp b/editor/themes/editor_icons.cpp new file mode 100644 index 0000000000..bb767747f3 --- /dev/null +++ b/editor/themes/editor_icons.cpp @@ -0,0 +1,252 @@ +/**************************************************************************/ +/* editor_icons.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "editor_icons.h" + +#include "editor/editor_settings.h" +#include "editor/editor_string_names.h" +#include "editor/themes/editor_color_map.h" +#include "editor/themes/editor_icons.gen.h" +#include "editor/themes/editor_scale.h" +#include "scene/resources/image_texture.h" +#include "scene/resources/texture.h" + +#include "modules/modules_enabled.gen.h" // For svg. +#ifdef MODULE_SVG_ENABLED +#include "modules/svg/image_loader_svg.h" +#endif + +void editor_configure_icons(bool p_dark_theme) { +#ifdef MODULE_SVG_ENABLED + if (p_dark_theme) { + ImageLoaderSVG::set_forced_color_map(HashMap<Color, Color>()); + } else { + ImageLoaderSVG::set_forced_color_map(EditorColorMap::get_color_conversion_map()); + } +#else + WARN_PRINT("SVG support disabled, editor icons won't be rendered."); +#endif +} + +// See also `generate_icon()` in `scene/theme/default_theme.cpp`. +Ref<ImageTexture> editor_generate_icon(int p_index, float p_scale, float p_saturation, const HashMap<Color, Color> &p_convert_colors = HashMap<Color, Color>()) { + Ref<Image> img = memnew(Image); + +#ifdef MODULE_SVG_ENABLED + // Upsample icon generation only if the editor scale isn't an integer multiplier. + // Generating upsampled icons is slower, and the benefit is hardly visible + // with integer editor scales. + const bool upsample = !Math::is_equal_approx(Math::round(p_scale), p_scale); + Error err = ImageLoaderSVG::create_image_from_string(img, editor_icons_sources[p_index], p_scale, upsample, p_convert_colors); + ERR_FAIL_COND_V_MSG(err != OK, Ref<ImageTexture>(), "Failed generating icon, unsupported or invalid SVG data in editor theme."); + if (p_saturation != 1.0) { + img->adjust_bcs(1.0, 1.0, p_saturation); + } +#else + // If the SVG module is disabled, we can't really display the UI well, but at least we won't crash. + // 16 pixels is used as it's the most common base size for Godot icons. + img = Image::create_empty(16 * p_scale, 16 * p_scale, false, Image::FORMAT_RGBA8); +#endif + + return ImageTexture::create_from_image(img); +} + +float get_gizmo_handle_scale(const String &gizmo_handle_name = "") { + const float scale_gizmo_handles_for_touch = EDITOR_GET("interface/touchscreen/scale_gizmo_handles"); + if (scale_gizmo_handles_for_touch > 1.0f) { + // The names of the icons that require additional scaling. + static HashSet<StringName> gizmo_to_scale; + if (gizmo_to_scale.is_empty()) { + gizmo_to_scale.insert("EditorHandle"); + gizmo_to_scale.insert("EditorHandleAdd"); + gizmo_to_scale.insert("EditorHandleDisabled"); + gizmo_to_scale.insert("EditorCurveHandle"); + gizmo_to_scale.insert("EditorPathSharpHandle"); + gizmo_to_scale.insert("EditorPathSmoothHandle"); + } + + if (gizmo_to_scale.has(gizmo_handle_name)) { + return EDSCALE * scale_gizmo_handles_for_touch; + } + } + + return EDSCALE; +} + +void editor_register_icons(const Ref<Theme> &p_theme, bool p_dark_theme, float p_icon_saturation, int p_thumb_size, bool p_only_thumbs) { + const String benchmark_key = vformat("Generate Icons (%s)", (p_only_thumbs ? "Only Thumbs" : "All")); + OS::get_singleton()->benchmark_begin_measure("EditorTheme", benchmark_key); + + // Before we register the icons, we adjust their colors and saturation. + // Most icons follow the standard rules for color conversion to follow the editor + // theme's polarity (dark/light). We also adjust the saturation for most icons, + // following the editor setting. + // Some icons are excluded from this conversion, and instead use the configured + // accent color to replace their innate accent color to match the editor theme. + // And then some icons are completely excluded from the conversion. + + // Standard color conversion map. + HashMap<Color, Color> color_conversion_map; + // Icons by default are set up for the dark theme, so if the theme is light, + // we apply the dark-to-light color conversion map. + if (!p_dark_theme) { + for (KeyValue<Color, Color> &E : EditorColorMap::get_color_conversion_map()) { + color_conversion_map[E.key] = E.value; + } + } + // These colors should be converted even if we are using a dark theme. + const Color error_color = p_theme->get_color(SNAME("error_color"), EditorStringName(Editor)); + const Color success_color = p_theme->get_color(SNAME("success_color"), EditorStringName(Editor)); + const Color warning_color = p_theme->get_color(SNAME("warning_color"), EditorStringName(Editor)); + color_conversion_map[Color::html("#ff5f5f")] = error_color; + color_conversion_map[Color::html("#5fff97")] = success_color; + color_conversion_map[Color::html("#ffdd65")] = warning_color; + + // The names of the icons to exclude from the standard color conversion. + HashSet<StringName> conversion_exceptions = EditorColorMap::get_color_conversion_exceptions(); + + // The names of the icons to exclude when adjusting for saturation. + HashSet<StringName> saturation_exceptions; + saturation_exceptions.insert("DefaultProjectIcon"); + saturation_exceptions.insert("Godot"); + saturation_exceptions.insert("Logo"); + + // Accent color conversion map. + // It is used on some icons (checkbox, radio, toggle, etc.), regardless of the dark + // or light mode. + HashMap<Color, Color> accent_color_map; + HashSet<StringName> accent_color_icons; + + const Color accent_color = p_theme->get_color(SNAME("accent_color"), EditorStringName(Editor)); + accent_color_map[Color::html("699ce8")] = accent_color; + if (accent_color.get_luminance() > 0.75) { + accent_color_map[Color::html("ffffff")] = Color(0.2, 0.2, 0.2); + } + + accent_color_icons.insert("GuiChecked"); + accent_color_icons.insert("GuiRadioChecked"); + accent_color_icons.insert("GuiIndeterminate"); + accent_color_icons.insert("GuiToggleOn"); + accent_color_icons.insert("GuiToggleOnMirrored"); + accent_color_icons.insert("PlayOverlay"); + + // Generate icons. + if (!p_only_thumbs) { + for (int i = 0; i < editor_icons_count; i++) { + Ref<ImageTexture> icon; + + const String &editor_icon_name = editor_icons_names[i]; + if (accent_color_icons.has(editor_icon_name)) { + icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name), 1.0, accent_color_map); + } else { + float saturation = p_icon_saturation; + if (saturation_exceptions.has(editor_icon_name)) { + saturation = 1.0; + } + + if (conversion_exceptions.has(editor_icon_name)) { + icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name), saturation); + } else { + icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name), saturation, color_conversion_map); + } + } + + p_theme->set_icon(editor_icon_name, EditorStringName(EditorIcons), icon); + } + } + + // Generate thumbnail icons with the given thumbnail size. + // See editor\icons\editor_icons_builders.py for the code that determines which icons are thumbnails. + if (p_thumb_size >= 64) { + const float scale = (float)p_thumb_size / 64.0 * EDSCALE; + for (int i = 0; i < editor_bg_thumbs_count; i++) { + const int index = editor_bg_thumbs_indices[i]; + Ref<ImageTexture> icon; + + if (accent_color_icons.has(editor_icons_names[index])) { + icon = editor_generate_icon(index, scale, 1.0, accent_color_map); + } else { + float saturation = p_icon_saturation; + if (saturation_exceptions.has(editor_icons_names[index])) { + saturation = 1.0; + } + + if (conversion_exceptions.has(editor_icons_names[index])) { + icon = editor_generate_icon(index, scale, saturation); + } else { + icon = editor_generate_icon(index, scale, saturation, color_conversion_map); + } + } + + p_theme->set_icon(editor_icons_names[index], EditorStringName(EditorIcons), icon); + } + } else { + const float scale = (float)p_thumb_size / 32.0 * EDSCALE; + for (int i = 0; i < editor_md_thumbs_count; i++) { + const int index = editor_md_thumbs_indices[i]; + Ref<ImageTexture> icon; + + if (accent_color_icons.has(editor_icons_names[index])) { + icon = editor_generate_icon(index, scale, 1.0, accent_color_map); + } else { + float saturation = p_icon_saturation; + if (saturation_exceptions.has(editor_icons_names[index])) { + saturation = 1.0; + } + + if (conversion_exceptions.has(editor_icons_names[index])) { + icon = editor_generate_icon(index, scale, saturation); + } else { + icon = editor_generate_icon(index, scale, saturation, color_conversion_map); + } + } + + p_theme->set_icon(editor_icons_names[index], EditorStringName(EditorIcons), icon); + } + } + OS::get_singleton()->benchmark_end_measure("EditorTheme", benchmark_key); +} + +void editor_copy_icons(const Ref<Theme> &p_theme, const Ref<Theme> &p_old_theme) { + for (int i = 0; i < editor_icons_count; i++) { + p_theme->set_icon(editor_icons_names[i], EditorStringName(EditorIcons), p_old_theme->get_icon(editor_icons_names[i], EditorStringName(EditorIcons))); + } +} + +// Returns the SVG code for the default project icon. +String get_default_project_icon() { + // FIXME: This icon can probably be predefined in editor_icons.gen.h so we don't have to look up. + for (int i = 0; i < editor_icons_count; i++) { + if (strcmp(editor_icons_names[i], "DefaultProjectIcon") == 0) { + return String(editor_icons_sources[i]); + } + } + return String(); +} diff --git a/editor/themes/editor_icons.h b/editor/themes/editor_icons.h new file mode 100644 index 0000000000..2094ebf27c --- /dev/null +++ b/editor/themes/editor_icons.h @@ -0,0 +1,42 @@ +/**************************************************************************/ +/* editor_icons.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#ifndef EDITOR_ICONS_H +#define EDITOR_ICONS_H + +#include "scene/resources/theme.h" + +void editor_configure_icons(bool p_dark_theme); +void editor_register_icons(const Ref<Theme> &p_theme, bool p_dark_theme, float p_icon_saturation, int p_thumb_size, bool p_only_thumbs = false); +void editor_copy_icons(const Ref<Theme> &p_theme, const Ref<Theme> &p_old_theme); + +String get_default_project_icon(); + +#endif // EDITOR_ICONS_H diff --git a/editor/editor_scale.cpp b/editor/themes/editor_scale.cpp index 0670e98e2c..0670e98e2c 100644 --- a/editor/editor_scale.cpp +++ b/editor/themes/editor_scale.cpp diff --git a/editor/editor_scale.h b/editor/themes/editor_scale.h index b3583fdcee..b3583fdcee 100644 --- a/editor/editor_scale.h +++ b/editor/themes/editor_scale.h diff --git a/editor/themes/editor_theme.cpp b/editor/themes/editor_theme.cpp new file mode 100644 index 0000000000..ab7c808303 --- /dev/null +++ b/editor/themes/editor_theme.cpp @@ -0,0 +1,131 @@ +/**************************************************************************/ +/* editor_theme.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "editor_theme.h" + +#include "editor/editor_string_names.h" +#include "scene/theme/theme_db.h" + +Vector<StringName> EditorTheme::editor_theme_types; + +// TODO: Refactor these and corresponding Theme methods to use the bool get_xxx(r_value) pattern internally. + +// Keep in sync with Theme::get_color. +Color EditorTheme::get_color(const StringName &p_name, const StringName &p_theme_type) const { + if (color_map.has(p_theme_type) && color_map[p_theme_type].has(p_name)) { + return color_map[p_theme_type][p_name]; + } else { + if (editor_theme_types.has(p_theme_type)) { + WARN_PRINT(vformat("Trying to access a non-existing editor theme color '%s' in '%s'.", p_name, p_theme_type)); + } + return Color(); + } +} + +// Keep in sync with Theme::get_constant. +int EditorTheme::get_constant(const StringName &p_name, const StringName &p_theme_type) const { + if (constant_map.has(p_theme_type) && constant_map[p_theme_type].has(p_name)) { + return constant_map[p_theme_type][p_name]; + } else { + if (editor_theme_types.has(p_theme_type)) { + WARN_PRINT(vformat("Trying to access a non-existing editor theme constant '%s' in '%s'.", p_name, p_theme_type)); + } + return 0; + } +} + +// Keep in sync with Theme::get_font. +Ref<Font> EditorTheme::get_font(const StringName &p_name, const StringName &p_theme_type) const { + if (font_map.has(p_theme_type) && font_map[p_theme_type].has(p_name) && font_map[p_theme_type][p_name].is_valid()) { + return font_map[p_theme_type][p_name]; + } else if (has_default_font()) { + if (editor_theme_types.has(p_theme_type)) { + WARN_PRINT(vformat("Trying to access a non-existing editor theme font '%s' in '%s'.", p_name, p_theme_type)); + } + return default_font; + } else { + if (editor_theme_types.has(p_theme_type)) { + WARN_PRINT(vformat("Trying to access a non-existing editor theme font '%s' in '%s'.", p_name, p_theme_type)); + } + return ThemeDB::get_singleton()->get_fallback_font(); + } +} + +// Keep in sync with Theme::get_font_size. +int EditorTheme::get_font_size(const StringName &p_name, const StringName &p_theme_type) const { + if (font_size_map.has(p_theme_type) && font_size_map[p_theme_type].has(p_name) && (font_size_map[p_theme_type][p_name] > 0)) { + return font_size_map[p_theme_type][p_name]; + } else if (has_default_font_size()) { + if (editor_theme_types.has(p_theme_type)) { + WARN_PRINT(vformat("Trying to access a non-existing editor theme font size '%s' in '%s'.", p_name, p_theme_type)); + } + return default_font_size; + } else { + if (editor_theme_types.has(p_theme_type)) { + WARN_PRINT(vformat("Trying to access a non-existing editor theme font size '%s' in '%s'.", p_name, p_theme_type)); + } + return ThemeDB::get_singleton()->get_fallback_font_size(); + } +} + +// Keep in sync with Theme::get_icon. +Ref<Texture2D> EditorTheme::get_icon(const StringName &p_name, const StringName &p_theme_type) const { + if (icon_map.has(p_theme_type) && icon_map[p_theme_type].has(p_name) && icon_map[p_theme_type][p_name].is_valid()) { + return icon_map[p_theme_type][p_name]; + } else { + if (editor_theme_types.has(p_theme_type)) { + WARN_PRINT(vformat("Trying to access a non-existing editor theme icon '%s' in '%s'.", p_name, p_theme_type)); + } + return ThemeDB::get_singleton()->get_fallback_icon(); + } +} + +// Keep in sync with Theme::get_stylebox. +Ref<StyleBox> EditorTheme::get_stylebox(const StringName &p_name, const StringName &p_theme_type) const { + if (style_map.has(p_theme_type) && style_map[p_theme_type].has(p_name) && style_map[p_theme_type][p_name].is_valid()) { + return style_map[p_theme_type][p_name]; + } else { + if (editor_theme_types.has(p_theme_type)) { + WARN_PRINT(vformat("Trying to access a non-existing editor theme stylebox '%s' in '%s'.", p_name, p_theme_type)); + } + return ThemeDB::get_singleton()->get_fallback_stylebox(); + } +} + +void EditorTheme::initialize() { + editor_theme_types.append(EditorStringName(Editor)); + editor_theme_types.append(EditorStringName(EditorFonts)); + editor_theme_types.append(EditorStringName(EditorIcons)); + editor_theme_types.append(EditorStringName(EditorStyles)); +} + +void EditorTheme::finalize() { + editor_theme_types.clear(); +} diff --git a/editor/themes/editor_theme.h b/editor/themes/editor_theme.h new file mode 100644 index 0000000000..41a60fdf96 --- /dev/null +++ b/editor/themes/editor_theme.h @@ -0,0 +1,53 @@ +/**************************************************************************/ +/* editor_theme.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#ifndef EDITOR_THEME_H +#define EDITOR_THEME_H + +#include "scene/resources/theme.h" + +class EditorTheme : public Theme { + GDCLASS(EditorTheme, Theme); + + static Vector<StringName> editor_theme_types; + +public: + virtual Color get_color(const StringName &p_name, const StringName &p_theme_type) const override; + virtual int get_constant(const StringName &p_name, const StringName &p_theme_type) const override; + virtual Ref<Font> get_font(const StringName &p_name, const StringName &p_theme_type) const override; + virtual int get_font_size(const StringName &p_name, const StringName &p_theme_type) const override; + virtual Ref<Texture2D> get_icon(const StringName &p_name, const StringName &p_theme_type) const override; + virtual Ref<StyleBox> get_stylebox(const StringName &p_name, const StringName &p_theme_type) const override; + + static void initialize(); + static void finalize(); +}; + +#endif // EDITOR_THEME_H diff --git a/editor/themes/editor_theme_builders.py b/editor/themes/editor_theme_builders.py new file mode 100644 index 0000000000..19b346db58 --- /dev/null +++ b/editor/themes/editor_theme_builders.py @@ -0,0 +1,41 @@ +""" +Functions used to generate source files during build time + +All such functions are invoked in a subprocess on Windows to prevent build flakiness. + +""" + +import os +from platform_methods import subprocess_main + + +def make_fonts_header(target, source, env): + dst = target[0] + + g = open(dst, "w", encoding="utf-8") + + g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") + g.write("#ifndef _EDITOR_FONTS_H\n") + g.write("#define _EDITOR_FONTS_H\n") + + # Saving uncompressed, since FreeType will reference from memory pointer. + for i in range(len(source)): + with open(source[i], "rb") as f: + buf = f.read() + + name = os.path.splitext(os.path.basename(source[i]))[0] + + g.write("static const int _font_" + name + "_size = " + str(len(buf)) + ";\n") + g.write("static const unsigned char _font_" + name + "[] = {\n") + for j in range(len(buf)): + g.write("\t" + str(buf[j]) + ",\n") + + g.write("};\n") + + g.write("#endif") + + g.close() + + +if __name__ == "__main__": + subprocess_main(globals()) diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp new file mode 100644 index 0000000000..4ce323c763 --- /dev/null +++ b/editor/themes/editor_theme_manager.cpp @@ -0,0 +1,2232 @@ +/**************************************************************************/ +/* editor_theme_manager.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "editor_theme_manager.h" + +#include "core/error/error_macros.h" +#include "core/io/resource_loader.h" +#include "editor/editor_settings.h" +#include "editor/editor_string_names.h" +#include "editor/themes/editor_color_map.h" +#include "editor/themes/editor_fonts.h" +#include "editor/themes/editor_icons.h" +#include "editor/themes/editor_scale.h" +#include "editor/themes/editor_theme.h" +#include "scene/resources/image_texture.h" +#include "scene/resources/style_box_flat.h" +#include "scene/resources/style_box_line.h" +#include "scene/resources/style_box_texture.h" +#include "scene/resources/texture.h" + +// Helper methods. + +Ref<StyleBoxTexture> make_stylebox(Ref<Texture2D> p_texture, float p_left, float p_top, float p_right, float p_bottom, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_bottom = -1, bool p_draw_center = true) { + Ref<StyleBoxTexture> style(memnew(StyleBoxTexture)); + style->set_texture(p_texture); + style->set_texture_margin_individual(p_left * EDSCALE, p_top * EDSCALE, p_right * EDSCALE, p_bottom * EDSCALE); + style->set_content_margin_individual((p_left + p_margin_left) * EDSCALE, (p_top + p_margin_top) * EDSCALE, (p_right + p_margin_right) * EDSCALE, (p_bottom + p_margin_bottom) * EDSCALE); + style->set_draw_center(p_draw_center); + return style; +} + +Ref<StyleBoxEmpty> make_empty_stylebox(float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_bottom = -1) { + Ref<StyleBoxEmpty> style(memnew(StyleBoxEmpty)); + style->set_content_margin_individual(p_margin_left * EDSCALE, p_margin_top * EDSCALE, p_margin_right * EDSCALE, p_margin_bottom * EDSCALE); + return style; +} + +Ref<StyleBoxFlat> make_flat_stylebox(Color p_color, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_bottom = -1, int p_corner_width = 0) { + Ref<StyleBoxFlat> style(memnew(StyleBoxFlat)); + style->set_bg_color(p_color); + // Adjust level of detail based on the corners' effective sizes. + style->set_corner_detail(Math::ceil(0.8 * p_corner_width * EDSCALE)); + style->set_corner_radius_all(p_corner_width * EDSCALE); + style->set_content_margin_individual(p_margin_left * EDSCALE, p_margin_top * EDSCALE, p_margin_right * EDSCALE, p_margin_bottom * EDSCALE); + // Work around issue about antialiased edges being blurrier (GH-35279). + style->set_anti_aliased(false); + return style; +} + +Ref<StyleBoxLine> make_line_stylebox(Color p_color, int p_thickness = 1, float p_grow_begin = 1, float p_grow_end = 1, bool p_vertical = false) { + Ref<StyleBoxLine> style(memnew(StyleBoxLine)); + style->set_color(p_color); + style->set_grow_begin(p_grow_begin); + style->set_grow_end(p_grow_end); + style->set_thickness(p_thickness); + style->set_vertical(p_vertical); + return style; +} + +// Theme generation and population routines. + +Ref<Theme> EditorThemeManager::_create_base_theme(const Ref<Theme> &p_old_theme) { + OS::get_singleton()->benchmark_begin_measure("EditorTheme", "Create Base Theme"); + + Ref<EditorTheme> theme = memnew(EditorTheme); + ThemeConfiguration config = _create_theme_config(theme); + _create_shared_styles(theme, config); + + // FIXME: Make the comparison more robust and fix imprecision issues by hashing affecting values. + // TODO: Refactor the icons check into their respective file, and add a similar check for fonts. + + // Register editor icons. + // If settings are comparable to the old theme, then just copy existing icons over. + // Otherwise, regenerate them. Also check if we need to regenerate "thumb" icons. + bool keep_old_icons = false; + bool regenerate_thumb_icons = true; + if (p_old_theme != nullptr) { + // We check editor scale, theme dark/light mode, icon saturation, and accent color. + + // That doesn't really work as expected, since theme constants are integers, and scales are floats. + // So this check will never work when changing between 100-199% values. + const float prev_scale = (float)p_old_theme->get_constant(SNAME("scale"), EditorStringName(Editor)); + const bool prev_dark_theme = (bool)p_old_theme->get_constant(SNAME("dark_theme"), EditorStringName(Editor)); + const Color prev_accent_color = p_old_theme->get_color(SNAME("accent_color"), EditorStringName(Editor)); + const float prev_icon_saturation = p_old_theme->get_color(SNAME("icon_saturation"), EditorStringName(Editor)).r; + const float prev_gizmo_handle_scale = (float)p_old_theme->get_constant(SNAME("gizmo_handle_scale"), EditorStringName(Editor)); + + keep_old_icons = (Math::is_equal_approx(prev_scale, EDSCALE) && + Math::is_equal_approx(prev_gizmo_handle_scale, config.gizmo_handle_scale) && + prev_dark_theme == config.dark_theme && + prev_accent_color == config.accent_color && + prev_icon_saturation == config.icon_saturation); + + const double prev_thumb_size = (double)p_old_theme->get_constant(SNAME("thumb_size"), EditorStringName(Editor)); + + regenerate_thumb_icons = !Math::is_equal_approx(prev_thumb_size, config.thumb_size); + } + + // External functions, see editor_icons.cpp. + editor_configure_icons(config.dark_theme); + if (keep_old_icons) { + editor_copy_icons(theme, p_old_theme); + } else { + editor_register_icons(theme, config.dark_theme, config.icon_saturation, config.thumb_size, false); + } + if (regenerate_thumb_icons) { + editor_register_icons(theme, config.dark_theme, config.icon_saturation, config.thumb_size, true); + } + + // External function, see editor_fonts.cpp. + editor_register_fonts(theme); + + _populate_standard_styles(theme, config); + _populate_editor_styles(theme, config); + _populate_text_editor_styles(theme, config); + + OS::get_singleton()->benchmark_end_measure("EditorTheme", "Create Base Theme"); + return theme; +} + +EditorThemeManager::ThemeConfiguration EditorThemeManager::_create_theme_config(const Ref<Theme> &p_theme) { + ThemeConfiguration config; + + // Basic properties. + + config.preset = EDITOR_GET("interface/theme/preset"); + config.spacing_preset = EDITOR_GET("interface/theme/spacing_preset"); + config.dark_theme = EditorSettings::get_singleton()->is_dark_theme(); + + config.base_color = EDITOR_GET("interface/theme/base_color"); + config.accent_color = EDITOR_GET("interface/theme/accent_color"); + config.contrast = EDITOR_GET("interface/theme/contrast"); + config.icon_saturation = EDITOR_GET("interface/theme/icon_saturation"); + + // Extra properties. + + config.base_spacing = EDITOR_GET("interface/theme/base_spacing"); + config.extra_spacing = EDITOR_GET("interface/theme/additional_spacing"); + // Ensure borders are visible when using an editor scale below 100%. + config.border_width = CLAMP((int)EDITOR_GET("interface/theme/border_size"), 0, 2) * MAX(1, EDSCALE); + config.corner_radius = CLAMP((int)EDITOR_GET("interface/theme/corner_radius"), 0, 6); + + config.draw_extra_borders = EDITOR_GET("interface/theme/draw_extra_borders"); + config.relationship_line_opacity = EDITOR_GET("interface/theme/relationship_line_opacity"); + config.thumb_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); + config.class_icon_size = 16 * EDSCALE; + config.increase_scrollbar_touch_area = EDITOR_GET("interface/touchscreen/increase_scrollbar_touch_area"); + config.gizmo_handle_scale = EDITOR_GET("interface/touchscreen/scale_gizmo_handles"); + config.color_picker_button_height = 28 * EDSCALE; + + config.default_contrast = 0.3; // Make sure to keep this in sync with the editor settings definition. + + // Handle main theme preset. + { + if (config.preset != "Custom") { + Color preset_accent_color; + Color preset_base_color; + float preset_contrast = 0; + bool preset_draw_extra_borders = false; + + // Please use alphabetical order if you're adding a new theme here. + if (config.preset == "Breeze Dark") { + preset_accent_color = Color(0.26, 0.76, 1.00); + preset_base_color = Color(0.24, 0.26, 0.28); + preset_contrast = config.default_contrast; + } else if (config.preset == "Godot 2") { + preset_accent_color = Color(0.53, 0.67, 0.89); + preset_base_color = Color(0.24, 0.23, 0.27); + preset_contrast = config.default_contrast; + } else if (config.preset == "Gray") { + preset_accent_color = Color(0.44, 0.73, 0.98); + preset_base_color = Color(0.24, 0.24, 0.24); + preset_contrast = config.default_contrast; + } else if (config.preset == "Light") { + preset_accent_color = Color(0.18, 0.50, 1.00); + preset_base_color = Color(0.9, 0.9, 0.9); + // A negative contrast rate looks better for light themes, since it better follows the natural order of UI "elevation". + preset_contrast = -0.06; + } else if (config.preset == "Solarized (Dark)") { + preset_accent_color = Color(0.15, 0.55, 0.82); + preset_base_color = Color(0.04, 0.23, 0.27); + preset_contrast = config.default_contrast; + } else if (config.preset == "Solarized (Light)") { + preset_accent_color = Color(0.15, 0.55, 0.82); + preset_base_color = Color(0.89, 0.86, 0.79); + // A negative contrast rate looks better for light themes, since it better follows the natural order of UI "elevation". + preset_contrast = -0.06; + } else if (config.preset == "Black (OLED)") { + preset_accent_color = Color(0.45, 0.75, 1.0); + preset_base_color = Color(0, 0, 0); + // The contrast rate value is irrelevant on a fully black theme. + preset_contrast = 0.0; + preset_draw_extra_borders = true; + } else { // Default + preset_accent_color = Color(0.44, 0.73, 0.98); + preset_base_color = Color(0.21, 0.24, 0.29); + preset_contrast = config.default_contrast; + } + + config.accent_color = preset_accent_color; + config.base_color = preset_base_color; + config.contrast = preset_contrast; + config.draw_extra_borders = preset_draw_extra_borders; + + EditorSettings::get_singleton()->set_initial_value("interface/theme/accent_color", config.accent_color); + EditorSettings::get_singleton()->set_initial_value("interface/theme/base_color", config.base_color); + EditorSettings::get_singleton()->set_initial_value("interface/theme/contrast", config.contrast); + EditorSettings::get_singleton()->set_initial_value("interface/theme/draw_extra_borders", config.draw_extra_borders); + } + + // Enforce values in case they were adjusted or overridden. + EditorSettings::get_singleton()->set_manually("interface/theme/preset", config.preset); + EditorSettings::get_singleton()->set_manually("interface/theme/accent_color", config.accent_color); + EditorSettings::get_singleton()->set_manually("interface/theme/base_color", config.base_color); + EditorSettings::get_singleton()->set_manually("interface/theme/contrast", config.contrast); + EditorSettings::get_singleton()->set_manually("interface/theme/draw_extra_borders", config.draw_extra_borders); + } + + // Handle theme spacing preset. + { + if (config.spacing_preset != "Custom") { + int preset_base_spacing = 0; + int preset_extra_spacing = 0; + + if (config.spacing_preset == "Compact") { + preset_base_spacing = 0; + preset_extra_spacing = 4; + } else if (config.spacing_preset == "Spacious") { + preset_base_spacing = 6; + preset_extra_spacing = 2; + } else { // Default + preset_base_spacing = 4; + preset_extra_spacing = 0; + } + + config.base_spacing = preset_base_spacing; + config.extra_spacing = preset_extra_spacing; + + EditorSettings::get_singleton()->set_initial_value("interface/theme/base_spacing", config.base_spacing); + EditorSettings::get_singleton()->set_initial_value("interface/theme/additional_spacing", config.extra_spacing); + } + + // Enforce values in case they were adjusted or overridden. + EditorSettings::get_singleton()->set_manually("interface/theme/spacing_preset", config.spacing_preset); + EditorSettings::get_singleton()->set_manually("interface/theme/base_spacing", config.base_spacing); + EditorSettings::get_singleton()->set_manually("interface/theme/additional_spacing", config.extra_spacing); + } + + // Generated properties. + + config.base_margin = config.base_spacing; + config.increased_margin = config.base_spacing + config.extra_spacing; + config.separation_margin = (config.base_spacing + config.extra_spacing / 2) * EDSCALE; + config.popup_margin = config.base_margin * 3 * EDSCALE; + // Make sure content doesn't stick to window decorations; this can be fixed in future with layout changes. + config.window_border_margin = MAX(1, config.base_margin * 2); + config.top_bar_separation = config.base_margin * 2 * EDSCALE; + + // Force the v_separation to be even so that the spacing on top and bottom is even. + // If the vsep is odd and cannot be split into 2 even groups (of pixels), then it will be lopsided. + // We add 2 to the vsep to give it some extra spacing which looks a bit more modern (see Windows, for example). + const int separation_base = config.increased_margin + 6; + config.forced_even_separation = separation_base + (separation_base % 2); + + return config; +} + +void EditorThemeManager::_create_shared_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config) { + // Colors. + { + // Base colors. + + p_theme->set_color("base_color", EditorStringName(Editor), p_config.base_color); + p_theme->set_color("accent_color", EditorStringName(Editor), p_config.accent_color); + + // White (dark theme) or black (light theme), will be used to generate the rest of the colors + p_config.mono_color = p_config.dark_theme ? Color(1, 1, 1) : Color(0, 0, 0); + + // Ensure base colors are in the 0..1 luminance range to avoid 8-bit integer overflow or text rendering issues. + // Some places in the editor use 8-bit integer colors. + p_config.dark_color_1 = p_config.base_color.lerp(Color(0, 0, 0, 1), p_config.contrast).clamp(); + p_config.dark_color_2 = p_config.base_color.lerp(Color(0, 0, 0, 1), p_config.contrast * 1.5).clamp(); + p_config.dark_color_3 = p_config.base_color.lerp(Color(0, 0, 0, 1), p_config.contrast * 2).clamp(); + + p_config.contrast_color_1 = p_config.base_color.lerp(p_config.mono_color, MAX(p_config.contrast, p_config.default_contrast)); + p_config.contrast_color_2 = p_config.base_color.lerp(p_config.mono_color, MAX(p_config.contrast * 1.5, p_config.default_contrast * 1.5)); + + p_config.highlight_color = Color(p_config.accent_color.r, p_config.accent_color.g, p_config.accent_color.b, 0.275); + p_config.highlight_disabled_color = p_config.highlight_color.lerp(p_config.dark_theme ? Color(0, 0, 0) : Color(1, 1, 1), 0.5); + + p_config.success_color = Color(0.45, 0.95, 0.5); + p_config.warning_color = Color(1, 0.87, 0.4); + p_config.error_color = Color(1, 0.47, 0.42); + if (!p_config.dark_theme) { + // Darken some colors to be readable on a light background. + p_config.success_color = p_config.success_color.lerp(p_config.mono_color, 0.35); + p_config.warning_color = p_config.warning_color.lerp(p_config.mono_color, 0.35); + p_config.error_color = p_config.error_color.lerp(p_config.mono_color, 0.25); + } + + p_theme->set_color("mono_color", EditorStringName(Editor), p_config.mono_color); + p_theme->set_color("dark_color_1", EditorStringName(Editor), p_config.dark_color_1); + p_theme->set_color("dark_color_2", EditorStringName(Editor), p_config.dark_color_2); + p_theme->set_color("dark_color_3", EditorStringName(Editor), p_config.dark_color_3); + p_theme->set_color("contrast_color_1", EditorStringName(Editor), p_config.contrast_color_1); + p_theme->set_color("contrast_color_2", EditorStringName(Editor), p_config.contrast_color_2); + p_theme->set_color("highlight_color", EditorStringName(Editor), p_config.highlight_color); + p_theme->set_color("highlight_disabled_color", EditorStringName(Editor), p_config.highlight_disabled_color); + p_theme->set_color("success_color", EditorStringName(Editor), p_config.success_color); + p_theme->set_color("warning_color", EditorStringName(Editor), p_config.warning_color); + p_theme->set_color("error_color", EditorStringName(Editor), p_config.error_color); + + // Only used when the Draw Extra Borders editor setting is enabled. + p_config.extra_border_color_1 = Color(0.5, 0.5, 0.5); + p_config.extra_border_color_2 = p_config.dark_theme ? Color(0.3, 0.3, 0.3) : Color(0.7, 0.7, 0.7); + + p_theme->set_color("extra_border_color_1", EditorStringName(Editor), p_config.extra_border_color_1); + p_theme->set_color("extra_border_color_2", EditorStringName(Editor), p_config.extra_border_color_2); + + // Font colors. + + p_config.font_color = p_config.mono_color.lerp(p_config.base_color, 0.25); + p_config.font_focus_color = p_config.mono_color.lerp(p_config.base_color, 0.125); + p_config.font_hover_color = p_config.mono_color.lerp(p_config.base_color, 0.125); + p_config.font_pressed_color = p_config.accent_color; + p_config.font_hover_pressed_color = p_config.font_hover_color.lerp(p_config.accent_color, 0.74); + p_config.font_disabled_color = Color(p_config.mono_color.r, p_config.mono_color.g, p_config.mono_color.b, 0.35); + p_config.font_readonly_color = Color(p_config.mono_color.r, p_config.mono_color.g, p_config.mono_color.b, 0.65); + p_config.font_placeholder_color = Color(p_config.mono_color.r, p_config.mono_color.g, p_config.mono_color.b, 0.6); + p_config.font_outline_color = Color(0, 0, 0, 0); + + p_theme->set_color("font_color", EditorStringName(Editor), p_config.font_color); + p_theme->set_color("font_focus_color", EditorStringName(Editor), p_config.font_focus_color); + p_theme->set_color("font_hover_color", EditorStringName(Editor), p_config.font_hover_color); + p_theme->set_color("font_pressed_color", EditorStringName(Editor), p_config.font_pressed_color); + p_theme->set_color("font_hover_pressed_color", EditorStringName(Editor), p_config.font_hover_pressed_color); + p_theme->set_color("font_disabled_color", EditorStringName(Editor), p_config.font_disabled_color); + p_theme->set_color("font_readonly_color", EditorStringName(Editor), p_config.font_readonly_color); + p_theme->set_color("font_placeholder_color", EditorStringName(Editor), p_config.font_placeholder_color); + p_theme->set_color("font_outline_color", EditorStringName(Editor), p_config.font_outline_color); + + // Icon colors. + + p_config.icon_normal_color = Color(1, 1, 1); + p_config.icon_focus_color = p_config.icon_normal_color * (p_config.dark_theme ? 1.15 : 1.45); + p_config.icon_focus_color.a = 1.0; + p_config.icon_hover_color = p_config.icon_focus_color; + // Make the pressed icon color overbright because icons are not completely white on a dark theme. + // On a light theme, icons are dark, so we need to modulate them with an even brighter color. + p_config.icon_pressed_color = p_config.accent_color * (p_config.dark_theme ? 1.15 : 3.5); + p_config.icon_pressed_color.a = 1.0; + p_config.icon_disabled_color = Color(p_config.icon_normal_color, 0.4); + + p_theme->set_color("icon_normal_color", EditorStringName(Editor), p_config.icon_normal_color); + p_theme->set_color("icon_focus_color", EditorStringName(Editor), p_config.icon_focus_color); + p_theme->set_color("icon_hover_color", EditorStringName(Editor), p_config.icon_hover_color); + p_theme->set_color("icon_pressed_color", EditorStringName(Editor), p_config.icon_pressed_color); + p_theme->set_color("icon_disabled_color", EditorStringName(Editor), p_config.icon_disabled_color); + + // Additional GUI colors. + + p_config.shadow_color = Color(0, 0, 0, p_config.dark_theme ? 0.3 : 0.1); + p_config.selection_color = p_config.accent_color * Color(1, 1, 1, 0.4); + p_config.disabled_border_color = p_config.mono_color.inverted().lerp(p_config.base_color, 0.7); + p_config.disabled_bg_color = p_config.mono_color.inverted().lerp(p_config.base_color, 0.9); + p_config.separator_color = Color(p_config.mono_color.r, p_config.mono_color.g, p_config.mono_color.b, 0.1); + + p_theme->set_color("selection_color", EditorStringName(Editor), p_config.selection_color); + p_theme->set_color("disabled_border_color", EditorStringName(Editor), p_config.disabled_border_color); + p_theme->set_color("disabled_bg_color", EditorStringName(Editor), p_config.disabled_bg_color); + p_theme->set_color("separator_color", EditorStringName(Editor), p_config.separator_color); + + // Additional editor colors. + + p_theme->set_color("box_selection_fill_color", EditorStringName(Editor), p_config.accent_color * Color(1, 1, 1, 0.3)); + p_theme->set_color("box_selection_stroke_color", EditorStringName(Editor), p_config.accent_color * Color(1, 1, 1, 0.8)); + + p_theme->set_color("axis_x_color", EditorStringName(Editor), Color(0.96, 0.20, 0.32)); + p_theme->set_color("axis_y_color", EditorStringName(Editor), Color(0.53, 0.84, 0.01)); + p_theme->set_color("axis_z_color", EditorStringName(Editor), Color(0.16, 0.55, 0.96)); + p_theme->set_color("axis_w_color", EditorStringName(Editor), Color(0.55, 0.55, 0.55)); + + const float prop_color_saturation = p_config.accent_color.get_s() * 0.75; + const float prop_color_value = p_config.accent_color.get_v(); + + p_theme->set_color("property_color_x", EditorStringName(Editor), Color().from_hsv(0.0 / 3.0 + 0.05, prop_color_saturation, prop_color_value)); + p_theme->set_color("property_color_y", EditorStringName(Editor), Color().from_hsv(1.0 / 3.0 + 0.05, prop_color_saturation, prop_color_value)); + p_theme->set_color("property_color_z", EditorStringName(Editor), Color().from_hsv(2.0 / 3.0 + 0.05, prop_color_saturation, prop_color_value)); + p_theme->set_color("property_color_w", EditorStringName(Editor), Color().from_hsv(1.5 / 3.0 + 0.05, prop_color_saturation, prop_color_value)); + + // Special colors for rendering methods. + + p_theme->set_color("forward_plus_color", EditorStringName(Editor), Color::hex(0x5d8c3fff)); + p_theme->set_color("mobile_color", EditorStringName(Editor), Color::hex(0xa5557dff)); + p_theme->set_color("gl_compatibility_color", EditorStringName(Editor), Color::hex(0x5586a4ff)); + + if (p_config.dark_theme) { + p_theme->set_color("highend_color", EditorStringName(Editor), Color(1.0, 0.0, 0.0)); + } else { + p_theme->set_color("highend_color", EditorStringName(Editor), Color::hex(0xad1128ff)); + } + } + + // Constants. + { + // Can't save single float in theme, so using Color. + p_theme->set_color("icon_saturation", EditorStringName(Editor), Color(p_config.icon_saturation, p_config.icon_saturation, p_config.icon_saturation)); + + // Controls may rely on the scale for their internal drawing logic. + p_theme->set_default_base_scale(EDSCALE); + p_theme->set_constant("scale", EditorStringName(Editor), EDSCALE); + + p_theme->set_constant("thumb_size", EditorStringName(Editor), p_config.thumb_size); + p_theme->set_constant("class_icon_size", EditorStringName(Editor), p_config.class_icon_size); + p_theme->set_constant("color_picker_button_height", EditorStringName(Editor), p_config.color_picker_button_height); + p_theme->set_constant("gizmo_handle_scale", EditorStringName(Editor), p_config.gizmo_handle_scale); + + p_theme->set_constant("base_margin", EditorStringName(Editor), p_config.base_margin); + p_theme->set_constant("increased_margin", EditorStringName(Editor), p_config.increased_margin); + p_theme->set_constant("window_border_margin", EditorStringName(Editor), p_config.window_border_margin); + p_theme->set_constant("top_bar_separation", EditorStringName(Editor), p_config.top_bar_separation); + + p_theme->set_constant("dark_theme", EditorStringName(Editor), p_config.dark_theme); + } + + // Styleboxes. + { + // This is the basic stylebox, used as a base for most other styleboxes (through `duplicate()`). + p_config.base_style = make_flat_stylebox(p_config.base_color, p_config.base_margin, p_config.base_margin, p_config.base_margin, p_config.base_margin, p_config.corner_radius); + p_config.base_style->set_border_width_all(p_config.border_width); + p_config.base_style->set_border_color(p_config.base_color); + + p_config.base_empty_style = make_empty_stylebox(p_config.base_margin, p_config.base_margin, p_config.base_margin, p_config.base_margin); + + // Button styles. + { + p_config.widget_margin = Vector2(p_config.increased_margin + 2, p_config.increased_margin + 1) * EDSCALE; + + p_config.button_style = p_config.base_style->duplicate(); + p_config.button_style->set_content_margin_individual(p_config.widget_margin.x, p_config.widget_margin.y, p_config.widget_margin.x, p_config.widget_margin.y); + p_config.button_style->set_bg_color(p_config.dark_color_1); + if (p_config.draw_extra_borders) { + p_config.button_style->set_border_width_all(Math::round(EDSCALE)); + p_config.button_style->set_border_color(p_config.extra_border_color_1); + } else { + p_config.button_style->set_border_color(p_config.dark_color_2); + } + + p_config.button_style_disabled = p_config.button_style->duplicate(); + p_config.button_style_disabled->set_bg_color(p_config.disabled_bg_color); + if (p_config.draw_extra_borders) { + p_config.button_style_disabled->set_border_color(p_config.extra_border_color_2); + } else { + p_config.button_style_disabled->set_border_color(p_config.disabled_border_color); + } + + p_config.button_style_focus = p_config.button_style->duplicate(); + p_config.button_style_focus->set_draw_center(false); + p_config.button_style_focus->set_border_width_all(Math::round(2 * MAX(1, EDSCALE))); + p_config.button_style_focus->set_border_color(p_config.accent_color); + + p_config.button_style_pressed = p_config.button_style->duplicate(); + p_config.button_style_pressed->set_bg_color(p_config.dark_color_1.darkened(0.125)); + + p_config.button_style_hover = p_config.button_style->duplicate(); + p_config.button_style_hover->set_bg_color(p_config.mono_color * Color(1, 1, 1, 0.11)); + if (p_config.draw_extra_borders) { + p_config.button_style_hover->set_border_color(p_config.extra_border_color_1); + } else { + p_config.button_style_hover->set_border_color(p_config.mono_color * Color(1, 1, 1, 0.05)); + } + } + + // Windows and popups. + { + p_config.popup_style = p_config.base_style->duplicate(); + p_config.popup_style->set_content_margin_all(p_config.popup_margin); + p_config.popup_style->set_border_color(p_config.contrast_color_1); + p_config.popup_style->set_shadow_color(p_config.shadow_color); + p_config.popup_style->set_shadow_size(4 * EDSCALE); + // Popups are separate windows by default in the editor. Windows currently don't support per-pixel transparency + // in 4.0, and even if it was, it may not always work in practice (e.g. running with compositing disabled). + p_config.popup_style->set_corner_radius_all(0); + + p_config.window_style = p_config.popup_style->duplicate(); + p_config.window_style->set_border_color(p_config.base_color); + p_config.window_style->set_border_width(SIDE_TOP, 24 * EDSCALE); + p_config.window_style->set_expand_margin(SIDE_TOP, 24 * EDSCALE); + + // Prevent corner artifacts between window title and body. + p_config.dialog_style = p_config.base_style->duplicate(); + p_config.dialog_style->set_corner_radius(CORNER_TOP_LEFT, 0); + p_config.dialog_style->set_corner_radius(CORNER_TOP_RIGHT, 0); + // Prevent visible line between window title and body. + p_config.dialog_style->set_expand_margin(SIDE_BOTTOM, 2 * EDSCALE); + } + + // Panels. + { + p_config.panel_container_style = p_config.button_style->duplicate(); + p_config.panel_container_style->set_draw_center(false); + p_config.panel_container_style->set_border_width_all(0); + + // Content panel for tabs and similar containers. + + // Compensate for the border. + const int content_panel_margin = p_config.base_margin * EDSCALE + p_config.border_width; + + p_config.content_panel_style = p_config.base_style->duplicate(); + p_config.content_panel_style->set_border_color(p_config.dark_color_3); + p_config.content_panel_style->set_border_width_all(p_config.border_width); + p_config.content_panel_style->set_border_width(Side::SIDE_TOP, 0); + p_config.content_panel_style->set_corner_radius(CORNER_TOP_LEFT, 0); + p_config.content_panel_style->set_corner_radius(CORNER_TOP_RIGHT, 0); + p_config.content_panel_style->set_content_margin_individual(content_panel_margin, 2 * EDSCALE + content_panel_margin, content_panel_margin, content_panel_margin); + + // Trees and similarly inset panels. + + p_config.tree_panel_style = p_config.base_style->duplicate(); + // Make Trees easier to distinguish from other controls by using a darker background color. + p_config.tree_panel_style->set_bg_color(p_config.dark_color_1.lerp(p_config.dark_color_2, 0.5)); + if (p_config.draw_extra_borders) { + p_config.tree_panel_style->set_border_width_all(Math::round(EDSCALE)); + p_config.tree_panel_style->set_border_color(p_config.extra_border_color_2); + } else { + p_config.tree_panel_style->set_border_color(p_config.dark_color_3); + } + } + } +} + +void EditorThemeManager::_populate_standard_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config) { + // Panels. + { + // Panel. + p_theme->set_stylebox("panel", "Panel", make_flat_stylebox(p_config.dark_color_1, 6, 4, 6, 4, p_config.corner_radius)); + + // PanelContainer. + p_theme->set_stylebox("panel", "PanelContainer", p_config.panel_container_style); + + // TooltipPanel & TooltipLabel. + { + // TooltipPanel is also used for custom tooltips, while TooltipLabel + // is only relevant for default tooltips. + + p_theme->set_color("font_color", "TooltipLabel", p_config.font_hover_color); + p_theme->set_color("font_shadow_color", "TooltipLabel", Color(0, 0, 0, 0)); + + Ref<StyleBoxFlat> style_tooltip = p_config.popup_style->duplicate(); + style_tooltip->set_shadow_size(0); + style_tooltip->set_content_margin_all(p_config.base_margin * EDSCALE * 0.5); + style_tooltip->set_bg_color(p_config.dark_color_3 * Color(0.8, 0.8, 0.8, 0.9)); + style_tooltip->set_border_width_all(0); + p_theme->set_stylebox("panel", "TooltipPanel", style_tooltip); + } + + // PopupPanel + p_theme->set_stylebox("panel", "PopupPanel", p_config.popup_style); + } + + // Buttons. + { + // Button. + + p_theme->set_stylebox("normal", "Button", p_config.button_style); + p_theme->set_stylebox("hover", "Button", p_config.button_style_hover); + p_theme->set_stylebox("pressed", "Button", p_config.button_style_pressed); + p_theme->set_stylebox("focus", "Button", p_config.button_style_focus); + p_theme->set_stylebox("disabled", "Button", p_config.button_style_disabled); + + p_theme->set_color("font_color", "Button", p_config.font_color); + p_theme->set_color("font_hover_color", "Button", p_config.font_hover_color); + p_theme->set_color("font_hover_pressed_color", "Button", p_config.font_hover_pressed_color); + p_theme->set_color("font_focus_color", "Button", p_config.font_focus_color); + p_theme->set_color("font_pressed_color", "Button", p_config.font_pressed_color); + p_theme->set_color("font_disabled_color", "Button", p_config.font_disabled_color); + p_theme->set_color("font_outline_color", "Button", p_config.font_outline_color); + + p_theme->set_color("icon_normal_color", "Button", p_config.icon_normal_color); + p_theme->set_color("icon_hover_color", "Button", p_config.icon_hover_color); + p_theme->set_color("icon_focus_color", "Button", p_config.icon_focus_color); + p_theme->set_color("icon_pressed_color", "Button", p_config.icon_pressed_color); + p_theme->set_color("icon_disabled_color", "Button", p_config.icon_disabled_color); + + p_theme->set_constant("h_separation", "Button", 4 * EDSCALE); + p_theme->set_constant("outline_size", "Button", 0); + + // MenuButton. + + p_theme->set_stylebox("normal", "MenuButton", p_config.panel_container_style); + p_theme->set_stylebox("hover", "MenuButton", p_config.button_style_hover); + p_theme->set_stylebox("pressed", "MenuButton", p_config.panel_container_style); + p_theme->set_stylebox("focus", "MenuButton", p_config.panel_container_style); + p_theme->set_stylebox("disabled", "MenuButton", p_config.panel_container_style); + + p_theme->set_color("font_color", "MenuButton", p_config.font_color); + p_theme->set_color("font_hover_color", "MenuButton", p_config.font_hover_color); + p_theme->set_color("font_hover_pressed_color", "MenuButton", p_config.font_hover_pressed_color); + p_theme->set_color("font_focus_color", "MenuButton", p_config.font_focus_color); + p_theme->set_color("font_outline_color", "MenuButton", p_config.font_outline_color); + + p_theme->set_constant("outline_size", "MenuButton", 0); + + // MenuBar. + + p_theme->set_stylebox("normal", "MenuBar", p_config.button_style); + p_theme->set_stylebox("hover", "MenuBar", p_config.button_style_hover); + p_theme->set_stylebox("pressed", "MenuBar", p_config.button_style_pressed); + p_theme->set_stylebox("disabled", "MenuBar", p_config.button_style_disabled); + + p_theme->set_color("font_color", "MenuBar", p_config.font_color); + p_theme->set_color("font_hover_color", "MenuBar", p_config.font_hover_color); + p_theme->set_color("font_hover_pressed_color", "MenuBar", p_config.font_hover_pressed_color); + p_theme->set_color("font_focus_color", "MenuBar", p_config.font_focus_color); + p_theme->set_color("font_pressed_color", "MenuBar", p_config.font_pressed_color); + p_theme->set_color("font_disabled_color", "MenuBar", p_config.font_disabled_color); + p_theme->set_color("font_outline_color", "MenuBar", p_config.font_outline_color); + + p_theme->set_color("icon_normal_color", "MenuBar", p_config.icon_normal_color); + p_theme->set_color("icon_hover_color", "MenuBar", p_config.icon_hover_color); + p_theme->set_color("icon_focus_color", "MenuBar", p_config.icon_focus_color); + p_theme->set_color("icon_pressed_color", "MenuBar", p_config.icon_pressed_color); + p_theme->set_color("icon_disabled_color", "MenuBar", p_config.icon_disabled_color); + + p_theme->set_constant("h_separation", "MenuBar", 4 * EDSCALE); + p_theme->set_constant("outline_size", "MenuBar", 0); + + // OptionButton. + { + Ref<StyleBoxFlat> option_button_focus_style = p_config.button_style_focus->duplicate(); + Ref<StyleBoxFlat> option_button_normal_style = p_config.button_style->duplicate(); + Ref<StyleBoxFlat> option_button_hover_style = p_config.button_style_hover->duplicate(); + Ref<StyleBoxFlat> option_button_pressed_style = p_config.button_style_pressed->duplicate(); + Ref<StyleBoxFlat> option_button_disabled_style = p_config.button_style_disabled->duplicate(); + + option_button_focus_style->set_content_margin(SIDE_RIGHT, 4 * EDSCALE); + option_button_normal_style->set_content_margin(SIDE_RIGHT, 4 * EDSCALE); + option_button_hover_style->set_content_margin(SIDE_RIGHT, 4 * EDSCALE); + option_button_pressed_style->set_content_margin(SIDE_RIGHT, 4 * EDSCALE); + option_button_disabled_style->set_content_margin(SIDE_RIGHT, 4 * EDSCALE); + + p_theme->set_stylebox("focus", "OptionButton", option_button_focus_style); + p_theme->set_stylebox("normal", "OptionButton", p_config.button_style); + p_theme->set_stylebox("hover", "OptionButton", p_config.button_style_hover); + p_theme->set_stylebox("pressed", "OptionButton", p_config.button_style_pressed); + p_theme->set_stylebox("disabled", "OptionButton", p_config.button_style_disabled); + + p_theme->set_stylebox("normal_mirrored", "OptionButton", option_button_normal_style); + p_theme->set_stylebox("hover_mirrored", "OptionButton", option_button_hover_style); + p_theme->set_stylebox("pressed_mirrored", "OptionButton", option_button_pressed_style); + p_theme->set_stylebox("disabled_mirrored", "OptionButton", option_button_disabled_style); + + p_theme->set_color("font_color", "OptionButton", p_config.font_color); + p_theme->set_color("font_hover_color", "OptionButton", p_config.font_hover_color); + p_theme->set_color("font_hover_pressed_color", "OptionButton", p_config.font_hover_pressed_color); + p_theme->set_color("font_focus_color", "OptionButton", p_config.font_focus_color); + p_theme->set_color("font_pressed_color", "OptionButton", p_config.font_pressed_color); + p_theme->set_color("font_disabled_color", "OptionButton", p_config.font_disabled_color); + p_theme->set_color("font_outline_color", "OptionButton", p_config.font_outline_color); + + p_theme->set_color("icon_normal_color", "OptionButton", p_config.icon_normal_color); + p_theme->set_color("icon_hover_color", "OptionButton", p_config.icon_hover_color); + p_theme->set_color("icon_focus_color", "OptionButton", p_config.icon_focus_color); + p_theme->set_color("icon_pressed_color", "OptionButton", p_config.icon_pressed_color); + p_theme->set_color("icon_disabled_color", "OptionButton", p_config.icon_disabled_color); + + p_theme->set_icon("arrow", "OptionButton", p_theme->get_icon(SNAME("GuiOptionArrow"), EditorStringName(EditorIcons))); + p_theme->set_constant("arrow_margin", "OptionButton", p_config.widget_margin.x - 2 * EDSCALE); + p_theme->set_constant("modulate_arrow", "OptionButton", true); + p_theme->set_constant("h_separation", "OptionButton", 4 * EDSCALE); + p_theme->set_constant("outline_size", "OptionButton", 0); + } + + // CheckButton. + + p_theme->set_stylebox("normal", "CheckButton", p_config.panel_container_style); + p_theme->set_stylebox("pressed", "CheckButton", p_config.panel_container_style); + p_theme->set_stylebox("disabled", "CheckButton", p_config.panel_container_style); + p_theme->set_stylebox("hover", "CheckButton", p_config.panel_container_style); + p_theme->set_stylebox("hover_pressed", "CheckButton", p_config.panel_container_style); + + p_theme->set_icon("checked", "CheckButton", p_theme->get_icon(SNAME("GuiToggleOn"), EditorStringName(EditorIcons))); + p_theme->set_icon("checked_disabled", "CheckButton", p_theme->get_icon(SNAME("GuiToggleOnDisabled"), EditorStringName(EditorIcons))); + p_theme->set_icon("unchecked", "CheckButton", p_theme->get_icon(SNAME("GuiToggleOff"), EditorStringName(EditorIcons))); + p_theme->set_icon("unchecked_disabled", "CheckButton", p_theme->get_icon(SNAME("GuiToggleOffDisabled"), EditorStringName(EditorIcons))); + + p_theme->set_icon("checked_mirrored", "CheckButton", p_theme->get_icon(SNAME("GuiToggleOnMirrored"), EditorStringName(EditorIcons))); + p_theme->set_icon("checked_disabled_mirrored", "CheckButton", p_theme->get_icon(SNAME("GuiToggleOnDisabledMirrored"), EditorStringName(EditorIcons))); + p_theme->set_icon("unchecked_mirrored", "CheckButton", p_theme->get_icon(SNAME("GuiToggleOffMirrored"), EditorStringName(EditorIcons))); + p_theme->set_icon("unchecked_disabled_mirrored", "CheckButton", p_theme->get_icon(SNAME("GuiToggleOffDisabledMirrored"), EditorStringName(EditorIcons))); + + p_theme->set_color("font_color", "CheckButton", p_config.font_color); + p_theme->set_color("font_hover_color", "CheckButton", p_config.font_hover_color); + p_theme->set_color("font_hover_pressed_color", "CheckButton", p_config.font_hover_pressed_color); + p_theme->set_color("font_focus_color", "CheckButton", p_config.font_focus_color); + p_theme->set_color("font_pressed_color", "CheckButton", p_config.font_pressed_color); + p_theme->set_color("font_disabled_color", "CheckButton", p_config.font_disabled_color); + p_theme->set_color("font_outline_color", "CheckButton", p_config.font_outline_color); + + p_theme->set_color("icon_normal_color", "CheckButton", p_config.icon_normal_color); + p_theme->set_color("icon_hover_color", "CheckButton", p_config.icon_hover_color); + p_theme->set_color("icon_focus_color", "CheckButton", p_config.icon_focus_color); + p_theme->set_color("icon_pressed_color", "CheckButton", p_config.icon_pressed_color); + p_theme->set_color("icon_disabled_color", "CheckButton", p_config.icon_disabled_color); + + p_theme->set_constant("h_separation", "CheckButton", 8 * EDSCALE); + p_theme->set_constant("check_v_offset", "CheckButton", 0); + p_theme->set_constant("outline_size", "CheckButton", 0); + + // CheckBox. + { + Ref<StyleBoxFlat> checkbox_style = p_config.panel_container_style->duplicate(); + checkbox_style->set_content_margin_all(p_config.base_margin * EDSCALE); + + p_theme->set_stylebox("normal", "CheckBox", checkbox_style); + p_theme->set_stylebox("pressed", "CheckBox", checkbox_style); + p_theme->set_stylebox("disabled", "CheckBox", checkbox_style); + p_theme->set_stylebox("hover", "CheckBox", checkbox_style); + p_theme->set_stylebox("hover_pressed", "CheckBox", checkbox_style); + p_theme->set_icon("checked", "CheckBox", p_theme->get_icon(SNAME("GuiChecked"), EditorStringName(EditorIcons))); + p_theme->set_icon("unchecked", "CheckBox", p_theme->get_icon(SNAME("GuiUnchecked"), EditorStringName(EditorIcons))); + p_theme->set_icon("radio_checked", "CheckBox", p_theme->get_icon(SNAME("GuiRadioChecked"), EditorStringName(EditorIcons))); + p_theme->set_icon("radio_unchecked", "CheckBox", p_theme->get_icon(SNAME("GuiRadioUnchecked"), EditorStringName(EditorIcons))); + p_theme->set_icon("checked_disabled", "CheckBox", p_theme->get_icon(SNAME("GuiCheckedDisabled"), EditorStringName(EditorIcons))); + p_theme->set_icon("unchecked_disabled", "CheckBox", p_theme->get_icon(SNAME("GuiUncheckedDisabled"), EditorStringName(EditorIcons))); + p_theme->set_icon("radio_checked_disabled", "CheckBox", p_theme->get_icon(SNAME("GuiRadioCheckedDisabled"), EditorStringName(EditorIcons))); + p_theme->set_icon("radio_unchecked_disabled", "CheckBox", p_theme->get_icon(SNAME("GuiRadioUncheckedDisabled"), EditorStringName(EditorIcons))); + + p_theme->set_color("font_color", "CheckBox", p_config.font_color); + p_theme->set_color("font_hover_color", "CheckBox", p_config.font_hover_color); + p_theme->set_color("font_hover_pressed_color", "CheckBox", p_config.font_hover_pressed_color); + p_theme->set_color("font_focus_color", "CheckBox", p_config.font_focus_color); + p_theme->set_color("font_pressed_color", "CheckBox", p_config.font_pressed_color); + p_theme->set_color("font_disabled_color", "CheckBox", p_config.font_disabled_color); + p_theme->set_color("font_outline_color", "CheckBox", p_config.font_outline_color); + + p_theme->set_color("icon_normal_color", "CheckBox", p_config.icon_normal_color); + p_theme->set_color("icon_hover_color", "CheckBox", p_config.icon_hover_color); + p_theme->set_color("icon_focus_color", "CheckBox", p_config.icon_focus_color); + p_theme->set_color("icon_pressed_color", "CheckBox", p_config.icon_pressed_color); + p_theme->set_color("icon_disabled_color", "CheckBox", p_config.icon_disabled_color); + + p_theme->set_constant("h_separation", "CheckBox", 8 * EDSCALE); + p_theme->set_constant("check_v_offset", "CheckBox", 0); + p_theme->set_constant("outline_size", "CheckBox", 0); + } + + // LinkButton. + + p_theme->set_stylebox("focus", "LinkButton", p_config.base_empty_style); + p_theme->set_color("font_color", "LinkButton", p_config.font_color); + p_theme->set_color("font_hover_color", "LinkButton", p_config.font_hover_color); + p_theme->set_color("font_hover_pressed_color", "LinkButton", p_config.font_hover_pressed_color); + p_theme->set_color("font_focus_color", "LinkButton", p_config.font_focus_color); + p_theme->set_color("font_pressed_color", "LinkButton", p_config.font_pressed_color); + p_theme->set_color("font_disabled_color", "LinkButton", p_config.font_disabled_color); + p_theme->set_color("font_outline_color", "LinkButton", p_config.font_outline_color); + + p_theme->set_constant("outline_size", "LinkButton", 0); + } + + // Tree & ItemList. + { + Ref<StyleBoxFlat> style_tree_focus = p_config.base_style->duplicate(); + style_tree_focus->set_bg_color(p_config.highlight_color); + style_tree_focus->set_border_width_all(0); + + Ref<StyleBoxFlat> style_tree_selected = style_tree_focus->duplicate(); + + const Color guide_color = p_config.mono_color * Color(1, 1, 1, 0.05); + + // Tree. + { + p_theme->set_icon("checked", "Tree", p_theme->get_icon(SNAME("GuiChecked"), EditorStringName(EditorIcons))); + p_theme->set_icon("checked_disabled", "Tree", p_theme->get_icon(SNAME("GuiCheckedDisabled"), EditorStringName(EditorIcons))); + p_theme->set_icon("indeterminate", "Tree", p_theme->get_icon(SNAME("GuiIndeterminate"), EditorStringName(EditorIcons))); + p_theme->set_icon("indeterminate_disabled", "Tree", p_theme->get_icon(SNAME("GuiIndeterminateDisabled"), EditorStringName(EditorIcons))); + p_theme->set_icon("unchecked", "Tree", p_theme->get_icon(SNAME("GuiUnchecked"), EditorStringName(EditorIcons))); + p_theme->set_icon("unchecked_disabled", "Tree", p_theme->get_icon(SNAME("GuiUncheckedDisabled"), EditorStringName(EditorIcons))); + p_theme->set_icon("arrow", "Tree", p_theme->get_icon(SNAME("GuiTreeArrowDown"), EditorStringName(EditorIcons))); + p_theme->set_icon("arrow_collapsed", "Tree", p_theme->get_icon(SNAME("GuiTreeArrowRight"), EditorStringName(EditorIcons))); + p_theme->set_icon("arrow_collapsed_mirrored", "Tree", p_theme->get_icon(SNAME("GuiTreeArrowLeft"), EditorStringName(EditorIcons))); + p_theme->set_icon("updown", "Tree", p_theme->get_icon(SNAME("GuiTreeUpdown"), EditorStringName(EditorIcons))); + p_theme->set_icon("select_arrow", "Tree", p_theme->get_icon(SNAME("GuiDropdown"), EditorStringName(EditorIcons))); + + p_theme->set_stylebox("panel", "Tree", p_config.tree_panel_style); + p_theme->set_stylebox("focus", "Tree", p_config.button_style_focus); + p_theme->set_stylebox("custom_button", "Tree", make_empty_stylebox()); + p_theme->set_stylebox("custom_button_pressed", "Tree", make_empty_stylebox()); + p_theme->set_stylebox("custom_button_hover", "Tree", p_config.button_style); + + p_theme->set_color("custom_button_font_highlight", "Tree", p_config.font_hover_color); + p_theme->set_color("font_color", "Tree", p_config.font_color); + p_theme->set_color("font_selected_color", "Tree", p_config.mono_color); + p_theme->set_color("font_disabled_color", "Tree", p_config.font_disabled_color); + p_theme->set_color("font_outline_color", "Tree", p_config.font_outline_color); + p_theme->set_color("title_button_color", "Tree", p_config.font_color); + p_theme->set_color("drop_position_color", "Tree", p_config.accent_color); + + p_theme->set_constant("v_separation", "Tree", p_config.separation_margin); + p_theme->set_constant("h_separation", "Tree", (p_config.increased_margin + 2) * EDSCALE); + p_theme->set_constant("guide_width", "Tree", p_config.border_width); + p_theme->set_constant("item_margin", "Tree", 3 * p_config.increased_margin * EDSCALE); + p_theme->set_constant("inner_item_margin_top", "Tree", p_config.separation_margin); + p_theme->set_constant("inner_item_margin_bottom", "Tree", p_config.separation_margin); + p_theme->set_constant("inner_item_margin_left", "Tree", p_config.increased_margin * EDSCALE); + p_theme->set_constant("inner_item_margin_right", "Tree", p_config.increased_margin * EDSCALE); + p_theme->set_constant("button_margin", "Tree", p_config.base_margin * EDSCALE); + p_theme->set_constant("scroll_border", "Tree", 40 * EDSCALE); + p_theme->set_constant("scroll_speed", "Tree", 12); + p_theme->set_constant("outline_size", "Tree", 0); + p_theme->set_constant("scrollbar_margin_left", "Tree", 0); + p_theme->set_constant("scrollbar_margin_top", "Tree", 0); + p_theme->set_constant("scrollbar_margin_right", "Tree", 0); + p_theme->set_constant("scrollbar_margin_bottom", "Tree", 0); + p_theme->set_constant("scrollbar_h_separation", "Tree", 1 * EDSCALE); + p_theme->set_constant("scrollbar_v_separation", "Tree", 1 * EDSCALE); + + Color relationship_line_color = p_config.mono_color * Color(1, 1, 1, p_config.relationship_line_opacity); + + p_theme->set_constant("draw_guides", "Tree", p_config.relationship_line_opacity < 0.01); + p_theme->set_color("guide_color", "Tree", guide_color); + + int relationship_line_width = 1; + Color parent_line_color = p_config.mono_color * Color(1, 1, 1, CLAMP(p_config.relationship_line_opacity + 0.45, 0.0, 1.0)); + Color children_line_color = p_config.mono_color * Color(1, 1, 1, CLAMP(p_config.relationship_line_opacity + 0.25, 0.0, 1.0)); + + p_theme->set_constant("draw_relationship_lines", "Tree", p_config.relationship_line_opacity >= 0.01); + p_theme->set_constant("relationship_line_width", "Tree", relationship_line_width); + p_theme->set_constant("parent_hl_line_width", "Tree", relationship_line_width * 2); + p_theme->set_constant("children_hl_line_width", "Tree", relationship_line_width); + p_theme->set_constant("parent_hl_line_margin", "Tree", relationship_line_width * 3); + p_theme->set_color("relationship_line_color", "Tree", relationship_line_color); + p_theme->set_color("parent_hl_line_color", "Tree", parent_line_color); + p_theme->set_color("children_hl_line_color", "Tree", children_line_color); + p_theme->set_color("drop_position_color", "Tree", p_config.accent_color); + + Ref<StyleBoxFlat> style_tree_btn = p_config.base_style->duplicate(); + style_tree_btn->set_bg_color(p_config.highlight_color); + style_tree_btn->set_border_width_all(0); + p_theme->set_stylebox("button_pressed", "Tree", style_tree_btn); + + Ref<StyleBoxFlat> style_tree_hover = p_config.base_style->duplicate(); + style_tree_hover->set_bg_color(p_config.highlight_color * Color(1, 1, 1, 0.4)); + style_tree_hover->set_border_width_all(0); + p_theme->set_stylebox("hover", "Tree", style_tree_hover); + + p_theme->set_stylebox("selected_focus", "Tree", style_tree_focus); + p_theme->set_stylebox("selected", "Tree", style_tree_selected); + + Ref<StyleBoxFlat> style_tree_cursor = p_config.base_style->duplicate(); + style_tree_cursor->set_draw_center(false); + style_tree_cursor->set_border_width_all(MAX(1, p_config.border_width)); + style_tree_cursor->set_border_color(p_config.contrast_color_1); + + Ref<StyleBoxFlat> style_tree_title = p_config.base_style->duplicate(); + style_tree_title->set_bg_color(p_config.dark_color_3); + style_tree_title->set_border_width_all(0); + p_theme->set_stylebox("cursor", "Tree", style_tree_cursor); + p_theme->set_stylebox("cursor_unfocused", "Tree", style_tree_cursor); + p_theme->set_stylebox("title_button_normal", "Tree", style_tree_title); + p_theme->set_stylebox("title_button_hover", "Tree", style_tree_title); + p_theme->set_stylebox("title_button_pressed", "Tree", style_tree_title); + } + + // ItemList. + { + Ref<StyleBoxFlat> style_itemlist_bg = p_config.base_style->duplicate(); + style_itemlist_bg->set_content_margin_all(p_config.separation_margin); + style_itemlist_bg->set_bg_color(p_config.dark_color_1); + + if (p_config.draw_extra_borders) { + style_itemlist_bg->set_border_width_all(Math::round(EDSCALE)); + style_itemlist_bg->set_border_color(p_config.extra_border_color_2); + } else { + style_itemlist_bg->set_border_width_all(p_config.border_width); + style_itemlist_bg->set_border_color(p_config.dark_color_3); + } + + Ref<StyleBoxFlat> style_itemlist_cursor = p_config.base_style->duplicate(); + style_itemlist_cursor->set_draw_center(false); + style_itemlist_cursor->set_border_width_all(p_config.border_width); + style_itemlist_cursor->set_border_color(p_config.highlight_color); + + Ref<StyleBoxFlat> style_itemlist_hover = style_tree_selected->duplicate(); + style_itemlist_hover->set_bg_color(p_config.highlight_color * Color(1, 1, 1, 0.3)); + style_itemlist_hover->set_border_width_all(0); + + p_theme->set_stylebox("panel", "ItemList", style_itemlist_bg); + p_theme->set_stylebox("focus", "ItemList", p_config.button_style_focus); + p_theme->set_stylebox("cursor", "ItemList", style_itemlist_cursor); + p_theme->set_stylebox("cursor_unfocused", "ItemList", style_itemlist_cursor); + p_theme->set_stylebox("selected_focus", "ItemList", style_tree_focus); + p_theme->set_stylebox("selected", "ItemList", style_tree_selected); + p_theme->set_stylebox("hovered", "ItemList", style_itemlist_hover); + p_theme->set_color("font_color", "ItemList", p_config.font_color); + p_theme->set_color("font_hovered_color", "ItemList", p_config.mono_color); + p_theme->set_color("font_selected_color", "ItemList", p_config.mono_color); + p_theme->set_color("font_outline_color", "ItemList", p_config.font_outline_color); + p_theme->set_color("guide_color", "ItemList", guide_color); + p_theme->set_constant("v_separation", "ItemList", p_config.forced_even_separation * 0.5 * EDSCALE); + p_theme->set_constant("h_separation", "ItemList", (p_config.increased_margin + 2) * EDSCALE); + p_theme->set_constant("icon_margin", "ItemList", (p_config.increased_margin + 2) * EDSCALE); + p_theme->set_constant("line_separation", "ItemList", p_config.separation_margin); + p_theme->set_constant("outline_size", "ItemList", 0); + } + } + + // TabBar & TabContainer. + { + Ref<StyleBoxFlat> style_tab_base = p_config.button_style->duplicate(); + + style_tab_base->set_border_width_all(0); + // Don't round the top corners to avoid creating a small blank space between the tabs and the main panel. + // This also makes the top highlight look better. + style_tab_base->set_corner_radius(CORNER_BOTTOM_LEFT, 0); + style_tab_base->set_corner_radius(CORNER_BOTTOM_RIGHT, 0); + + // When using a border width greater than 0, visually line up the left of the selected tab with the underlying panel. + style_tab_base->set_expand_margin(SIDE_LEFT, -p_config.border_width); + + style_tab_base->set_content_margin(SIDE_LEFT, p_config.widget_margin.x + 5 * EDSCALE); + style_tab_base->set_content_margin(SIDE_RIGHT, p_config.widget_margin.x + 5 * EDSCALE); + style_tab_base->set_content_margin(SIDE_BOTTOM, p_config.widget_margin.y); + style_tab_base->set_content_margin(SIDE_TOP, p_config.widget_margin.y); + + Ref<StyleBoxFlat> style_tab_selected = style_tab_base->duplicate(); + + style_tab_selected->set_bg_color(p_config.base_color); + // Add a highlight line at the top of the selected tab. + style_tab_selected->set_border_width(SIDE_TOP, Math::round(2 * EDSCALE)); + // Make the highlight line prominent, but not too prominent as to not be distracting. + Color tab_highlight = p_config.dark_color_2.lerp(p_config.accent_color, 0.75); + style_tab_selected->set_border_color(tab_highlight); + style_tab_selected->set_corner_radius_all(0); + + Ref<StyleBoxFlat> style_tab_hovered = style_tab_base->duplicate(); + + style_tab_hovered->set_bg_color(p_config.dark_color_1.lerp(p_config.base_color, 0.4)); + // Hovered tab has a subtle highlight between normal and selected states. + style_tab_hovered->set_corner_radius_all(0); + + Ref<StyleBoxFlat> style_tab_unselected = style_tab_base->duplicate(); + style_tab_unselected->set_expand_margin(SIDE_BOTTOM, 0); + style_tab_unselected->set_bg_color(p_config.dark_color_1); + // Add some spacing between unselected tabs to make them easier to distinguish from each other + style_tab_unselected->set_border_color(Color(0, 0, 0, 0)); + + Ref<StyleBoxFlat> style_tab_disabled = style_tab_base->duplicate(); + style_tab_disabled->set_expand_margin(SIDE_BOTTOM, 0); + style_tab_disabled->set_bg_color(p_config.disabled_bg_color); + style_tab_disabled->set_border_color(p_config.disabled_bg_color); + + Ref<StyleBoxFlat> style_tab_focus = p_config.button_style_focus->duplicate(); + + Ref<StyleBoxFlat> style_tabbar_background = make_flat_stylebox(p_config.dark_color_1, 0, 0, 0, 0, p_config.corner_radius * EDSCALE); + style_tabbar_background->set_corner_radius(CORNER_BOTTOM_LEFT, 0); + style_tabbar_background->set_corner_radius(CORNER_BOTTOM_RIGHT, 0); + p_theme->set_stylebox("tabbar_background", "TabContainer", style_tabbar_background); + p_theme->set_stylebox("panel", "TabContainer", p_config.content_panel_style); + + p_theme->set_stylebox("tab_selected", "TabContainer", style_tab_selected); + p_theme->set_stylebox("tab_hovered", "TabContainer", style_tab_hovered); + p_theme->set_stylebox("tab_unselected", "TabContainer", style_tab_unselected); + p_theme->set_stylebox("tab_disabled", "TabContainer", style_tab_disabled); + p_theme->set_stylebox("tab_focus", "TabContainer", style_tab_focus); + p_theme->set_stylebox("tab_selected", "TabBar", style_tab_selected); + p_theme->set_stylebox("tab_hovered", "TabBar", style_tab_hovered); + p_theme->set_stylebox("tab_unselected", "TabBar", style_tab_unselected); + p_theme->set_stylebox("tab_disabled", "TabBar", style_tab_disabled); + p_theme->set_stylebox("tab_focus", "TabBar", style_tab_focus); + p_theme->set_stylebox("button_pressed", "TabBar", p_config.panel_container_style); + p_theme->set_stylebox("button_highlight", "TabBar", p_config.panel_container_style); + + p_theme->set_color("font_selected_color", "TabContainer", p_config.font_color); + p_theme->set_color("font_hovered_color", "TabContainer", p_config.font_color); + p_theme->set_color("font_unselected_color", "TabContainer", p_config.font_disabled_color); + p_theme->set_color("font_outline_color", "TabContainer", p_config.font_outline_color); + p_theme->set_color("font_selected_color", "TabBar", p_config.font_color); + p_theme->set_color("font_hovered_color", "TabBar", p_config.font_color); + p_theme->set_color("font_unselected_color", "TabBar", p_config.font_disabled_color); + p_theme->set_color("font_outline_color", "TabBar", p_config.font_outline_color); + p_theme->set_color("drop_mark_color", "TabContainer", tab_highlight); + p_theme->set_color("drop_mark_color", "TabBar", tab_highlight); + + p_theme->set_icon("menu", "TabContainer", p_theme->get_icon(SNAME("GuiTabMenu"), EditorStringName(EditorIcons))); + p_theme->set_icon("menu_highlight", "TabContainer", p_theme->get_icon(SNAME("GuiTabMenuHl"), EditorStringName(EditorIcons))); + p_theme->set_icon("close", "TabBar", p_theme->get_icon(SNAME("GuiClose"), EditorStringName(EditorIcons))); + p_theme->set_icon("increment", "TabContainer", p_theme->get_icon(SNAME("GuiScrollArrowRight"), EditorStringName(EditorIcons))); + p_theme->set_icon("decrement", "TabContainer", p_theme->get_icon(SNAME("GuiScrollArrowLeft"), EditorStringName(EditorIcons))); + p_theme->set_icon("increment", "TabBar", p_theme->get_icon(SNAME("GuiScrollArrowRight"), EditorStringName(EditorIcons))); + p_theme->set_icon("decrement", "TabBar", p_theme->get_icon(SNAME("GuiScrollArrowLeft"), EditorStringName(EditorIcons))); + p_theme->set_icon("increment_highlight", "TabBar", p_theme->get_icon(SNAME("GuiScrollArrowRightHl"), EditorStringName(EditorIcons))); + p_theme->set_icon("decrement_highlight", "TabBar", p_theme->get_icon(SNAME("GuiScrollArrowLeftHl"), EditorStringName(EditorIcons))); + p_theme->set_icon("increment_highlight", "TabContainer", p_theme->get_icon(SNAME("GuiScrollArrowRightHl"), EditorStringName(EditorIcons))); + p_theme->set_icon("decrement_highlight", "TabContainer", p_theme->get_icon(SNAME("GuiScrollArrowLeftHl"), EditorStringName(EditorIcons))); + p_theme->set_icon("drop_mark", "TabContainer", p_theme->get_icon(SNAME("GuiTabDropMark"), EditorStringName(EditorIcons))); + p_theme->set_icon("drop_mark", "TabBar", p_theme->get_icon(SNAME("GuiTabDropMark"), EditorStringName(EditorIcons))); + + p_theme->set_constant("side_margin", "TabContainer", 0); + p_theme->set_constant("outline_size", "TabContainer", 0); + p_theme->set_constant("h_separation", "TabBar", 4 * EDSCALE); + p_theme->set_constant("outline_size", "TabBar", 0); + } + + // Separators. + p_theme->set_stylebox("separator", "HSeparator", make_line_stylebox(p_config.separator_color, MAX(Math::round(EDSCALE), p_config.border_width))); + p_theme->set_stylebox("separator", "VSeparator", make_line_stylebox(p_config.separator_color, MAX(Math::round(EDSCALE), p_config.border_width), 0, 0, true)); + + // LineEdit & TextEdit. + { + Ref<StyleBoxFlat> text_editor_style = p_config.button_style->duplicate(); + // The original button_style style has an extra 1 pixel offset that makes LineEdits not align with Buttons, + // so this compensates for that. + text_editor_style->set_content_margin(SIDE_TOP, text_editor_style->get_content_margin(SIDE_TOP) - 1 * EDSCALE); + + // Don't round the bottom corners to make the line look sharper. + text_editor_style->set_corner_radius(CORNER_BOTTOM_LEFT, 0); + text_editor_style->set_corner_radius(CORNER_BOTTOM_RIGHT, 0); + + if (p_config.draw_extra_borders) { + text_editor_style->set_border_width_all(Math::round(EDSCALE)); + text_editor_style->set_border_color(p_config.extra_border_color_1); + } else { + // Add a bottom line to make LineEdits more visible, especially in sectioned inspectors + // such as the Project Settings. + text_editor_style->set_border_width(SIDE_BOTTOM, Math::round(2 * EDSCALE)); + text_editor_style->set_border_color(p_config.dark_color_2); + } + + Ref<StyleBoxFlat> text_editor_disabled_style = text_editor_style->duplicate(); + text_editor_disabled_style->set_border_color(p_config.disabled_border_color); + text_editor_disabled_style->set_bg_color(p_config.disabled_bg_color); + + // LineEdit. + + p_theme->set_stylebox("normal", "LineEdit", text_editor_style); + p_theme->set_stylebox("focus", "LineEdit", p_config.button_style_focus); + p_theme->set_stylebox("read_only", "LineEdit", text_editor_disabled_style); + + p_theme->set_icon("clear", "LineEdit", p_theme->get_icon(SNAME("GuiClose"), EditorStringName(EditorIcons))); + + p_theme->set_color("font_color", "LineEdit", p_config.font_color); + p_theme->set_color("font_selected_color", "LineEdit", p_config.mono_color); + p_theme->set_color("font_uneditable_color", "LineEdit", p_config.font_readonly_color); + p_theme->set_color("font_placeholder_color", "LineEdit", p_config.font_placeholder_color); + p_theme->set_color("font_outline_color", "LineEdit", p_config.font_outline_color); + p_theme->set_color("caret_color", "LineEdit", p_config.font_color); + p_theme->set_color("selection_color", "LineEdit", p_config.selection_color); + p_theme->set_color("clear_button_color", "LineEdit", p_config.font_color); + p_theme->set_color("clear_button_color_pressed", "LineEdit", p_config.accent_color); + + p_theme->set_constant("minimum_character_width", "LineEdit", 4); + p_theme->set_constant("outline_size", "LineEdit", 0); + p_theme->set_constant("caret_width", "LineEdit", 1); + + // TextEdit. + + p_theme->set_stylebox("normal", "TextEdit", text_editor_style); + p_theme->set_stylebox("focus", "TextEdit", p_config.button_style_focus); + p_theme->set_stylebox("read_only", "TextEdit", text_editor_disabled_style); + + p_theme->set_icon("tab", "TextEdit", p_theme->get_icon(SNAME("GuiTab"), EditorStringName(EditorIcons))); + p_theme->set_icon("space", "TextEdit", p_theme->get_icon(SNAME("GuiSpace"), EditorStringName(EditorIcons))); + + p_theme->set_color("font_color", "TextEdit", p_config.font_color); + p_theme->set_color("font_readonly_color", "TextEdit", p_config.font_readonly_color); + p_theme->set_color("font_placeholder_color", "TextEdit", p_config.font_placeholder_color); + p_theme->set_color("font_outline_color", "TextEdit", p_config.font_outline_color); + p_theme->set_color("caret_color", "TextEdit", p_config.font_color); + p_theme->set_color("selection_color", "TextEdit", p_config.selection_color); + p_theme->set_color("background_color", "TextEdit", Color(0, 0, 0, 0)); + + p_theme->set_constant("line_spacing", "TextEdit", 4 * EDSCALE); + p_theme->set_constant("outline_size", "TextEdit", 0); + p_theme->set_constant("caret_width", "TextEdit", 1); + } + + // Containers. + { + p_theme->set_constant("separation", "BoxContainer", p_config.separation_margin); + p_theme->set_constant("separation", "HBoxContainer", p_config.separation_margin); + p_theme->set_constant("separation", "VBoxContainer", p_config.separation_margin); + p_theme->set_constant("margin_left", "MarginContainer", 0); + p_theme->set_constant("margin_top", "MarginContainer", 0); + p_theme->set_constant("margin_right", "MarginContainer", 0); + p_theme->set_constant("margin_bottom", "MarginContainer", 0); + p_theme->set_constant("h_separation", "GridContainer", p_config.separation_margin); + p_theme->set_constant("v_separation", "GridContainer", p_config.separation_margin); + p_theme->set_constant("h_separation", "FlowContainer", p_config.separation_margin); + p_theme->set_constant("v_separation", "FlowContainer", p_config.separation_margin); + p_theme->set_constant("h_separation", "HFlowContainer", p_config.separation_margin); + p_theme->set_constant("v_separation", "HFlowContainer", p_config.separation_margin); + p_theme->set_constant("h_separation", "VFlowContainer", p_config.separation_margin); + p_theme->set_constant("v_separation", "VFlowContainer", p_config.separation_margin); + + // SplitContainer. + + p_theme->set_icon("h_grabber", "SplitContainer", p_theme->get_icon(SNAME("GuiHsplitter"), EditorStringName(EditorIcons))); + p_theme->set_icon("v_grabber", "SplitContainer", p_theme->get_icon(SNAME("GuiVsplitter"), EditorStringName(EditorIcons))); + p_theme->set_icon("grabber", "VSplitContainer", p_theme->get_icon(SNAME("GuiVsplitter"), EditorStringName(EditorIcons))); + p_theme->set_icon("grabber", "HSplitContainer", p_theme->get_icon(SNAME("GuiHsplitter"), EditorStringName(EditorIcons))); + + p_theme->set_constant("separation", "SplitContainer", p_config.separation_margin); + p_theme->set_constant("separation", "HSplitContainer", p_config.separation_margin); + p_theme->set_constant("separation", "VSplitContainer", p_config.separation_margin); + + p_theme->set_constant("minimum_grab_thickness", "SplitContainer", p_config.increased_margin * EDSCALE); + p_theme->set_constant("minimum_grab_thickness", "HSplitContainer", p_config.increased_margin * EDSCALE); + p_theme->set_constant("minimum_grab_thickness", "VSplitContainer", p_config.increased_margin * EDSCALE); + + // GridContainer. + p_theme->set_constant("v_separation", "GridContainer", Math::round(p_config.widget_margin.y - 2 * EDSCALE)); + } + + // Window and dialogs. + { + // Window. + + p_theme->set_stylebox("embedded_border", "Window", p_config.window_style); + p_theme->set_stylebox("embedded_unfocused_border", "Window", p_config.window_style); + + p_theme->set_color("title_color", "Window", p_config.font_color); + p_theme->set_icon("close", "Window", p_theme->get_icon(SNAME("GuiClose"), EditorStringName(EditorIcons))); + p_theme->set_icon("close_pressed", "Window", p_theme->get_icon(SNAME("GuiClose"), EditorStringName(EditorIcons))); + p_theme->set_constant("close_h_offset", "Window", 22 * EDSCALE); + p_theme->set_constant("close_v_offset", "Window", 20 * EDSCALE); + p_theme->set_constant("title_height", "Window", 24 * EDSCALE); + p_theme->set_constant("resize_margin", "Window", 4 * EDSCALE); + p_theme->set_font("title_font", "Window", p_theme->get_font(SNAME("title"), EditorStringName(EditorFonts))); + p_theme->set_font_size("title_font_size", "Window", p_theme->get_font_size(SNAME("title_size"), EditorStringName(EditorFonts))); + + // AcceptDialog. + p_theme->set_stylebox("panel", "AcceptDialog", p_config.dialog_style); + p_theme->set_constant("buttons_separation", "AcceptDialog", 8 * EDSCALE); + + // FileDialog. + p_theme->set_icon("folder", "FileDialog", p_theme->get_icon(SNAME("Folder"), EditorStringName(EditorIcons))); + p_theme->set_icon("parent_folder", "FileDialog", p_theme->get_icon(SNAME("ArrowUp"), EditorStringName(EditorIcons))); + p_theme->set_icon("back_folder", "FileDialog", p_theme->get_icon(SNAME("Back"), EditorStringName(EditorIcons))); + p_theme->set_icon("forward_folder", "FileDialog", p_theme->get_icon(SNAME("Forward"), EditorStringName(EditorIcons))); + p_theme->set_icon("reload", "FileDialog", p_theme->get_icon(SNAME("Reload"), EditorStringName(EditorIcons))); + p_theme->set_icon("toggle_hidden", "FileDialog", p_theme->get_icon(SNAME("GuiVisibilityVisible"), EditorStringName(EditorIcons))); + // Use a different color for folder icons to make them easier to distinguish from files. + // On a light theme, the icon will be dark, so we need to lighten it before blending it with the accent color. + p_theme->set_color("folder_icon_color", "FileDialog", (p_config.dark_theme ? Color(1, 1, 1) : Color(4.25, 4.25, 4.25)).lerp(p_config.accent_color, 0.7)); + p_theme->set_color("files_disabled", "FileDialog", p_config.font_disabled_color); + + // PopupDialog. + p_theme->set_stylebox("panel", "PopupDialog", p_config.popup_style); + + // PopupMenu. + { + Ref<StyleBoxFlat> style_popup_menu = p_config.popup_style->duplicate(); + // Use 1 pixel for the sides, since if 0 is used, the highlight of hovered items is drawn + // on top of the popup border. This causes a 'gap' in the panel border when an item is highlighted, + // and it looks weird. 1px solves this. + style_popup_menu->set_content_margin_individual(EDSCALE, 2 * EDSCALE, EDSCALE, 2 * EDSCALE); + // Always display a border for PopupMenus so they can be distinguished from their background. + style_popup_menu->set_border_width_all(EDSCALE); + if (p_config.draw_extra_borders) { + style_popup_menu->set_border_color(p_config.extra_border_color_2); + } else { + style_popup_menu->set_border_color(p_config.dark_color_2); + } + p_theme->set_stylebox("panel", "PopupMenu", style_popup_menu); + + Ref<StyleBoxFlat> style_menu_hover = p_config.button_style_hover->duplicate(); + // Don't use rounded corners for hover highlights since the StyleBox touches the PopupMenu's edges. + style_menu_hover->set_corner_radius_all(0); + p_theme->set_stylebox("hover", "PopupMenu", style_menu_hover); + + Ref<StyleBoxLine> style_popup_separator(memnew(StyleBoxLine)); + style_popup_separator->set_color(p_config.separator_color); + style_popup_separator->set_grow_begin(p_config.popup_margin - MAX(Math::round(EDSCALE), p_config.border_width)); + style_popup_separator->set_grow_end(p_config.popup_margin - MAX(Math::round(EDSCALE), p_config.border_width)); + style_popup_separator->set_thickness(MAX(Math::round(EDSCALE), p_config.border_width)); + + Ref<StyleBoxLine> style_popup_labeled_separator_left(memnew(StyleBoxLine)); + style_popup_labeled_separator_left->set_grow_begin(p_config.popup_margin - MAX(Math::round(EDSCALE), p_config.border_width)); + style_popup_labeled_separator_left->set_color(p_config.separator_color); + style_popup_labeled_separator_left->set_thickness(MAX(Math::round(EDSCALE), p_config.border_width)); + + Ref<StyleBoxLine> style_popup_labeled_separator_right(memnew(StyleBoxLine)); + style_popup_labeled_separator_right->set_grow_end(p_config.popup_margin - MAX(Math::round(EDSCALE), p_config.border_width)); + style_popup_labeled_separator_right->set_color(p_config.separator_color); + style_popup_labeled_separator_right->set_thickness(MAX(Math::round(EDSCALE), p_config.border_width)); + + p_theme->set_stylebox("separator", "PopupMenu", style_popup_separator); + p_theme->set_stylebox("labeled_separator_left", "PopupMenu", style_popup_labeled_separator_left); + p_theme->set_stylebox("labeled_separator_right", "PopupMenu", style_popup_labeled_separator_right); + + p_theme->set_color("font_color", "PopupMenu", p_config.font_color); + p_theme->set_color("font_hover_color", "PopupMenu", p_config.font_hover_color); + p_theme->set_color("font_accelerator_color", "PopupMenu", p_config.font_disabled_color); + p_theme->set_color("font_disabled_color", "PopupMenu", p_config.font_disabled_color); + p_theme->set_color("font_separator_color", "PopupMenu", p_config.font_disabled_color); + p_theme->set_color("font_outline_color", "PopupMenu", p_config.font_outline_color); + + p_theme->set_icon("checked", "PopupMenu", p_theme->get_icon(SNAME("GuiChecked"), EditorStringName(EditorIcons))); + p_theme->set_icon("unchecked", "PopupMenu", p_theme->get_icon(SNAME("GuiUnchecked"), EditorStringName(EditorIcons))); + p_theme->set_icon("radio_checked", "PopupMenu", p_theme->get_icon(SNAME("GuiRadioChecked"), EditorStringName(EditorIcons))); + p_theme->set_icon("radio_unchecked", "PopupMenu", p_theme->get_icon(SNAME("GuiRadioUnchecked"), EditorStringName(EditorIcons))); + p_theme->set_icon("checked_disabled", "PopupMenu", p_theme->get_icon(SNAME("GuiCheckedDisabled"), EditorStringName(EditorIcons))); + p_theme->set_icon("unchecked_disabled", "PopupMenu", p_theme->get_icon(SNAME("GuiUncheckedDisabled"), EditorStringName(EditorIcons))); + p_theme->set_icon("radio_checked_disabled", "PopupMenu", p_theme->get_icon(SNAME("GuiRadioCheckedDisabled"), EditorStringName(EditorIcons))); + p_theme->set_icon("radio_unchecked_disabled", "PopupMenu", p_theme->get_icon(SNAME("GuiRadioUncheckedDisabled"), EditorStringName(EditorIcons))); + p_theme->set_icon("submenu", "PopupMenu", p_theme->get_icon(SNAME("ArrowRight"), EditorStringName(EditorIcons))); + p_theme->set_icon("submenu_mirrored", "PopupMenu", p_theme->get_icon(SNAME("ArrowLeft"), EditorStringName(EditorIcons))); + p_theme->set_icon("visibility_hidden", "PopupMenu", p_theme->get_icon(SNAME("GuiVisibilityHidden"), EditorStringName(EditorIcons))); + p_theme->set_icon("visibility_visible", "PopupMenu", p_theme->get_icon(SNAME("GuiVisibilityVisible"), EditorStringName(EditorIcons))); + p_theme->set_icon("visibility_xray", "PopupMenu", p_theme->get_icon(SNAME("GuiVisibilityXray"), EditorStringName(EditorIcons))); + + p_theme->set_constant("v_separation", "PopupMenu", p_config.forced_even_separation * EDSCALE); + p_theme->set_constant("outline_size", "PopupMenu", 0); + p_theme->set_constant("item_start_padding", "PopupMenu", p_config.separation_margin); + p_theme->set_constant("item_end_padding", "PopupMenu", p_config.separation_margin); + } + } + + // Sliders and scrollbars. + { + Ref<Texture2D> empty_icon = memnew(ImageTexture); + + // HScrollBar. + + if (p_config.increase_scrollbar_touch_area) { + p_theme->set_stylebox("scroll", "HScrollBar", make_line_stylebox(p_config.separator_color, 50)); + } else { + p_theme->set_stylebox("scroll", "HScrollBar", make_stylebox(p_theme->get_icon(SNAME("GuiScrollBg"), EditorStringName(EditorIcons)), 5, 5, 5, 5, -5, 1, -5, 1)); + } + p_theme->set_stylebox("scroll_focus", "HScrollBar", make_stylebox(p_theme->get_icon(SNAME("GuiScrollBg"), EditorStringName(EditorIcons)), 5, 5, 5, 5, 1, 1, 1, 1)); + p_theme->set_stylebox("grabber", "HScrollBar", make_stylebox(p_theme->get_icon(SNAME("GuiScrollGrabber"), EditorStringName(EditorIcons)), 6, 6, 6, 6, 1, 1, 1, 1)); + p_theme->set_stylebox("grabber_highlight", "HScrollBar", make_stylebox(p_theme->get_icon(SNAME("GuiScrollGrabberHl"), EditorStringName(EditorIcons)), 5, 5, 5, 5, 1, 1, 1, 1)); + p_theme->set_stylebox("grabber_pressed", "HScrollBar", make_stylebox(p_theme->get_icon(SNAME("GuiScrollGrabberPressed"), EditorStringName(EditorIcons)), 6, 6, 6, 6, 1, 1, 1, 1)); + + p_theme->set_icon("increment", "HScrollBar", empty_icon); + p_theme->set_icon("increment_highlight", "HScrollBar", empty_icon); + p_theme->set_icon("increment_pressed", "HScrollBar", empty_icon); + p_theme->set_icon("decrement", "HScrollBar", empty_icon); + p_theme->set_icon("decrement_highlight", "HScrollBar", empty_icon); + p_theme->set_icon("decrement_pressed", "HScrollBar", empty_icon); + + // VScrollBar. + + if (p_config.increase_scrollbar_touch_area) { + p_theme->set_stylebox("scroll", "VScrollBar", make_line_stylebox(p_config.separator_color, 50, 1, 1, true)); + } else { + p_theme->set_stylebox("scroll", "VScrollBar", make_stylebox(p_theme->get_icon(SNAME("GuiScrollBg"), EditorStringName(EditorIcons)), 5, 5, 5, 5, 1, -5, 1, -5)); + } + p_theme->set_stylebox("scroll_focus", "VScrollBar", make_stylebox(p_theme->get_icon(SNAME("GuiScrollBg"), EditorStringName(EditorIcons)), 5, 5, 5, 5, 1, 1, 1, 1)); + p_theme->set_stylebox("grabber", "VScrollBar", make_stylebox(p_theme->get_icon(SNAME("GuiScrollGrabber"), EditorStringName(EditorIcons)), 6, 6, 6, 6, 1, 1, 1, 1)); + p_theme->set_stylebox("grabber_highlight", "VScrollBar", make_stylebox(p_theme->get_icon(SNAME("GuiScrollGrabberHl"), EditorStringName(EditorIcons)), 5, 5, 5, 5, 1, 1, 1, 1)); + p_theme->set_stylebox("grabber_pressed", "VScrollBar", make_stylebox(p_theme->get_icon(SNAME("GuiScrollGrabberPressed"), EditorStringName(EditorIcons)), 6, 6, 6, 6, 1, 1, 1, 1)); + + p_theme->set_icon("increment", "VScrollBar", empty_icon); + p_theme->set_icon("increment_highlight", "VScrollBar", empty_icon); + p_theme->set_icon("increment_pressed", "VScrollBar", empty_icon); + p_theme->set_icon("decrement", "VScrollBar", empty_icon); + p_theme->set_icon("decrement_highlight", "VScrollBar", empty_icon); + p_theme->set_icon("decrement_pressed", "VScrollBar", empty_icon); + + // HSlider. + p_theme->set_icon("grabber_highlight", "HSlider", p_theme->get_icon(SNAME("GuiSliderGrabberHl"), EditorStringName(EditorIcons))); + p_theme->set_icon("grabber", "HSlider", p_theme->get_icon(SNAME("GuiSliderGrabber"), EditorStringName(EditorIcons))); + p_theme->set_stylebox("slider", "HSlider", make_flat_stylebox(p_config.dark_color_3, 0, p_config.base_margin / 2, 0, p_config.base_margin / 2, p_config.corner_radius)); + p_theme->set_stylebox("grabber_area", "HSlider", make_flat_stylebox(p_config.contrast_color_1, 0, p_config.base_margin / 2, 0, p_config.base_margin / 2, p_config.corner_radius)); + p_theme->set_stylebox("grabber_area_highlight", "HSlider", make_flat_stylebox(p_config.contrast_color_1, 0, p_config.base_margin / 2, 0, p_config.base_margin / 2)); + p_theme->set_constant("center_grabber", "HSlider", 0); + p_theme->set_constant("grabber_offset", "HSlider", 0); + + // VSlider. + p_theme->set_icon("grabber", "VSlider", p_theme->get_icon(SNAME("GuiSliderGrabber"), EditorStringName(EditorIcons))); + p_theme->set_icon("grabber_highlight", "VSlider", p_theme->get_icon(SNAME("GuiSliderGrabberHl"), EditorStringName(EditorIcons))); + p_theme->set_stylebox("slider", "VSlider", make_flat_stylebox(p_config.dark_color_3, p_config.base_margin / 2, 0, p_config.base_margin / 2, 0, p_config.corner_radius)); + p_theme->set_stylebox("grabber_area", "VSlider", make_flat_stylebox(p_config.contrast_color_1, p_config.base_margin / 2, 0, p_config.base_margin / 2, 0, p_config.corner_radius)); + p_theme->set_stylebox("grabber_area_highlight", "VSlider", make_flat_stylebox(p_config.contrast_color_1, p_config.base_margin / 2, 0, p_config.base_margin / 2, 0)); + p_theme->set_constant("center_grabber", "VSlider", 0); + p_theme->set_constant("grabber_offset", "VSlider", 0); + } + + // Labels. + { + // RichTextLabel. + + p_theme->set_stylebox("normal", "RichTextLabel", p_config.tree_panel_style); + p_theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox()); + + p_theme->set_color("default_color", "RichTextLabel", p_config.font_color); + p_theme->set_color("font_shadow_color", "RichTextLabel", Color(0, 0, 0, 0)); + p_theme->set_color("font_outline_color", "RichTextLabel", p_config.font_outline_color); + p_theme->set_color("selection_color", "RichTextLabel", p_config.selection_color); + + p_theme->set_constant("shadow_offset_x", "RichTextLabel", 1 * EDSCALE); + p_theme->set_constant("shadow_offset_y", "RichTextLabel", 1 * EDSCALE); + p_theme->set_constant("shadow_outline_size", "RichTextLabel", 1 * EDSCALE); + p_theme->set_constant("outline_size", "RichTextLabel", 0); + + // Label. + + p_theme->set_stylebox("normal", "Label", p_config.base_empty_style); + + p_theme->set_color("font_color", "Label", p_config.font_color); + p_theme->set_color("font_shadow_color", "Label", Color(0, 0, 0, 0)); + p_theme->set_color("font_outline_color", "Label", p_config.font_outline_color); + + p_theme->set_constant("shadow_offset_x", "Label", 1 * EDSCALE); + p_theme->set_constant("shadow_offset_y", "Label", 1 * EDSCALE); + p_theme->set_constant("shadow_outline_size", "Label", 1 * EDSCALE); + p_theme->set_constant("line_spacing", "Label", 3 * EDSCALE); + p_theme->set_constant("outline_size", "Label", 0); + } + + // SpinBox. + p_theme->set_icon("updown", "SpinBox", p_theme->get_icon(SNAME("GuiSpinboxUpdown"), EditorStringName(EditorIcons))); + p_theme->set_icon("updown_disabled", "SpinBox", p_theme->get_icon(SNAME("GuiSpinboxUpdownDisabled"), EditorStringName(EditorIcons))); + + // ProgressBar. + p_theme->set_stylebox("background", "ProgressBar", make_stylebox(p_theme->get_icon(SNAME("GuiProgressBar"), EditorStringName(EditorIcons)), 4, 4, 4, 4, 0, 0, 0, 0)); + p_theme->set_stylebox("fill", "ProgressBar", make_stylebox(p_theme->get_icon(SNAME("GuiProgressFill"), EditorStringName(EditorIcons)), 6, 6, 6, 6, 2, 1, 2, 1)); + p_theme->set_color("font_color", "ProgressBar", p_config.font_color); + p_theme->set_color("font_outline_color", "ProgressBar", p_config.font_outline_color); + p_theme->set_constant("outline_size", "ProgressBar", 0); + + // GraphEdit and related nodes. + { + // GraphEdit. + + p_theme->set_stylebox("panel", "GraphEdit", p_config.tree_panel_style); + p_theme->set_stylebox("menu_panel", "GraphEdit", make_flat_stylebox(p_config.dark_color_1 * Color(1, 1, 1, 0.6), 4, 2, 4, 2, 3)); + + if (p_config.dark_theme) { + p_theme->set_color("grid_major", "GraphEdit", Color(1.0, 1.0, 1.0, 0.1)); + p_theme->set_color("grid_minor", "GraphEdit", Color(1.0, 1.0, 1.0, 0.05)); + } else { + p_theme->set_color("grid_major", "GraphEdit", Color(0.0, 0.0, 0.0, 0.15)); + p_theme->set_color("grid_minor", "GraphEdit", Color(0.0, 0.0, 0.0, 0.07)); + } + p_theme->set_color("selection_fill", "GraphEdit", p_theme->get_color(SNAME("box_selection_fill_color"), EditorStringName(Editor))); + p_theme->set_color("selection_stroke", "GraphEdit", p_theme->get_color(SNAME("box_selection_stroke_color"), EditorStringName(Editor))); + p_theme->set_color("activity", "GraphEdit", p_config.accent_color); + + p_theme->set_icon("zoom_out", "GraphEdit", p_theme->get_icon(SNAME("ZoomLess"), EditorStringName(EditorIcons))); + p_theme->set_icon("zoom_in", "GraphEdit", p_theme->get_icon(SNAME("ZoomMore"), EditorStringName(EditorIcons))); + p_theme->set_icon("zoom_reset", "GraphEdit", p_theme->get_icon(SNAME("ZoomReset"), EditorStringName(EditorIcons))); + p_theme->set_icon("grid_toggle", "GraphEdit", p_theme->get_icon(SNAME("GridToggle"), EditorStringName(EditorIcons))); + p_theme->set_icon("minimap_toggle", "GraphEdit", p_theme->get_icon(SNAME("GridMinimap"), EditorStringName(EditorIcons))); + p_theme->set_icon("snapping_toggle", "GraphEdit", p_theme->get_icon(SNAME("SnapGrid"), EditorStringName(EditorIcons))); + p_theme->set_icon("layout", "GraphEdit", p_theme->get_icon(SNAME("GridLayout"), EditorStringName(EditorIcons))); + + // GraphEditMinimap. + { + Ref<StyleBoxFlat> style_minimap_bg = make_flat_stylebox(p_config.dark_color_1, 0, 0, 0, 0); + style_minimap_bg->set_border_color(p_config.dark_color_3); + style_minimap_bg->set_border_width_all(1); + p_theme->set_stylebox("panel", "GraphEditMinimap", style_minimap_bg); + + Ref<StyleBoxFlat> style_minimap_camera; + Ref<StyleBoxFlat> style_minimap_node; + if (p_config.dark_theme) { + style_minimap_camera = make_flat_stylebox(Color(0.65, 0.65, 0.65, 0.2), 0, 0, 0, 0); + style_minimap_camera->set_border_color(Color(0.65, 0.65, 0.65, 0.45)); + style_minimap_node = make_flat_stylebox(Color(1, 1, 1), 0, 0, 0, 0); + } else { + style_minimap_camera = make_flat_stylebox(Color(0.38, 0.38, 0.38, 0.2), 0, 0, 0, 0); + style_minimap_camera->set_border_color(Color(0.38, 0.38, 0.38, 0.45)); + style_minimap_node = make_flat_stylebox(Color(0, 0, 0), 0, 0, 0, 0); + } + style_minimap_camera->set_border_width_all(1); + style_minimap_node->set_anti_aliased(false); + p_theme->set_stylebox("camera", "GraphEditMinimap", style_minimap_camera); + p_theme->set_stylebox("node", "GraphEditMinimap", style_minimap_node); + + const Color minimap_resizer_color = p_config.dark_theme ? Color(1, 1, 1, 0.65) : Color(0, 0, 0, 0.65); + p_theme->set_icon("resizer", "GraphEditMinimap", p_theme->get_icon(SNAME("GuiResizerTopLeft"), EditorStringName(EditorIcons))); + p_theme->set_color("resizer_color", "GraphEditMinimap", minimap_resizer_color); + } + + // GraphElement & GraphNode. + { + const int gn_margin_top = 2; + const int gn_margin_side = 2; + const int gn_margin_bottom = 2; + + const Color gn_bg_color = p_config.dark_theme ? p_config.dark_color_3 : p_config.dark_color_1.lerp(p_config.mono_color, 0.09); + const Color gn_selected_border_color = gn_bg_color.lerp(p_config.accent_color, 0.275); + const Color gn_frame_bg = gn_bg_color.lerp(p_config.tree_panel_style->get_bg_color(), 0.3); + + Ref<StyleBoxFlat> gn_panel_style = make_flat_stylebox(gn_frame_bg, gn_margin_side, gn_margin_top, gn_margin_side, gn_margin_bottom, p_config.corner_radius); + gn_panel_style->set_border_width_all(p_config.border_width); + gn_panel_style->set_border_color(gn_bg_color); + gn_panel_style->set_corner_radius_individual(0, 0, p_config.corner_radius * EDSCALE, p_config.corner_radius * EDSCALE); + gn_panel_style->set_expand_margin(SIDE_TOP, 17 * EDSCALE); + + Ref<StyleBoxFlat> gn_panel_selected_style = make_flat_stylebox(gn_frame_bg, gn_margin_side, gn_margin_top, gn_margin_side, gn_margin_bottom, p_config.corner_radius); + gn_panel_selected_style->set_border_width_all(2 * EDSCALE + p_config.border_width); + gn_panel_selected_style->set_border_color(gn_selected_border_color); + gn_panel_selected_style->set_corner_radius_individual(0, 0, p_config.corner_radius * EDSCALE, p_config.corner_radius * EDSCALE); + gn_panel_selected_style->set_expand_margin(SIDE_TOP, 17 * EDSCALE); + + const int gn_titlebar_margin_left = 12; + const int gn_titlebar_margin_right = 4; // The rest is for the close button. + + Ref<StyleBoxFlat> gn_titlebar_style = make_flat_stylebox(gn_bg_color, gn_titlebar_margin_left, gn_margin_top, gn_titlebar_margin_right, 0, p_config.corner_radius); + gn_titlebar_style->set_expand_margin(SIDE_TOP, 2 * EDSCALE); + gn_titlebar_style->set_corner_radius_individual(p_config.corner_radius * EDSCALE, p_config.corner_radius * EDSCALE, 0, 0); + + Ref<StyleBoxFlat> gn_titlebar_selected_style = make_flat_stylebox(gn_selected_border_color, gn_titlebar_margin_left, gn_margin_top, gn_titlebar_margin_right, 0, p_config.corner_radius); + gn_titlebar_selected_style->set_corner_radius_individual(p_config.corner_radius * EDSCALE, p_config.corner_radius * EDSCALE, 0, 0); + gn_titlebar_selected_style->set_expand_margin(SIDE_TOP, 2 * EDSCALE); + + Color gn_decoration_color = p_config.dark_color_1.inverted(); + + // GraphElement. + + p_theme->set_stylebox("panel", "GraphElement", gn_panel_style); + p_theme->set_stylebox("panel_selected", "GraphElement", gn_panel_selected_style); + p_theme->set_stylebox("titlebar", "GraphElement", gn_titlebar_style); + p_theme->set_stylebox("titlebar_selected", "GraphElement", gn_titlebar_selected_style); + + p_theme->set_color("resizer_color", "GraphElement", gn_decoration_color); + p_theme->set_icon("resizer", "GraphElement", p_theme->get_icon(SNAME("GuiResizer"), EditorStringName(EditorIcons))); + + // GraphNode. + + Ref<StyleBoxEmpty> gn_slot_style = make_empty_stylebox(12, 0, 12, 0); + + p_theme->set_stylebox("panel", "GraphNode", gn_panel_style); + p_theme->set_stylebox("panel_selected", "GraphNode", gn_panel_selected_style); + p_theme->set_stylebox("titlebar", "GraphNode", gn_titlebar_style); + p_theme->set_stylebox("titlebar_selected", "GraphNode", gn_titlebar_selected_style); + p_theme->set_stylebox("slot", "GraphNode", gn_slot_style); + + p_theme->set_color("resizer_color", "GraphNode", gn_decoration_color); + + p_theme->set_constant("port_h_offset", "GraphNode", 0); + p_theme->set_constant("separation", "GraphNode", 1 * EDSCALE); + + Ref<ImageTexture> port_icon = p_theme->get_icon(SNAME("GuiGraphNodePort"), EditorStringName(EditorIcons)); + // The true size is 24x24 This is necessary for sharp port icons at high zoom levels in GraphEdit (up to ~200%). + port_icon->set_size_override(Size2(12, 12)); + p_theme->set_icon("port", "GraphNode", port_icon); + + // GraphNode's title Label. + p_theme->set_type_variation("GraphNodeTitleLabel", "Label"); + p_theme->set_stylebox("normal", "GraphNodeTitleLabel", make_empty_stylebox(0, 0, 0, 0)); + p_theme->set_color("font_color", "GraphNodeTitleLabel", p_config.font_color); + p_theme->set_constant("line_spacing", "GraphNodeTitleLabel", 3 * EDSCALE); + } + } + + // ColorPicker and related nodes. + { + // ColorPicker. + + p_theme->set_constant("margin", "ColorPicker", p_config.base_margin); + p_theme->set_constant("sv_width", "ColorPicker", 256 * EDSCALE); + p_theme->set_constant("sv_height", "ColorPicker", 256 * EDSCALE); + p_theme->set_constant("h_width", "ColorPicker", 30 * EDSCALE); + p_theme->set_constant("label_width", "ColorPicker", 10 * EDSCALE); + p_theme->set_constant("center_slider_grabbers", "ColorPicker", 1); + + p_theme->set_icon("screen_picker", "ColorPicker", p_theme->get_icon(SNAME("ColorPick"), EditorStringName(EditorIcons))); + p_theme->set_icon("shape_circle", "ColorPicker", p_theme->get_icon(SNAME("PickerShapeCircle"), EditorStringName(EditorIcons))); + p_theme->set_icon("shape_rect", "ColorPicker", p_theme->get_icon(SNAME("PickerShapeRectangle"), EditorStringName(EditorIcons))); + p_theme->set_icon("shape_rect_wheel", "ColorPicker", p_theme->get_icon(SNAME("PickerShapeRectangleWheel"), EditorStringName(EditorIcons))); + p_theme->set_icon("add_preset", "ColorPicker", p_theme->get_icon(SNAME("Add"), EditorStringName(EditorIcons))); + p_theme->set_icon("sample_bg", "ColorPicker", p_theme->get_icon(SNAME("GuiMiniCheckerboard"), EditorStringName(EditorIcons))); + p_theme->set_icon("sample_revert", "ColorPicker", p_theme->get_icon(SNAME("Reload"), EditorStringName(EditorIcons))); + p_theme->set_icon("overbright_indicator", "ColorPicker", p_theme->get_icon(SNAME("OverbrightIndicator"), EditorStringName(EditorIcons))); + p_theme->set_icon("bar_arrow", "ColorPicker", p_theme->get_icon(SNAME("ColorPickerBarArrow"), EditorStringName(EditorIcons))); + p_theme->set_icon("picker_cursor", "ColorPicker", p_theme->get_icon(SNAME("PickerCursor"), EditorStringName(EditorIcons))); + + // ColorPickerButton. + p_theme->set_icon("bg", "ColorPickerButton", p_theme->get_icon(SNAME("GuiMiniCheckerboard"), EditorStringName(EditorIcons))); + + // ColorPresetButton. + p_theme->set_stylebox("preset_fg", "ColorPresetButton", make_flat_stylebox(Color(1, 1, 1), 2, 2, 2, 2, 2)); + p_theme->set_icon("preset_bg", "ColorPresetButton", p_theme->get_icon(SNAME("GuiMiniCheckerboard"), EditorStringName(EditorIcons))); + p_theme->set_icon("overbright_indicator", "ColorPresetButton", p_theme->get_icon(SNAME("OverbrightIndicator"), EditorStringName(EditorIcons))); + } +} + +void EditorThemeManager::_populate_editor_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config) { + // Project manager. + { + p_theme->set_stylebox("search_panel", "ProjectManager", p_config.tree_panel_style); + p_theme->set_constant("sidebar_button_icon_separation", "ProjectManager", int(6 * EDSCALE)); + + // ProjectTag. + { + p_theme->set_type_variation("ProjectTag", "Button"); + + Ref<StyleBoxFlat> tag = p_config.button_style->duplicate(); + tag->set_bg_color(p_config.dark_theme ? tag->get_bg_color().lightened(0.2) : tag->get_bg_color().darkened(0.2)); + tag->set_corner_radius(CORNER_TOP_LEFT, 0); + tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0); + tag->set_corner_radius(CORNER_TOP_RIGHT, 4); + tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4); + p_theme->set_stylebox("normal", "ProjectTag", tag); + + tag = p_config.button_style_hover->duplicate(); + tag->set_corner_radius(CORNER_TOP_LEFT, 0); + tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0); + tag->set_corner_radius(CORNER_TOP_RIGHT, 4); + tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4); + p_theme->set_stylebox("hover", "ProjectTag", tag); + + tag = p_config.button_style_pressed->duplicate(); + tag->set_corner_radius(CORNER_TOP_LEFT, 0); + tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0); + tag->set_corner_radius(CORNER_TOP_RIGHT, 4); + tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4); + p_theme->set_stylebox("pressed", "ProjectTag", tag); + } + } + + // Editor and main screen. + { + // Editor background. + Color background_color_opaque = p_config.dark_color_2; + background_color_opaque.a = 1.0; + p_theme->set_color("background", EditorStringName(Editor), background_color_opaque); + p_theme->set_stylebox("Background", EditorStringName(EditorStyles), make_flat_stylebox(background_color_opaque, p_config.base_margin, p_config.base_margin, p_config.base_margin, p_config.base_margin)); + + p_theme->set_stylebox("PanelForeground", EditorStringName(EditorStyles), p_config.base_style); + + // Editor focus. + p_theme->set_stylebox("Focus", EditorStringName(EditorStyles), p_config.button_style_focus); + // Use a less opaque color to be less distracting for the 2D and 3D editor viewports. + Ref<StyleBoxFlat> style_widget_focus_viewport = p_config.button_style_focus->duplicate(); + style_widget_focus_viewport->set_border_color(p_config.accent_color * Color(1, 1, 1, 0.5)); + p_theme->set_stylebox("FocusViewport", EditorStringName(EditorStyles), style_widget_focus_viewport); + + // This stylebox is used in 3d and 2d viewports (no borders). + Ref<StyleBoxFlat> style_content_panel_vp = p_config.content_panel_style->duplicate(); + style_content_panel_vp->set_content_margin_individual(p_config.border_width * 2, p_config.base_margin * EDSCALE, p_config.border_width * 2, p_config.border_width * 2); + p_theme->set_stylebox("Content", EditorStringName(EditorStyles), style_content_panel_vp); + + // 2D/CanvasItem editor + Ref<StyleBoxFlat> style_canvas_editor_info = make_flat_stylebox(Color(0.0, 0.0, 0.0, 0.2)); + style_canvas_editor_info->set_expand_margin_all(4 * EDSCALE); + p_theme->set_stylebox("CanvasItemInfoOverlay", EditorStringName(EditorStyles), style_canvas_editor_info); + + // 3D/Spatial editor. + Ref<StyleBoxFlat> style_info_3d_viewport = p_config.base_style->duplicate(); + style_info_3d_viewport->set_bg_color(style_info_3d_viewport->get_bg_color() * Color(1, 1, 1, 0.5)); + style_info_3d_viewport->set_border_width_all(0); + p_theme->set_stylebox("Information3dViewport", EditorStringName(EditorStyles), style_info_3d_viewport); + + // 2D and 3D contextual toolbar. + // Use a custom stylebox to make contextual menu items stand out from the rest. + // This helps with editor usability as contextual menu items change when selecting nodes, + // even though it may not be immediately obvious at first. + Ref<StyleBoxFlat> toolbar_stylebox = memnew(StyleBoxFlat); + toolbar_stylebox->set_bg_color(p_config.accent_color * Color(1, 1, 1, 0.1)); + toolbar_stylebox->set_anti_aliased(false); + // Add an underline to the StyleBox, but prevent its minimum vertical size from changing. + toolbar_stylebox->set_border_color(p_config.accent_color); + toolbar_stylebox->set_border_width(SIDE_BOTTOM, Math::round(2 * EDSCALE)); + toolbar_stylebox->set_content_margin(SIDE_BOTTOM, 0); + toolbar_stylebox->set_expand_margin_individual(4 * EDSCALE, 2 * EDSCALE, 4 * EDSCALE, 4 * EDSCALE); + p_theme->set_stylebox("ContextualToolbar", EditorStringName(EditorStyles), toolbar_stylebox); + + // Script editor. + p_theme->set_stylebox("ScriptEditorPanel", EditorStringName(EditorStyles), make_empty_stylebox(p_config.base_margin, 0, p_config.base_margin, p_config.base_margin)); + p_theme->set_stylebox("ScriptEditorPanelFloating", EditorStringName(EditorStyles), make_empty_stylebox(0, 0, 0, 0)); + p_theme->set_stylebox("ScriptEditor", EditorStringName(EditorStyles), make_empty_stylebox(0, 0, 0, 0)); + + // Bottom panel. + Ref<StyleBoxFlat> style_bottom_panel = p_config.content_panel_style->duplicate(); + style_bottom_panel->set_corner_radius_all(p_config.corner_radius * EDSCALE); + p_theme->set_stylebox("BottomPanel", EditorStringName(EditorStyles), style_bottom_panel); + + // Main menu. + p_theme->set_stylebox("MenuHover", EditorStringName(EditorStyles), p_config.button_style_hover); + } + + // Editor GUI widgets. + { + // EditorSpinSlider. + p_theme->set_color("label_color", "EditorSpinSlider", p_config.font_color); + p_theme->set_color("read_only_label_color", "EditorSpinSlider", p_config.font_readonly_color); + + Ref<StyleBoxFlat> editor_spin_label_bg = p_config.base_style->duplicate(); + editor_spin_label_bg->set_bg_color(p_config.dark_color_3); + editor_spin_label_bg->set_border_width_all(0); + p_theme->set_stylebox("label_bg", "EditorSpinSlider", editor_spin_label_bg); + + // Launch Pad and Play buttons + Ref<StyleBoxFlat> style_launch_pad = make_flat_stylebox(p_config.dark_color_1, 2 * EDSCALE, 0, 2 * EDSCALE, 0, p_config.corner_radius); + style_launch_pad->set_corner_radius_all(p_config.corner_radius * EDSCALE); + p_theme->set_stylebox("LaunchPadNormal", EditorStringName(EditorStyles), style_launch_pad); + Ref<StyleBoxFlat> style_launch_pad_movie = style_launch_pad->duplicate(); + style_launch_pad_movie->set_bg_color(p_config.accent_color * Color(1, 1, 1, 0.1)); + style_launch_pad_movie->set_border_color(p_config.accent_color); + style_launch_pad_movie->set_border_width_all(Math::round(2 * EDSCALE)); + p_theme->set_stylebox("LaunchPadMovieMode", EditorStringName(EditorStyles), style_launch_pad_movie); + + p_theme->set_stylebox("MovieWriterButtonNormal", EditorStringName(EditorStyles), make_empty_stylebox(0, 0, 0, 0)); + Ref<StyleBoxFlat> style_write_movie_button = p_config.button_style_pressed->duplicate(); + style_write_movie_button->set_bg_color(p_config.accent_color); + style_write_movie_button->set_corner_radius_all(p_config.corner_radius * EDSCALE); + style_write_movie_button->set_content_margin(SIDE_TOP, 0); + style_write_movie_button->set_content_margin(SIDE_BOTTOM, 0); + style_write_movie_button->set_content_margin(SIDE_LEFT, 0); + style_write_movie_button->set_content_margin(SIDE_RIGHT, 0); + style_write_movie_button->set_expand_margin(SIDE_RIGHT, 2 * EDSCALE); + p_theme->set_stylebox("MovieWriterButtonPressed", EditorStringName(EditorStyles), style_write_movie_button); + } + + // Standard GUI variations. + { + // Custom theme type for MarginContainer with 4px margins. + p_theme->set_type_variation("MarginContainer4px", "MarginContainer"); + p_theme->set_constant("margin_left", "MarginContainer4px", 4 * EDSCALE); + p_theme->set_constant("margin_top", "MarginContainer4px", 4 * EDSCALE); + p_theme->set_constant("margin_right", "MarginContainer4px", 4 * EDSCALE); + p_theme->set_constant("margin_bottom", "MarginContainer4px", 4 * EDSCALE); + + // Header LinkButton variation. + p_theme->set_type_variation("HeaderSmallLink", "LinkButton"); + p_theme->set_font("font", "HeaderSmallLink", p_theme->get_font(SNAME("font"), SNAME("HeaderSmall"))); + p_theme->set_font_size("font_size", "HeaderSmallLink", p_theme->get_font_size(SNAME("font_size"), SNAME("HeaderSmall"))); + + // Flat button variations. + { + Ref<StyleBoxEmpty> style_flat_button = make_empty_stylebox(); + for (int i = 0; i < 4; i++) { + style_flat_button->set_content_margin((Side)i, p_config.button_style->get_margin((Side)i) + p_config.button_style->get_border_width((Side)i)); + } + + Ref<StyleBoxFlat> style_flat_button_pressed = p_config.button_style_pressed->duplicate(); + Color flat_pressed_color = p_config.dark_color_1.lightened(0.24).lerp(p_config.accent_color, 0.2) * Color(0.8, 0.8, 0.8, 0.85); + if (p_config.dark_theme) { + flat_pressed_color = p_config.dark_color_1.lerp(p_config.accent_color, 0.12) * Color(0.6, 0.6, 0.6, 0.85); + } + style_flat_button_pressed->set_bg_color(flat_pressed_color); + + p_theme->set_stylebox("normal", "FlatButton", style_flat_button); + p_theme->set_stylebox("hover", "FlatButton", style_flat_button); + p_theme->set_stylebox("pressed", "FlatButton", style_flat_button_pressed); + p_theme->set_stylebox("disabled", "FlatButton", style_flat_button); + + p_theme->set_stylebox("normal", "FlatMenuButton", style_flat_button); + p_theme->set_stylebox("hover", "FlatMenuButton", style_flat_button); + p_theme->set_stylebox("pressed", "FlatMenuButton", style_flat_button_pressed); + p_theme->set_stylebox("disabled", "FlatMenuButton", style_flat_button); + + // Variation for Editor Log filter buttons. + + p_theme->set_type_variation("EditorLogFilterButton", "Button"); + // When pressed, don't tint the icons with the accent color, just leave them normal. + p_theme->set_color("icon_pressed_color", "EditorLogFilterButton", p_config.icon_normal_color); + // When unpressed, dim the icons. + p_theme->set_color("icon_normal_color", "EditorLogFilterButton", p_config.icon_disabled_color); + + // When pressed, add a small bottom border to the buttons to better show their active state, + // similar to active tabs. + Ref<StyleBoxFlat> editor_log_button_pressed = style_flat_button_pressed->duplicate(); + editor_log_button_pressed->set_border_width(SIDE_BOTTOM, 2 * EDSCALE); + editor_log_button_pressed->set_border_color(p_config.accent_color); + p_theme->set_stylebox("pressed", "EditorLogFilterButton", editor_log_button_pressed); + } + + // Complex editor windows. + { + Ref<StyleBoxFlat> style_complex_window = p_config.window_style->duplicate(); + style_complex_window->set_bg_color(p_config.dark_color_2); + style_complex_window->set_border_color(p_config.dark_color_2); + p_theme->set_stylebox("panel", "EditorSettingsDialog", style_complex_window); + p_theme->set_stylebox("panel", "ProjectSettingsEditor", style_complex_window); + p_theme->set_stylebox("panel", "EditorAbout", style_complex_window); + } + + // InspectorActionButton. + { + p_theme->set_type_variation("InspectorActionButton", "Button"); + + const float action_extra_margin = 32 * EDSCALE; + p_theme->set_constant("h_separation", "InspectorActionButton", action_extra_margin); + + Color color_inspector_action = p_config.dark_color_1.lerp(p_config.mono_color, 0.12); + color_inspector_action.a = 0.5; + Ref<StyleBoxFlat> style_inspector_action = p_config.button_style->duplicate(); + style_inspector_action->set_bg_color(color_inspector_action); + style_inspector_action->set_content_margin(SIDE_RIGHT, action_extra_margin); + p_theme->set_stylebox("normal", "InspectorActionButton", style_inspector_action); + + style_inspector_action = p_config.button_style_hover->duplicate(); + style_inspector_action->set_content_margin(SIDE_RIGHT, action_extra_margin); + p_theme->set_stylebox("hover", "InspectorActionButton", style_inspector_action); + + style_inspector_action = p_config.button_style_pressed->duplicate(); + style_inspector_action->set_content_margin(SIDE_RIGHT, action_extra_margin); + p_theme->set_stylebox("pressed", "InspectorActionButton", style_inspector_action); + + style_inspector_action = p_config.button_style_disabled->duplicate(); + style_inspector_action->set_content_margin(SIDE_RIGHT, action_extra_margin); + p_theme->set_stylebox("disabled", "InspectorActionButton", style_inspector_action); + } + + // Buttons in material previews. + { + const Color dim_light_color = p_config.icon_normal_color.darkened(0.24); + const Color dim_light_highlighted_color = p_config.icon_normal_color.darkened(0.18); + Ref<StyleBox> sb_empty_borderless = make_empty_stylebox(); + + p_theme->set_type_variation("PreviewLightButton", "Button"); + // When pressed, don't use the accent color tint. When unpressed, dim the icon. + p_theme->set_color("icon_normal_color", "PreviewLightButton", dim_light_color); + p_theme->set_color("icon_focus_color", "PreviewLightButton", dim_light_color); + p_theme->set_color("icon_pressed_color", "PreviewLightButton", p_config.icon_normal_color); + p_theme->set_color("icon_hover_pressed_color", "PreviewLightButton", p_config.icon_normal_color); + // Unpressed icon is dim, so use a dim highlight. + p_theme->set_color("icon_hover_color", "PreviewLightButton", dim_light_highlighted_color); + + p_theme->set_stylebox("normal", "PreviewLightButton", sb_empty_borderless); + p_theme->set_stylebox("hover", "PreviewLightButton", sb_empty_borderless); + p_theme->set_stylebox("focus", "PreviewLightButton", sb_empty_borderless); + p_theme->set_stylebox("pressed", "PreviewLightButton", sb_empty_borderless); + } + + // TabContainerOdd variation. + { + // Can be used on tabs against the base color background (e.g. nested tabs). + p_theme->set_type_variation("TabContainerOdd", "TabContainer"); + + Ref<StyleBoxFlat> style_tab_selected_odd = p_theme->get_stylebox(SNAME("tab_selected"), SNAME("TabContainer"))->duplicate(); + style_tab_selected_odd->set_bg_color(p_config.disabled_bg_color); + p_theme->set_stylebox("tab_selected", "TabContainerOdd", style_tab_selected_odd); + + Ref<StyleBoxFlat> style_content_panel_odd = p_config.content_panel_style->duplicate(); + style_content_panel_odd->set_bg_color(p_config.disabled_bg_color); + p_theme->set_stylebox("panel", "TabContainerOdd", style_content_panel_odd); + } + + // EditorValidationPanel. + p_theme->set_stylebox("panel", "EditorValidationPanel", p_config.tree_panel_style); + + // ControlEditor. + { + p_theme->set_type_variation("ControlEditorPopupPanel", "PopupPanel"); + + Ref<StyleBoxFlat> control_editor_popup_style = p_config.popup_style->duplicate(); + control_editor_popup_style->set_shadow_size(0); + control_editor_popup_style->set_content_margin(SIDE_LEFT, p_config.base_margin * EDSCALE); + control_editor_popup_style->set_content_margin(SIDE_TOP, p_config.base_margin * EDSCALE); + control_editor_popup_style->set_content_margin(SIDE_RIGHT, p_config.base_margin * EDSCALE); + control_editor_popup_style->set_content_margin(SIDE_BOTTOM, p_config.base_margin * EDSCALE); + control_editor_popup_style->set_border_width_all(0); + + p_theme->set_stylebox("panel", "ControlEditorPopupPanel", control_editor_popup_style); + } + } + + // Editor inspector. + { + // Sub-inspectors. + for (int i = 0; i < 16; i++) { + Color si_base_color = p_config.accent_color; + + float hue_rotate = (i * 2 % 16) / 16.0; + si_base_color.set_hsv(Math::fmod(float(si_base_color.get_h() + hue_rotate), float(1.0)), si_base_color.get_s(), si_base_color.get_v()); + si_base_color = p_config.accent_color.lerp(si_base_color, float(EDITOR_GET("docks/property_editor/subresource_hue_tint"))); + + // Sub-inspector background. + Ref<StyleBoxFlat> sub_inspector_bg = p_config.base_style->duplicate(); + sub_inspector_bg->set_bg_color(p_config.dark_color_1.lerp(si_base_color, 0.08)); + sub_inspector_bg->set_border_width_all(2 * EDSCALE); + sub_inspector_bg->set_border_color(si_base_color * Color(0.7, 0.7, 0.7, 0.8)); + sub_inspector_bg->set_content_margin_all(4 * EDSCALE); + sub_inspector_bg->set_corner_radius(CORNER_TOP_LEFT, 0); + sub_inspector_bg->set_corner_radius(CORNER_TOP_RIGHT, 0); + + p_theme->set_stylebox("sub_inspector_bg" + itos(i), EditorStringName(Editor), sub_inspector_bg); + + // EditorProperty background while it has a sub-inspector open. + Ref<StyleBoxFlat> bg_color = make_flat_stylebox(si_base_color * Color(0.7, 0.7, 0.7, 0.8), 0, 0, 0, 0, p_config.corner_radius); + bg_color->set_anti_aliased(false); + bg_color->set_corner_radius(CORNER_BOTTOM_LEFT, 0); + bg_color->set_corner_radius(CORNER_BOTTOM_RIGHT, 0); + + p_theme->set_stylebox("sub_inspector_property_bg" + itos(i), EditorStringName(Editor), bg_color); + } + + p_theme->set_color("sub_inspector_property_color", EditorStringName(Editor), p_config.dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1)); + + // EditorProperty. + + Ref<StyleBoxFlat> style_property_bg = p_config.base_style->duplicate(); + style_property_bg->set_bg_color(p_config.highlight_color); + style_property_bg->set_border_width_all(0); + + Ref<StyleBoxFlat> style_property_child_bg = p_config.base_style->duplicate(); + style_property_child_bg->set_bg_color(p_config.dark_color_2); + style_property_child_bg->set_border_width_all(0); + + p_theme->set_stylebox("bg", "EditorProperty", Ref<StyleBoxEmpty>(memnew(StyleBoxEmpty))); + p_theme->set_stylebox("bg_selected", "EditorProperty", style_property_bg); + p_theme->set_stylebox("child_bg", "EditorProperty", style_property_child_bg); + p_theme->set_constant("font_offset", "EditorProperty", 8 * EDSCALE); + p_theme->set_constant("v_separation", "EditorProperty", p_config.increased_margin * EDSCALE); + + const Color property_color = p_config.font_color.lerp(Color(0.5, 0.5, 0.5), 0.5); + const Color readonly_color = property_color.lerp(p_config.dark_theme ? Color(0, 0, 0) : Color(1, 1, 1), 0.25); + const Color readonly_warning_color = p_config.error_color.lerp(p_config.dark_theme ? Color(0, 0, 0) : Color(1, 1, 1), 0.25); + + p_theme->set_color("property_color", "EditorProperty", property_color); + p_theme->set_color("readonly_color", "EditorProperty", readonly_color); + p_theme->set_color("warning_color", "EditorProperty", p_config.warning_color); + p_theme->set_color("readonly_warning_color", "EditorProperty", readonly_warning_color); + + Ref<StyleBoxFlat> style_property_group_note = p_config.base_style->duplicate(); + Color property_group_note_color = p_config.accent_color; + property_group_note_color.a = 0.1; + style_property_group_note->set_bg_color(property_group_note_color); + p_theme->set_stylebox("bg_group_note", "EditorProperty", style_property_group_note); + + // EditorInspectorSection. + + Color inspector_section_color = p_config.font_color.lerp(Color(0.5, 0.5, 0.5), 0.35); + p_theme->set_color("font_color", "EditorInspectorSection", inspector_section_color); + + Color inspector_indent_color = p_config.accent_color; + inspector_indent_color.a = 0.2; + Ref<StyleBoxFlat> inspector_indent_style = make_flat_stylebox(inspector_indent_color, 2.0 * EDSCALE, 0, 2.0 * EDSCALE, 0); + p_theme->set_stylebox("indent_box", "EditorInspectorSection", inspector_indent_style); + p_theme->set_constant("indent_size", "EditorInspectorSection", 6.0 * EDSCALE); + + Color prop_category_color = p_config.dark_color_1.lerp(p_config.mono_color, 0.12); + Color prop_section_color = p_config.dark_color_1.lerp(p_config.mono_color, 0.09); + Color prop_subsection_color = p_config.dark_color_1.lerp(p_config.mono_color, 0.06); + + p_theme->set_color("prop_category", EditorStringName(Editor), prop_category_color); + p_theme->set_color("prop_section", EditorStringName(Editor), prop_section_color); + p_theme->set_color("prop_subsection", EditorStringName(Editor), prop_subsection_color); + + // EditorInspectorCategory. + + Ref<StyleBoxFlat> category_bg = p_config.base_style->duplicate(); + category_bg->set_bg_color(prop_category_color); + category_bg->set_border_color(prop_category_color); + p_theme->set_stylebox("bg", "EditorInspectorCategory", category_bg); + + p_theme->set_constant("inspector_margin", EditorStringName(Editor), 12 * EDSCALE); + + // Dictionary editor. + + // Expand to the left and right by 4px to compensate for the dictionary editor margins. + Ref<StyleBoxFlat> style_dictionary_add_item = make_flat_stylebox(prop_subsection_color, 0, 4, 0, 4, p_config.corner_radius); + style_dictionary_add_item->set_expand_margin(SIDE_LEFT, 4 * EDSCALE); + style_dictionary_add_item->set_expand_margin(SIDE_RIGHT, 4 * EDSCALE); + p_theme->set_stylebox("DictionaryAddItem", EditorStringName(EditorStyles), style_dictionary_add_item); + } + + // Editor help. + { + Ref<StyleBoxFlat> style_editor_help = p_config.base_style->duplicate(); + style_editor_help->set_bg_color(p_config.dark_color_2); + style_editor_help->set_border_color(p_config.dark_color_3); + p_theme->set_stylebox("background", "EditorHelp", style_editor_help); + + const Color kbd_color = p_config.font_color.lerp(Color(0.5, 0.5, 0.5), 0.5); + + p_theme->set_color("title_color", "EditorHelp", p_config.accent_color); + p_theme->set_color("headline_color", "EditorHelp", p_config.mono_color); + p_theme->set_color("text_color", "EditorHelp", p_config.font_color); + p_theme->set_color("comment_color", "EditorHelp", p_config.font_color * Color(1, 1, 1, 0.6)); + p_theme->set_color("symbol_color", "EditorHelp", p_config.font_color * Color(1, 1, 1, 0.6)); + p_theme->set_color("value_color", "EditorHelp", p_config.font_color * Color(1, 1, 1, 0.6)); + p_theme->set_color("qualifier_color", "EditorHelp", p_config.font_color * Color(1, 1, 1, 0.8)); + p_theme->set_color("type_color", "EditorHelp", p_config.accent_color.lerp(p_config.font_color, 0.5)); + p_theme->set_color("selection_color", "EditorHelp", p_config.selection_color); + p_theme->set_color("link_color", "EditorHelp", p_config.accent_color.lerp(p_config.mono_color, 0.8)); + p_theme->set_color("code_color", "EditorHelp", p_config.accent_color.lerp(p_config.mono_color, 0.6)); + p_theme->set_color("kbd_color", "EditorHelp", p_config.accent_color.lerp(kbd_color, 0.6)); + p_theme->set_color("code_bg_color", "EditorHelp", p_config.dark_color_3); + p_theme->set_color("kbd_bg_color", "EditorHelp", p_config.dark_color_1); + p_theme->set_color("param_bg_color", "EditorHelp", p_config.dark_color_1); + p_theme->set_constant("line_separation", "EditorHelp", Math::round(6 * EDSCALE)); + p_theme->set_constant("table_h_separation", "EditorHelp", 16 * EDSCALE); + p_theme->set_constant("table_v_separation", "EditorHelp", 6 * EDSCALE); + p_theme->set_constant("text_highlight_h_padding", "EditorHelp", 1 * EDSCALE); + p_theme->set_constant("text_highlight_v_padding", "EditorHelp", 2 * EDSCALE); + } + + // Asset Library. + p_theme->set_stylebox("bg", "AssetLib", p_config.base_empty_style); + p_theme->set_stylebox("panel", "AssetLib", p_config.content_panel_style); + p_theme->set_color("status_color", "AssetLib", Color(0.5, 0.5, 0.5)); // FIXME: Use a defined color instead. + p_theme->set_icon("dismiss", "AssetLib", p_theme->get_icon(SNAME("Close"), EditorStringName(EditorIcons))); + + // Debugger. + { + Ref<StyleBoxFlat> debugger_panel_style = p_config.content_panel_style->duplicate(); + debugger_panel_style->set_border_width(SIDE_BOTTOM, 0); + p_theme->set_stylebox("DebuggerPanel", EditorStringName(EditorStyles), debugger_panel_style); + + // This pattern of get_font()->get_height(get_font_size()) is used quite a lot and is very verbose. + // FIXME: Introduce Theme::get_font_height() / Control::get_theme_font_height() / Window::get_theme_font_height(). + const int offset_i1 = p_theme->get_font(SNAME("tab_selected"), SNAME("TabContainer"))->get_height(p_theme->get_font_size(SNAME("tab_selected"), SNAME("TabContainer"))); + const int offset_i2 = p_theme->get_stylebox(SNAME("tab_selected"), SNAME("TabContainer"))->get_minimum_size().height; + const int offset_i3 = p_theme->get_stylebox(SNAME("panel"), SNAME("TabContainer"))->get_content_margin(SIDE_TOP); + const int invisible_top_offset = offset_i1 + offset_i2 + offset_i3; + + Ref<StyleBoxFlat> invisible_top_panel_style = p_config.content_panel_style->duplicate(); + invisible_top_panel_style->set_expand_margin(SIDE_TOP, -invisible_top_offset); + invisible_top_panel_style->set_content_margin(SIDE_TOP, 0); + p_theme->set_stylebox("BottomPanelDebuggerOverride", EditorStringName(EditorStyles), invisible_top_panel_style); + } + + // Resource and node editors. + { + // TextureRegion editor. + Ref<StyleBoxFlat> style_texture_region_bg = p_config.tree_panel_style->duplicate(); + style_texture_region_bg->set_content_margin_all(0); + p_theme->set_stylebox("TextureRegionPreviewBG", EditorStringName(EditorStyles), style_texture_region_bg); + p_theme->set_stylebox("TextureRegionPreviewFG", EditorStringName(EditorStyles), make_empty_stylebox(0, 0, 0, 0)); + + // Theme editor. + { + p_theme->set_color("preview_picker_overlay_color", "ThemeEditor", Color(0.1, 0.1, 0.1, 0.25)); + + Color theme_preview_picker_bg_color = p_config.accent_color; + theme_preview_picker_bg_color.a = 0.2; + Ref<StyleBoxFlat> theme_preview_picker_sb = make_flat_stylebox(theme_preview_picker_bg_color, 0, 0, 0, 0); + theme_preview_picker_sb->set_border_color(p_config.accent_color); + theme_preview_picker_sb->set_border_width_all(1.0 * EDSCALE); + p_theme->set_stylebox("preview_picker_overlay", "ThemeEditor", theme_preview_picker_sb); + + Color theme_preview_picker_label_bg_color = p_config.accent_color; + theme_preview_picker_label_bg_color.set_v(0.5); + Ref<StyleBoxFlat> theme_preview_picker_label_sb = make_flat_stylebox(theme_preview_picker_label_bg_color, 4.0, 1.0, 4.0, 3.0); + p_theme->set_stylebox("preview_picker_label", "ThemeEditor", theme_preview_picker_label_sb); + + Ref<StyleBoxFlat> style_theme_preview_tab = p_theme->get_stylebox(SNAME("tab_selected"), SNAME("TabContainerOdd"))->duplicate(); + style_theme_preview_tab->set_expand_margin(SIDE_BOTTOM, 5 * EDSCALE); + p_theme->set_stylebox("ThemeEditorPreviewFG", EditorStringName(EditorStyles), style_theme_preview_tab); + + Ref<StyleBoxFlat> style_theme_preview_bg_tab = p_theme->get_stylebox(SNAME("tab_unselected"), SNAME("TabContainer"))->duplicate(); + style_theme_preview_bg_tab->set_expand_margin(SIDE_BOTTOM, 2 * EDSCALE); + p_theme->set_stylebox("ThemeEditorPreviewBG", EditorStringName(EditorStyles), style_theme_preview_bg_tab); + } + + // VisualShader editor. + p_theme->set_stylebox("label_style", "VShaderEditor", make_empty_stylebox(2, 1, 2, 1)); + + // StateMachine graph. + { + p_theme->set_stylebox("panel", "GraphStateMachine", p_config.tree_panel_style); + p_theme->set_stylebox("error_panel", "GraphStateMachine", p_config.tree_panel_style); + p_theme->set_color("error_color", "GraphStateMachine", p_config.error_color); + + const int sm_margin_side = 10 * EDSCALE; + const int sm_margin_bottom = 2; + const Color sm_bg_color = p_config.dark_theme ? p_config.dark_color_3 : p_config.dark_color_1.lerp(p_config.mono_color, 0.09); + + Ref<StyleBoxFlat> sm_node_style = make_flat_stylebox(p_config.dark_color_3 * Color(1, 1, 1, 0.7), sm_margin_side, 24 * EDSCALE, sm_margin_side, sm_margin_bottom, p_config.corner_radius); + sm_node_style->set_border_width_all(p_config.border_width); + sm_node_style->set_border_color(sm_bg_color); + + Ref<StyleBoxFlat> sm_node_selected_style = make_flat_stylebox(sm_bg_color * Color(1, 1, 1, 0.9), sm_margin_side, 24 * EDSCALE, sm_margin_side, sm_margin_bottom, p_config.corner_radius); + sm_node_selected_style->set_border_width_all(2 * EDSCALE + p_config.border_width); + sm_node_selected_style->set_border_color(p_config.accent_color * Color(1, 1, 1, 0.9)); + sm_node_selected_style->set_shadow_size(8 * EDSCALE); + sm_node_selected_style->set_shadow_color(p_config.shadow_color); + + Ref<StyleBoxFlat> sm_node_playing_style = sm_node_selected_style->duplicate(); + sm_node_playing_style->set_border_color(p_config.warning_color); + sm_node_playing_style->set_shadow_color(p_config.warning_color * Color(1, 1, 1, 0.2)); + + p_theme->set_stylebox("node_frame", "GraphStateMachine", sm_node_style); + p_theme->set_stylebox("node_frame_selected", "GraphStateMachine", sm_node_selected_style); + p_theme->set_stylebox("node_frame_playing", "GraphStateMachine", sm_node_playing_style); + + Ref<StyleBoxFlat> sm_node_start_style = sm_node_style->duplicate(); + sm_node_start_style->set_border_width_all(1 * EDSCALE); + sm_node_start_style->set_border_color(p_config.success_color.lightened(0.24)); + p_theme->set_stylebox("node_frame_start", "GraphStateMachine", sm_node_start_style); + + Ref<StyleBoxFlat> sm_node_end_style = sm_node_style->duplicate(); + sm_node_end_style->set_border_width_all(1 * EDSCALE); + sm_node_end_style->set_border_color(p_config.error_color); + p_theme->set_stylebox("node_frame_end", "GraphStateMachine", sm_node_end_style); + + p_theme->set_font("node_title_font", "GraphStateMachine", p_theme->get_font(SNAME("font"), SNAME("Label"))); + p_theme->set_font_size("node_title_font_size", "GraphStateMachine", p_theme->get_font_size(SNAME("font_size"), SNAME("Label"))); + p_theme->set_color("node_title_font_color", "GraphStateMachine", p_config.font_color); + + p_theme->set_color("transition_color", "GraphStateMachine", p_config.font_color); + p_theme->set_color("transition_disabled_color", "GraphStateMachine", p_config.font_color * Color(1, 1, 1, 0.2)); + p_theme->set_color("transition_icon_color", "GraphStateMachine", Color(1, 1, 1)); + p_theme->set_color("transition_icon_disabled_color", "GraphStateMachine", Color(1, 1, 1, 0.2)); + p_theme->set_color("highlight_color", "GraphStateMachine", p_config.accent_color); + p_theme->set_color("highlight_disabled_color", "GraphStateMachine", p_config.accent_color * Color(1, 1, 1, 0.6)); + p_theme->set_color("guideline_color", "GraphStateMachine", p_config.font_color * Color(1, 1, 1, 0.3)); + + p_theme->set_color("playback_color", "GraphStateMachine", p_config.font_color); + p_theme->set_color("playback_background_color", "GraphStateMachine", p_config.font_color * Color(1, 1, 1, 0.3)); + } + } +} + +void EditorThemeManager::_generate_text_editor_defaults(ThemeConfiguration &p_config) { + // Adaptive colors for comments and elements with lower relevance. + const Color dim_color = Color(p_config.font_color, 0.5); + const float mono_value = p_config.mono_color.r; + const Color alpha1 = Color(mono_value, mono_value, mono_value, 0.07); + const Color alpha2 = Color(mono_value, mono_value, mono_value, 0.14); + const Color alpha3 = Color(mono_value, mono_value, mono_value, 0.27); + + /* clang-format off */ + // Syntax highlight token colors. + const Color symbol_color = p_config.dark_theme ? Color(0.67, 0.79, 1) : Color(0, 0, 0.61); + const Color keyword_color = p_config.dark_theme ? Color(1.0, 0.44, 0.52) : Color(0.9, 0.135, 0.51); + const Color control_flow_keyword_color = p_config.dark_theme ? Color(1.0, 0.55, 0.8) : Color(0.743, 0.12, 0.8); + const Color base_type_color = p_config.dark_theme ? Color(0.26, 1.0, 0.76) : Color(0, 0.6, 0.2); + const Color engine_type_color = p_config.dark_theme ? Color(0.56, 1, 0.86) : Color(0.11, 0.55, 0.4); + const Color user_type_color = p_config.dark_theme ? Color(0.78, 1, 0.93) : Color(0.18, 0.45, 0.4); + const Color comment_color = p_config.dark_theme ? dim_color : Color(0.08, 0.08, 0.08, 0.5); + const Color doc_comment_color = p_config.dark_theme ? Color(0.6, 0.7, 0.8, 0.8) : Color(0.15, 0.15, 0.4, 0.7); + const Color string_color = p_config.dark_theme ? Color(1, 0.93, 0.63) : Color(0.6, 0.42, 0); + + // Use the brightest background color on a light theme (which generally uses a negative contrast rate). + const Color te_background_color = p_config.dark_theme ? p_config.dark_color_2 : p_config.dark_color_3; + const Color completion_background_color = p_config.dark_theme ? p_config.base_color : p_config.dark_color_2; + const Color completion_selected_color = alpha1; + const Color completion_existing_color = alpha2; + // Same opacity as the scroll grabber editor icon. + const Color completion_scroll_color = Color(mono_value, mono_value, mono_value, 0.29); + const Color completion_scroll_hovered_color = Color(mono_value, mono_value, mono_value, 0.4); + const Color completion_font_color = p_config.font_color; + const Color text_color = p_config.font_color; + const Color line_number_color = dim_color; + const Color safe_line_number_color = p_config.dark_theme ? (dim_color * Color(1, 1.2, 1, 1.5)) : Color(0, 0.4, 0, 0.75); + const Color caret_color = p_config.mono_color; + const Color caret_background_color = p_config.mono_color.inverted(); + const Color text_selected_color = Color(0, 0, 0, 0); + const Color selection_color = p_config.selection_color; + const Color brace_mismatch_color = p_config.dark_theme ? p_config.error_color : Color(1, 0.08, 0, 1); + const Color current_line_color = alpha1; + const Color line_length_guideline_color = p_config.dark_theme ? p_config.base_color : p_config.dark_color_2; + const Color word_highlighted_color = alpha1; + const Color number_color = p_config.dark_theme ? Color(0.63, 1, 0.88) : Color(0, 0.55, 0.28, 1); + const Color function_color = p_config.dark_theme ? Color(0.34, 0.7, 1.0) : Color(0, 0.225, 0.9, 1); + const Color member_variable_color = p_config.dark_theme ? Color(0.34, 0.7, 1.0).lerp(p_config.mono_color, 0.6) : Color(0, 0.4, 0.68, 1); + const Color mark_color = Color(p_config.error_color.r, p_config.error_color.g, p_config.error_color.b, 0.3); + const Color bookmark_color = Color(0.08, 0.49, 0.98); + const Color breakpoint_color = p_config.dark_theme ? p_config.error_color : Color(1, 0.27, 0.2, 1); + const Color executing_line_color = Color(0.98, 0.89, 0.27); + const Color code_folding_color = alpha3; + const Color folded_code_region_color = Color(0.68, 0.46, 0.77, 0.2); + const Color search_result_color = alpha1; + const Color search_result_border_color = p_config.dark_theme ? Color(0.41, 0.61, 0.91, 0.38) : Color(0, 0.4, 1, 0.38); + /* clang-format on */ + + EditorSettings *setting = EditorSettings::get_singleton(); + + /* clang-format off */ + setting->set_initial_value("text_editor/theme/highlighting/symbol_color", symbol_color, true); + setting->set_initial_value("text_editor/theme/highlighting/keyword_color", keyword_color, true); + setting->set_initial_value("text_editor/theme/highlighting/control_flow_keyword_color", control_flow_keyword_color, true); + setting->set_initial_value("text_editor/theme/highlighting/base_type_color", base_type_color, true); + setting->set_initial_value("text_editor/theme/highlighting/engine_type_color", engine_type_color, true); + setting->set_initial_value("text_editor/theme/highlighting/user_type_color", user_type_color, true); + setting->set_initial_value("text_editor/theme/highlighting/comment_color", comment_color, true); + setting->set_initial_value("text_editor/theme/highlighting/doc_comment_color", doc_comment_color, true); + setting->set_initial_value("text_editor/theme/highlighting/string_color", string_color, true); + setting->set_initial_value("text_editor/theme/highlighting/background_color", te_background_color, true); + setting->set_initial_value("text_editor/theme/highlighting/completion_background_color", completion_background_color, true); + setting->set_initial_value("text_editor/theme/highlighting/completion_selected_color", completion_selected_color, true); + setting->set_initial_value("text_editor/theme/highlighting/completion_existing_color", completion_existing_color, true); + setting->set_initial_value("text_editor/theme/highlighting/completion_scroll_color", completion_scroll_color, true); + setting->set_initial_value("text_editor/theme/highlighting/completion_scroll_hovered_color", completion_scroll_hovered_color, true); + setting->set_initial_value("text_editor/theme/highlighting/completion_font_color", completion_font_color, true); + setting->set_initial_value("text_editor/theme/highlighting/text_color", text_color, true); + setting->set_initial_value("text_editor/theme/highlighting/line_number_color", line_number_color, true); + setting->set_initial_value("text_editor/theme/highlighting/safe_line_number_color", safe_line_number_color, true); + setting->set_initial_value("text_editor/theme/highlighting/caret_color", caret_color, true); + setting->set_initial_value("text_editor/theme/highlighting/caret_background_color", caret_background_color, true); + setting->set_initial_value("text_editor/theme/highlighting/text_selected_color", text_selected_color, true); + setting->set_initial_value("text_editor/theme/highlighting/selection_color", selection_color, true); + setting->set_initial_value("text_editor/theme/highlighting/brace_mismatch_color", brace_mismatch_color, true); + setting->set_initial_value("text_editor/theme/highlighting/current_line_color", current_line_color, true); + setting->set_initial_value("text_editor/theme/highlighting/line_length_guideline_color", line_length_guideline_color, true); + setting->set_initial_value("text_editor/theme/highlighting/word_highlighted_color", word_highlighted_color, true); + setting->set_initial_value("text_editor/theme/highlighting/number_color", number_color, true); + setting->set_initial_value("text_editor/theme/highlighting/function_color", function_color, true); + setting->set_initial_value("text_editor/theme/highlighting/member_variable_color", member_variable_color, true); + setting->set_initial_value("text_editor/theme/highlighting/mark_color", mark_color, true); + setting->set_initial_value("text_editor/theme/highlighting/bookmark_color", bookmark_color, true); + setting->set_initial_value("text_editor/theme/highlighting/breakpoint_color", breakpoint_color, true); + setting->set_initial_value("text_editor/theme/highlighting/executing_line_color", executing_line_color, true); + setting->set_initial_value("text_editor/theme/highlighting/code_folding_color", code_folding_color, true); + setting->set_initial_value("text_editor/theme/highlighting/folded_code_region_color", folded_code_region_color, true); + setting->set_initial_value("text_editor/theme/highlighting/search_result_color", search_result_color, true); + setting->set_initial_value("text_editor/theme/highlighting/search_result_border_color", search_result_border_color, true); + /* clang-format on */ +} + +void EditorThemeManager::_populate_text_editor_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config) { + String text_editor_color_theme = EditorSettings::get_singleton()->get("text_editor/theme/color_theme"); + if (text_editor_color_theme == "Default") { + _generate_text_editor_defaults(p_config); + } else if (text_editor_color_theme == "Godot 2") { + EditorSettings::get_singleton()->load_text_editor_theme(); + } + + // Now theme is loaded, apply it to CodeEdit. + p_theme->set_font("font", "CodeEdit", p_theme->get_font(SNAME("source"), EditorStringName(EditorFonts))); + p_theme->set_font_size("font_size", "CodeEdit", p_theme->get_font_size(SNAME("source_size"), EditorStringName(EditorFonts))); + + /* clang-format off */ + p_theme->set_icon("tab", "CodeEdit", p_theme->get_icon(SNAME("GuiTab"), EditorStringName(EditorIcons))); + p_theme->set_icon("space", "CodeEdit", p_theme->get_icon(SNAME("GuiSpace"), EditorStringName(EditorIcons))); + p_theme->set_icon("folded", "CodeEdit", p_theme->get_icon(SNAME("CodeFoldedRightArrow"), EditorStringName(EditorIcons))); + p_theme->set_icon("can_fold", "CodeEdit", p_theme->get_icon(SNAME("CodeFoldDownArrow"), EditorStringName(EditorIcons))); + p_theme->set_icon("folded_code_region", "CodeEdit", p_theme->get_icon(SNAME("CodeRegionFoldedRightArrow"), EditorStringName(EditorIcons))); + p_theme->set_icon("can_fold_code_region", "CodeEdit", p_theme->get_icon(SNAME("CodeRegionFoldDownArrow"), EditorStringName(EditorIcons))); + p_theme->set_icon("executing_line", "CodeEdit", p_theme->get_icon(SNAME("TextEditorPlay"), EditorStringName(EditorIcons))); + p_theme->set_icon("breakpoint", "CodeEdit", p_theme->get_icon(SNAME("Breakpoint"), EditorStringName(EditorIcons))); + /* clang-format on */ + + p_theme->set_constant("line_spacing", "CodeEdit", EDITOR_GET("text_editor/appearance/whitespace/line_spacing")); + + const Color background_color = EDITOR_GET("text_editor/theme/highlighting/background_color"); + Ref<StyleBoxFlat> code_edit_stylebox = make_flat_stylebox(background_color, p_config.widget_margin.x, p_config.widget_margin.y, p_config.widget_margin.x, p_config.widget_margin.y, p_config.corner_radius); + p_theme->set_stylebox("normal", "CodeEdit", code_edit_stylebox); + p_theme->set_stylebox("read_only", "CodeEdit", code_edit_stylebox); + p_theme->set_stylebox("focus", "CodeEdit", Ref<StyleBoxEmpty>(memnew(StyleBoxEmpty))); + + p_theme->set_color("background_color", "CodeEdit", Color(0, 0, 0, 0)); // Unset any color, we use a stylebox. + + /* clang-format off */ + p_theme->set_color("completion_background_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_background_color")); + p_theme->set_color("completion_selected_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_selected_color")); + p_theme->set_color("completion_existing_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_existing_color")); + p_theme->set_color("completion_scroll_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_scroll_color")); + p_theme->set_color("completion_scroll_hovered_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_scroll_hovered_color")); + p_theme->set_color("font_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/text_color")); + p_theme->set_color("line_number_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/line_number_color")); + p_theme->set_color("caret_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/caret_color")); + p_theme->set_color("font_selected_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/text_selected_color")); + p_theme->set_color("selection_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/selection_color")); + p_theme->set_color("brace_mismatch_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/brace_mismatch_color")); + p_theme->set_color("current_line_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/current_line_color")); + p_theme->set_color("line_length_guideline_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/line_length_guideline_color")); + p_theme->set_color("word_highlighted_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/word_highlighted_color")); + p_theme->set_color("bookmark_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/bookmark_color")); + p_theme->set_color("breakpoint_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/breakpoint_color")); + p_theme->set_color("executing_line_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/executing_line_color")); + p_theme->set_color("code_folding_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/code_folding_color")); + p_theme->set_color("folded_code_region_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/folded_code_region_color")); + p_theme->set_color("search_result_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/search_result_color")); + p_theme->set_color("search_result_border_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/search_result_border_color")); + /* clang-format on */ +} + +// Public interface for theme generation. + +Ref<Theme> EditorThemeManager::generate_theme(const Ref<Theme> &p_old_theme) { + OS::get_singleton()->benchmark_begin_measure("EditorTheme", "Generate Theme"); + + Ref<Theme> theme = _create_base_theme(p_old_theme); + + const String custom_theme_path = EDITOR_GET("interface/theme/custom_theme"); + if (!custom_theme_path.is_empty()) { + Ref<Theme> custom_theme = ResourceLoader::load(custom_theme_path); + if (custom_theme.is_valid()) { + theme->merge_with(custom_theme); + } + } + + OS::get_singleton()->benchmark_end_measure("EditorTheme", "Generate Theme"); + return theme; +} + +bool EditorThemeManager::is_generated_theme_outdated() { + // This list includes settings used by files in the editor/themes folder. + // Note that the editor scale is purposefully omitted because it cannot be changed + // without a restart, so there is no point regenerating the theme. + + // TODO: We can use this information more intelligently to do partial theme updates and speed things up. + return EditorSettings::get_singleton()->check_changed_settings_in_group("interface/theme") || + EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/font") || + EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/main_font") || + EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/code_font") || + EditorSettings::get_singleton()->check_changed_settings_in_group("text_editor/theme") || + EditorSettings::get_singleton()->check_changed_settings_in_group("text_editor/help/help") || + EditorSettings::get_singleton()->check_changed_settings_in_group("filesystem/file_dialog/thumbnail_size") || + EditorSettings::get_singleton()->check_changed_settings_in_group("run/output/font_size") || + EditorSettings::get_singleton()->check_changed_settings_in_group("interface/touchscreen/increase_scrollbar_touch_area") || + EditorSettings::get_singleton()->check_changed_settings_in_group("interface/touchscreen/scale_gizmo_handles"); +} + +void EditorThemeManager::initialize() { + EditorColorMap::create(); + EditorTheme::initialize(); +} + +void EditorThemeManager::finalize() { + EditorColorMap::finish(); + EditorTheme::finalize(); +} diff --git a/editor/themes/editor_theme_manager.h b/editor/themes/editor_theme_manager.h new file mode 100644 index 0000000000..86188ec244 --- /dev/null +++ b/editor/themes/editor_theme_manager.h @@ -0,0 +1,150 @@ +/**************************************************************************/ +/* editor_theme_manager.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#ifndef EDITOR_THEME_MANAGER_H +#define EDITOR_THEME_MANAGER_H + +#include "scene/resources/style_box_flat.h" +#include "scene/resources/theme.h" + +class EditorThemeManager { + struct ThemeConfiguration { + // Basic properties. + + String preset; + String spacing_preset; + bool dark_theme = false; + + Color base_color; + Color accent_color; + float contrast = 1.0; + float icon_saturation = 1.0; + + // Extra properties. + + int base_spacing = 4; + int extra_spacing = 0; + int border_width = 0; + int corner_radius = 3; + + bool draw_extra_borders = false; + float relationship_line_opacity = 1.0; + int thumb_size = 16; + int class_icon_size = 16; + bool increase_scrollbar_touch_area = false; + float gizmo_handle_scale = 1.0; + int color_picker_button_height = 28; + + float default_contrast = 1.0; + + // Generated properties. + + int base_margin = 4; + int increased_margin = 4; + int separation_margin = 4; + int popup_margin = 12; + int window_border_margin = 8; + int top_bar_separation = 8; + int forced_even_separation = 0; + + Color mono_color; + Color dark_color_1; + Color dark_color_2; + Color dark_color_3; + Color contrast_color_1; + Color contrast_color_2; + Color highlight_color; + Color highlight_disabled_color; + Color success_color; + Color warning_color; + Color error_color; + Color extra_border_color_1; + Color extra_border_color_2; + + Color font_color; + Color font_focus_color; + Color font_hover_color; + Color font_pressed_color; + Color font_hover_pressed_color; + Color font_disabled_color; + Color font_readonly_color; + Color font_placeholder_color; + Color font_outline_color; + + Color icon_normal_color; + Color icon_focus_color; + Color icon_hover_color; + Color icon_pressed_color; + Color icon_disabled_color; + + Color shadow_color; + Color selection_color; + Color disabled_border_color; + Color disabled_bg_color; + Color separator_color; + + Ref<StyleBoxFlat> base_style; + Ref<StyleBoxEmpty> base_empty_style; + + Ref<StyleBoxFlat> button_style; + Ref<StyleBoxFlat> button_style_disabled; + Ref<StyleBoxFlat> button_style_focus; + Ref<StyleBoxFlat> button_style_pressed; + Ref<StyleBoxFlat> button_style_hover; + + Ref<StyleBoxFlat> popup_style; + Ref<StyleBoxFlat> window_style; + Ref<StyleBoxFlat> dialog_style; + Ref<StyleBoxFlat> panel_container_style; + Ref<StyleBoxFlat> content_panel_style; + Ref<StyleBoxFlat> tree_panel_style; + + Vector2 widget_margin; + }; + + static Ref<Theme> _create_base_theme(const Ref<Theme> &p_old_theme = nullptr); + static ThemeConfiguration _create_theme_config(const Ref<Theme> &p_theme); + + static void _create_shared_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config); + static void _populate_standard_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config); + static void _populate_editor_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config); + + static void _generate_text_editor_defaults(ThemeConfiguration &p_config); + static void _populate_text_editor_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config); + +public: + static Ref<Theme> generate_theme(const Ref<Theme> &p_old_theme = nullptr); + static bool is_generated_theme_outdated(); + + static void initialize(); + static void finalize(); +}; + +#endif // EDITOR_THEME_MANAGER_H diff --git a/editor/window_wrapper.cpp b/editor/window_wrapper.cpp index aec4005ce5..a085c2e44f 100644 --- a/editor/window_wrapper.cpp +++ b/editor/window_wrapper.cpp @@ -31,10 +31,10 @@ #include "window_wrapper.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/progress_dialog.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/label.h" #include "scene/gui/panel.h" diff --git a/main/main.cpp b/main/main.cpp index b50def9cec..dbe186d63a 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -475,7 +475,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --profiling Enable profiling in the script debugger.\n"); OS::get_singleton()->print(" --gpu-profile Show a GPU profile of the tasks that took the most time during frame rendering.\n"); OS::get_singleton()->print(" --gpu-validation Enable graphics API validation layers for debugging.\n"); -#if DEBUG_ENABLED +#ifdef DEBUG_ENABLED OS::get_singleton()->print(" --gpu-abort Abort on graphics API usage errors (usually validation layer errors). May help see the problem if your system freezes.\n"); #endif OS::get_singleton()->print(" --generate-spirv-debug-info Generate SPIR-V debug information. This allows source-level shader debugging with RenderDoc.\n"); @@ -1615,12 +1615,18 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } // Initialize WorkerThreadPool. - if (editor || project_manager) { - WorkerThreadPool::get_singleton()->init(-1, 0.75); - } else { - int worker_threads = GLOBAL_GET("threading/worker_pool/max_threads"); - float low_priority_ratio = GLOBAL_GET("threading/worker_pool/low_priority_thread_ratio"); - WorkerThreadPool::get_singleton()->init(worker_threads, low_priority_ratio); + { +#ifdef THREADS_ENABLED + if (editor || project_manager) { + WorkerThreadPool::get_singleton()->init(-1, 0.75); + } else { + int worker_threads = GLOBAL_GET("threading/worker_pool/max_threads"); + float low_priority_ratio = GLOBAL_GET("threading/worker_pool/low_priority_thread_ratio"); + WorkerThreadPool::get_singleton()->init(worker_threads, low_priority_ratio); + } +#else + WorkerThreadPool::get_singleton()->init(0, 0); +#endif } #ifdef TOOLS_ENABLED diff --git a/misc/dist/html/editor.html b/misc/dist/html/editor.html index 93afbf085d..e5c68c6338 100644 --- a/misc/dist/html/editor.html +++ b/misc/dist/html/editor.html @@ -23,7 +23,7 @@ <link id="-gd-engine-icon" rel="icon" type="image/png" href="favicon.png"> <link rel="apple-touch-icon" type="image/png" href="favicon.png"> <link rel="manifest" href="manifest.json"> - <title>Godot Engine Web Editor (@GODOT_VERSION@)</title> + <title>Godot Engine Web Editor (___GODOT_VERSION___)</title> <style> *:focus { /* More visible outline for better keyboard navigation. */ @@ -294,7 +294,7 @@ a:active { <br > <img src="logo.svg" alt="Godot Engine logo" width="1024" height="414" style="width: auto; height: auto; max-width: min(85%, 50vh); max-height: 250px"> <br > - @GODOT_VERSION@ + ___GODOT_VERSION___ <br > <a href="releases/">Need an old version?</a> <br > @@ -384,7 +384,9 @@ window.addEventListener('load', () => { }); } - const missing = Engine.getMissingFeatures(); + const missing = Engine.getMissingFeatures({ + threads: ___GODOT_THREADS_ENABLED___, + }); if (missing.length) { // Display error dialog as threading support is required for the editor. document.getElementById('startButton').disabled = 'disabled'; diff --git a/misc/dist/html/full-size.html b/misc/dist/html/full-size.html index 6710cb1533..54571e27c7 100644 --- a/misc/dist/html/full-size.html +++ b/misc/dist/html/full-size.html @@ -136,6 +136,7 @@ body { <script src="$GODOT_URL"></script> <script> const GODOT_CONFIG = $GODOT_CONFIG; +const GODOT_THREADS_ENABLED = $GODOT_THREADS_ENABLED; const engine = new Engine(GODOT_CONFIG); (function () { @@ -213,7 +214,9 @@ const engine = new Engine(GODOT_CONFIG); initializing = false; } - const missing = Engine.getMissingFeatures(); + const missing = Engine.getMissingFeatures({ + threads: GODOT_THREADS_ENABLED, + }); if (missing.length !== 0) { const missingMsg = 'Error\nThe following features required to run Godot projects on the Web are missing:\n'; displayFailureNotice(missingMsg + missing.join('\n')); diff --git a/misc/dist/html/service-worker.js b/misc/dist/html/service-worker.js index 310574f21d..70e7a399e1 100644 --- a/misc/dist/html/service-worker.js +++ b/misc/dist/html/service-worker.js @@ -3,14 +3,14 @@ // that they need an Internet connection to run the project if desired. // Incrementing CACHE_VERSION will kick off the install event and force // previously cached resources to be updated from the network. -const CACHE_VERSION = "@GODOT_VERSION@"; -const CACHE_PREFIX = "@GODOT_NAME@-sw-cache-"; +const CACHE_VERSION = "___GODOT_VERSION___"; +const CACHE_PREFIX = "___GODOT_NAME___-sw-cache-"; const CACHE_NAME = CACHE_PREFIX + CACHE_VERSION; -const OFFLINE_URL = "@GODOT_OFFLINE_PAGE@"; +const OFFLINE_URL = "___GODOT_OFFLINE_PAGE___"; // Files that will be cached on load. -const CACHED_FILES = @GODOT_CACHE@; +const CACHED_FILES = ___GODOT_CACHE___; // Files that we might not want the user to preload, and will only be cached on first load. -const CACHABLE_FILES = @GODOT_OPT_CACHE@; +const CACHABLE_FILES = ___GODOT_OPT_CACHE___; const FULL_CACHE = CACHED_FILES.concat(CACHABLE_FILES); self.addEventListener("install", (event) => { @@ -22,7 +22,7 @@ self.addEventListener("activate", (event) => { function (keys) { // Remove old caches. return Promise.all(keys.filter(key => key.startsWith(CACHE_PREFIX) && key != CACHE_NAME).map(key => caches.delete(key))); - }).then(function() { + }).then(function () { // Enable navigation preload if available. return ("navigationPreload" in self.registration) ? self.registration.navigationPreload.enable() : Promise.resolve(); }) diff --git a/misc/extension_api_validation/4.2-stable.expected b/misc/extension_api_validation/4.2-stable.expected index 2c52144896..25094dda77 100644 --- a/misc/extension_api_validation/4.2-stable.expected +++ b/misc/extension_api_validation/4.2-stable.expected @@ -51,3 +51,11 @@ Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/texture_u Barrier arguments have been removed from all relevant functions as they're no longer required. Draw and compute list overlap no longer needs to be specified. Initial and final actions have been simplified into fewer options. + + +GH-87115 +-------- +Validate extension JSON: Error: Field 'classes/TileMap/methods/get_collision_visibility_mode': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Field 'classes/TileMap/methods/get_navigation_visibility_mode': is_const changed value in new API, from false to true. + +Two TileMap getters were made const. No adjustments should be necessary. diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 1f0830aa17..920aa63fbe 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -2320,14 +2320,13 @@ struct GDScriptDepSort { void GDScriptLanguage::reload_all_scripts() { #ifdef DEBUG_ENABLED print_verbose("GDScript: Reloading all scripts"); - List<Ref<GDScript>> scripts; + Array scripts; { MutexLock lock(this->mutex); SelfList<GDScript> *elem = script_list.first(); while (elem) { - // Scripts will reload all subclasses, so only reload root scripts. - if (elem->self()->is_root_script() && elem->self()->get_path().is_resource_file()) { + if (elem->self()->get_path().is_resource_file()) { print_verbose("GDScript: Found: " + elem->self()->get_path()); scripts.push_back(Ref<GDScript>(elem->self())); //cast to gdscript to avoid being erased by accident } @@ -2348,19 +2347,11 @@ void GDScriptLanguage::reload_all_scripts() { #endif } - //as scripts are going to be reloaded, must proceed without locking here - - scripts.sort_custom<GDScriptDepSort>(); //update in inheritance dependency order - - for (Ref<GDScript> &scr : scripts) { - print_verbose("GDScript: Reloading: " + scr->get_path()); - scr->load_source_code(scr->get_path()); - scr->reload(true); - } + reload_scripts(scripts, true); #endif } -void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) { +void GDScriptLanguage::reload_scripts(const Array &p_scripts, bool p_soft_reload) { #ifdef DEBUG_ENABLED List<Ref<GDScript>> scripts; @@ -2386,7 +2377,7 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so scripts.sort_custom<GDScriptDepSort>(); //update in inheritance dependency order for (Ref<GDScript> &scr : scripts) { - bool reload = scr == p_script || to_reload.has(scr->get_base()); + bool reload = p_scripts.has(scr) || to_reload.has(scr->get_base()); if (!reload) { continue; @@ -2409,7 +2400,7 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so } } -//same thing for placeholders + //same thing for placeholders #ifdef TOOLS_ENABLED while (scr->placeholders.size()) { @@ -2437,6 +2428,8 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so for (KeyValue<Ref<GDScript>, HashMap<ObjectID, List<Pair<StringName, Variant>>>> &E : to_reload) { Ref<GDScript> scr = E.key; + print_verbose("GDScript: Reloading: " + scr->get_path()); + scr->load_source_code(scr->get_path()); scr->reload(p_soft_reload); //restore state if saved @@ -2484,6 +2477,12 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so #endif } +void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) { + Array scripts; + scripts.push_back(p_script); + reload_scripts(scripts, p_soft_reload); +} + void GDScriptLanguage::frame() { calls = 0; diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 7b0e2136ed..2da9b89eb9 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -575,6 +575,7 @@ public: virtual String debug_parse_stack_level_expression(int p_level, const String &p_expression, int p_max_subitems = -1, int p_max_depth = -1) override; virtual void reload_all_scripts() override; + virtual void reload_scripts(const Array &p_scripts, bool p_soft_reload) override; virtual void reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) override; virtual void frame() override; diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 3fd5b3f519..7026d131e3 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -4908,8 +4908,19 @@ GDScriptParser::DataType GDScriptAnalyzer::type_from_property(const PropertyInfo } result.builtin_type = p_property.type; if (p_property.type == Variant::OBJECT) { - result.kind = GDScriptParser::DataType::NATIVE; - result.native_type = p_property.class_name == StringName() ? SNAME("Object") : p_property.class_name; + if (ScriptServer::is_global_class(p_property.class_name)) { + result.kind = GDScriptParser::DataType::SCRIPT; + result.script_path = ScriptServer::get_global_class_path(p_property.class_name); + result.native_type = ScriptServer::get_global_class_native_base(p_property.class_name); + + Ref<Script> scr = ResourceLoader::load(ScriptServer::get_global_class_path(p_property.class_name)); + if (scr.is_valid()) { + result.script_type = scr; + } + } else { + result.kind = GDScriptParser::DataType::NATIVE; + result.native_type = p_property.class_name == StringName() ? "Object" : p_property.class_name; + } } else { result.kind = GDScriptParser::DataType::BUILTIN; result.builtin_type = p_property.type; diff --git a/modules/gdscript/gdscript_byte_codegen.h b/modules/gdscript/gdscript_byte_codegen.h index 9bface6136..f902cb10cc 100644 --- a/modules/gdscript/gdscript_byte_codegen.h +++ b/modules/gdscript/gdscript_byte_codegen.h @@ -121,7 +121,7 @@ class GDScriptByteCodeGenerator : public GDScriptCodeGenerator { RBMap<MethodBind *, int> method_bind_map; RBMap<GDScriptFunction *, int> lambdas_map; -#if DEBUG_ENABLED +#ifdef DEBUG_ENABLED // Keep method and property names for pointer and validated operations. // Used when disassembling the bytecode. Vector<String> operator_names; diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 9ad2ba1914..210e2c3898 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -1370,7 +1370,7 @@ static void _find_identifiers(const GDScriptParser::CompletionContext &p_context } } -static GDScriptCompletionIdentifier _type_from_variant(const Variant &p_value) { +static GDScriptCompletionIdentifier _type_from_variant(const Variant &p_value, GDScriptParser::CompletionContext &p_context) { GDScriptCompletionIdentifier ci; ci.value = p_value; ci.type.is_constant = true; @@ -1392,8 +1392,22 @@ static GDScriptCompletionIdentifier _type_from_variant(const Variant &p_value) { scr = obj->get_script(); } if (scr.is_valid()) { - ci.type.script_type = scr; + ci.type.script_path = scr->get_path(); + + if (scr->get_path().ends_with(".gd")) { + Error err; + Ref<GDScriptParserRef> parser = GDScriptCache::get_parser(scr->get_path(), GDScriptParserRef::INTERFACE_SOLVED, err); + if (err == OK) { + ci.type.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT; + ci.type.class_type = parser->get_parser()->get_tree(); + ci.type.kind = GDScriptParser::DataType::CLASS; + p_context.dependent_parsers.push_back(parser); + return ci; + } + } + ci.type.kind = GDScriptParser::DataType::SCRIPT; + ci.type.script_type = scr; ci.type.native_type = scr->get_instance_base_type(); } else { ci.type.kind = GDScriptParser::DataType::NATIVE; @@ -1418,8 +1432,19 @@ static GDScriptCompletionIdentifier _type_from_property(const PropertyInfo &p_pr ci.type.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT; ci.type.builtin_type = p_property.type; if (p_property.type == Variant::OBJECT) { - ci.type.kind = GDScriptParser::DataType::NATIVE; - ci.type.native_type = p_property.class_name == StringName() ? "Object" : p_property.class_name; + if (ScriptServer::is_global_class(p_property.class_name)) { + ci.type.kind = GDScriptParser::DataType::SCRIPT; + ci.type.script_path = ScriptServer::get_global_class_path(p_property.class_name); + ci.type.native_type = ScriptServer::get_global_class_native_base(p_property.class_name); + + Ref<Script> scr = ResourceLoader::load(ScriptServer::get_global_class_path(p_property.class_name)); + if (scr.is_valid()) { + ci.type.script_type = scr; + } + } else { + ci.type.kind = GDScriptParser::DataType::NATIVE; + ci.type.native_type = p_property.class_name == StringName() ? "Object" : p_property.class_name; + } } else { ci.type.kind = GDScriptParser::DataType::BUILTIN; } @@ -1481,7 +1506,7 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, if (p_expression->is_constant) { // Already has a value, so just use that. - r_type = _type_from_variant(p_expression->reduced_value); + r_type = _type_from_variant(p_expression->reduced_value, p_context); switch (p_expression->get_datatype().kind) { case GDScriptParser::DataType::ENUM: case GDScriptParser::DataType::CLASS: @@ -1495,7 +1520,7 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, switch (p_expression->type) { case GDScriptParser::Node::LITERAL: { const GDScriptParser::LiteralNode *literal = static_cast<const GDScriptParser::LiteralNode *>(p_expression); - r_type = _type_from_variant(literal->value); + r_type = _type_from_variant(literal->value, p_context); found = true; } break; case GDScriptParser::Node::SELF: { @@ -1676,7 +1701,7 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, if (!which.is_empty()) { // Try singletons first if (GDScriptLanguage::get_singleton()->get_named_globals_map().has(which)) { - r_type = _type_from_variant(GDScriptLanguage::get_singleton()->get_named_globals_map()[which]); + r_type = _type_from_variant(GDScriptLanguage::get_singleton()->get_named_globals_map()[which], p_context); found = true; } else { for (const KeyValue<StringName, ProjectSettings::AutoloadInfo> &E : ProjectSettings::get_singleton()->get_autoload_list()) { @@ -1727,7 +1752,7 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, if (ce.error == Callable::CallError::CALL_OK && ret.get_type() != Variant::NIL) { if (ret.get_type() != Variant::OBJECT || ret.operator Object *() != nullptr) { - r_type = _type_from_variant(ret); + r_type = _type_from_variant(ret, p_context); found = true; } } @@ -1755,7 +1780,7 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, if (base.value.get_type() == Variant::DICTIONARY && base.value.operator Dictionary().has(String(subscript->attribute->name))) { Variant value = base.value.operator Dictionary()[String(subscript->attribute->name)]; - r_type = _type_from_variant(value); + r_type = _type_from_variant(value, p_context); found = true; break; } @@ -1807,7 +1832,7 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, if (base.value.in(index.value)) { Variant value = base.value.get(index.value); - r_type = _type_from_variant(value); + r_type = _type_from_variant(value, p_context); found = true; break; } @@ -1862,7 +1887,7 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, bool valid = false; Variant res = base_val.get(index.value, &valid); if (valid) { - r_type = _type_from_variant(res); + r_type = _type_from_variant(res, p_context); r_type.value = Variant(); r_type.type.is_constant = false; found = true; @@ -1920,7 +1945,7 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, found = false; break; } - r_type = _type_from_variant(res); + r_type = _type_from_variant(res, p_context); if (!v1_use_value || !v2_use_value) { r_type.value = Variant(); r_type.type.is_constant = false; @@ -2155,7 +2180,7 @@ static bool _guess_identifier_type(GDScriptParser::CompletionContext &p_context, } else { Ref<Script> scr = ResourceLoader::load(ScriptServer::get_global_class_path(p_identifier->name)); if (scr.is_valid()) { - r_type = _type_from_variant(scr); + r_type = _type_from_variant(scr, p_context); r_type.type.is_meta_type = true; return true; } @@ -2165,7 +2190,7 @@ static bool _guess_identifier_type(GDScriptParser::CompletionContext &p_context, // Check global variables (including autoloads). if (GDScriptLanguage::get_singleton()->get_named_globals_map().has(p_identifier->name)) { - r_type = _type_from_variant(GDScriptLanguage::get_singleton()->get_named_globals_map()[p_identifier->name]); + r_type = _type_from_variant(GDScriptLanguage::get_singleton()->get_named_globals_map()[p_identifier->name], p_context); return true; } @@ -2218,7 +2243,7 @@ static bool _guess_identifier_type_from_base(GDScriptParser::CompletionContext & const GDScriptParser::ExpressionNode *init = member.variable->initializer; if (init->is_constant) { r_type.value = init->reduced_value; - r_type = _type_from_variant(init->reduced_value); + r_type = _type_from_variant(init->reduced_value, p_context); return true; } else if (init->start_line == p_context.current_line) { return false; @@ -2245,7 +2270,7 @@ static bool _guess_identifier_type_from_base(GDScriptParser::CompletionContext & r_type.enumeration = member.m_enum->identifier->name; return true; case GDScriptParser::ClassNode::Member::ENUM_VALUE: - r_type = _type_from_variant(member.enum_value.value); + r_type = _type_from_variant(member.enum_value.value, p_context); return true; case GDScriptParser::ClassNode::Member::SIGNAL: r_type.type.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT; @@ -2281,7 +2306,7 @@ static bool _guess_identifier_type_from_base(GDScriptParser::CompletionContext & HashMap<StringName, Variant> constants; scr->get_constants(&constants); if (constants.has(p_identifier)) { - r_type = _type_from_variant(constants[p_identifier]); + r_type = _type_from_variant(constants[p_identifier], p_context); return true; } @@ -2345,7 +2370,7 @@ static bool _guess_identifier_type_from_base(GDScriptParser::CompletionContext & bool valid = false; Variant res = tmp.get(p_identifier, &valid); if (valid) { - r_type = _type_from_variant(res); + r_type = _type_from_variant(res, p_context); r_type.value = Variant(); r_type.type.is_constant = false; return true; @@ -3197,6 +3222,11 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c List<String> opts; p_owner->get_argument_options("get_node", 0, &opts); + bool for_unique_name = false; + if (completion_context.node != nullptr && completion_context.node->type == GDScriptParser::Node::GET_NODE && !static_cast<GDScriptParser::GetNodeNode *>(completion_context.node)->use_dollar) { + for_unique_name = true; + } + for (const String &E : opts) { r_forced = true; String opt = E.strip_edges(); @@ -3205,6 +3235,14 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c // or handle NodePaths which are valid identifiers and don't need quotes. opt = opt.unquote(); } + + if (for_unique_name) { + if (!opt.begins_with("%")) { + continue; + } + opt = opt.substr(1); + } + // The path needs quotes if it's not a valid identifier (with an exception // for "/" as path separator, which also doesn't require quotes). if (!opt.replace("/", "_").is_valid_identifier()) { @@ -3216,11 +3254,13 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c options.insert(option.display, option); } - // Get autoloads. - for (const KeyValue<StringName, ProjectSettings::AutoloadInfo> &E : ProjectSettings::get_singleton()->get_autoload_list()) { - String path = "/root/" + E.key; - ScriptLanguage::CodeCompletionOption option(path.quote(quote_style), ScriptLanguage::CODE_COMPLETION_KIND_NODE_PATH); - options.insert(option.display, option); + if (!for_unique_name) { + // Get autoloads. + for (const KeyValue<StringName, ProjectSettings::AutoloadInfo> &E : ProjectSettings::get_singleton()->get_autoload_list()) { + String path = "/root/" + E.key; + ScriptLanguage::CodeCompletionOption option(path.quote(quote_style), ScriptLanguage::CODE_COMPLETION_KIND_NODE_PATH); + options.insert(option.display, option); + } } } } break; @@ -3564,7 +3604,8 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co case GDScriptParser::COMPLETION_ASSIGN: case GDScriptParser::COMPLETION_CALL_ARGUMENTS: case GDScriptParser::COMPLETION_IDENTIFIER: - case GDScriptParser::COMPLETION_PROPERTY_METHOD: { + case GDScriptParser::COMPLETION_PROPERTY_METHOD: + case GDScriptParser::COMPLETION_SUBSCRIPT: { GDScriptParser::DataType base_type; if (context.current_class) { if (context.type != GDScriptParser::COMPLETION_SUPER_METHOD) { diff --git a/modules/gdscript/language_server/gdscript_text_document.cpp b/modules/gdscript/language_server/gdscript_text_document.cpp index 95b3be2811..e00b92b752 100644 --- a/modules/gdscript/language_server/gdscript_text_document.cpp +++ b/modules/gdscript/language_server/gdscript_text_document.cpp @@ -114,7 +114,7 @@ void GDScriptTextDocument::didSave(const Variant &p_param) { scr->update_exports(); ScriptEditor::get_singleton()->reload_scripts(true); ScriptEditor::get_singleton()->update_docs_from_script(scr); - ScriptEditor::get_singleton()->trigger_live_script_reload(); + ScriptEditor::get_singleton()->trigger_live_script_reload(scr->get_path()); } } diff --git a/modules/gdscript/tests/README.md b/modules/gdscript/tests/README.md index 361d586d32..cea251bab5 100644 --- a/modules/gdscript/tests/README.md +++ b/modules/gdscript/tests/README.md @@ -6,3 +6,44 @@ and output files. See the [Integration tests for GDScript documentation](https://docs.godotengine.org/en/latest/contributing/development/core_and_modules/unit_testing.html#integration-tests-for-gdscript) for information about creating and running GDScript integration tests. + +# GDScript Autocompletion tests + +The `script/completion` folder contains test for the GDScript autocompletion. + +Each test case consists of at least one `.gd` file, which contains the code, and one `.cfg` file, which contains expected results and configuration. Inside of the GDScript file the character `➡` represents the cursor position, at which autocompletion is invoked. + +The config file contains two section: + +`[input]` contains keys that configure the test environment. The following keys are possible: + +- `cs: boolean = false`: If `true`, the test will be skipped when running a non C# build. +- `use_single_quotes: boolean = false`: Configures the corresponding editor setting for the test. +- `scene: String`: Allows to specify a scene which is opened while autocompletion is performed. If this is not set the test runner will search for a `.tscn` file with the same basename as the GDScript file. If that isn't found either, autocompletion will behave as if no scene was opened. + +`[output]` specifies the expected results for the test. The following key are supported: + +- `include: Array`: An unordered list of suggestions that should be in the result. Each entry is one dictionary with the following keys: `display`, `insert_text`, `kind`, `location`, which correspond to the suggestion struct which is used in the code. The runner only tests against specified keys, so in most cases `display` will suffice. +- `exclude: Array`: An array of suggestions which should not be in the result. The entries take the same form as for `include`. +- `call_hint: String`: The expected call hint returned by autocompletion. +- `forced: boolean`: Whether autocompletion is expected to force opening a completion window. + +Tests will only test against entries in `[output]` that were specified. + +## Writing autocompletion tests + +To avoid failing edge cases a certain behaviour needs to be tested multiple times. Some things that tests should account for: + +- All possible types: Test with all possible types that apply to the tested behaviour. (For the last points testing against `SCRIPT` and `CLASS` should suffice. `CLASS` can be obtained through C#, `SCRIPT` through GDScript. Relying on autoloads to be of type `SCRIPT` is not good, since this might change in the future.) + + - `BUILTIN` + - `NATIVE` + - GDScripts (with `class_name` as well as `preload`ed) + - C# (as standin for all other language bindings) (with `class_name` as well as `preload`ed) + - Autoloads + +- Possible contexts: the completion might be placed in different places of the program. e.g: + - initializers of class members + - directly inside a suite + - assignments inside a suite + - as parameter to a call diff --git a/modules/gdscript/tests/scripts/completion/get_node/get_node_member_annotated.cfg b/modules/gdscript/tests/scripts/completion/get_node/get_node_member_annotated.cfg index 4edee46039..27e695d245 100644 --- a/modules/gdscript/tests/scripts/completion/get_node/get_node_member_annotated.cfg +++ b/modules/gdscript/tests/scripts/completion/get_node/get_node_member_annotated.cfg @@ -1,4 +1,4 @@ [output] -expected=[ +include=[ {"display": "autoplay"}, ] diff --git a/modules/gdscript/tests/test_completion.h b/modules/gdscript/tests/test_completion.h index abc34bd4bf..fd6b5321e6 100644 --- a/modules/gdscript/tests/test_completion.h +++ b/modules/gdscript/tests/test_completion.h @@ -128,19 +128,23 @@ static void test_directory(const String &p_dir) { EditorSettings::get_singleton()->set_setting("text_editor/completion/use_single_quotes", conf.get_value("input", "use_single_quotes", false)); List<Dictionary> include; - to_dict_list(conf.get_value("result", "include", Array()), include); + to_dict_list(conf.get_value("output", "include", Array()), include); List<Dictionary> exclude; - to_dict_list(conf.get_value("result", "exclude", Array()), exclude); + to_dict_list(conf.get_value("output", "exclude", Array()), exclude); List<ScriptLanguage::CodeCompletionOption> options; String call_hint; bool forced; Node *owner = nullptr; - if (dir->file_exists(next.get_basename() + ".tscn")) { - String project_path = "res://completion"; - Ref<PackedScene> scene = ResourceLoader::load(project_path.path_join(next.get_basename() + ".tscn"), "PackedScene"); + if (conf.has_section_key("input", "scene")) { + Ref<PackedScene> scene = ResourceLoader::load(conf.get_value("input", "scene"), "PackedScene"); + if (scene.is_valid()) { + owner = scene->instantiate(); + } + } else if (dir->file_exists(next.get_basename() + ".tscn")) { + Ref<PackedScene> scene = ResourceLoader::load(path.path_join(next.get_basename() + ".tscn"), "PackedScene"); if (scene.is_valid()) { owner = scene->instantiate(); } @@ -169,8 +173,8 @@ static void test_directory(const String &p_dir) { CHECK_MESSAGE(contains_excluded.is_empty(), "Autocompletion suggests illegal option '", contains_excluded, "' for '", path.path_join(next), "'."); CHECK(include.is_empty()); - String expected_call_hint = conf.get_value("result", "call_hint", call_hint); - bool expected_forced = conf.get_value("result", "forced", forced); + String expected_call_hint = conf.get_value("output", "call_hint", call_hint); + bool expected_forced = conf.get_value("output", "forced", forced); CHECK(expected_call_hint == call_hint); CHECK(expected_forced == forced); diff --git a/modules/gltf/doc_classes/GLTFAccessor.xml b/modules/gltf/doc_classes/GLTFAccessor.xml index f678a11319..ba7323b7cd 100644 --- a/modules/gltf/doc_classes/GLTFAccessor.xml +++ b/modules/gltf/doc_classes/GLTFAccessor.xml @@ -1,14 +1,19 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GLTFAccessor" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> <brief_description> + Represents a GLTF accessor. </brief_description> <description> + GLTFAccessor is a data structure representing GLTF a [code]accessor[/code] that would be found in the [code]"accessors"[/code] array. A buffer is a blob of binary data. A buffer view is a slice of a buffer. An accessor is a typed interpretation of the data in a buffer view. + Most custom data stored in GLTF does not need accessors, only buffer views (see [GLTFBufferView]). Accessors are for more advanced use cases such as interleaved mesh data encoded for the GPU. </description> <tutorials> + <link title="Buffers, BufferViews, and Accessors in Khronos glTF specification">https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_005_BuffersBufferViewsAccessors.md</link> <link title="Runtime file loading and saving">$DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html</link> </tutorials> <members> <member name="buffer_view" type="int" setter="set_buffer_view" getter="get_buffer_view" default="-1"> + The index of the buffer view this accessor is referencing. If [code]-1[/code], this accessor is not referencing any buffer view. </member> <member name="byte_offset" type="int" setter="set_byte_offset" getter="get_byte_offset" default="0"> </member> diff --git a/modules/gltf/doc_classes/GLTFBufferView.xml b/modules/gltf/doc_classes/GLTFBufferView.xml index d0f76a9af3..11d58bda72 100644 --- a/modules/gltf/doc_classes/GLTFBufferView.xml +++ b/modules/gltf/doc_classes/GLTFBufferView.xml @@ -1,22 +1,40 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GLTFBufferView" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> <brief_description> + Represents a GLTF buffer view. </brief_description> <description> + GLTFBufferView is a data structure representing GLTF a [code]bufferView[/code] that would be found in the [code]"bufferViews"[/code] array. A buffer is a blob of binary data. A buffer view is a slice of a buffer that can be used to identify and extract data from the buffer. + Most custom uses of buffers only need to use the [member buffer], [member byte_length], and [member byte_offset]. The [member byte_stride] and [member indices] properties are for more advanced use cases such as interleaved mesh data encoded for the GPU. </description> <tutorials> + <link title="Buffers, BufferViews, and Accessors in Khronos glTF specification">https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_005_BuffersBufferViewsAccessors.md</link> <link title="Runtime file loading and saving">$DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html</link> </tutorials> + <methods> + <method name="load_buffer_view_data" qualifiers="const"> + <return type="PackedByteArray" /> + <param index="0" name="state" type="GLTFState" /> + <description> + Loads the buffer view data from the buffer referenced by this buffer view in the given [GLTFState]. Interleaved data with a byte stride is not yet supported by this method. The data is returned as a [PackedByteArray]. + </description> + </method> + </methods> <members> <member name="buffer" type="int" setter="set_buffer" getter="get_buffer" default="-1"> + The index of the buffer this buffer view is referencing. If [code]-1[/code], this buffer view is not referencing any buffer. </member> <member name="byte_length" type="int" setter="set_byte_length" getter="get_byte_length" default="0"> + The length, in bytes, of this buffer view. If [code]0[/code], this buffer view is empty. </member> <member name="byte_offset" type="int" setter="set_byte_offset" getter="get_byte_offset" default="0"> + The offset, in bytes, from the start of the buffer to the start of this buffer view. </member> <member name="byte_stride" type="int" setter="set_byte_stride" getter="get_byte_stride" default="-1"> + The stride, in bytes, between interleaved data. If [code]-1[/code], this buffer view is not interleaved. </member> <member name="indices" type="bool" setter="set_indices" getter="get_indices" default="false"> + True if the GLTFBufferView's OpenGL GPU buffer type is an [code]ELEMENT_ARRAY_BUFFER[/code] used for vertex indices (integer constant [code]34963[/code]). False if the buffer type is [code]ARRAY_BUFFER[/code] used for vertex attributes (integer constant [code]34962[/code]) or when any other value. See [url=https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_005_BuffersBufferViewsAccessors.md]Buffers, BufferViews, and Accessors[/url] for possible values. This property is set but never used, setting this property will do nothing. </member> </members> </class> diff --git a/modules/gltf/doc_classes/GLTFDocumentExtension.xml b/modules/gltf/doc_classes/GLTFDocumentExtension.xml index aaa55e772a..0eabcb5022 100644 --- a/modules/gltf/doc_classes/GLTFDocumentExtension.xml +++ b/modules/gltf/doc_classes/GLTFDocumentExtension.xml @@ -30,7 +30,7 @@ <param index="3" name="node" type="Node" /> <description> Part of the export process. This method is run after [method _get_saveable_image_formats] and before [method _export_post]. If this [GLTFDocumentExtension] is used for exporting images, this runs after [method _serialize_texture_json]. - This method can be used to modify the final JSON of each node. + This method can be used to modify the final JSON of each node. Data should be primarily stored in [param gltf_node] prior to serializing the JSON, but the original Godot [param node] is also provided if available. The node may be null if not available, such as when exporting GLTF data not generated from a Godot scene. </description> </method> <method name="_export_post" qualifiers="virtual"> @@ -114,7 +114,7 @@ <param index="0" name="state" type="GLTFState" /> <description> Part of the import process. This method is run after [method _parse_node_extensions] and before [method _generate_scene_node]. - This method can be used to modify any of the data imported so far, including any scene nodes, before running the final per-node import step. + This method can be used to modify any of the data imported so far after parsing, before generating the nodes and then running the final per-node import step. </description> </method> <method name="_import_preflight" qualifiers="virtual"> diff --git a/modules/gltf/doc_classes/GLTFState.xml b/modules/gltf/doc_classes/GLTFState.xml index e256041737..100750f400 100644 --- a/modules/gltf/doc_classes/GLTFState.xml +++ b/modules/gltf/doc_classes/GLTFState.xml @@ -20,6 +20,14 @@ Appends an extension to the list of extensions used by this GLTF file during serialization. If [param required] is true, the extension will also be added to the list of required extensions. Do not run this in [method GLTFDocumentExtension._export_post], as that stage is too late to add extensions. The final list is sorted alphabetically. </description> </method> + <method name="append_data_to_buffers"> + <return type="int" /> + <param index="0" name="data" type="PackedByteArray" /> + <param index="1" name="deduplication" type="bool" /> + <description> + Appends the given byte array data to the buffers and creates a [GLTFBufferView] for it. The index of the destination [GLTFBufferView] is returned. If [param deduplication] is true, the buffers will first be searched for duplicate data, otherwise new bytes will always be appended. + </description> + </method> <method name="get_accessors"> <return type="GLTFAccessor[]" /> <description> diff --git a/modules/gltf/editor/editor_scene_exporter_gltf_plugin.cpp b/modules/gltf/editor/editor_scene_exporter_gltf_plugin.cpp index 56e4bfbb32..fee8156375 100644 --- a/modules/gltf/editor/editor_scene_exporter_gltf_plugin.cpp +++ b/modules/gltf/editor/editor_scene_exporter_gltf_plugin.cpp @@ -37,9 +37,9 @@ #include "editor/editor_file_system.h" #include "editor/editor_inspector.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/gui/editor_file_dialog.h" #include "editor/import/3d/scene_import_settings.h" +#include "editor/themes/editor_scale.h" String SceneExporterGLTFPlugin::get_name() const { return "ConvertGLTF2"; diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp index 24dab16b90..4636782063 100644 --- a/modules/gltf/editor/editor_scene_importer_blend.cpp +++ b/modules/gltf/editor/editor_scene_importer_blend.cpp @@ -38,10 +38,10 @@ #include "core/config/project_settings.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" #include "main/main.h" #include "scene/gui/line_edit.h" diff --git a/modules/gltf/extensions/gltf_document_extension.cpp b/modules/gltf/extensions/gltf_document_extension.cpp index 582bcf466b..9fdd6034a9 100644 --- a/modules/gltf/extensions/gltf_document_extension.cpp +++ b/modules/gltf/extensions/gltf_document_extension.cpp @@ -185,7 +185,6 @@ Error GLTFDocumentExtension::serialize_texture_json(Ref<GLTFState> p_state, Dict Error GLTFDocumentExtension::export_node(Ref<GLTFState> p_state, Ref<GLTFNode> p_gltf_node, Dictionary &r_dict, Node *p_node) { ERR_FAIL_NULL_V(p_state, ERR_INVALID_PARAMETER); ERR_FAIL_NULL_V(p_gltf_node, ERR_INVALID_PARAMETER); - ERR_FAIL_NULL_V(p_node, ERR_INVALID_PARAMETER); Error err = OK; GDVIRTUAL_CALL(_export_node, p_state, p_gltf_node, r_dict, p_node, err); return err; diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 8a60df85cf..c840889f5e 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -405,6 +405,7 @@ static Vector<real_t> _xform_to_array(const Transform3D p_transform) { Error GLTFDocument::_serialize_nodes(Ref<GLTFState> p_state) { Array nodes; + const int scene_node_count = p_state->scene_nodes.size(); for (int i = 0; i < p_state->nodes.size(); i++) { Dictionary node; Ref<GLTFNode> gltf_node = p_state->nodes[i]; @@ -452,10 +453,13 @@ Error GLTFDocument::_serialize_nodes(Ref<GLTFState> p_state) { node["children"] = children; } + Node *scene_node = nullptr; + if (i < scene_node_count) { + scene_node = p_state->scene_nodes[i]; + } for (Ref<GLTFDocumentExtension> ext : document_extensions) { ERR_CONTINUE(ext.is_null()); - ERR_CONTINUE(!p_state->scene_nodes.find(i)); - Error err = ext->export_node(p_state, gltf_node, node, p_state->scene_nodes[i]); + Error err = ext->export_node(p_state, gltf_node, node, scene_node); ERR_CONTINUE(err != OK); } @@ -7471,11 +7475,13 @@ Node *GLTFDocument::generate_scene(Ref<GLTFState> p_state, float p_bake_fps, boo ERR_CONTINUE(!E.value); for (Ref<GLTFDocumentExtension> ext : document_extensions) { ERR_CONTINUE(ext.is_null()); - ERR_CONTINUE(!p_state->json.has("nodes")); - Array nodes = p_state->json["nodes"]; - ERR_CONTINUE(E.key >= nodes.size()); - ERR_CONTINUE(E.key < 0); - Dictionary node_json = nodes[E.key]; + Dictionary node_json; + if (p_state->json.has("nodes")) { + Array nodes = p_state->json["nodes"]; + if (0 <= E.key && E.key < nodes.size()) { + node_json = nodes[E.key]; + } + } Ref<GLTFNode> gltf_node = p_state->nodes[E.key]; err = ext->import_node(p_state, gltf_node, node_json, E.value); ERR_CONTINUE(err != OK); diff --git a/modules/gltf/gltf_state.cpp b/modules/gltf/gltf_state.cpp index 766fe41257..0c47d5777c 100644 --- a/modules/gltf/gltf_state.cpp +++ b/modules/gltf/gltf_state.cpp @@ -34,6 +34,8 @@ void GLTFState::_bind_methods() { ClassDB::bind_method(D_METHOD("add_used_extension", "extension_name", "required"), &GLTFState::add_used_extension); + ClassDB::bind_method(D_METHOD("append_data_to_buffers", "data", "deduplication"), &GLTFState::append_data_to_buffers); + ClassDB::bind_method(D_METHOD("get_json"), &GLTFState::get_json); ClassDB::bind_method(D_METHOD("set_json", "json"), &GLTFState::set_json); ClassDB::bind_method(D_METHOD("get_major_version"), &GLTFState::get_major_version); @@ -399,3 +401,29 @@ Variant GLTFState::get_additional_data(const StringName &p_extension_name) { void GLTFState::set_additional_data(const StringName &p_extension_name, Variant p_additional_data) { additional_data[p_extension_name] = p_additional_data; } + +GLTFBufferViewIndex GLTFState::append_data_to_buffers(const Vector<uint8_t> &p_data, const bool p_deduplication = false) { + if (p_deduplication) { + for (int i = 0; i < buffer_views.size(); i++) { + Ref<GLTFBufferView> buffer_view = buffer_views[i]; + Vector<uint8_t> buffer_view_data = buffer_view->load_buffer_view_data(this); + if (buffer_view_data == p_data) { + return i; + } + } + } + // Append the given data to a buffer and create a buffer view for it. + if (unlikely(buffers.is_empty())) { + buffers.push_back(Vector<uint8_t>()); + } + Vector<uint8_t> &destination_buffer = buffers.write[0]; + Ref<GLTFBufferView> buffer_view; + buffer_view.instantiate(); + buffer_view->set_buffer(0); + buffer_view->set_byte_offset(destination_buffer.size()); + buffer_view->set_byte_length(p_data.size()); + destination_buffer.append_array(p_data); + const int new_index = buffer_views.size(); + buffer_views.push_back(buffer_view); + return new_index; +} diff --git a/modules/gltf/gltf_state.h b/modules/gltf/gltf_state.h index 1ed8ce3629..3edf9a722f 100644 --- a/modules/gltf/gltf_state.h +++ b/modules/gltf/gltf_state.h @@ -105,6 +105,7 @@ protected: public: void add_used_extension(const String &p_extension, bool p_required = false); + GLTFBufferViewIndex append_data_to_buffers(const Vector<uint8_t> &p_data, const bool p_deduplication); enum GLTFHandleBinary { HANDLE_BINARY_DISCARD_TEXTURES = 0, diff --git a/modules/gltf/register_types.cpp b/modules/gltf/register_types.cpp index 0bf02cf890..94c9d66f78 100644 --- a/modules/gltf/register_types.cpp +++ b/modules/gltf/register_types.cpp @@ -118,6 +118,7 @@ void initialize_gltf_module(ModuleInitializationLevel p_level) { GDREGISTER_CLASS(GLTFTexture); GDREGISTER_CLASS(GLTFTextureSampler); // Register GLTFDocumentExtension classes with GLTFDocument. + // Ensure physics is first in this list so that physics nodes are created before other nodes. GLTF_REGISTER_DOCUMENT_EXTENSION(GLTFDocumentExtensionPhysics); GLTF_REGISTER_DOCUMENT_EXTENSION(GLTFDocumentExtensionTextureKTX); GLTF_REGISTER_DOCUMENT_EXTENSION(GLTFDocumentExtensionTextureWebP); diff --git a/modules/gltf/structures/gltf_buffer_view.cpp b/modules/gltf/structures/gltf_buffer_view.cpp index 7678f23f57..d40ed69915 100644 --- a/modules/gltf/structures/gltf_buffer_view.cpp +++ b/modules/gltf/structures/gltf_buffer_view.cpp @@ -30,7 +30,11 @@ #include "gltf_buffer_view.h" +#include "../gltf_state.h" + void GLTFBufferView::_bind_methods() { + ClassDB::bind_method(D_METHOD("load_buffer_view_data", "state"), &GLTFBufferView::load_buffer_view_data); + ClassDB::bind_method(D_METHOD("get_buffer"), &GLTFBufferView::get_buffer); ClassDB::bind_method(D_METHOD("set_buffer", "buffer"), &GLTFBufferView::set_buffer); ClassDB::bind_method(D_METHOD("get_byte_offset"), &GLTFBufferView::get_byte_offset); @@ -88,3 +92,12 @@ bool GLTFBufferView::get_indices() { void GLTFBufferView::set_indices(bool p_indices) { indices = p_indices; } + +Vector<uint8_t> GLTFBufferView::load_buffer_view_data(const Ref<GLTFState> p_state) const { + ERR_FAIL_COND_V_MSG(byte_stride > 0, Vector<uint8_t>(), "Buffer views with byte stride are not yet supported by this method."); + const TypedArray<Vector<uint8_t>> &buffers = p_state->get_buffers(); + ERR_FAIL_INDEX_V(buffer, buffers.size(), Vector<uint8_t>()); + const PackedByteArray &buffer_data = buffers[buffer]; + const int64_t byte_end = byte_offset + byte_length; + return buffer_data.slice(byte_offset, byte_end); +} diff --git a/modules/gltf/structures/gltf_buffer_view.h b/modules/gltf/structures/gltf_buffer_view.h index 6d138dbf11..e4b7168130 100644 --- a/modules/gltf/structures/gltf_buffer_view.h +++ b/modules/gltf/structures/gltf_buffer_view.h @@ -64,7 +64,8 @@ public: bool get_indices(); void set_indices(bool p_indices); - // matrices need to be transformed to this + + Vector<uint8_t> load_buffer_view_data(const Ref<GLTFState> p_state) const; }; #endif // GLTF_BUFFER_VIEW_H diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp index 225138dfb3..b8902694c9 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.cpp +++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp @@ -36,11 +36,11 @@ #include "core/input/input.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/plugins/node_3d_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/3d/camera_3d.h" #include "scene/gui/dialogs.h" #include "scene/gui/label.h" diff --git a/modules/minimp3/audio_stream_mp3.cpp b/modules/minimp3/audio_stream_mp3.cpp index 4efa4d329e..a46a1c93b5 100644 --- a/modules/minimp3/audio_stream_mp3.cpp +++ b/modules/minimp3/audio_stream_mp3.cpp @@ -46,7 +46,9 @@ int AudioStreamPlaybackMP3::_mix_internal(AudioFrame *p_buffer, int p_frames) { int frames_mixed_this_step = p_frames; int beat_length_frames = -1; - bool beat_loop = mp3_stream->has_loop() && mp3_stream->get_bpm() > 0 && mp3_stream->get_beat_count() > 0; + bool use_loop = looping_override ? looping : mp3_stream->loop; + + bool beat_loop = use_loop && mp3_stream->get_bpm() > 0 && mp3_stream->get_beat_count() > 0; if (beat_loop) { beat_length_frames = mp3_stream->get_beat_count() * mp3_stream->sample_rate * 60 / mp3_stream->get_bpm(); } @@ -82,7 +84,7 @@ int AudioStreamPlaybackMP3::_mix_internal(AudioFrame *p_buffer, int p_frames) { else { //EOF - if (mp3_stream->loop) { + if (use_loop) { seek(mp3_stream->loop_offset); loops++; } else { @@ -143,6 +145,25 @@ void AudioStreamPlaybackMP3::tag_used_streams() { mp3_stream->tag_used(get_playback_position()); } +void AudioStreamPlaybackMP3::set_parameter(const StringName &p_name, const Variant &p_value) { + if (p_name == SNAME("looping")) { + if (p_value == Variant()) { + looping_override = false; + looping = false; + } else { + looping_override = true; + looping = p_value; + } + } +} + +Variant AudioStreamPlaybackMP3::get_parameter(const StringName &p_name) const { + if (looping_override && p_name == SNAME("looping")) { + return looping; + } + return Variant(); +} + AudioStreamPlaybackMP3::~AudioStreamPlaybackMP3() { if (mp3d) { mp3dec_ex_close(mp3d); @@ -232,6 +253,10 @@ bool AudioStreamMP3::is_monophonic() const { return false; } +void AudioStreamMP3::get_parameter_list(List<Parameter> *r_parameters) { + r_parameters->push_back(Parameter(PropertyInfo(Variant::BOOL, "looping", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_CHECKABLE), Variant())); +} + void AudioStreamMP3::set_bpm(double p_bpm) { ERR_FAIL_COND(p_bpm < 0); bpm = p_bpm; diff --git a/modules/minimp3/audio_stream_mp3.h b/modules/minimp3/audio_stream_mp3.h index 30760703e3..7d85e0a321 100644 --- a/modules/minimp3/audio_stream_mp3.h +++ b/modules/minimp3/audio_stream_mp3.h @@ -47,6 +47,8 @@ class AudioStreamPlaybackMP3 : public AudioStreamPlaybackResampled { AudioFrame loop_fade[FADE_SIZE]; int loop_fade_remaining = FADE_SIZE; + bool looping_override = false; + bool looping = false; mp3dec_ex_t *mp3d = nullptr; uint32_t frames_mixed = 0; bool active = false; @@ -72,6 +74,9 @@ public: virtual void tag_used_streams() override; + virtual void set_parameter(const StringName &p_name, const Variant &p_value) override; + virtual Variant get_parameter(const StringName &p_name) const override; + AudioStreamPlaybackMP3() {} ~AudioStreamPlaybackMP3(); }; @@ -126,6 +131,8 @@ public: virtual bool is_monophonic() const override; + virtual void get_parameter_list(List<Parameter> *r_parameters) override; + AudioStreamMP3(); virtual ~AudioStreamMP3(); }; diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index ac6977504a..ef24dc35ca 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -720,11 +720,22 @@ void CSharpLanguage::reload_all_scripts() { #endif } -void CSharpLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) { - (void)p_script; // UNUSED - +void CSharpLanguage::reload_scripts(const Array &p_scripts, bool p_soft_reload) { CRASH_COND(!Engine::get_singleton()->is_editor_hint()); + bool has_csharp_script = false; + for (int i = 0; i < p_scripts.size(); ++i) { + Ref<CSharpScript> cs_script = p_scripts[i]; + if (cs_script.is_valid()) { + has_csharp_script = true; + break; + } + } + + if (!has_csharp_script) { + return; + } + #ifdef TOOLS_ENABLED get_godotsharp_editor()->get_node(NodePath("HotReloadAssemblyWatcher"))->call("RestartTimer"); #endif @@ -736,6 +747,12 @@ void CSharpLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft #endif } +void CSharpLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) { + Array scripts; + scripts.push_back(p_script); + reload_scripts(scripts, p_soft_reload); +} + #ifdef GD_MONO_HOT_RELOAD bool CSharpLanguage::is_assembly_reloading_needed() { ERR_FAIL_NULL_V(gdmono, false); @@ -1074,7 +1091,7 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { } // The script instance could not be instantiated or wasn't in the list of placeholders to replace. obj->set_script(scr); -#if DEBUG_ENABLED +#ifdef DEBUG_ENABLED // If we reached here, the instantiated script must be a placeholder. CRASH_COND(!obj->get_script_instance()->is_placeholder()); #endif @@ -2310,7 +2327,7 @@ void CSharpScript::reload_registered_script(Ref<CSharpScript> p_script) { p_script->_update_exports(); -#if TOOLS_ENABLED +#ifdef TOOLS_ENABLED // If the EditorFileSystem singleton is available, update the file; // otherwise, the file will be updated when the singleton becomes available. EditorFileSystem *efs = EditorFileSystem::get_singleton(); @@ -2666,7 +2683,7 @@ Error CSharpScript::reload(bool p_keep_state) { _update_exports(); -#if TOOLS_ENABLED +#ifdef TOOLS_ENABLED // If the EditorFileSystem singleton is available, update the file; // otherwise, the file will be updated when the singleton becomes available. EditorFileSystem *efs = EditorFileSystem::get_singleton(); diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 41e8d63be1..310cb81929 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -478,6 +478,7 @@ public: /* TODO? */ void get_public_annotations(List<MethodInfo> *p_annotations) const override {} void reload_all_scripts() override; + void reload_scripts(const Array &p_scripts, bool p_soft_reload) override; void reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) override; /* LOADER FUNCTIONS */ diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk.sln b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk.sln index 03a7dc453c..9674626183 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk.sln +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk.sln @@ -6,6 +6,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Godot.SourceGenerators", "G EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Godot.SourceGenerators.Sample", "Godot.SourceGenerators.Sample\Godot.SourceGenerators.Sample.csproj", "{7297A614-8DF5-43DE-9EAD-99671B26BD1F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Godot.SourceGenerators.Tests", "Godot.SourceGenerators.Tests\Godot.SourceGenerators.Tests.csproj", "{07E6D201-35C9-4463-9B29-D16621EA733D}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GodotSharp", "..\..\glue\GodotSharp\GodotSharp\GodotSharp.csproj", "{AEBF0036-DA76-4341-B651-A3F2856AB2FA}" EndProject Global @@ -26,6 +28,10 @@ Global {7297A614-8DF5-43DE-9EAD-99671B26BD1F}.Debug|Any CPU.Build.0 = Debug|Any CPU {7297A614-8DF5-43DE-9EAD-99671B26BD1F}.Release|Any CPU.ActiveCfg = Release|Any CPU {7297A614-8DF5-43DE-9EAD-99671B26BD1F}.Release|Any CPU.Build.0 = Release|Any CPU + {07E6D201-35C9-4463-9B29-D16621EA733D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {07E6D201-35C9-4463-9B29-D16621EA733D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {07E6D201-35C9-4463-9B29-D16621EA733D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {07E6D201-35C9-4463-9B29-D16621EA733D}.Release|Any CPU.Build.0 = Release|Any CPU {AEBF0036-DA76-4341-B651-A3F2856AB2FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AEBF0036-DA76-4341-B651-A3F2856AB2FA}.Debug|Any CPU.Build.0 = Debug|Any CPU {AEBF0036-DA76-4341-B651-A3F2856AB2FA}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/GlobalClass.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/GlobalClass.cs new file mode 100644 index 0000000000..b9f11908e1 --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/GlobalClass.cs @@ -0,0 +1,14 @@ +namespace Godot.SourceGenerators.Sample; + +[GlobalClass] +public partial class CustomGlobalClass : GodotObject +{ +} + +// This doesn't works because global classes can't have any generic type parameter. +/* +[GlobalClass] +public partial class CustomGlobalClass<T> : Node +{ +} +*/ diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/Godot.SourceGenerators.Sample.csproj b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/Godot.SourceGenerators.Sample.csproj index 3f569ebac3..d0907c1cd4 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/Godot.SourceGenerators.Sample.csproj +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/Godot.SourceGenerators.Sample.csproj @@ -2,6 +2,7 @@ <PropertyGroup> <TargetFramework>net6.0</TargetFramework> + <LangVersion>11</LangVersion> </PropertyGroup> <PropertyGroup> diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/MustBeVariantSamples.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/MustBeVariantSamples.cs new file mode 100644 index 0000000000..1e06091e80 --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/MustBeVariantSamples.cs @@ -0,0 +1,164 @@ +using System; +using Godot.Collections; +using Array = Godot.Collections.Array; + +namespace Godot.SourceGenerators.Sample; + +public class MustBeVariantMethods +{ + public void MustBeVariantMethodCalls() + { + Method<bool>(); + Method<char>(); + Method<sbyte>(); + Method<byte>(); + Method<short>(); + Method<ushort>(); + Method<int>(); + Method<uint>(); + Method<long>(); + Method<ulong>(); + Method<float>(); + Method<double>(); + Method<string>(); + Method<Vector2>(); + Method<Vector2I>(); + Method<Rect2>(); + Method<Rect2I>(); + Method<Transform2D>(); + Method<Vector3>(); + Method<Vector3I>(); + Method<Vector4>(); + Method<Vector4I>(); + Method<Basis>(); + Method<Quaternion>(); + Method<Transform3D>(); + Method<Projection>(); + Method<Aabb>(); + Method<Color>(); + Method<Plane>(); + Method<Callable>(); + Method<Signal>(); + Method<GodotObject>(); + Method<StringName>(); + Method<NodePath>(); + Method<Rid>(); + Method<Dictionary>(); + Method<Array>(); + Method<byte[]>(); + Method<int[]>(); + Method<long[]>(); + Method<float[]>(); + Method<double[]>(); + Method<string[]>(); + Method<Vector2[]>(); + Method<Vector3[]>(); + Method<Color[]>(); + Method<GodotObject[]>(); + Method<StringName[]>(); + Method<NodePath[]>(); + Method<Rid[]>(); + + // This call fails because generic type is not Variant-compatible. + //Method<object>(); + } + + public void Method<[MustBeVariant] T>() + { + } + + public void MustBeVariantClasses() + { + new ClassWithGenericVariant<bool>(); + new ClassWithGenericVariant<char>(); + new ClassWithGenericVariant<sbyte>(); + new ClassWithGenericVariant<byte>(); + new ClassWithGenericVariant<short>(); + new ClassWithGenericVariant<ushort>(); + new ClassWithGenericVariant<int>(); + new ClassWithGenericVariant<uint>(); + new ClassWithGenericVariant<long>(); + new ClassWithGenericVariant<ulong>(); + new ClassWithGenericVariant<float>(); + new ClassWithGenericVariant<double>(); + new ClassWithGenericVariant<string>(); + new ClassWithGenericVariant<Vector2>(); + new ClassWithGenericVariant<Vector2I>(); + new ClassWithGenericVariant<Rect2>(); + new ClassWithGenericVariant<Rect2I>(); + new ClassWithGenericVariant<Transform2D>(); + new ClassWithGenericVariant<Vector3>(); + new ClassWithGenericVariant<Vector3I>(); + new ClassWithGenericVariant<Vector4>(); + new ClassWithGenericVariant<Vector4I>(); + new ClassWithGenericVariant<Basis>(); + new ClassWithGenericVariant<Quaternion>(); + new ClassWithGenericVariant<Transform3D>(); + new ClassWithGenericVariant<Projection>(); + new ClassWithGenericVariant<Aabb>(); + new ClassWithGenericVariant<Color>(); + new ClassWithGenericVariant<Plane>(); + new ClassWithGenericVariant<Callable>(); + new ClassWithGenericVariant<Signal>(); + new ClassWithGenericVariant<GodotObject>(); + new ClassWithGenericVariant<StringName>(); + new ClassWithGenericVariant<NodePath>(); + new ClassWithGenericVariant<Rid>(); + new ClassWithGenericVariant<Dictionary>(); + new ClassWithGenericVariant<Array>(); + new ClassWithGenericVariant<byte[]>(); + new ClassWithGenericVariant<int[]>(); + new ClassWithGenericVariant<long[]>(); + new ClassWithGenericVariant<float[]>(); + new ClassWithGenericVariant<double[]>(); + new ClassWithGenericVariant<string[]>(); + new ClassWithGenericVariant<Vector2[]>(); + new ClassWithGenericVariant<Vector3[]>(); + new ClassWithGenericVariant<Color[]>(); + new ClassWithGenericVariant<GodotObject[]>(); + new ClassWithGenericVariant<StringName[]>(); + new ClassWithGenericVariant<NodePath[]>(); + new ClassWithGenericVariant<Rid[]>(); + + // This class fails because generic type is not Variant-compatible. + //new ClassWithGenericVariant<object>(); + } +} + +public class ClassWithGenericVariant<[MustBeVariant] T> +{ +} + +public class MustBeVariantAnnotatedMethods +{ + [GenericTypeAttribute<string>()] + public void MethodWithAttributeOk() + { + } + + // This method definition fails because generic type is not Variant-compatible. + /* + [GenericTypeAttribute<object>()] + public void MethodWithWrongAttribute() + { + } + */ +} + +[GenericTypeAttribute<string>()] +public class ClassVariantAnnotated +{ +} + +// This class definition fails because generic type is not Variant-compatible. +/* +[GenericTypeAttribute<object>()] +public class ClassNonVariantAnnotated +{ +} +*/ + +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] +public class GenericTypeAttribute<[MustBeVariant] T> : Attribute +{ +} diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/CSharpAnalyzerVerifier.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/CSharpAnalyzerVerifier.cs new file mode 100644 index 0000000000..e3e7373b2e --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/CSharpAnalyzerVerifier.cs @@ -0,0 +1,56 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Testing; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Testing; +using Microsoft.CodeAnalysis.Testing.Verifiers; +using Microsoft.CodeAnalysis.Text; + +namespace Godot.SourceGenerators.Tests; + +public static class CSharpAnalyzerVerifier<TAnalyzer> +where TAnalyzer : DiagnosticAnalyzer, new() +{ + public class Test : CSharpAnalyzerTest<TAnalyzer, XUnitVerifier> + { + public Test() + { + ReferenceAssemblies = ReferenceAssemblies.Net.Net60; + + SolutionTransforms.Add((Solution solution, ProjectId projectId) => + { + Project project = + solution.GetProject(projectId)!.AddMetadataReference(Constants.GodotSharpAssembly + .CreateMetadataReference()); + + return project.Solution; + }); + } + } + + public static Task Verify(string sources, params DiagnosticResult[] expected) + { + return MakeVerifier(new string[] { sources }, expected).RunAsync(); + } + + public static Test MakeVerifier(ICollection<string> sources, params DiagnosticResult[] expected) + { + var verifier = new Test(); + + verifier.TestState.AnalyzerConfigFiles.Add(("/.globalconfig", $""" + is_global = true + build_property.GodotProjectDir = {Constants.ExecutingAssemblyPath} + """)); + + verifier.TestState.Sources.AddRange(sources.Select(source => + { + return (source, SourceText.From(File.ReadAllText(Path.Combine(Constants.SourceFolderPath, source)))); + })); + + verifier.ExpectedDiagnostics.AddRange(expected); + return verifier; + } +} diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/GlobalClassAnalyzerTests.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/GlobalClassAnalyzerTests.cs new file mode 100644 index 0000000000..74d6afceb3 --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/GlobalClassAnalyzerTests.cs @@ -0,0 +1,20 @@ +using Xunit; + +namespace Godot.SourceGenerators.Tests; + +public class GlobalClassAnalyzerTests +{ + [Fact] + public async void GlobalClassMustDeriveFromGodotObjectTest() + { + const string GlobalClassGD0401 = "GlobalClass.GD0401.cs"; + await CSharpAnalyzerVerifier<GlobalClassAnalyzer>.Verify(GlobalClassGD0401); + } + + [Fact] + public async void GlobalClassMustNotBeGenericTest() + { + const string GlobalClassGD0402 = "GlobalClass.GD0402.cs"; + await CSharpAnalyzerVerifier<GlobalClassAnalyzer>.Verify(GlobalClassGD0402); + } +} diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/Godot.SourceGenerators.Tests.csproj b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/Godot.SourceGenerators.Tests.csproj index e39c14f049..13e54a543f 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/Godot.SourceGenerators.Tests.csproj +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/Godot.SourceGenerators.Tests.csproj @@ -17,6 +17,8 @@ <ItemGroup> <PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" Version="1.1.1" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" /> + <PackageReference Include="Microsoft.CodeAnalysis.Testing.Verifiers.XUnit" Version="1.1.1" /> + <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.1" /> <PackageReference Include="xunit" Version="2.4.2" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/MustBeVariantAnalyzerTests.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/MustBeVariantAnalyzerTests.cs new file mode 100644 index 0000000000..62c602efbb --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/MustBeVariantAnalyzerTests.cs @@ -0,0 +1,20 @@ +using Xunit; + +namespace Godot.SourceGenerators.Tests; + +public class MustBeVariantAnalyzerTests +{ + [Fact] + public async void GenericTypeArgumentMustBeVariantTest() + { + const string MustBeVariantGD0301 = "MustBeVariant.GD0301.cs"; + await CSharpAnalyzerVerifier<MustBeVariantAnalyzer>.Verify(MustBeVariantGD0301); + } + + [Fact] + public async void GenericTypeParameterMustBeVariantAnnotatedTest() + { + const string MustBeVariantGD0302 = "MustBeVariant.GD0302.cs"; + await CSharpAnalyzerVerifier<MustBeVariantAnalyzer>.Verify(MustBeVariantGD0302); + } +} diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0401.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0401.cs new file mode 100644 index 0000000000..6e6d3a6f39 --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0401.cs @@ -0,0 +1,22 @@ +using Godot; + +// This works because it inherits from GodotObject. +[GlobalClass] +public partial class CustomGlobalClass1 : GodotObject +{ + +} + +// This works because it inherits from an object that inherits from GodotObject +[GlobalClass] +public partial class CustomGlobalClass2 : Node +{ + +} + +// This raises a GD0401 diagnostic error: global classes must inherit from GodotObject +{|GD0401:[GlobalClass] +public partial class CustomGlobalClass3 +{ + +}|} diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0402.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0402.cs new file mode 100644 index 0000000000..1c0a169841 --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0402.cs @@ -0,0 +1,15 @@ +using Godot; + +// This works because it inherits from GodotObject and it doesn't have any generic type parameter. +[GlobalClass] +public partial class CustomGlobalClass : GodotObject +{ + +} + +// This raises a GD0402 diagnostic error: global classes can't have any generic type parameter +{|GD0402:[GlobalClass] +public partial class CustomGlobalClass<T> : GodotObject +{ + +}|} diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/MustBeVariant.GD0301.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/MustBeVariant.GD0301.cs new file mode 100644 index 0000000000..031039cba1 --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/MustBeVariant.GD0301.cs @@ -0,0 +1,71 @@ +using System; +using Godot; +using Godot.Collections; +using Array = Godot.Collections.Array; + +public class MustBeVariantGD0301 +{ + public void MethodCallsError() + { + // This raises a GD0301 diagnostic error: object is not Variant (and Method<T> requires a variant generic type). + Method<{|GD0301:object|}>(); + } + public void MethodCallsOk() + { + // All these calls are valid because they are Variant types. + Method<bool>(); + Method<char>(); + Method<sbyte>(); + Method<byte>(); + Method<short>(); + Method<ushort>(); + Method<int>(); + Method<uint>(); + Method<long>(); + Method<ulong>(); + Method<float>(); + Method<double>(); + Method<string>(); + Method<Vector2>(); + Method<Vector2I>(); + Method<Rect2>(); + Method<Rect2I>(); + Method<Transform2D>(); + Method<Vector3>(); + Method<Vector3I>(); + Method<Vector4>(); + Method<Vector4I>(); + Method<Basis>(); + Method<Quaternion>(); + Method<Transform3D>(); + Method<Projection>(); + Method<Aabb>(); + Method<Color>(); + Method<Plane>(); + Method<Callable>(); + Method<Signal>(); + Method<GodotObject>(); + Method<StringName>(); + Method<NodePath>(); + Method<Rid>(); + Method<Dictionary>(); + Method<Array>(); + Method<byte[]>(); + Method<int[]>(); + Method<long[]>(); + Method<float[]>(); + Method<double[]>(); + Method<string[]>(); + Method<Vector2[]>(); + Method<Vector3[]>(); + Method<Color[]>(); + Method<GodotObject[]>(); + Method<StringName[]>(); + Method<NodePath[]>(); + Method<Rid[]>(); + } + + public void Method<[MustBeVariant] T>() + { + } +} diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/MustBeVariant.GD0302.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/MustBeVariant.GD0302.cs new file mode 100644 index 0000000000..ce182e8c62 --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/MustBeVariant.GD0302.cs @@ -0,0 +1,27 @@ +using Godot; + +public class MustBeVariantGD0302 +{ + public void MethodOk<[MustBeVariant] T>() + { + // T is guaranteed to be a Variant-compatible type because it's annotated with the [MustBeVariant] attribute, so it can be used here. + new ExampleClass<T>(); + Method<T>(); + } + + public void MethodFail<T>() + { + // These two calls raise a GD0302 diagnostic error: T is not valid here because it may not a Variant type and method call and class require it. + new ExampleClass<{|GD0302:T|}>(); + Method<{|GD0302:T|}>(); + } + + public void Method<[MustBeVariant] T>() + { + } +} + +public class ExampleClass<[MustBeVariant] T> +{ + +} diff --git a/modules/mono/editor/editor_internal_calls.cpp b/modules/mono/editor/editor_internal_calls.cpp index fc99f3ceda..05dacd28fb 100644 --- a/modules/mono/editor/editor_internal_calls.cpp +++ b/modules/mono/editor/editor_internal_calls.cpp @@ -43,10 +43,10 @@ #include "editor/debugger/editor_debugger_node.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/gui/editor_run_bar.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "main/main.h" #ifdef UNIX_ENABLED @@ -148,7 +148,7 @@ void godot_icall_Internal_ReloadAssemblies(bool p_soft_reload) { } void godot_icall_Internal_EditorDebuggerNodeReloadScripts() { - EditorDebuggerNode::get_singleton()->reload_scripts(); + EditorDebuggerNode::get_singleton()->reload_all_scripts(); } bool godot_icall_Internal_ScriptEditorEdit(Resource *p_resource, int32_t p_line, int32_t p_col, bool p_grab_focus) { @@ -175,7 +175,7 @@ void godot_icall_Internal_EditorPlugin_AddControlToEditorRunBar(Control *p_contr void godot_icall_Internal_ScriptEditorDebugger_ReloadScripts() { EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); if (ed) { - ed->reload_scripts(); + ed->reload_all_scripts(); } } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs index 57b5b09ebb..63af6ee6e8 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs @@ -98,11 +98,11 @@ namespace Godot Vector3 dstMax = with._position + with._size; return srcMin.X <= dstMin.X && - srcMax.X > dstMax.X && + srcMax.X >= dstMax.X && srcMin.Y <= dstMin.Y && - srcMax.Y > dstMax.Y && + srcMax.Y >= dstMax.Y && srcMin.Z <= dstMin.Z && - srcMax.Z > dstMax.Z; + srcMax.Z >= dstMax.Z; } /// <summary> diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs index 71a35ab809..cf4ac45a9f 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs @@ -123,8 +123,8 @@ namespace Godot public readonly bool Encloses(Rect2 b) { return b._position.X >= _position.X && b._position.Y >= _position.Y && - b._position.X + b._size.X < _position.X + _size.X && - b._position.Y + b._size.Y < _position.Y + _size.Y; + b._position.X + b._size.X <= _position.X + _size.X && + b._position.Y + b._size.Y <= _position.Y + _size.Y; } /// <summary> diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs index ef7e9eacd8..58560df0c5 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs @@ -113,8 +113,8 @@ namespace Godot public readonly bool Encloses(Rect2I b) { return b._position.X >= _position.X && b._position.Y >= _position.Y && - b._position.X + b._size.X < _position.X + _size.X && - b._position.Y + b._size.Y < _position.Y + _size.Y; + b._position.X + b._size.X <= _position.X + _size.X && + b._position.Y + b._size.Y <= _position.Y + _size.Y; } /// <summary> diff --git a/modules/mono/glue/runtime_interop.cpp b/modules/mono/glue/runtime_interop.cpp index 3518507f8c..0089e9c2a2 100644 --- a/modules/mono/glue/runtime_interop.cpp +++ b/modules/mono/glue/runtime_interop.cpp @@ -316,7 +316,7 @@ void godotsharp_internal_new_csharp_script(Ref<CSharpScript> *r_dest) { } void godotsharp_internal_editor_file_system_update_file(const String *p_script_path) { -#if TOOLS_ENABLED +#ifdef TOOLS_ENABLED // If the EditorFileSystem singleton is available, update the file; // otherwise, the file will be updated when the singleton becomes available. EditorFileSystem *efs = EditorFileSystem::get_singleton(); diff --git a/modules/mono/utils/path_utils.cpp b/modules/mono/utils/path_utils.cpp index aa97534675..ee17a668d7 100644 --- a/modules/mono/utils/path_utils.cpp +++ b/modules/mono/utils/path_utils.cpp @@ -152,7 +152,7 @@ String realpath(const String &p_path) { } return result.simplify_path(); -#elif UNIX_ENABLED +#elif defined(UNIX_ENABLED) char *resolved_path = ::realpath(p_path.utf8().get_data(), nullptr); if (!resolved_path) { diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp index a53eefc452..a45e5ffdc0 100644 --- a/modules/multiplayer/editor/editor_network_profiler.cpp +++ b/modules/multiplayer/editor/editor_network_profiler.cpp @@ -31,9 +31,9 @@ #include "editor_network_profiler.h" #include "core/os/os.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/themes/editor_scale.h" void EditorNetworkProfiler::_bind_methods() { ADD_SIGNAL(MethodInfo("enable_profiling", PropertyInfo(Variant::BOOL, "enable"))); diff --git a/modules/multiplayer/editor/replication_editor.cpp b/modules/multiplayer/editor/replication_editor.cpp index eab1f5d51d..2e3df732e2 100644 --- a/modules/multiplayer/editor/replication_editor.cpp +++ b/modules/multiplayer/editor/replication_editor.cpp @@ -33,13 +33,13 @@ #include "../multiplayer_synchronizer.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/scene_tree_editor.h" #include "editor/inspector_dock.h" #include "editor/property_selector.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/dialogs.h" #include "scene/gui/separator.h" #include "scene/gui/tree.h" diff --git a/modules/noise/editor/noise_editor_plugin.cpp b/modules/noise/editor/noise_editor_plugin.cpp index 91e9f7d477..917fa0cd15 100644 --- a/modules/noise/editor/noise_editor_plugin.cpp +++ b/modules/noise/editor/noise_editor_plugin.cpp @@ -36,7 +36,7 @@ #include "../noise_texture_2d.h" #include "editor/editor_inspector.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/gui/texture_rect.h" diff --git a/modules/openxr/doc_classes/OpenXRHand.xml b/modules/openxr/doc_classes/OpenXRHand.xml index eb7decd30d..1c4da83138 100644 --- a/modules/openxr/doc_classes/OpenXRHand.xml +++ b/modules/openxr/doc_classes/OpenXRHand.xml @@ -7,10 +7,14 @@ This node enables OpenXR's hand tracking functionality. The node should be a child node of an [XROrigin3D] node, tracking will update its position to the player's tracked hand Palm joint location (the center of the middle finger's metacarpal bone). This node also updates the skeleton of a properly skinned hand or avatar model. If the skeleton is a hand (one of the hand bones is the root node of the skeleton), then the skeleton will be placed relative to the hand palm location and the hand mesh and skeleton should be children of the OpenXRHand node. If the hand bones are part of a full skeleton, then the root of the hand will keep its location with the assumption that IK is used to position the hand and arm. + By default the skeleton hand bones are repositioned to match the size of the tracked hand. To preserve the modeled bone sizes change [member bone_update] to apply rotation only. </description> <tutorials> </tutorials> <members> + <member name="bone_update" type="int" setter="set_bone_update" getter="get_bone_update" enum="OpenXRHand.BoneUpdate" default="0"> + Specify the type of updates to perform on the bone. + </member> <member name="hand" type="int" setter="set_hand" getter="get_hand" enum="OpenXRHand.Hands" default="0"> Specifies whether this node tracks the left or right hand of the player. </member> @@ -52,5 +56,14 @@ <constant name="SKELETON_RIG_MAX" value="2" enum="SkeletonRig"> Maximum supported hands. </constant> + <constant name="BONE_UPDATE_FULL" value="0" enum="BoneUpdate"> + The skeletons bones are fully updated (both position and rotation) to match the tracked bones. + </constant> + <constant name="BONE_UPDATE_ROTATION_ONLY" value="1" enum="BoneUpdate"> + The skeletons bones are only rotated to align with the tracked bones, preserving bone length. + </constant> + <constant name="BONE_UPDATE_MAX" value="2" enum="BoneUpdate"> + Maximum supported bone update mode. + </constant> </constants> </class> diff --git a/modules/openxr/editor/openxr_action_map_editor.cpp b/modules/openxr/editor/openxr_action_map_editor.cpp index dacf284046..15468a1c67 100644 --- a/modules/openxr/editor/openxr_action_map_editor.cpp +++ b/modules/openxr/editor/openxr_action_map_editor.cpp @@ -32,9 +32,9 @@ #include "core/config/project_settings.h" #include "editor/editor_node.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/gui/editor_file_dialog.h" +#include "editor/themes/editor_scale.h" // TODO implement redo/undo system diff --git a/modules/openxr/extensions/openxr_fb_update_swapchain_extension.cpp b/modules/openxr/extensions/openxr_fb_update_swapchain_extension.cpp index 1289183ea4..c3f692185b 100644 --- a/modules/openxr/extensions/openxr_fb_update_swapchain_extension.cpp +++ b/modules/openxr/extensions/openxr_fb_update_swapchain_extension.cpp @@ -30,7 +30,7 @@ #include "openxr_fb_update_swapchain_extension.h" -// always include this as late as possible +// Always include this as late as possible. #include "../openxr_platform_inc.h" OpenXRFBUpdateSwapchainExtension *OpenXRFBUpdateSwapchainExtension::singleton = nullptr; diff --git a/modules/openxr/extensions/openxr_opengl_extension.h b/modules/openxr/extensions/openxr_opengl_extension.h index 3b0aa0bce9..5f529829a7 100644 --- a/modules/openxr/extensions/openxr_opengl_extension.h +++ b/modules/openxr/extensions/openxr_opengl_extension.h @@ -39,7 +39,7 @@ #include "core/templates/vector.h" -// always include this as late as possible +// Always include this as late as possible. #include "../openxr_platform_inc.h" class OpenXROpenGLExtension : public OpenXRGraphicsExtensionWrapper { @@ -65,9 +65,9 @@ private: #ifdef WIN32 static XrGraphicsBindingOpenGLWin32KHR graphics_binding_gl; -#elif ANDROID_ENABLED +#elif defined(ANDROID_ENABLED) static XrGraphicsBindingOpenGLESAndroidKHR graphics_binding_gl; -#else +#else // Linux/X11 static XrGraphicsBindingOpenGLXlibKHR graphics_binding_gl; #endif diff --git a/modules/openxr/extensions/openxr_vulkan_extension.h b/modules/openxr/extensions/openxr_vulkan_extension.h index f31621fda0..86c0f327dd 100644 --- a/modules/openxr/extensions/openxr_vulkan_extension.h +++ b/modules/openxr/extensions/openxr_vulkan_extension.h @@ -37,7 +37,7 @@ #include "core/templates/vector.h" -// always include this as late as possible +// Always include this as late as possible. #include "../openxr_platform_inc.h" class OpenXRVulkanExtension : public OpenXRGraphicsExtensionWrapper, VulkanHooks { diff --git a/modules/openxr/scene/openxr_hand.cpp b/modules/openxr/scene/openxr_hand.cpp index 8ce33b55c3..2a4104f6ee 100644 --- a/modules/openxr/scene/openxr_hand.cpp +++ b/modules/openxr/scene/openxr_hand.cpp @@ -49,10 +49,14 @@ void OpenXRHand::_bind_methods() { ClassDB::bind_method(D_METHOD("set_skeleton_rig", "skeleton_rig"), &OpenXRHand::set_skeleton_rig); ClassDB::bind_method(D_METHOD("get_skeleton_rig"), &OpenXRHand::get_skeleton_rig); + ClassDB::bind_method(D_METHOD("set_bone_update", "bone_update"), &OpenXRHand::set_bone_update); + ClassDB::bind_method(D_METHOD("get_bone_update"), &OpenXRHand::get_bone_update); + ADD_PROPERTY(PropertyInfo(Variant::INT, "hand", PROPERTY_HINT_ENUM, "Left,Right"), "set_hand", "get_hand"); ADD_PROPERTY(PropertyInfo(Variant::INT, "motion_range", PROPERTY_HINT_ENUM, "Unobstructed,Conform to controller"), "set_motion_range", "get_motion_range"); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "hand_skeleton", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Skeleton3D"), "set_hand_skeleton", "get_hand_skeleton"); ADD_PROPERTY(PropertyInfo(Variant::INT, "skeleton_rig", PROPERTY_HINT_ENUM, "OpenXR,Humanoid"), "set_skeleton_rig", "get_skeleton_rig"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "bone_update", PROPERTY_HINT_ENUM, "Full,Rotation Only"), "set_bone_update", "get_bone_update"); BIND_ENUM_CONSTANT(HAND_LEFT); BIND_ENUM_CONSTANT(HAND_RIGHT); @@ -65,6 +69,10 @@ void OpenXRHand::_bind_methods() { BIND_ENUM_CONSTANT(SKELETON_RIG_OPENXR); BIND_ENUM_CONSTANT(SKELETON_RIG_HUMANOID); BIND_ENUM_CONSTANT(SKELETON_RIG_MAX); + + BIND_ENUM_CONSTANT(BONE_UPDATE_FULL); + BIND_ENUM_CONSTANT(BONE_UPDATE_ROTATION_ONLY); + BIND_ENUM_CONSTANT(BONE_UPDATE_MAX); } OpenXRHand::OpenXRHand() { @@ -134,6 +142,16 @@ OpenXRHand::SkeletonRig OpenXRHand::get_skeleton_rig() const { return skeleton_rig; } +void OpenXRHand::set_bone_update(BoneUpdate p_bone_update) { + ERR_FAIL_INDEX(p_bone_update, BONE_UPDATE_MAX); + + bone_update = p_bone_update; +} + +OpenXRHand::BoneUpdate OpenXRHand::get_bone_update() const { + return bone_update; +} + Skeleton3D *OpenXRHand::get_skeleton() { if (!has_node(hand_skeleton)) { return nullptr; @@ -346,8 +364,12 @@ void OpenXRHand::_update_skeleton() { const Quaternion q = inv_quaternions[parent_joint] * quaternions[joint]; const Vector3 p = inv_quaternions[parent_joint].xform(positions[joint] - positions[parent_joint]); - // and set our pose - skeleton->set_bone_pose_position(joints[joint].bone, p); + // Update the bone position if enabled by update mode. + if (bone_update == BONE_UPDATE_FULL) { + skeleton->set_bone_pose_position(joints[joint].bone, p); + } + + // Always update the bone rotation. skeleton->set_bone_pose_rotation(joints[joint].bone, q); } diff --git a/modules/openxr/scene/openxr_hand.h b/modules/openxr/scene/openxr_hand.h index 14eb893bcc..4c77e7277c 100644 --- a/modules/openxr/scene/openxr_hand.h +++ b/modules/openxr/scene/openxr_hand.h @@ -61,6 +61,12 @@ public: SKELETON_RIG_MAX }; + enum BoneUpdate { + BONE_UPDATE_FULL, + BONE_UPDATE_ROTATION_ONLY, + BONE_UPDATE_MAX + }; + private: struct JointData { int bone = -1; @@ -74,6 +80,7 @@ private: MotionRange motion_range = MOTION_RANGE_UNOBSTRUCTED; NodePath hand_skeleton; SkeletonRig skeleton_rig = SKELETON_RIG_OPENXR; + BoneUpdate bone_update = BONE_UPDATE_FULL; JointData joints[XR_HAND_JOINT_COUNT_EXT]; @@ -101,11 +108,15 @@ public: void set_skeleton_rig(SkeletonRig p_skeleton_rig); SkeletonRig get_skeleton_rig() const; + void set_bone_update(BoneUpdate p_bone_update); + BoneUpdate get_bone_update() const; + void _notification(int p_what); }; VARIANT_ENUM_CAST(OpenXRHand::Hands) VARIANT_ENUM_CAST(OpenXRHand::MotionRange) VARIANT_ENUM_CAST(OpenXRHand::SkeletonRig) +VARIANT_ENUM_CAST(OpenXRHand::BoneUpdate) #endif // OPENXR_HAND_H diff --git a/modules/svg/register_types.cpp b/modules/svg/register_types.cpp index 7b61749f61..82d816d833 100644 --- a/modules/svg/register_types.cpp +++ b/modules/svg/register_types.cpp @@ -34,6 +34,12 @@ #include <thorvg.h> +#ifdef THREADS_ENABLED +#define TVG_THREADS 1 +#else +#define TVG_THREADS 0 +#endif + static Ref<ImageLoaderSVG> image_loader_svg; void initialize_svg_module(ModuleInitializationLevel p_level) { @@ -42,7 +48,8 @@ void initialize_svg_module(ModuleInitializationLevel p_level) { } tvg::CanvasEngine tvgEngine = tvg::CanvasEngine::Sw; - if (tvg::Initializer::init(tvgEngine, 1) != tvg::Result::Success) { + + if (tvg::Initializer::init(tvgEngine, TVG_THREADS) != tvg::Result::Success) { return; } diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index 7ec0b697bf..e6003f35df 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -46,8 +46,9 @@ int AudioStreamPlaybackOggVorbis::_mix_internal(AudioFrame *p_buffer, int p_fram int todo = p_frames; int beat_length_frames = -1; - bool beat_loop = vorbis_stream->has_loop(); - if (beat_loop && vorbis_stream->get_bpm() > 0 && vorbis_stream->get_beat_count() > 0) { + bool use_loop = looping_override ? looping : vorbis_stream->loop; + + if (use_loop && vorbis_stream->get_bpm() > 0 && vorbis_stream->get_beat_count() > 0) { beat_length_frames = vorbis_stream->get_beat_count() * vorbis_data->get_sampling_rate() * 60 / vorbis_stream->get_bpm(); } @@ -99,7 +100,7 @@ int AudioStreamPlaybackOggVorbis::_mix_internal(AudioFrame *p_buffer, int p_fram } else **/ - if (beat_loop && beat_length_frames <= (int)frames_mixed) { + if (use_loop && beat_length_frames <= (int)frames_mixed) { // End of file when doing beat-based looping. <= used instead of == because importer editing if (!have_packets_left && !have_samples_left) { //Nothing remaining, so do nothing. @@ -125,7 +126,7 @@ int AudioStreamPlaybackOggVorbis::_mix_internal(AudioFrame *p_buffer, int p_fram if (!have_packets_left && !have_samples_left) { // Actual end of file! bool is_not_empty = mixed > 0 || vorbis_stream->get_length() > 0; - if (vorbis_stream->loop && is_not_empty) { + if (use_loop && is_not_empty) { //loop seek(vorbis_stream->loop_offset); @@ -257,6 +258,25 @@ void AudioStreamPlaybackOggVorbis::tag_used_streams() { vorbis_stream->tag_used(get_playback_position()); } +void AudioStreamPlaybackOggVorbis::set_parameter(const StringName &p_name, const Variant &p_value) { + if (p_name == SNAME("looping")) { + if (p_value == Variant()) { + looping_override = false; + looping = false; + } else { + looping_override = true; + looping = p_value; + } + } +} + +Variant AudioStreamPlaybackOggVorbis::get_parameter(const StringName &p_name) const { + if (looping_override && p_name == SNAME("looping")) { + return looping; + } + return Variant(); +} + void AudioStreamPlaybackOggVorbis::seek(double p_time) { ERR_FAIL_COND(!ready); ERR_FAIL_COND(vorbis_stream.is_null()); @@ -493,6 +513,10 @@ bool AudioStreamOggVorbis::is_monophonic() const { return false; } +void AudioStreamOggVorbis::get_parameter_list(List<Parameter> *r_parameters) { + r_parameters->push_back(Parameter(PropertyInfo(Variant::BOOL, "looping", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_CHECKABLE), Variant())); +} + void AudioStreamOggVorbis::_bind_methods() { ClassDB::bind_static_method("AudioStreamOggVorbis", D_METHOD("load_from_buffer", "buffer"), &AudioStreamOggVorbis::load_from_buffer); ClassDB::bind_static_method("AudioStreamOggVorbis", D_METHOD("load_from_file", "path"), &AudioStreamOggVorbis::load_from_file); diff --git a/modules/vorbis/audio_stream_ogg_vorbis.h b/modules/vorbis/audio_stream_ogg_vorbis.h index 6abaeaaebd..64a7815b57 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.h +++ b/modules/vorbis/audio_stream_ogg_vorbis.h @@ -44,6 +44,8 @@ class AudioStreamPlaybackOggVorbis : public AudioStreamPlaybackResampled { uint32_t frames_mixed = 0; bool active = false; + bool looping_override = false; + bool looping = false; int loops = 0; enum { @@ -95,6 +97,9 @@ public: virtual void tag_used_streams() override; + virtual void set_parameter(const StringName &p_name, const Variant &p_value) override; + virtual Variant get_parameter(const StringName &p_name) const override; + AudioStreamPlaybackOggVorbis() {} ~AudioStreamPlaybackOggVorbis(); }; @@ -152,6 +157,8 @@ public: virtual bool is_monophonic() const override; + virtual void get_parameter_list(List<Parameter> *r_parameters) override; + AudioStreamOggVorbis(); virtual ~AudioStreamOggVorbis(); }; diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 762e5a8323..653e7bfe6f 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -45,9 +45,9 @@ #include "editor/editor_log.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/import/resource_importer_texture_settings.h" +#include "editor/themes/editor_scale.h" #include "main/splash.gen.h" #include "scene/resources/image_texture.h" @@ -1605,7 +1605,11 @@ void EditorExportPlatformAndroid::load_icon_refs(const Ref<EditorExportPreset> & print_verbose("Loading regular icon from " + path); if (path.is_empty() || ImageLoader::load_image(path, icon) != OK) { print_verbose("- falling back to project icon: " + project_icon_path); - ImageLoader::load_image(project_icon_path, icon); + if (!project_icon_path.is_empty()) { + ImageLoader::load_image(project_icon_path, icon); + } else { + ERR_PRINT("No project icon specified. Please specify one in the Project Settings under Application -> Config -> Icon"); + } } // Adaptive foreground: user selection -> regular icon (user selection -> project icon -> default). diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp index 395cd5d760..d35819c34d 100644 --- a/platform/ios/export/export_plugin.cpp +++ b/platform/ios/export/export_plugin.cpp @@ -38,11 +38,11 @@ #include "core/string/translation.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/export/editor_export.h" #include "editor/import/resource_importer_texture_settings.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/themes/editor_scale.h" #include "modules/modules_enabled.gen.h" // For mono and svg. #ifdef MODULE_SVG_ENABLED @@ -868,7 +868,183 @@ struct ExportLibsData { String dest_dir; }; -void EditorExportPlatformIOS::_add_assets_to_project(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &p_project_data, const Vector<IOSExportAsset> &p_additional_assets) { +void EditorExportPlatformIOS::_check_xcframework_content(const String &p_path, int &r_total_libs, int &r_static_libs, int &r_dylibs, int &r_frameworks) const { + Ref<PList> plist; + plist.instantiate(); + plist->load_file(p_path.path_join("Info.plist")); + Ref<PListNode> root_node = plist->get_root(); + if (root_node.is_null()) { + return; + } + Dictionary root = root_node->get_value(); + if (!root.has("AvailableLibraries")) { + return; + } + Ref<PListNode> libs_node = root["AvailableLibraries"]; + if (libs_node.is_null()) { + return; + } + Array libs = libs_node->get_value(); + r_total_libs = libs.size(); + for (int j = 0; j < libs.size(); j++) { + Ref<PListNode> lib_node = libs[j]; + if (lib_node.is_null()) { + return; + } + Dictionary lib = lib_node->get_value(); + if (lib.has("BinaryPath")) { + Ref<PListNode> path_node = lib["BinaryPath"]; + if (path_node.is_valid()) { + String path = path_node->get_value(); + if (path.ends_with(".a")) { + r_static_libs++; + } + if (path.ends_with(".dylib")) { + r_dylibs++; + } + if (path.ends_with(".framework")) { + r_frameworks++; + } + } + } + } +} + +Error EditorExportPlatformIOS::_convert_to_framework(const String &p_source, const String &p_destination, const String &p_id) const { + print_line("Converting to .framework", p_source, " -> ", p_destination); + + Ref<DirAccess> da = DirAccess::create_for_path(p_source); + if (da.is_null()) { + return ERR_CANT_OPEN; + } + + Ref<DirAccess> filesystem_da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + if (filesystem_da.is_null()) { + return ERR_CANT_OPEN; + } + + if (!filesystem_da->dir_exists(p_destination)) { + Error make_dir_err = filesystem_da->make_dir_recursive(p_destination); + if (make_dir_err) { + return make_dir_err; + } + } + + String asset = p_source.ends_with("/") ? p_source.left(p_source.length() - 1) : p_source; + if (asset.ends_with(".xcframework")) { + Ref<PList> plist; + plist.instantiate(); + plist->load_file(p_source.path_join("Info.plist")); + Ref<PListNode> root_node = plist->get_root(); + if (root_node.is_null()) { + return ERR_CANT_OPEN; + } + Dictionary root = root_node->get_value(); + if (!root.has("AvailableLibraries")) { + return ERR_CANT_OPEN; + } + Ref<PListNode> libs_node = root["AvailableLibraries"]; + if (libs_node.is_null()) { + return ERR_CANT_OPEN; + } + Array libs = libs_node->get_value(); + for (int j = 0; j < libs.size(); j++) { + Ref<PListNode> lib_node = libs[j]; + if (lib_node.is_null()) { + return ERR_CANT_OPEN; + } + Dictionary lib = lib_node->get_value(); + if (lib.has("BinaryPath") && lib.has("LibraryPath") && lib.has("LibraryIdentifier")) { + Ref<PListNode> bpath_node = lib["BinaryPath"]; + Ref<PListNode> lpath_node = lib["LibraryPath"]; + Ref<PListNode> lid_node = lib["LibraryIdentifier"]; + if (bpath_node.is_valid() && lpath_node.is_valid() && lid_node.is_valid()) { + String binary_path = bpath_node->get_value(); + String library_identifier = lid_node->get_value(); + + String file_name = binary_path.get_basename().get_file(); + String framework_name = file_name + ".framework"; + + bpath_node->data_string = framework_name.utf8(); + lpath_node->data_string = framework_name.utf8(); + if (!filesystem_da->dir_exists(p_destination.path_join(library_identifier))) { + filesystem_da->make_dir_recursive(p_destination.path_join(library_identifier)); + } + _convert_to_framework(p_source.path_join(library_identifier).path_join(binary_path), p_destination.path_join(library_identifier).path_join(framework_name), p_id); + if (lib.has("DebugSymbolsPath")) { + Ref<PListNode> dpath_node = lib["DebugSymbolsPath"]; + if (dpath_node.is_valid()) { + String dpath = dpath_node->get_value(); + if (da->dir_exists(p_source.path_join(library_identifier).path_join(dpath))) { + da->copy_dir(p_source.path_join(library_identifier).path_join(dpath), p_destination.path_join(library_identifier).path_join("dSYMs")); + } + } + } + } + } + } + String info_plist = plist->save_text(); + + Ref<FileAccess> f = FileAccess::open(p_destination.path_join("Info.plist"), FileAccess::WRITE); + if (f.is_valid()) { + f->store_string(info_plist); + } + } else { + String file_name = p_destination.get_basename().get_file(); + String framework_name = file_name + ".framework"; + + da->copy(p_source, p_destination.path_join(file_name)); + + // Performing `install_name_tool -id @rpath/{name}.framework/{name} ./{name}` on dylib + { + List<String> install_name_args; + install_name_args.push_back("-id"); + install_name_args.push_back(String("@rpath").path_join(framework_name).path_join(file_name)); + install_name_args.push_back(p_destination.path_join(file_name)); + + OS::get_singleton()->execute("install_name_tool", install_name_args); + } + + // Creating Info.plist + { + String info_plist_format = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" + "<plist version=\"1.0\">\n" + " <dict>\n" + " <key>CFBundleShortVersionString</key>\n" + " <string>1.0</string>\n" + " <key>CFBundleIdentifier</key>\n" + " <string>$id.framework.$name</string>\n" + " <key>CFBundleName</key>\n" + " <string>$name</string>\n" + " <key>CFBundleExecutable</key>\n" + " <string>$name</string>\n" + " <key>DTPlatformName</key>\n" + " <string>iphoneos</string>\n" + " <key>CFBundleInfoDictionaryVersion</key>\n" + " <string>6.0</string>\n" + " <key>CFBundleVersion</key>\n" + " <string>1</string>\n" + " <key>CFBundlePackageType</key>\n" + " <string>FMWK</string>\n" + " <key>MinimumOSVersion</key>\n" + " <string>12.0</string>\n" + " </dict>\n" + "</plist>"; + + String info_plist = info_plist_format.replace("$id", p_id).replace("$name", file_name); + + Ref<FileAccess> f = FileAccess::open(p_destination.path_join("Info.plist"), FileAccess::WRITE); + if (f.is_valid()) { + f->store_string(info_plist); + } + } + } + + return OK; +} + +void EditorExportPlatformIOS::_add_assets_to_project(const String &p_out_dir, const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &p_project_data, const Vector<IOSExportAsset> &p_additional_assets) { // that is just a random number, we just need Godot IDs not to clash with // existing IDs in the project. PbxId current_id = { 0x58938401, 0, 0 }; @@ -893,7 +1069,12 @@ void EditorExportPlatformIOS::_add_assets_to_project(const Ref<EditorExportPrese String type; if (asset.exported_path.ends_with(".framework")) { - if (asset.should_embed) { + int total_libs = 0; + int static_libs = 0; + int dylibs = 0; + int frameworks = 0; + _check_xcframework_content(p_out_dir.path_join(asset.exported_path), total_libs, static_libs, dylibs, frameworks); + if (asset.should_embed && (static_libs != total_libs)) { additional_asset_info_format += "$framework_id = {isa = PBXBuildFile; fileRef = $ref_id; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };\n"; framework_id = (++current_id).str(); pbx_embeded_frameworks += framework_id + ",\n"; @@ -956,12 +1137,12 @@ void EditorExportPlatformIOS::_add_assets_to_project(const Ref<EditorExportPrese } } -Error EditorExportPlatformIOS::_copy_asset(const String &p_out_dir, const String &p_asset, const String *p_custom_file_name, bool p_is_framework, bool p_should_embed, Vector<IOSExportAsset> &r_exported_assets) { +Error EditorExportPlatformIOS::_copy_asset(const Ref<EditorExportPreset> &p_preset, const String &p_out_dir, const String &p_asset, const String *p_custom_file_name, bool p_is_framework, bool p_should_embed, Vector<IOSExportAsset> &r_exported_assets) { String binary_name = p_out_dir.get_file().get_basename(); Ref<DirAccess> da = DirAccess::create_for_path(p_asset); if (da.is_null()) { - ERR_FAIL_V_MSG(ERR_CANT_CREATE, "Can't create directory: " + p_asset + "."); + ERR_FAIL_V_MSG(ERR_CANT_CREATE, "Can't open directory: " + p_asset + "."); } bool file_exists = da->file_exists(p_asset); bool dir_exists = da->dir_exists(p_asset); @@ -975,7 +1156,8 @@ Error EditorExportPlatformIOS::_copy_asset(const String &p_out_dir, const String String destination; String asset_path; - bool create_framework = false; + Ref<DirAccess> filesystem_da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + ERR_FAIL_COND_V_MSG(filesystem_da.is_null(), ERR_CANT_CREATE, "Cannot create DirAccess for path '" + p_out_dir + "'."); if (p_is_framework && asset.ends_with(".dylib")) { // For iOS we need to turn .dylib into .framework @@ -995,10 +1177,23 @@ Error EditorExportPlatformIOS::_copy_asset(const String &p_out_dir, const String asset_path = asset_path.path_join(framework_name); destination_dir = p_out_dir.path_join(asset_path); destination = destination_dir.path_join(file_name); - create_framework = true; - } else if (p_is_framework && (asset.ends_with(".framework") || asset.ends_with(".xcframework"))) { - asset_path = String("dylibs").path_join(base_dir); + // Convert to framework and copy. + Error err = _convert_to_framework(p_asset, destination, p_preset->get("application/bundle_identifier")); + if (err) { + return err; + } + } else if (p_is_framework && asset.ends_with(".xcframework")) { + // For iOS we need to turn .dylib inside .xcframework + // into .framework to be able to send application to AppStore + + int total_libs = 0; + int static_libs = 0; + int dylibs = 0; + int frameworks = 0; + _check_xcframework_content(p_asset, total_libs, static_libs, dylibs, frameworks); + + asset_path = String("dylibs").path_join(base_dir); String file_name; if (!p_custom_file_name) { @@ -1010,8 +1205,29 @@ Error EditorExportPlatformIOS::_copy_asset(const String &p_out_dir, const String asset_path = asset_path.path_join(file_name); destination_dir = p_out_dir.path_join(asset_path); destination = destination_dir; - } else { - asset_path = base_dir; + + if (dylibs > 0) { + // Convert to framework and copy. + Error err = _convert_to_framework(p_asset, destination, p_preset->get("application/bundle_identifier")); + if (err) { + return err; + } + } else { + // Copy as is. + if (!filesystem_da->dir_exists(destination_dir)) { + Error make_dir_err = filesystem_da->make_dir_recursive(destination_dir); + if (make_dir_err) { + return make_dir_err; + } + } + Error err = dir_exists ? da->copy_dir(p_asset, destination) : da->copy(p_asset, destination); + if (err) { + return err; + } + } + } else if (p_is_framework && asset.ends_with(".framework")) { + // Framework. + asset_path = String("dylibs").path_join(base_dir); String file_name; @@ -1021,99 +1237,67 @@ Error EditorExportPlatformIOS::_copy_asset(const String &p_out_dir, const String file_name = *p_custom_file_name; } - destination_dir = p_out_dir.path_join(asset_path); asset_path = asset_path.path_join(file_name); - destination = p_out_dir.path_join(asset_path); - } - - Ref<DirAccess> filesystem_da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - ERR_FAIL_COND_V_MSG(filesystem_da.is_null(), ERR_CANT_CREATE, "Cannot create DirAccess for path '" + p_out_dir + "'."); + destination_dir = p_out_dir.path_join(asset_path); + destination = destination_dir; - if (!filesystem_da->dir_exists(destination_dir)) { - Error make_dir_err = filesystem_da->make_dir_recursive(destination_dir); - if (make_dir_err) { - return make_dir_err; + // Copy as is. + if (!filesystem_da->dir_exists(destination_dir)) { + Error make_dir_err = filesystem_da->make_dir_recursive(destination_dir); + if (make_dir_err) { + return make_dir_err; + } } - } - - Error err = dir_exists ? da->copy_dir(p_asset, destination) : da->copy(p_asset, destination); - if (err) { - return err; - } - if (asset_path.ends_with("/")) { - asset_path = asset_path.left(asset_path.length() - 1); - } - IOSExportAsset exported_asset = { binary_name.path_join(asset_path), p_is_framework, p_should_embed }; - r_exported_assets.push_back(exported_asset); + Error err = dir_exists ? da->copy_dir(p_asset, destination) : da->copy(p_asset, destination); + if (err) { + return err; + } + } else { + // Unknown resource. + asset_path = base_dir; - if (create_framework) { String file_name; if (!p_custom_file_name) { - file_name = p_asset.get_basename().get_file(); + file_name = p_asset.get_file(); } else { file_name = *p_custom_file_name; } - String framework_name = file_name + ".framework"; - - // Performing `install_name_tool -id @rpath/{name}.framework/{name} ./{name}` on dylib - { - List<String> install_name_args; - install_name_args.push_back("-id"); - install_name_args.push_back(String("@rpath").path_join(framework_name).path_join(file_name)); - install_name_args.push_back(destination); - - OS::get_singleton()->execute("install_name_tool", install_name_args); - } - - // Creating Info.plist - { - String info_plist_format = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" - "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" - "<plist version=\"1.0\">\n" - "<dict>\n" - "<key>CFBundleShortVersionString</key>\n" - "<string>1.0</string>\n" - "<key>CFBundleIdentifier</key>\n" - "<string>com.gdextension.framework.$name</string>\n" - "<key>CFBundleName</key>\n" - "<string>$name</string>\n" - "<key>CFBundleExecutable</key>\n" - "<string>$name</string>\n" - "<key>DTPlatformName</key>\n" - "<string>iphoneos</string>\n" - "<key>CFBundleInfoDictionaryVersion</key>\n" - "<string>6.0</string>\n" - "<key>CFBundleVersion</key>\n" - "<string>1</string>\n" - "<key>CFBundlePackageType</key>\n" - "<string>FMWK</string>\n" - "<key>MinimumOSVersion</key>\n" - "<string>10.0</string>\n" - "</dict>\n" - "</plist>"; - - String info_plist = info_plist_format.replace("$name", file_name); + destination_dir = p_out_dir.path_join(asset_path); + asset_path = asset_path.path_join(file_name); + destination = p_out_dir.path_join(asset_path); - Ref<FileAccess> f = FileAccess::open(destination_dir.path_join("Info.plist"), FileAccess::WRITE); - if (f.is_valid()) { - f->store_string(info_plist); + // Copy as is. + if (!filesystem_da->dir_exists(destination_dir)) { + Error make_dir_err = filesystem_da->make_dir_recursive(destination_dir); + if (make_dir_err) { + return make_dir_err; } } + Error err = dir_exists ? da->copy_dir(p_asset, destination) : da->copy(p_asset, destination); + if (err) { + return err; + } } + if (asset_path.ends_with("/")) { + asset_path = asset_path.left(asset_path.length() - 1); + } + IOSExportAsset exported_asset = { binary_name.path_join(asset_path), p_is_framework, p_should_embed }; + r_exported_assets.push_back(exported_asset); + return OK; } -Error EditorExportPlatformIOS::_export_additional_assets(const String &p_out_dir, const Vector<String> &p_assets, bool p_is_framework, bool p_should_embed, Vector<IOSExportAsset> &r_exported_assets) { +Error EditorExportPlatformIOS::_export_additional_assets(const Ref<EditorExportPreset> &p_preset, const String &p_out_dir, const Vector<String> &p_assets, bool p_is_framework, bool p_should_embed, Vector<IOSExportAsset> &r_exported_assets) { for (int f_idx = 0; f_idx < p_assets.size(); ++f_idx) { const String &asset = p_assets[f_idx]; if (asset.begins_with("res://")) { - Error err = _copy_asset(p_out_dir, asset, nullptr, p_is_framework, p_should_embed, r_exported_assets); + Error err = _copy_asset(p_preset, p_out_dir, asset, nullptr, p_is_framework, p_should_embed, r_exported_assets); ERR_FAIL_COND_V(err != OK, err); } else if (ProjectSettings::get_singleton()->localize_path(asset).begins_with("res://")) { - Error err = _copy_asset(p_out_dir, ProjectSettings::get_singleton()->localize_path(asset), nullptr, p_is_framework, p_should_embed, r_exported_assets); + Error err = _copy_asset(p_preset, p_out_dir, ProjectSettings::get_singleton()->localize_path(asset), nullptr, p_is_framework, p_should_embed, r_exported_assets); ERR_FAIL_COND_V(err != OK, err); } else { // either SDK-builtin or already a part of the export template @@ -1125,26 +1309,26 @@ Error EditorExportPlatformIOS::_export_additional_assets(const String &p_out_dir return OK; } -Error EditorExportPlatformIOS::_export_additional_assets(const String &p_out_dir, const Vector<SharedObject> &p_libraries, Vector<IOSExportAsset> &r_exported_assets) { +Error EditorExportPlatformIOS::_export_additional_assets(const Ref<EditorExportPreset> &p_preset, const String &p_out_dir, const Vector<SharedObject> &p_libraries, Vector<IOSExportAsset> &r_exported_assets) { Vector<Ref<EditorExportPlugin>> export_plugins = EditorExport::get_singleton()->get_export_plugins(); for (int i = 0; i < export_plugins.size(); i++) { Vector<String> linked_frameworks = export_plugins[i]->get_ios_frameworks(); - Error err = _export_additional_assets(p_out_dir, linked_frameworks, true, false, r_exported_assets); + Error err = _export_additional_assets(p_preset, p_out_dir, linked_frameworks, true, false, r_exported_assets); ERR_FAIL_COND_V(err, err); Vector<String> embedded_frameworks = export_plugins[i]->get_ios_embedded_frameworks(); - err = _export_additional_assets(p_out_dir, embedded_frameworks, true, true, r_exported_assets); + err = _export_additional_assets(p_preset, p_out_dir, embedded_frameworks, true, true, r_exported_assets); ERR_FAIL_COND_V(err, err); Vector<String> project_static_libs = export_plugins[i]->get_ios_project_static_libs(); for (int j = 0; j < project_static_libs.size(); j++) { project_static_libs.write[j] = project_static_libs[j].get_file(); // Only the file name as it's copied to the project } - err = _export_additional_assets(p_out_dir, project_static_libs, true, false, r_exported_assets); + err = _export_additional_assets(p_preset, p_out_dir, project_static_libs, true, false, r_exported_assets); ERR_FAIL_COND_V(err, err); Vector<String> ios_bundle_files = export_plugins[i]->get_ios_bundle_files(); - err = _export_additional_assets(p_out_dir, ios_bundle_files, false, false, r_exported_assets); + err = _export_additional_assets(p_preset, p_out_dir, ios_bundle_files, false, false, r_exported_assets); ERR_FAIL_COND_V(err, err); } @@ -1152,7 +1336,7 @@ Error EditorExportPlatformIOS::_export_additional_assets(const String &p_out_dir for (int i = 0; i < p_libraries.size(); ++i) { library_paths.push_back(p_libraries[i].path); } - Error err = _export_additional_assets(p_out_dir, library_paths, true, true, r_exported_assets); + Error err = _export_additional_assets(p_preset, p_out_dir, library_paths, true, true, r_exported_assets); ERR_FAIL_COND_V(err, err); return OK; @@ -1197,7 +1381,7 @@ Error EditorExportPlatformIOS::_export_ios_plugins(const Ref<EditorExportPreset> String plugin_binary_result_file = plugin.binary.get_file(); // We shouldn't embed .xcframework that contains static libraries. // Static libraries are not embedded anyway. - err = _copy_asset(dest_dir, plugin_main_binary, &plugin_binary_result_file, true, false, r_exported_assets); + err = _copy_asset(p_preset, dest_dir, plugin_main_binary, &plugin_binary_result_file, true, false, r_exported_assets); ERR_FAIL_COND_V(err != OK, err); // Adding dependencies. @@ -1322,15 +1506,15 @@ Error EditorExportPlatformIOS::_export_ios_plugins(const Ref<EditorExportPreset> // Export files { // Export linked plugin dependency - err = _export_additional_assets(dest_dir, plugin_linked_dependencies, true, false, r_exported_assets); + err = _export_additional_assets(p_preset, dest_dir, plugin_linked_dependencies, true, false, r_exported_assets); ERR_FAIL_COND_V(err != OK, err); // Export embedded plugin dependency - err = _export_additional_assets(dest_dir, plugin_embedded_dependencies, true, true, r_exported_assets); + err = _export_additional_assets(p_preset, dest_dir, plugin_embedded_dependencies, true, true, r_exported_assets); ERR_FAIL_COND_V(err != OK, err); // Export plugin files - err = _export_additional_assets(dest_dir, plugin_files, false, false, r_exported_assets); + err = _export_additional_assets(p_preset, dest_dir, plugin_files, false, false, r_exported_assets); ERR_FAIL_COND_V(err != OK, err); } @@ -1729,8 +1913,8 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres } print_line("Exporting additional assets"); - _export_additional_assets(binary_dir, libraries, assets); - _add_assets_to_project(p_preset, project_file_data, assets); + _export_additional_assets(p_preset, binary_dir, libraries, assets); + _add_assets_to_project(dest_dir, p_preset, project_file_data, assets); String project_file_name = binary_dir + ".xcodeproj/project.pbxproj"; { Ref<FileAccess> f = FileAccess::open(project_file_name, FileAccess::WRITE); diff --git a/platform/ios/export/export_plugin.h b/platform/ios/export/export_plugin.h index 1f926c4d14..edbe566dab 100644 --- a/platform/ios/export/export_plugin.h +++ b/platform/ios/export/export_plugin.h @@ -133,10 +133,13 @@ class EditorExportPlatformIOS : public EditorExportPlatform { Vector<ExportArchitecture> _get_supported_architectures() const; Vector<String> _get_preset_architectures(const Ref<EditorExportPreset> &p_preset) const; - void _add_assets_to_project(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &p_project_data, const Vector<IOSExportAsset> &p_additional_assets); - Error _export_additional_assets(const String &p_out_dir, const Vector<String> &p_assets, bool p_is_framework, bool p_should_embed, Vector<IOSExportAsset> &r_exported_assets); - Error _copy_asset(const String &p_out_dir, const String &p_asset, const String *p_custom_file_name, bool p_is_framework, bool p_should_embed, Vector<IOSExportAsset> &r_exported_assets); - Error _export_additional_assets(const String &p_out_dir, const Vector<SharedObject> &p_libraries, Vector<IOSExportAsset> &r_exported_assets); + void _check_xcframework_content(const String &p_path, int &r_total_libs, int &r_static_libs, int &r_dylibs, int &r_frameworks) const; + Error _convert_to_framework(const String &p_source, const String &p_destination, const String &p_id) const; + + void _add_assets_to_project(const String &p_out_dir, const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &p_project_data, const Vector<IOSExportAsset> &p_additional_assets); + Error _export_additional_assets(const Ref<EditorExportPreset> &p_preset, const String &p_out_dir, const Vector<String> &p_assets, bool p_is_framework, bool p_should_embed, Vector<IOSExportAsset> &r_exported_assets); + Error _copy_asset(const Ref<EditorExportPreset> &p_preset, const String &p_out_dir, const String &p_asset, const String *p_custom_file_name, bool p_is_framework, bool p_should_embed, Vector<IOSExportAsset> &r_exported_assets); + Error _export_additional_assets(const Ref<EditorExportPreset> &p_preset, const String &p_out_dir, const Vector<SharedObject> &p_libraries, Vector<IOSExportAsset> &r_exported_assets); Error _export_ios_plugins(const Ref<EditorExportPreset> &p_preset, IOSConfigData &p_config_data, const String &dest_dir, Vector<IOSExportAsset> &r_exported_assets, bool p_debug); Error _export_project_helper(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags, bool p_simulator, bool p_oneclick); diff --git a/platform/linuxbsd/export/export_plugin.cpp b/platform/linuxbsd/export/export_plugin.cpp index 64efcffae3..773b124c6a 100644 --- a/platform/linuxbsd/export/export_plugin.cpp +++ b/platform/linuxbsd/export/export_plugin.cpp @@ -36,9 +36,9 @@ #include "core/config/project_settings.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/export/editor_export.h" +#include "editor/themes/editor_scale.h" #include "modules/modules_enabled.gen.h" // For svg. #ifdef MODULE_SVG_ENABLED diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index dc2196853d..2fff4ce32c 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -2010,7 +2010,7 @@ void DisplayServerX11::window_set_transient(WindowID p_window, WindowID p_parent // RevertToPointerRoot is used to make sure we don't lose all focus in case // a subwindow and its parent are both destroyed. if (!wd_window.no_focus && !wd_window.is_popup && wd_window.focused) { - if ((xwa.map_state == IsViewable) && !wd_parent.no_focus && !wd_window.is_popup) { + if ((xwa.map_state == IsViewable) && !wd_parent.no_focus && !wd_window.is_popup && _window_focus_check()) { XSetInputFocus(x11_display, wd_parent.x11_window, RevertToPointerRoot, CurrentTime); } } @@ -2891,10 +2891,15 @@ void DisplayServerX11::window_move_to_foreground(WindowID p_window) { XFlush(x11_display); } +DisplayServerX11::WindowID DisplayServerX11::get_focused_window() const { + return last_focused_window; +} + bool DisplayServerX11::window_is_focused(WindowID p_window) const { _THREAD_SAFE_METHOD_ ERR_FAIL_COND_V(!windows.has(p_window), false); + const WindowData &wd = windows[p_window]; return wd.focused; @@ -2945,7 +2950,7 @@ void DisplayServerX11::window_set_ime_active(const bool p_active, WindowID p_win XWindowAttributes xwa; XSync(x11_display, False); XGetWindowAttributes(x11_display, wd.x11_xim_window, &xwa); - if (xwa.map_state == IsViewable) { + if (xwa.map_state == IsViewable && _window_focus_check()) { XSetInputFocus(x11_display, wd.x11_xim_window, RevertToParent, CurrentTime); } XSetICFocus(wd.xic); @@ -4228,6 +4233,22 @@ bool DisplayServerX11::mouse_process_popups() { return closed; } +bool DisplayServerX11::_window_focus_check() { + Window focused_window; + int focus_ret_state; + XGetInputFocus(x11_display, &focused_window, &focus_ret_state); + + bool has_focus = false; + for (const KeyValue<int, DisplayServerX11::WindowData> &wid : windows) { + if (wid.value.x11_window == focused_window) { + has_focus = true; + break; + } + } + + return has_focus; +} + void DisplayServerX11::process_events() { _THREAD_SAFE_METHOD_ @@ -4499,7 +4520,7 @@ void DisplayServerX11::process_events() { // Set focus when menu window is started. // RevertToPointerRoot is used to make sure we don't lose all focus in case // a subwindow and its parent are both destroyed. - if ((xwa.map_state == IsViewable) && !wd.no_focus && !wd.is_popup) { + if ((xwa.map_state == IsViewable) && !wd.no_focus && !wd.is_popup && _window_focus_check()) { XSetInputFocus(x11_display, wd.x11_window, RevertToPointerRoot, CurrentTime); } @@ -4675,7 +4696,7 @@ void DisplayServerX11::process_events() { // Set focus when menu window is re-used. // RevertToPointerRoot is used to make sure we don't lose all focus in case // a subwindow and its parent are both destroyed. - if ((xwa.map_state == IsViewable) && !wd.no_focus && !wd.is_popup) { + if ((xwa.map_state == IsViewable) && !wd.no_focus && !wd.is_popup && _window_focus_check()) { XSetInputFocus(x11_display, wd.x11_window, RevertToPointerRoot, CurrentTime); } diff --git a/platform/linuxbsd/x11/display_server_x11.h b/platform/linuxbsd/x11/display_server_x11.h index ac2c7843f6..3b362e5c22 100644 --- a/platform/linuxbsd/x11/display_server_x11.h +++ b/platform/linuxbsd/x11/display_server_x11.h @@ -354,6 +354,7 @@ class DisplayServerX11 : public DisplayServer { Context context = CONTEXT_ENGINE; WindowID _get_focused_window_or_popup() const; + bool _window_focus_check(); void _send_window_event(const WindowData &wd, WindowEvent p_event); static void _dispatch_input_events(const Ref<InputEvent> &p_event); @@ -491,6 +492,8 @@ public: virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) override; virtual bool window_is_focused(WindowID p_window = MAIN_WINDOW_ID) const override; + virtual WindowID get_focused_window() const override; + virtual bool window_can_draw(WindowID p_window = MAIN_WINDOW_ID) const override; virtual bool can_any_window_draw() const override; diff --git a/platform/macos/detect.py b/platform/macos/detect.py index 12db2690de..bc14d233bb 100644 --- a/platform/macos/detect.py +++ b/platform/macos/detect.py @@ -67,21 +67,30 @@ def get_mvk_sdk_path(): if not os.path.exists(dirname): return "" - ver_file = "0.0.0.0" - ver_num = ver_parse(ver_file) - + ver_num = ver_parse("0.0.0.0") files = os.listdir(dirname) + lib_name_out = dirname for file in files: if os.path.isdir(os.path.join(dirname, file)): ver_comp = ver_parse(file) - lib_name = os.path.join( - os.path.join(dirname, file), "MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/libMoltenVK.a" - ) - if os.path.isfile(lib_name) and ver_comp > ver_num: - ver_num = ver_comp - ver_file = file + if ver_comp > ver_num: + # Try new SDK location. + lib_name = os.path.join( + os.path.join(dirname, file), "macOS/lib/MoltenVK.xcframework/macos-arm64_x86_64/" + ) + if os.path.isfile(os.path.join(lib_name, "libMoltenVK.a")): + ver_num = ver_comp + lib_name_out = lib_name + else: + # Try old SDK location. + lib_name = os.path.join( + os.path.join(dirname, file), "MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/" + ) + if os.path.isfile(os.path.join(lib_name, "libMoltenVK.a")): + ver_num = ver_comp + lib_name_out = lib_name - return os.path.join(os.path.join(dirname, ver_file), "MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/") + return lib_name_out def configure(env: "Environment"): @@ -272,6 +281,12 @@ def configure(env: "Environment"): mvk_list.insert( 0, os.path.join( + os.path.expanduser(env["vulkan_sdk_path"]), "macOS/lib/MoltenVK.xcframework/macos-arm64_x86_64/" + ), + ) + mvk_list.insert( + 0, + os.path.join( os.path.expanduser(env["vulkan_sdk_path"]), "MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/" ), ) diff --git a/platform/macos/display_server_macos.h b/platform/macos/display_server_macos.h index f8fd0f93ef..cc343a6d64 100644 --- a/platform/macos/display_server_macos.h +++ b/platform/macos/display_server_macos.h @@ -428,6 +428,8 @@ public: virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) override; virtual bool window_is_focused(WindowID p_window = MAIN_WINDOW_ID) const override; + virtual WindowID get_focused_window() const override; + virtual bool window_can_draw(WindowID p_window = MAIN_WINDOW_ID) const override; virtual bool can_any_window_draw() const override; diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index bd92b7d472..378688f78a 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -3723,6 +3723,10 @@ bool DisplayServerMacOS::window_is_focused(WindowID p_window) const { return wd.focused; } +DisplayServerMacOS::WindowID DisplayServerMacOS::get_focused_window() const { + return last_focused_window; +} + bool DisplayServerMacOS::window_can_draw(WindowID p_window) const { return windows[p_window].is_visible; } diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index c347082010..7ed78db6f8 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -42,9 +42,9 @@ #include "drivers/png/png_driver_common.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/import/resource_importer_texture_settings.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/image_texture.h" #include "modules/modules_enabled.gen.h" // For svg and regex. diff --git a/platform/web/.eslintrc.html.js b/platform/web/.eslintrc.html.js index 5cb8de360a..8c9a3d83da 100644 --- a/platform/web/.eslintrc.html.js +++ b/platform/web/.eslintrc.html.js @@ -15,5 +15,7 @@ module.exports = { "Godot": true, "Engine": true, "$GODOT_CONFIG": true, + "$GODOT_THREADS_ENABLED": true, + "___GODOT_THREADS_ENABLED___": true, }, }; diff --git a/platform/web/SCsub b/platform/web/SCsub index 1af0642554..3e0cc9ac4a 100644 --- a/platform/web/SCsub +++ b/platform/web/SCsub @@ -13,7 +13,7 @@ if "serve" in COMMAND_LINE_TARGETS or "run" in COMMAND_LINE_TARGETS: except Exception: print("GODOT_WEB_TEST_PORT must be a valid integer") sys.exit(255) - serve(env.Dir("#bin/.web_zip").abspath, port, "run" in COMMAND_LINE_TARGETS) + serve(env.Dir(env.GetTemplateZipPath()).abspath, port, "run" in COMMAND_LINE_TARGETS) sys.exit(0) web_files = [ @@ -95,7 +95,7 @@ engine = [ "js/engine/engine.js", ] externs = [env.File("#platform/web/js/engine/engine.externs.js")] -js_engine = env.CreateEngineFile("#bin/godot${PROGSUFFIX}.engine.js", engine, externs) +js_engine = env.CreateEngineFile("#bin/godot${PROGSUFFIX}.engine.js", engine, externs, env["threads"]) env.Depends(js_engine, externs) wrap_list = [ diff --git a/platform/web/audio_driver_web.cpp b/platform/web/audio_driver_web.cpp index 1298d28ebf..ec3c22bf7c 100644 --- a/platform/web/audio_driver_web.cpp +++ b/platform/web/audio_driver_web.cpp @@ -30,6 +30,8 @@ #include "audio_driver_web.h" +#include "godot_audio.h" + #include "core/config/project_settings.h" #include <emscripten.h> @@ -184,6 +186,8 @@ Error AudioDriverWeb::input_stop() { return OK; } +#ifdef THREADS_ENABLED + /// AudioWorkletNode implementation (threads) void AudioDriverWorklet::_audio_thread_func(void *p_data) { AudioDriverWorklet *driver = static_cast<AudioDriverWorklet *>(p_data); @@ -245,3 +249,51 @@ void AudioDriverWorklet::finish_driver() { quit = true; // Ask thread to quit. thread.wait_to_finish(); } + +#else // No threads. + +/// AudioWorkletNode implementation (no threads) +AudioDriverWorklet *AudioDriverWorklet::singleton = nullptr; + +Error AudioDriverWorklet::create(int &p_buffer_size, int p_channels) { + if (!godot_audio_has_worklet()) { + return ERR_UNAVAILABLE; + } + return (Error)godot_audio_worklet_create(p_channels); +} + +void AudioDriverWorklet::start(float *p_out_buf, int p_out_buf_size, float *p_in_buf, int p_in_buf_size) { + _audio_driver_process(); + godot_audio_worklet_start_no_threads(p_out_buf, p_out_buf_size, &_process_callback, p_in_buf, p_in_buf_size, &_capture_callback); +} + +void AudioDriverWorklet::_process_callback(int p_pos, int p_samples) { + AudioDriverWorklet *driver = AudioDriverWorklet::get_singleton(); + driver->_audio_driver_process(p_pos, p_samples); +} + +void AudioDriverWorklet::_capture_callback(int p_pos, int p_samples) { + AudioDriverWorklet *driver = AudioDriverWorklet::get_singleton(); + driver->_audio_driver_capture(p_pos, p_samples); +} + +/// ScriptProcessorNode implementation +AudioDriverScriptProcessor *AudioDriverScriptProcessor::singleton = nullptr; + +void AudioDriverScriptProcessor::_process_callback() { + AudioDriverScriptProcessor::get_singleton()->_audio_driver_capture(); + AudioDriverScriptProcessor::get_singleton()->_audio_driver_process(); +} + +Error AudioDriverScriptProcessor::create(int &p_buffer_samples, int p_channels) { + if (!godot_audio_has_script_processor()) { + return ERR_UNAVAILABLE; + } + return (Error)godot_audio_script_create(&p_buffer_samples, p_channels); +} + +void AudioDriverScriptProcessor::start(float *p_out_buf, int p_out_buf_size, float *p_in_buf, int p_in_buf_size) { + godot_audio_script_start(p_in_buf, p_in_buf_size, p_out_buf, p_out_buf_size, &_process_callback); +} + +#endif // THREADS_ENABLED diff --git a/platform/web/audio_driver_web.h b/platform/web/audio_driver_web.h index 12a61746c3..df88d0a94c 100644 --- a/platform/web/audio_driver_web.h +++ b/platform/web/audio_driver_web.h @@ -90,6 +90,7 @@ public: AudioDriverWeb() {} }; +#ifdef THREADS_ENABLED class AudioDriverWorklet : public AudioDriverWeb { private: enum { @@ -120,4 +121,54 @@ public: virtual void unlock() override; }; +#else + +class AudioDriverWorklet : public AudioDriverWeb { +private: + static void _process_callback(int p_pos, int p_samples); + static void _capture_callback(int p_pos, int p_samples); + + static AudioDriverWorklet *singleton; + +protected: + virtual Error create(int &p_buffer_size, int p_output_channels) override; + virtual void start(float *p_out_buf, int p_out_buf_size, float *p_in_buf, int p_in_buf_size) override; + +public: + virtual const char *get_name() const override { + return "AudioWorklet"; + } + + virtual void lock() override {} + virtual void unlock() override {} + + static AudioDriverWorklet *get_singleton() { return singleton; } + + AudioDriverWorklet() { singleton = this; } +}; + +class AudioDriverScriptProcessor : public AudioDriverWeb { +private: + static void _process_callback(); + + static AudioDriverScriptProcessor *singleton; + +protected: + virtual Error create(int &p_buffer_size, int p_output_channels) override; + virtual void start(float *p_out_buf, int p_out_buf_size, float *p_in_buf, int p_in_buf_size) override; + virtual void finish_driver() override; + +public: + virtual const char *get_name() const override { return "ScriptProcessor"; } + + virtual void lock() override {} + virtual void unlock() override {} + + static AudioDriverScriptProcessor *get_singleton() { return singleton; } + + AudioDriverScriptProcessor() { singleton = this; } +}; + +#endif // THREADS_ENABLED + #endif // AUDIO_DRIVER_WEB_H diff --git a/platform/web/detect.py b/platform/web/detect.py index 53fae67f6a..bce03eb79e 100644 --- a/platform/web/detect.py +++ b/platform/web/detect.py @@ -8,6 +8,7 @@ from emscripten_helpers import ( add_js_pre, add_js_externs, create_template_zip, + get_template_zip_path, ) from methods import get_compiler_version from SCons.Util import WhereIs @@ -161,6 +162,9 @@ def configure(env: "Environment"): # Add method that joins/compiles our Engine files. env.AddMethod(create_engine_file, "CreateEngineFile") + # Add method for getting the final zip path + env.AddMethod(get_template_zip_path, "GetTemplateZipPath") + # Add method for creating the final zip file env.AddMethod(create_template_zip, "CreateTemplateZip") @@ -209,13 +213,17 @@ def configure(env: "Environment"): stack_size_opt = "STACK_SIZE" if cc_semver >= (3, 1, 25) else "TOTAL_STACK" env.Append(LINKFLAGS=["-s", "%s=%sKB" % (stack_size_opt, env["stack_size"])]) - # Thread support (via SharedArrayBuffer). - env.Append(CPPDEFINES=["PTHREAD_NO_RENAME"]) - env.Append(CCFLAGS=["-s", "USE_PTHREADS=1"]) - env.Append(LINKFLAGS=["-s", "USE_PTHREADS=1"]) - env.Append(LINKFLAGS=["-s", "DEFAULT_PTHREAD_STACK_SIZE=%sKB" % env["default_pthread_stack_size"]]) - env.Append(LINKFLAGS=["-s", "PTHREAD_POOL_SIZE=8"]) - env.Append(LINKFLAGS=["-s", "WASM_MEM_MAX=2048MB"]) + if env["threads"]: + # Thread support (via SharedArrayBuffer). + env.Append(CPPDEFINES=["PTHREAD_NO_RENAME"]) + env.Append(CCFLAGS=["-s", "USE_PTHREADS=1"]) + env.Append(LINKFLAGS=["-s", "USE_PTHREADS=1"]) + env.Append(LINKFLAGS=["-s", "DEFAULT_PTHREAD_STACK_SIZE=%sKB" % env["default_pthread_stack_size"]]) + env.Append(LINKFLAGS=["-s", "PTHREAD_POOL_SIZE=8"]) + env.Append(LINKFLAGS=["-s", "WASM_MEM_MAX=2048MB"]) + elif env["proxy_to_pthread"]: + print('"threads=no" support requires "proxy_to_pthread=no", disabling proxy to pthread.') + env["proxy_to_pthread"] = False if env["lto"] != "none": # Workaround https://github.com/emscripten-core/emscripten/issues/19781. @@ -224,7 +232,7 @@ def configure(env: "Environment"): if env["dlink_enabled"]: if env["proxy_to_pthread"]: - print("GDExtension support requires proxy_to_pthread=no, disabling") + print("GDExtension support requires proxy_to_pthread=no, disabling proxy to pthread.") env["proxy_to_pthread"] = False if cc_semver < (3, 1, 14): diff --git a/platform/web/doc_classes/EditorExportPlatformWeb.xml b/platform/web/doc_classes/EditorExportPlatformWeb.xml index c4c4fd870b..f07f265b0d 100644 --- a/platform/web/doc_classes/EditorExportPlatformWeb.xml +++ b/platform/web/doc_classes/EditorExportPlatformWeb.xml @@ -47,6 +47,10 @@ </member> <member name="variant/extensions_support" type="bool" setter="" getter=""> </member> + <member name="variant/thread_support" type="bool" setter="" getter=""> + If enabled, the exported game will support threads. It requires [url=https://web.dev/articles/coop-coep]a "cross-origin isolated" website[/url], which can be difficult to setup and brings some limitations (e.g. not being able to communicate with third-party websites). + If disabled, the exported game will not support threads. As a result, it is more prone to performance and audio issues, but will only require to be run on a HTTPS website. + </member> <member name="vram_texture_compression/for_desktop" type="bool" setter="" getter=""> </member> <member name="vram_texture_compression/for_mobile" type="bool" setter="" getter=""> diff --git a/platform/web/emscripten_helpers.py b/platform/web/emscripten_helpers.py index ec33397842..3ba133c9a1 100644 --- a/platform/web/emscripten_helpers.py +++ b/platform/web/emscripten_helpers.py @@ -4,7 +4,12 @@ from SCons.Util import WhereIs def run_closure_compiler(target, source, env, for_signature): - closure_bin = os.path.join(os.path.dirname(WhereIs("emcc")), "node_modules", ".bin", "google-closure-compiler") + closure_bin = os.path.join( + os.path.dirname(WhereIs("emcc")), + "node_modules", + ".bin", + "google-closure-compiler", + ) cmd = [WhereIs("node"), closure_bin] cmd.extend(["--compilation_level", "ADVANCED_OPTIMIZATIONS"]) for f in env["JSEXTERNS"]: @@ -31,27 +36,29 @@ def get_build_version(): return v -def create_engine_file(env, target, source, externs): +def create_engine_file(env, target, source, externs, threads_enabled): if env["use_closure_compiler"]: return env.BuildJS(target, source, JSEXTERNS=externs) - return env.Textfile(target, [env.File(s) for s in source]) + subst_dict = {"___GODOT_THREADS_ENABLED": "true" if threads_enabled else "false"} + return env.Substfile(target=target, source=[env.File(s) for s in source], SUBST_DICT=subst_dict) def create_template_zip(env, js, wasm, worker, side): binary_name = "godot.editor" if env.editor_build else "godot" - zip_dir = env.Dir("#bin/.web_zip") + zip_dir = env.Dir(env.GetTemplateZipPath()) in_files = [ js, wasm, - worker, "#platform/web/js/libs/audio.worklet.js", ] out_files = [ zip_dir.File(binary_name + ".js"), zip_dir.File(binary_name + ".wasm"), - zip_dir.File(binary_name + ".worker.js"), zip_dir.File(binary_name + ".audio.worklet.js"), ] + if env["threads"]: + in_files.append(worker) + out_files.append(zip_dir.File(binary_name + ".worker.js")) # Dynamic linking (extensions) specific. if env["dlink_enabled"]: in_files.append(side) # Side wasm (contains the actual Godot code). @@ -65,18 +72,20 @@ def create_template_zip(env, js, wasm, worker, side): "godot.editor.html", "offline.html", "godot.editor.js", - "godot.editor.worker.js", "godot.editor.audio.worklet.js", "logo.svg", "favicon.png", ] + if env["threads"]: + cache.append("godot.editor.worker.js") opt_cache = ["godot.editor.wasm"] subst_dict = { - "@GODOT_VERSION@": get_build_version(), - "@GODOT_NAME@": "GodotEngine", - "@GODOT_CACHE@": json.dumps(cache), - "@GODOT_OPT_CACHE@": json.dumps(opt_cache), - "@GODOT_OFFLINE_PAGE@": "offline.html", + "___GODOT_VERSION___": get_build_version(), + "___GODOT_NAME___": "GodotEngine", + "___GODOT_CACHE___": json.dumps(cache), + "___GODOT_OPT_CACHE___": json.dumps(opt_cache), + "___GODOT_OFFLINE_PAGE___": "offline.html", + "___GODOT_THREADS_ENABLED___": "true" if env["threads"] else "false", } html = env.Substfile(target="#bin/godot${PROGSUFFIX}.html", source=html, SUBST_DICT=subst_dict) in_files.append(html) @@ -88,7 +97,9 @@ def create_template_zip(env, js, wasm, worker, side): out_files.append(zip_dir.File("favicon.png")) # PWA service_worker = env.Substfile( - target="#bin/godot${PROGSUFFIX}.service.worker.js", source=service_worker, SUBST_DICT=subst_dict + target="#bin/godot${PROGSUFFIX}.service.worker.js", + source=service_worker, + SUBST_DICT=subst_dict, ) in_files.append(service_worker) out_files.append(zip_dir.File("service.worker.js")) @@ -115,6 +126,10 @@ def create_template_zip(env, js, wasm, worker, side): ) +def get_template_zip_path(env): + return "#bin/.web_zip" + + def add_js_libraries(env, libraries): env.Append(JS_LIBS=env.File(libraries)) diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp index ee170280e2..d7e72612b4 100644 --- a/platform/web/export/export_plugin.cpp +++ b/platform/web/export/export_plugin.cpp @@ -34,11 +34,11 @@ #include "run_icon_svg.gen.h" #include "core/config/project_settings.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/export/editor_export.h" #include "editor/import/resource_importer_texture_settings.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/image_texture.h" #include "modules/modules_enabled.gen.h" // For mono and svg. @@ -169,6 +169,13 @@ void EditorExportPlatformWeb::_fix_html(Vector<uint8_t> &p_html, const Ref<Edito replaces["$GODOT_PROJECT_NAME"] = GLOBAL_GET("application/config/name"); replaces["$GODOT_HEAD_INCLUDE"] = head_include + custom_head_include; replaces["$GODOT_CONFIG"] = str_config; + + if (p_preset->get("variant/thread_support")) { + replaces["$GODOT_THREADS_ENABLED"] = "true"; + } else { + replaces["$GODOT_THREADS_ENABLED"] = "false"; + } + _replace_strings(replaces, p_html); } @@ -216,9 +223,9 @@ Error EditorExportPlatformWeb::_build_pwa(const Ref<EditorExportPreset> &p_prese const String name = p_path.get_file().get_basename(); bool extensions = (bool)p_preset->get("variant/extensions_support"); HashMap<String, String> replaces; - replaces["@GODOT_VERSION@"] = String::num_int64(OS::get_singleton()->get_unix_time()) + "|" + String::num_int64(OS::get_singleton()->get_ticks_usec()); - replaces["@GODOT_NAME@"] = proj_name.substr(0, 16); - replaces["@GODOT_OFFLINE_PAGE@"] = name + ".offline.html"; + replaces["___GODOT_VERSION___"] = String::num_int64(OS::get_singleton()->get_unix_time()) + "|" + String::num_int64(OS::get_singleton()->get_ticks_usec()); + replaces["___GODOT_NAME___"] = proj_name.substr(0, 16); + replaces["___GODOT_OFFLINE_PAGE___"] = name + ".offline.html"; // Files cached during worker install. Array cache_files; @@ -231,7 +238,7 @@ Error EditorExportPlatformWeb::_build_pwa(const Ref<EditorExportPreset> &p_prese } cache_files.push_back(name + ".worker.js"); cache_files.push_back(name + ".audio.worklet.js"); - replaces["@GODOT_CACHE@"] = Variant(cache_files).to_json_string(); + replaces["___GODOT_CACHE___"] = Variant(cache_files).to_json_string(); // Heavy files that are cached on demand. Array opt_cache_files; @@ -243,7 +250,7 @@ Error EditorExportPlatformWeb::_build_pwa(const Ref<EditorExportPreset> &p_prese opt_cache_files.push_back(p_shared_objects[i].path.get_file()); } } - replaces["@GODOT_OPT_CACHE@"] = Variant(opt_cache_files).to_json_string(); + replaces["___GODOT_OPT_CACHE___"] = Variant(opt_cache_files).to_json_string(); const String sw_path = dir.path_join(name + ".service.worker.js"); Vector<uint8_t> sw; @@ -335,6 +342,7 @@ void EditorExportPlatformWeb::get_export_options(List<ExportOption> *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "variant/extensions_support"), false)); // Export type. + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "variant/thread_support"), true)); // Thread support (i.e. run with or without COEP/COOP headers). r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "vram_texture_compression/for_desktop"), true)); // S3TC r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "vram_texture_compression/for_mobile"), false)); // ETC or ETC2, depending on renderer @@ -377,10 +385,11 @@ bool EditorExportPlatformWeb::has_valid_export_configuration(const Ref<EditorExp String err; bool valid = false; bool extensions = (bool)p_preset->get("variant/extensions_support"); + bool thread_support = (bool)p_preset->get("variant/thread_support"); // Look for export templates (first official, and if defined custom templates). - bool dvalid = exists_export_template(_get_template_name(extensions, true), &err); - bool rvalid = exists_export_template(_get_template_name(extensions, false), &err); + bool dvalid = exists_export_template(_get_template_name(extensions, thread_support, true), &err); + bool rvalid = exists_export_template(_get_template_name(extensions, thread_support, false), &err); if (p_preset->get("custom_template/debug") != "") { dvalid = FileAccess::exists(p_preset->get("custom_template/debug")); @@ -454,7 +463,8 @@ Error EditorExportPlatformWeb::export_project(const Ref<EditorExportPreset> &p_p template_path = template_path.strip_edges(); if (template_path.is_empty()) { bool extensions = (bool)p_preset->get("variant/extensions_support"); - template_path = find_export_template(_get_template_name(extensions, p_debug)); + bool thread_support = (bool)p_preset->get("variant/thread_support"); + template_path = find_export_template(_get_template_name(extensions, thread_support, p_debug)); } if (!template_path.is_empty() && !FileAccess::exists(template_path)) { diff --git a/platform/web/export/export_plugin.h b/platform/web/export/export_plugin.h index 9bb82d472e..98e3fe729e 100644 --- a/platform/web/export/export_plugin.h +++ b/platform/web/export/export_plugin.h @@ -56,11 +56,14 @@ class EditorExportPlatformWeb : public EditorExportPlatform { Mutex server_lock; Thread server_thread; - String _get_template_name(bool p_extension, bool p_debug) const { + String _get_template_name(bool p_extension, bool p_thread_support, bool p_debug) const { String name = "web"; if (p_extension) { name += "_dlink"; } + if (!p_thread_support) { + name += "_nothreads"; + } if (p_debug) { name += "_debug.zip"; } else { diff --git a/platform/web/js/engine/features.js b/platform/web/js/engine/features.js index b7c6c9d445..81bc82f3c6 100644 --- a/platform/web/js/engine/features.js +++ b/platform/web/js/engine/features.js @@ -72,8 +72,14 @@ const Features = { // eslint-disable-line no-unused-vars * * @returns {Array<string>} A list of human-readable missing features. * @function Engine.getMissingFeatures + * @typedef {{ threads: boolean }} SupportedFeatures + * @param {SupportedFeatures} supportedFeatures */ - getMissingFeatures: function () { + getMissingFeatures: function (supportedFeatures = {}) { + const { + threads: supportsThreads = true, + } = supportedFeatures; + const missing = []; if (!Features.isWebGLAvailable(2)) { missing.push('WebGL2 - Check web browser configuration and hardware support'); @@ -84,12 +90,16 @@ const Features = { // eslint-disable-line no-unused-vars if (!Features.isSecureContext()) { missing.push('Secure Context - Check web server configuration (use HTTPS)'); } - if (!Features.isCrossOriginIsolated()) { - missing.push('Cross Origin Isolation - Check web server configuration (send correct headers)'); - } - if (!Features.isSharedArrayBufferAvailable()) { - missing.push('SharedArrayBuffer - Check web server configuration (send correct headers)'); + + if (supportsThreads) { + if (!Features.isCrossOriginIsolated()) { + missing.push('Cross-Origin Isolation - Check that the web server configuration sends the correct headers.'); + } + if (!Features.isSharedArrayBufferAvailable()) { + missing.push('SharedArrayBuffer - Check that the web server configuration sends the correct headers.'); + } } + // Audio is normally optional since we have a dummy fallback. return missing; }, diff --git a/platform/web/js/libs/audio.worklet.js b/platform/web/js/libs/audio.worklet.js index 89b581b3d6..3b94cab85c 100644 --- a/platform/web/js/libs/audio.worklet.js +++ b/platform/web/js/libs/audio.worklet.js @@ -167,7 +167,7 @@ class GodotProcessor extends AudioWorkletProcessor { GodotProcessor.write_input(this.input_buffer, input); this.input.write(this.input_buffer); } else { - this.port.postMessage('Input buffer is full! Skipping input frame.'); + // this.port.postMessage('Input buffer is full! Skipping input frame.'); // Uncomment this line to debug input buffer. } } const process_output = GodotProcessor.array_has_data(outputs); @@ -184,7 +184,7 @@ class GodotProcessor extends AudioWorkletProcessor { this.port.postMessage({ 'cmd': 'read', 'data': chunk }); } } else { - this.port.postMessage('Output buffer has not enough frames! Skipping output frame.'); + // this.port.postMessage('Output buffer has not enough frames! Skipping output frame.'); // Uncomment this line to debug output buffer. } } this.process_notify(); diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 0549e408a7..1cfbc33ef8 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -3,6 +3,7 @@ Import("env") import os +from pathlib import Path from platform_methods import run_in_subprocess import platform_windows_builders @@ -25,6 +26,19 @@ common_win_wrap = [ "console_wrapper_windows.cpp", ] + +def arrange_program_clean(prog): + """ + Given an SCons program, arrange for output files SCons doesn't know about + to be cleaned when SCons is called with --clean + """ + extensions_to_clean = [".ilk", ".exp", ".pdb", ".lib"] + for program in prog: + executable_stem = Path(program.name).stem + extra_files_to_clean = [f"#bin/{executable_stem}{extension}" for extension in extensions_to_clean] + Clean(prog, extra_files_to_clean) + + res_file = "godot_res.rc" res_target = "godot_res" + env["OBJSUFFIX"] res_obj = env.RES(res_target, res_file) @@ -32,6 +46,7 @@ res_obj = env.RES(res_target, res_file) sources = common_win + res_obj prog = env.add_program("#bin/godot", sources, PROGSUFFIX=env["PROGSUFFIX"]) +arrange_program_clean(prog) # Build console wrapper app. if env["windows_subsystem"] == "gui": @@ -48,6 +63,7 @@ if env["windows_subsystem"] == "gui": env_wrap.Append(LIBS=["version"]) prog_wrap = env_wrap.add_program("#bin/godot", common_win_wrap + res_wrap_obj, PROGSUFFIX=env["PROGSUFFIX_WRAP"]) + arrange_program_clean(prog_wrap) env_wrap.Depends(prog_wrap, prog) # Microsoft Visual Studio Project Generation diff --git a/platform/windows/detect.py b/platform/windows/detect.py index bc04057793..79698f5bd7 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -441,10 +441,6 @@ def configure_msvc(env, vcvars_msvc_config): LIBS += ["vulkan"] if env["d3d12"]: - if env["dxc_path"] == "": - print("The Direct3D 12 rendering driver requires dxc_path to be set.") - sys.exit(255) - env.AppendUnique(CPPDEFINES=["D3D12_ENABLED", "RD_ENABLED"]) LIBS += ["d3d12", "dxgi", "dxguid"] LIBS += ["version"] # Mesa dependency. diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index a6c2cd7313..b56954ae81 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -1948,6 +1948,10 @@ bool DisplayServerWindows::window_is_focused(WindowID p_window) const { return wd.window_focused; } +DisplayServerWindows::WindowID DisplayServerWindows::get_focused_window() const { + return last_focused_window; +} + bool DisplayServerWindows::window_can_draw(WindowID p_window) const { _THREAD_SAFE_METHOD_ diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h index 29c2460c10..2668e14540 100644 --- a/platform/windows/display_server_windows.h +++ b/platform/windows/display_server_windows.h @@ -611,6 +611,8 @@ public: virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) override; virtual bool window_is_focused(WindowID p_window = MAIN_WINDOW_ID) const override; + virtual WindowID get_focused_window() const override; + virtual bool window_can_draw(WindowID p_window = MAIN_WINDOW_ID) const override; virtual bool can_any_window_draw() const override; diff --git a/platform/windows/export/export_plugin.cpp b/platform/windows/export/export_plugin.cpp index 418f38c127..6cdd370bfe 100644 --- a/platform/windows/export/export_plugin.cpp +++ b/platform/windows/export/export_plugin.cpp @@ -37,9 +37,9 @@ #include "core/io/image_loader.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_string_names.h" #include "editor/export/editor_export.h" +#include "editor/themes/editor_scale.h" #include "modules/modules_enabled.gen.h" // For svg. #ifdef MODULE_SVG_ENABLED diff --git a/platform/windows/godot.natvis b/platform/windows/godot.natvis index 36b0919185..94cc52be98 100644 --- a/platform/windows/godot.natvis +++ b/platform/windows/godot.natvis @@ -5,11 +5,43 @@ <Item Name="[size]">_cowdata._ptr ? (((const unsigned int *)(_cowdata._ptr))[-1]) : 0</Item> <ArrayItems> <Size>_cowdata._ptr ? (((const unsigned int *)(_cowdata._ptr))[-1]) : 0</Size> - <ValuePointer>_cowdata._ptr</ValuePointer> + <ValuePointer>($T1 *) _cowdata._ptr</ValuePointer> </ArrayItems> </Expand> </Type> + <Type Name="Array"> + <Expand> + <Item Name="[size]">_p->array._cowdata._ptr ? (((const unsigned int *)(_p->array._cowdata._ptr))[-1]) : 0</Item> + <ArrayItems> + <Size>_p->array._cowdata._ptr ? (((const unsigned int *)(_p->array._cowdata._ptr))[-1]) : 0</Size> + <ValuePointer>(Variant *) _p->array._cowdata._ptr</ValuePointer> + </ArrayItems> + </Expand> + </Type> + + <Type Name="TypedArray<*>"> + <Expand> + <Item Name="[size]"> _p->array._cowdata._ptr ? (((const unsigned int *)(_p->array._cowdata._ptr))[-1]) : 0</Item> + <ArrayItems> + <Size>_p->array._cowdata._ptr ? (((const unsigned int *)(_p->array._cowdata._ptr))[-1]) : 0</Size> + <ValuePointer >(Variant *) _p->array._cowdata._ptr</ValuePointer> + </ArrayItems> + </Expand> + </Type> + + <Type Name="Dictionary"> + <Expand> + <Item Name="[size]">_p && _p->variant_map.head_element ? _p->variant_map.num_elements : 0</Item> + <LinkedListItems> + <Size>_p && _p->variant_map.head_element ? _p->variant_map.num_elements : 0</Size> + <HeadPointer>_p ? _p->variant_map.head_element : nullptr</HeadPointer> + <NextPointer>next</NextPointer> + <ValueNode Name="[{data.key}]">(*this),view(MapHelper)</ValueNode> + </LinkedListItems> + </Expand> + </Type> + <Type Name="LocalVector<*>"> <Expand> <Item Name="[size]">count</Item> @@ -32,18 +64,80 @@ </Expand> </Type> - <Type Name="HashMap<*,*>"> + <Type Name="NodePath"> + <DisplayString Condition="!data">[empty]</DisplayString> + <DisplayString Condition="!!data">{{[absolute] = {data->absolute} [path] = {data->path,view(NodePathHelper)} [subpath] = {data->subpath,view(NodePathHelper)}}}</DisplayString> <Expand> - <Item Name="[size]">num_elements</Item> + <Item Name="[path]">data->path,view(NodePathHelper)</Item> + <Item Name="[subpath]">data->subpath,view(NodePathHelper)</Item> + <Item Name="[absolute]">data->absolute</Item> + </Expand> + </Type> + + <Type Name="Vector<StringName>" IncludeView="NodePathHelper"> + <Expand> + <ArrayItems> + <Size>_cowdata._ptr ? (((const unsigned int *)(_cowdata._ptr))[-1]) : 0</Size> + <ValuePointer>((StringName *)_cowdata._ptr),view(NodePathHelper)</ValuePointer> + </ArrayItems> + </Expand> + </Type> + + <Type Name="StringName" IncludeView="NodePathHelper"> + <DisplayString Condition="_data && _data->cname">{_data->cname,s8b}</DisplayString> + <DisplayString Condition="_data && !_data->cname">{_data->name,s32b}</DisplayString> + <DisplayString Condition="!_data">[empty]</DisplayString> + <StringView Condition="_data && _data->cname">_data->cname,s8b</StringView> + <StringView Condition="_data && !_data->cname">_data->name,s32b</StringView> + </Type> + + <Type Name="HashMapElement<*,*>"> + <DisplayString>{{Key = {($T1 *) &data.key} Value = {($T2 *) &data.value}}}</DisplayString> + <Expand> + <Item Name="[key]">($T1 *) &data.key</Item> + <Item Name="[value]">($T2 *) &data.value</Item> + </Expand> + </Type> + + <!-- elements displayed by index --> + <Type Name="HashMap<*,*,*,*,*>" Priority="Medium"> + <Expand> + <Item Name="[size]">head_element ? num_elements : 0</Item> <LinkedListItems> - <Size>num_elements</Size> + <Size>head_element ? num_elements : 0</Size> <HeadPointer>head_element</HeadPointer> <NextPointer>next</NextPointer> - <ValueNode>data</ValueNode> + <ValueNode>(*this)</ValueNode> </LinkedListItems> </Expand> </Type> + <!-- elements by key:value --> + <!-- show elements by index by specifying "ShowElementsByIndex"--> + <Type Name="HashMap<*,*,*,*,*>" ExcludeView="ShowElementsByIndex" Priority="MediumHigh"> + <Expand> + <Item Name="[size]">head_element ? num_elements : 0</Item> + <LinkedListItems> + <Size>head_element ? num_elements : 0</Size> + <HeadPointer>head_element</HeadPointer> + <NextPointer>next</NextPointer> + <ValueNode Name="[{data.key}]">(*this),view(MapHelper)</ValueNode> + </LinkedListItems> + </Expand> + </Type> + + <Type Name="KeyValue<*,*>" IncludeView="MapHelper"> + <DisplayString>{value}</DisplayString> + </Type> + + <Type Name="HashMapElement<*,*>" IncludeView="MapHelper"> + <DisplayString>{data.value}</DisplayString> + <Expand> + <Item Name="[key]" >($T1 *) &data.key</Item> + <Item Name="[value]">($T2 *) &data.value</Item> + </Expand> + </Type> + <Type Name="VMap<*,*>"> <Expand> <Item Condition="_cowdata._ptr" Name="[size]">*(reinterpret_cast<int*>(_cowdata._ptr) - 1)</Item> @@ -58,11 +152,6 @@ <DisplayString Condition="dynamic_cast<CallableCustomMethodPointerBase*>(key.custom)">{dynamic_cast<CallableCustomMethodPointerBase*>(key.custom)->text}</DisplayString> </Type> - <!-- requires PR 64364 - <Type Name="GDScriptThreadContext"> - <DisplayString Condition="_is_main == true">main thread {_debug_thread_id}</DisplayString> - </Type> - --> <Type Name="Variant"> <DisplayString Condition="type == Variant::NIL">nil</DisplayString> @@ -82,22 +171,22 @@ <DisplayString Condition="type == Variant::PLANE">{*(Plane *)_data._mem}</DisplayString> <DisplayString Condition="type == Variant::QUATERNION">{*(Quaternion *)_data._mem}</DisplayString> <DisplayString Condition="type == Variant::COLOR">{*(Color *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::STRING_NAME">{*(StringName *)_data._mem}</DisplayString> <DisplayString Condition="type == Variant::NODE_PATH">{*(NodePath *)_data._mem}</DisplayString> <DisplayString Condition="type == Variant::RID">{*(::RID *)_data._mem}</DisplayString> - <DisplayString Condition="type == Variant::OBJECT">{*(Object *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::OBJECT">{*(*reinterpret_cast<ObjData*>(&_data._mem[0])).obj}</DisplayString> <DisplayString Condition="type == Variant::DICTIONARY">{*(Dictionary *)_data._mem}</DisplayString> <DisplayString Condition="type == Variant::ARRAY">{*(Array *)_data._mem}</DisplayString> <DisplayString Condition="type == Variant::PACKED_BYTE_ARRAY">{reinterpret_cast<const Variant::PackedArrayRef<unsigned char>*>(_data.packed_array)->array}</DisplayString> <DisplayString Condition="type == Variant::PACKED_INT32_ARRAY">{reinterpret_cast<const Variant::PackedArrayRef<int>*>(_data.packed_array)->array}</DisplayString> - <!-- broken, will show incorrect data - <DisplayString Condition="type == Variant::PACKED_INT64_ARRAY">{*(PackedInt64Array *)_data._mem}</DisplayString> - --> + <DisplayString Condition="type == Variant::PACKED_INT64_ARRAY">{*reinterpret_cast<PackedInt64Array *>(&_data.packed_array[1])}</DisplayString> <DisplayString Condition="type == Variant::PACKED_FLOAT32_ARRAY">{reinterpret_cast<const Variant::PackedArrayRef<float>*>(_data.packed_array)->array}</DisplayString> <DisplayString Condition="type == Variant::PACKED_FLOAT64_ARRAY">{reinterpret_cast<const Variant::PackedArrayRef<double>*>(_data.packed_array)->array}</DisplayString> <DisplayString Condition="type == Variant::PACKED_STRING_ARRAY">{reinterpret_cast<const Variant::PackedArrayRef<String>*>(_data.packed_array)->array}</DisplayString> <DisplayString Condition="type == Variant::PACKED_VECTOR2_ARRAY">{reinterpret_cast<const Variant::PackedArrayRef<Vector2>*>(_data.packed_array)->array}</DisplayString> <DisplayString Condition="type == Variant::PACKED_VECTOR3_ARRAY">{reinterpret_cast<const Variant::PackedArrayRef<Vector3>*>(_data.packed_array)->array}</DisplayString> <DisplayString Condition="type == Variant::PACKED_COLOR_ARRAY">{reinterpret_cast<const Variant::PackedArrayRef<Color>*>(_data.packed_array)->array}</DisplayString> + <DisplayString Condition="type < 0 || type >= Variant::VARIANT_MAX">[INVALID]</DisplayString> <StringView Condition="type == Variant::STRING && ((String *)(_data._mem))->_cowdata._ptr">((String *)(_data._mem))->_cowdata._ptr,s32</StringView> @@ -116,20 +205,22 @@ <Item Name="[value]" Condition="type == Variant::PLANE">*(Plane *)_data._mem</Item> <Item Name="[value]" Condition="type == Variant::QUATERNION">*(Quaternion *)_data._mem</Item> <Item Name="[value]" Condition="type == Variant::COLOR">*(Color *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::STRING_NAME">*(StringName *)_data._mem</Item> <Item Name="[value]" Condition="type == Variant::NODE_PATH">*(NodePath *)_data._mem</Item> <Item Name="[value]" Condition="type == Variant::RID">*(::RID *)_data._mem</Item> - <Item Name="[value]" Condition="type == Variant::OBJECT">*(Object *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::OBJECT">*(*reinterpret_cast<ObjData*>(&_data._mem[0])).obj</Item> <Item Name="[value]" Condition="type == Variant::DICTIONARY">*(Dictionary *)_data._mem</Item> <Item Name="[value]" Condition="type == Variant::ARRAY">*(Array *)_data._mem</Item> <Item Name="[value]" Condition="type == Variant::PACKED_BYTE_ARRAY">reinterpret_cast<const Variant::PackedArrayRef<unsigned char>*>(_data.packed_array)->array</Item> - <Item Name="[value]" Condition="type == Variant::PACKED_INT32_ARRAY">*(PackedInt32Array *)_data._mem</Item> - <Item Name="[value]" Condition="type == Variant::PACKED_INT64_ARRAY">*(PackedInt64Array *)_data._mem</Item> - <Item Name="[value]" Condition="type == Variant::PACKED_FLOAT32_ARRAY">*(PackedFloat32Array *)_data._mem</Item> - <Item Name="[value]" Condition="type == Variant::PACKED_FLOAT64_ARRAY">*(PackedFloat64Array *)_data._mem</Item> - <Item Name="[value]" Condition="type == Variant::PACKED_STRING_ARRAY">*(PackedStringArray *)_data._mem</Item> - <Item Name="[value]" Condition="type == Variant::PACKED_VECTOR2_ARRAY">*(PackedVector2Array *)_data._mem</Item> - <Item Name="[value]" Condition="type == Variant::PACKED_VECTOR3_ARRAY">*(PackedVector3Array *)_data._mem</Item> - <Item Name="[value]" Condition="type == Variant::PACKED_COLOR_ARRAY">*(PackedColorArray *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::PACKED_INT32_ARRAY">reinterpret_cast<const Variant::PackedArrayRef<int>*>(_data.packed_array)->array</Item> + <Item Name="[value]" Condition="type == Variant::PACKED_INT64_ARRAY">*reinterpret_cast<PackedInt64Array *>(&_data.packed_array[1])</Item> + <Item Name="[value]" Condition="type == Variant::PACKED_FLOAT32_ARRAY">reinterpret_cast<const Variant::PackedArrayRef<float>*>(_data.packed_array)->array</Item> + <Item Name="[value]" Condition="type == Variant::PACKED_FLOAT64_ARRAY">reinterpret_cast<const Variant::PackedArrayRef<double>*>(_data.packed_array)->array</Item> + <Item Name="[value]" Condition="type == Variant::PACKED_STRING_ARRAY">reinterpret_cast<const Variant::PackedArrayRef<String>*>(_data.packed_array)->array</Item> + <Item Name="[value]" Condition="type == Variant::PACKED_VECTOR2_ARRAY">reinterpret_cast<const Variant::PackedArrayRef<Vector2>*>(_data.packed_array)->array</Item> + <Item Name="[value]" Condition="type == Variant::PACKED_VECTOR3_ARRAY">reinterpret_cast<const Variant::PackedArrayRef<Vector3>*>(_data.packed_array)->array</Item> + <Item Name="[value]" Condition="type == Variant::PACKED_COLOR_ARRAY">reinterpret_cast<const Variant::PackedArrayRef<Color>*>(_data.packed_array)->array</Item> + </Expand> </Type> @@ -148,10 +239,10 @@ </Type> <Type Name="StringName"> - <DisplayString Condition="_data && _data->cname">{_data->cname}</DisplayString> + <DisplayString Condition="_data && _data->cname">{_data->cname,na}</DisplayString> <DisplayString Condition="_data && !_data->cname">{_data->name,s32}</DisplayString> <DisplayString Condition="!_data">[empty]</DisplayString> - <StringView Condition="_data && _data->cname">_data->cname</StringView> + <StringView Condition="_data && _data->cname">_data->cname,na</StringView> <StringView Condition="_data && !_data->cname">_data->name,s32</StringView> </Type> diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index afc5748ac5..f6e6eb8b17 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -33,84 +33,48 @@ #include "core/config/project_settings.h" #include "scene/2d/area_2d.h" #include "scene/2d/audio_listener_2d.h" -#include "scene/main/window.h" +#include "scene/audio/audio_stream_player_internal.h" +#include "scene/main/viewport.h" #include "scene/resources/world_2d.h" +#include "scene/scene_string_names.h" +#include "servers/audio/audio_stream.h" +#include "servers/audio_server.h" void AudioStreamPlayer2D::_notification(int p_what) { + internal->notification(p_what); + switch (p_what) { case NOTIFICATION_ENTER_TREE: { AudioServer::get_singleton()->add_listener_changed_callback(_listener_changed_cb, this); - if (autoplay && !Engine::get_singleton()->is_editor_hint()) { - play(); - } - set_stream_paused(!can_process()); } break; case NOTIFICATION_EXIT_TREE: { - set_stream_paused(true); AudioServer::get_singleton()->remove_listener_changed_callback(_listener_changed_cb, this); } break; - case NOTIFICATION_PREDELETE: { - stop(); - } break; - - case NOTIFICATION_PAUSED: { - if (!can_process()) { - // Node can't process so we start fading out to silence. - set_stream_paused(true); - } - } break; - - case NOTIFICATION_UNPAUSED: { - set_stream_paused(false); - } break; - case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { // Update anything related to position first, if possible of course. - if (setplay.get() > 0 || (active.is_set() && last_mix_count != AudioServer::get_singleton()->get_mix_count()) || force_update_panning) { + if (setplay.get() > 0 || (internal->active.is_set() && last_mix_count != AudioServer::get_singleton()->get_mix_count()) || force_update_panning) { force_update_panning = false; _update_panning(); } if (setplayback.is_valid() && setplay.get() >= 0) { - active.set(); - AudioServer::get_singleton()->start_playback_stream(setplayback, _get_actual_bus(), volume_vector, setplay.get(), pitch_scale); + internal->active.set(); + AudioServer::get_singleton()->start_playback_stream(setplayback, _get_actual_bus(), volume_vector, setplay.get(), internal->pitch_scale); setplayback.unref(); setplay.set(-1); } - if (!stream_playbacks.is_empty() && active.is_set()) { - // Stop playing if no longer active. - Vector<Ref<AudioStreamPlayback>> playbacks_to_remove; - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - if (playback.is_valid() && !AudioServer::get_singleton()->is_playback_active(playback) && !AudioServer::get_singleton()->is_playback_paused(playback)) { - playbacks_to_remove.push_back(playback); - } - } - // Now go through and remove playbacks that have finished. Removing elements from a Vector in a range based for is asking for trouble. - for (Ref<AudioStreamPlayback> &playback : playbacks_to_remove) { - stream_playbacks.erase(playback); - } - if (!playbacks_to_remove.is_empty() && stream_playbacks.is_empty()) { - // This node is no longer actively playing audio. - active.clear(); - set_physics_process_internal(false); - } - if (!playbacks_to_remove.is_empty()) { - emit_signal(SNAME("finished")); - } - } - - while (stream_playbacks.size() > max_polyphony) { - AudioServer::get_singleton()->stop_playback_stream(stream_playbacks[0]); - stream_playbacks.remove_at(0); + if (!internal->stream_playbacks.is_empty() && internal->active.is_set()) { + internal->process(); } + internal->ensure_playback_limit(); } break; } } -// Interacts with PhysicsServer2D, so can only be called during _physics_process +// Interacts with PhysicsServer2D, so can only be called during _physics_process. StringName AudioStreamPlayer2D::_get_actual_bus() { Vector2 global_pos = get_global_position(); @@ -142,12 +106,12 @@ StringName AudioStreamPlayer2D::_get_actual_bus() { return area2d->get_audio_bus_name(); } - return default_bus; + return internal->bus; } // Interacts with PhysicsServer2D, so can only be called during _physics_process void AudioStreamPlayer2D::_update_panning() { - if (!active.is_set() || stream.is_null()) { + if (!internal->active.is_set() || internal->stream.is_null()) { return; } @@ -192,7 +156,7 @@ void AudioStreamPlayer2D::_update_panning() { } float multiplier = Math::pow(1.0f - dist / max_distance, attenuation); - multiplier *= Math::db_to_linear(volume_db); // Also apply player volume! + multiplier *= Math::db_to_linear(internal->volume_db); // Also apply player volume! float pan = relative_to_listener.x / screen_size.x; // Don't let the panning effect extend (too far) beyond the screen. @@ -211,147 +175,96 @@ void AudioStreamPlayer2D::_update_panning() { volume_vector.write[0] = AudioFrame(MAX(prev_sample[0], new_sample[0]), MAX(prev_sample[1], new_sample[1])); } - for (const Ref<AudioStreamPlayback> &playback : stream_playbacks) { + for (const Ref<AudioStreamPlayback> &playback : internal->stream_playbacks) { AudioServer::get_singleton()->set_playback_bus_exclusive(playback, _get_actual_bus(), volume_vector); } - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - AudioServer::get_singleton()->set_playback_pitch_scale(playback, pitch_scale); + for (Ref<AudioStreamPlayback> &playback : internal->stream_playbacks) { + AudioServer::get_singleton()->set_playback_pitch_scale(playback, internal->pitch_scale); } last_mix_count = AudioServer::get_singleton()->get_mix_count(); } void AudioStreamPlayer2D::set_stream(Ref<AudioStream> p_stream) { - stop(); - stream = p_stream; + internal->set_stream(p_stream); } Ref<AudioStream> AudioStreamPlayer2D::get_stream() const { - return stream; + return internal->stream; } void AudioStreamPlayer2D::set_volume_db(float p_volume) { - volume_db = p_volume; + internal->volume_db = p_volume; } float AudioStreamPlayer2D::get_volume_db() const { - return volume_db; + return internal->volume_db; } void AudioStreamPlayer2D::set_pitch_scale(float p_pitch_scale) { - ERR_FAIL_COND(!(p_pitch_scale > 0.0)); - pitch_scale = p_pitch_scale; - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - AudioServer::get_singleton()->set_playback_pitch_scale(playback, p_pitch_scale); - } + internal->set_pitch_scale(p_pitch_scale); } float AudioStreamPlayer2D::get_pitch_scale() const { - return pitch_scale; + return internal->pitch_scale; } void AudioStreamPlayer2D::play(float p_from_pos) { - if (stream.is_null()) { + Ref<AudioStreamPlayback> stream_playback = internal->play_basic(); + if (stream_playback.is_null()) { return; } - ERR_FAIL_COND_MSG(!is_inside_tree(), "Playback can only happen when a node is inside the scene tree"); - if (stream->is_monophonic() && is_playing()) { - stop(); - } - Ref<AudioStreamPlayback> stream_playback = stream->instantiate_playback(); - ERR_FAIL_COND_MSG(stream_playback.is_null(), "Failed to instantiate playback."); - - stream_playbacks.push_back(stream_playback); setplayback = stream_playback; setplay.set(p_from_pos); - active.set(); - set_physics_process_internal(true); } void AudioStreamPlayer2D::seek(float p_seconds) { - if (is_playing()) { - stop(); - play(p_seconds); - } + internal->seek(p_seconds); } void AudioStreamPlayer2D::stop() { setplay.set(-1); - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - AudioServer::get_singleton()->stop_playback_stream(playback); - } - stream_playbacks.clear(); - active.clear(); - set_physics_process_internal(false); + internal->stop(); } bool AudioStreamPlayer2D::is_playing() const { - for (const Ref<AudioStreamPlayback> &playback : stream_playbacks) { - if (AudioServer::get_singleton()->is_playback_active(playback)) { - return true; - } - } if (setplay.get() >= 0) { return true; // play() has been called this frame, but no playback exists just yet. } - return false; + return internal->is_playing(); } float AudioStreamPlayer2D::get_playback_position() { - // Return the playback position of the most recently started playback stream. - if (!stream_playbacks.is_empty()) { - return AudioServer::get_singleton()->get_playback_position(stream_playbacks[stream_playbacks.size() - 1]); - } - return 0; + return internal->get_playback_position(); } void AudioStreamPlayer2D::set_bus(const StringName &p_bus) { - default_bus = p_bus; // This will be pushed to the audio server during the next physics timestep, which is fast enough. + internal->bus = p_bus; // This will be pushed to the audio server during the next physics timestep, which is fast enough. } StringName AudioStreamPlayer2D::get_bus() const { - for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { - if (AudioServer::get_singleton()->get_bus_name(i) == default_bus) { - return default_bus; - } - } - return SceneStringNames::get_singleton()->Master; + return internal->get_bus(); } void AudioStreamPlayer2D::set_autoplay(bool p_enable) { - autoplay = p_enable; + internal->autoplay = p_enable; } bool AudioStreamPlayer2D::is_autoplay_enabled() { - return autoplay; + return internal->autoplay; } void AudioStreamPlayer2D::_set_playing(bool p_enable) { - if (p_enable) { - play(); - } else { - stop(); - } + internal->set_playing(p_enable); } bool AudioStreamPlayer2D::_is_active() const { - return active.is_set(); + return internal->is_active(); } void AudioStreamPlayer2D::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "bus") { - String options; - for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { - if (i > 0) { - options += ","; - } - String name = AudioServer::get_singleton()->get_bus_name(i); - options += name; - } - - p_property.hint_string = options; - } + internal->validate_property(p_property); } void AudioStreamPlayer2D::set_max_distance(float p_pixels) { @@ -380,37 +293,27 @@ uint32_t AudioStreamPlayer2D::get_area_mask() const { } void AudioStreamPlayer2D::set_stream_paused(bool p_pause) { - // TODO this does not have perfect recall, fix that maybe? If there are zero playbacks registered with the AudioServer, this bool isn't persisted. - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - AudioServer::get_singleton()->set_playback_paused(playback, p_pause); - } + internal->set_stream_paused(p_pause); } bool AudioStreamPlayer2D::get_stream_paused() const { - // There's currently no way to pause some playback streams but not others. Check the first and don't bother looking at the rest. - if (!stream_playbacks.is_empty()) { - return AudioServer::get_singleton()->is_playback_paused(stream_playbacks[0]); - } - return false; + return internal->get_stream_paused(); } bool AudioStreamPlayer2D::has_stream_playback() { - return !stream_playbacks.is_empty(); + return internal->has_stream_playback(); } Ref<AudioStreamPlayback> AudioStreamPlayer2D::get_stream_playback() { - ERR_FAIL_COND_V_MSG(stream_playbacks.is_empty(), Ref<AudioStreamPlayback>(), "Player is inactive. Call play() before requesting get_stream_playback()."); - return stream_playbacks[stream_playbacks.size() - 1]; + return internal->get_stream_playback(); } void AudioStreamPlayer2D::set_max_polyphony(int p_max_polyphony) { - if (p_max_polyphony > 0) { - max_polyphony = p_max_polyphony; - } + internal->set_max_polyphony(p_max_polyphony); } int AudioStreamPlayer2D::get_max_polyphony() const { - return max_polyphony; + return internal->max_polyphony; } void AudioStreamPlayer2D::set_panning_strength(float p_panning_strength) { @@ -422,12 +325,16 @@ float AudioStreamPlayer2D::get_panning_strength() const { return panning_strength; } -void AudioStreamPlayer2D::_on_bus_layout_changed() { - notify_property_list_changed(); +bool AudioStreamPlayer2D::_set(const StringName &p_name, const Variant &p_value) { + return internal->set(p_name, p_value); +} + +bool AudioStreamPlayer2D::_get(const StringName &p_name, Variant &r_ret) const { + return internal->get(p_name, r_ret); } -void AudioStreamPlayer2D::_on_bus_renamed(int p_bus_index, const StringName &p_old_name, const StringName &p_new_name) { - notify_property_list_changed(); +void AudioStreamPlayer2D::_get_property_list(List<PropertyInfo> *p_list) const { + internal->get_property_list(p_list); } void AudioStreamPlayer2D::_bind_methods() { @@ -494,11 +401,11 @@ void AudioStreamPlayer2D::_bind_methods() { } AudioStreamPlayer2D::AudioStreamPlayer2D() { - AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp(this, &AudioStreamPlayer2D::_on_bus_layout_changed)); - AudioServer::get_singleton()->connect("bus_renamed", callable_mp(this, &AudioStreamPlayer2D::_on_bus_renamed)); + internal = memnew(AudioStreamPlayerInternal(this, callable_mp(this, &AudioStreamPlayer2D::play), true)); cached_global_panning_strength = GLOBAL_GET("audio/general/2d_panning_strength"); set_hide_clip_children(true); } AudioStreamPlayer2D::~AudioStreamPlayer2D() { + memdelete(internal); } diff --git a/scene/2d/audio_stream_player_2d.h b/scene/2d/audio_stream_player_2d.h index 0766f2f77d..3552735cd7 100644 --- a/scene/2d/audio_stream_player_2d.h +++ b/scene/2d/audio_stream_player_2d.h @@ -32,9 +32,11 @@ #define AUDIO_STREAM_PLAYER_2D_H #include "scene/2d/node_2d.h" -#include "scene/scene_string_names.h" -#include "servers/audio/audio_stream.h" -#include "servers/audio_server.h" + +struct AudioFrame; +class AudioStream; +class AudioStreamPlayback; +class AudioStreamPlayerInternal; class AudioStreamPlayer2D : public Node2D { GDCLASS(AudioStreamPlayer2D, Node2D); @@ -52,10 +54,8 @@ private: Viewport *viewport = nullptr; //pointer only used for reference to previous mix }; - Vector<Ref<AudioStreamPlayback>> stream_playbacks; - Ref<AudioStream> stream; + AudioStreamPlayerInternal *internal = nullptr; - SafeFlag active{ false }; SafeNumeric<float> setplay{ -1.0 }; Ref<AudioStreamPlayback> setplayback; @@ -64,21 +64,12 @@ private: uint64_t last_mix_count = -1; bool force_update_panning = false; - float volume_db = 0.0; - float pitch_scale = 1.0; - bool autoplay = false; - StringName default_bus = SceneStringNames::get_singleton()->Master; - int max_polyphony = 1; - void _set_playing(bool p_enable); bool _is_active() const; StringName _get_actual_bus(); void _update_panning(); - void _on_bus_layout_changed(); - void _on_bus_renamed(int p_bus_index, const StringName &p_old_name, const StringName &p_new_name); - static void _listener_changed_cb(void *self) { reinterpret_cast<AudioStreamPlayer2D *>(self)->force_update_panning = true; } uint32_t area_mask = 1; @@ -94,6 +85,10 @@ protected: void _notification(int p_what); static void _bind_methods(); + bool _set(const StringName &p_name, const Variant &p_value); + bool _get(const StringName &p_name, Variant &r_ret) const; + void _get_property_list(List<PropertyInfo> *p_list) const; + public: void set_stream(Ref<AudioStream> p_stream); Ref<AudioStream> get_stream() const; diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 0f5fa6543e..08baa7e387 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -229,7 +229,7 @@ void Camera2D::_notification(int p_what) { } break; case NOTIFICATION_TRANSFORM_CHANGED: { - if (!is_processing_internal() && !is_physics_processing_internal()) { + if (!position_smoothing_enabled || _is_editing_in_editor()) { _update_scroll(); } } break; diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index a0e7e4cf25..282d14da5d 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -34,7 +34,7 @@ #include "scene/main/timer.h" #ifdef TOOLS_ENABLED -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #endif #ifdef TOOLS_ENABLED diff --git a/scene/2d/tile_map.compat.inc b/scene/2d/tile_map.compat.inc index ed216173c7..04937bdf7e 100644 --- a/scene/2d/tile_map.compat.inc +++ b/scene/2d/tile_map.compat.inc @@ -42,10 +42,20 @@ int TileMap::_get_quadrant_size_compat_81070() const { return get_rendering_quadrant_size(); } +TileMap::VisibilityMode TileMap::_get_collision_visibility_mode_bind_compat_87115() { + return get_collision_visibility_mode(); +} + +TileMap::VisibilityMode TileMap::_get_navigation_visibility_mode_bind_compat_87115() { + return get_navigation_visibility_mode(); +} + void TileMap::_bind_compatibility_methods() { ClassDB::bind_compatibility_method(D_METHOD("get_used_rect"), &TileMap::_get_used_rect_bind_compat_78328); ClassDB::bind_compatibility_method(D_METHOD("set_quadrant_size", "quadrant_size"), &TileMap::_set_quadrant_size_compat_81070); ClassDB::bind_compatibility_method(D_METHOD("get_quadrant_size"), &TileMap::_get_quadrant_size_compat_81070); + ClassDB::bind_compatibility_method(D_METHOD("get_collision_visibility_mode"), &TileMap::_get_collision_visibility_mode_bind_compat_87115); + ClassDB::bind_compatibility_method(D_METHOD("get_navigation_visibility_mode"), &TileMap::_get_navigation_visibility_mode_bind_compat_87115); } #endif diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index decbbab476..24eefce99d 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -167,7 +167,7 @@ void TileMap::set_selected_layer(int p_layer_id) { emit_signal(CoreStringNames::get_singleton()->changed); // Update the layers modulation. - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_SELECTED_LAYER); } } @@ -178,45 +178,9 @@ int TileMap::get_selected_layer() const { void TileMap::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_ENTER_TREE: { - for (Ref<TileMapLayer> &layer : layers) { - layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_IN_TREE); - } - } break; - - case NOTIFICATION_EXIT_TREE: { - for (Ref<TileMapLayer> &layer : layers) { - layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_IN_TREE); - } - } break; - - case TileMap::NOTIFICATION_ENTER_CANVAS: { - for (Ref<TileMapLayer> &layer : layers) { - layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_IN_CANVAS); - } - } break; - - case TileMap::NOTIFICATION_EXIT_CANVAS: { - for (Ref<TileMapLayer> &layer : layers) { - layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_IN_CANVAS); - } - } break; - - case NOTIFICATION_DRAW: { - // Rendering. - if (tile_set.is_valid()) { - RenderingServer::get_singleton()->canvas_item_set_sort_children_by_y(get_canvas_item(), is_y_sort_enabled()); - } - } break; - - case TileMap::NOTIFICATION_VISIBILITY_CHANGED: { - for (Ref<TileMapLayer> &layer : layers) { - layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_VISIBILITY); - } - } break; - case TileMap::NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { - // Physics. + // This is only executed when collision_animatable is enabled. + bool in_editor = false; #ifdef TOOLS_ENABLED in_editor = Engine::get_singleton()->is_editor_hint(); @@ -224,39 +188,30 @@ void TileMap::_notification(int p_what) { if (is_inside_tree() && collision_animatable && !in_editor) { // Update transform on the physics tick when in animatable mode. last_valid_transform = new_transform; + print_line("Physics: ", new_transform); set_notify_local_transform(false); set_global_transform(new_transform); - _update_notify_local_transform(); - } - } break; - - case NOTIFICATION_TRANSFORM_CHANGED: { - // Physics. - for (Ref<TileMapLayer> &layer : layers) { - layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_XFORM); + set_notify_local_transform(true); } } break; case TileMap::NOTIFICATION_LOCAL_TRANSFORM_CHANGED: { - for (Ref<TileMapLayer> &layer : layers) { - layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_LOCAL_XFORM); - } + // This is only executed when collision_animatable is enabled. - // Physics. bool in_editor = false; #ifdef TOOLS_ENABLED in_editor = Engine::get_singleton()->is_editor_hint(); #endif - // Only active when animatable. Send the new transform to the physics... if (is_inside_tree() && collision_animatable && !in_editor) { // Store last valid transform. new_transform = get_global_transform(); + print_line("local XFORM: ", last_valid_transform); // ... but then revert changes. set_notify_local_transform(false); set_global_transform(last_valid_transform); - _update_notify_local_transform(); + set_notify_local_transform(true); } } break; } @@ -285,7 +240,7 @@ void TileMap::_internal_update() { } // Update dirty quadrants on layers. - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->internal_update(); } @@ -308,7 +263,7 @@ void TileMap::set_tileset(const Ref<TileSet> &p_tileset) { tile_set->connect_changed(callable_mp(this, &TileMap::_tile_set_changed)); } - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_TILE_SET); } @@ -323,7 +278,7 @@ void TileMap::set_rendering_quadrant_size(int p_size) { ERR_FAIL_COND_MSG(p_size < 1, "TileMapQuadrant size cannot be smaller than 1."); rendering_quadrant_size = p_size; - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_QUADRANT_SIZE); } emit_signal(CoreStringNames::get_singleton()->changed); @@ -429,10 +384,11 @@ void TileMap::add_layer(int p_to_pos) { ERR_FAIL_INDEX(p_to_pos, (int)layers.size() + 1); // Must clear before adding the layer. - Ref<TileMapLayer> new_layer; - new_layer.instantiate(); - new_layer->set_tile_map(this); + TileMapLayer *new_layer = memnew(TileMapLayer); layers.insert(p_to_pos, new_layer); + add_child(new_layer); + new_layer->set_name(vformat("Layer%d", p_to_pos)); + move_child(new_layer, p_to_pos); for (uint32_t i = 0; i < layers.size(); i++) { layers[i]->set_layer_index_in_tile_map_node(i); } @@ -449,10 +405,11 @@ void TileMap::move_layer(int p_layer, int p_to_pos) { ERR_FAIL_INDEX(p_to_pos, (int)layers.size() + 1); // Clear before shuffling layers. - Ref<TileMapLayer> layer = layers[p_layer]; + TileMapLayer *layer = layers[p_layer]; layers.insert(p_to_pos, layer); layers.remove_at(p_to_pos < p_layer ? p_layer + 1 : p_layer); for (uint32_t i = 0; i < layers.size(); i++) { + move_child(layer, i); layers[i]->set_layer_index_in_tile_map_node(i); } queue_internal_update(); @@ -471,6 +428,7 @@ void TileMap::remove_layer(int p_layer) { ERR_FAIL_INDEX(p_layer, (int)layers.size()); // Clear before removing the layer. + layers[p_layer]->queue_free(); layers.remove_at(p_layer); for (uint32_t i = 0; i < layers.size(); i++) { layers[i]->set_layer_index_in_tile_map_node(i); @@ -513,7 +471,6 @@ Color TileMap::get_layer_modulate(int p_layer) const { void TileMap::set_layer_y_sort_enabled(int p_layer, bool p_y_sort_enabled) { TILEMAP_CALL_FOR_LAYER(p_layer, set_y_sort_enabled, p_y_sort_enabled); - _update_notify_local_transform(); } bool TileMap::is_layer_y_sort_enabled(int p_layer) const { @@ -552,17 +509,16 @@ RID TileMap::get_layer_navigation_map(int p_layer) const { TILEMAP_CALL_FOR_LAYER_V(p_layer, RID(), get_navigation_map); } -void TileMap::set_collision_animatable(bool p_enabled) { - if (collision_animatable == p_enabled) { +void TileMap::set_collision_animatable(bool p_collision_animatable) { + if (collision_animatable == p_collision_animatable) { return; } - collision_animatable = p_enabled; - _update_notify_local_transform(); - set_physics_process_internal(p_enabled); - for (Ref<TileMapLayer> &layer : layers) { - layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_COLLISION_ANIMATABLE); + collision_animatable = p_collision_animatable; + set_notify_local_transform(p_collision_animatable); + set_physics_process_internal(p_collision_animatable); + for (TileMapLayer *layer : layers) { + layer->set_use_kinematic_bodies(layer); } - emit_signal(CoreStringNames::get_singleton()->changed); } bool TileMap::is_collision_animatable() const { @@ -574,13 +530,13 @@ void TileMap::set_collision_visibility_mode(TileMap::VisibilityMode p_show_colli return; } collision_visibility_mode = p_show_collision; - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_COLLISION_VISIBILITY_MODE); } emit_signal(CoreStringNames::get_singleton()->changed); } -TileMap::VisibilityMode TileMap::get_collision_visibility_mode() { +TileMap::VisibilityMode TileMap::get_collision_visibility_mode() const { return collision_visibility_mode; } @@ -589,13 +545,13 @@ void TileMap::set_navigation_visibility_mode(TileMap::VisibilityMode p_show_navi return; } navigation_visibility_mode = p_show_navigation; - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_NAVIGATION_VISIBILITY_MODE); } emit_signal(CoreStringNames::get_singleton()->changed); } -TileMap::VisibilityMode TileMap::get_navigation_visibility_mode() { +TileMap::VisibilityMode TileMap::get_navigation_visibility_mode() const { return navigation_visibility_mode; } @@ -604,7 +560,7 @@ void TileMap::set_y_sort_enabled(bool p_enable) { return; } Node2D::set_y_sort_enabled(p_enable); - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_Y_SORT_ENABLED); } emit_signal(CoreStringNames::get_singleton()->changed); @@ -640,27 +596,8 @@ Ref<TileMapPattern> TileMap::get_pattern(int p_layer, TypedArray<Vector2i> p_coo } Vector2i TileMap::map_pattern(const Vector2i &p_position_in_tilemap, const Vector2i &p_coords_in_pattern, Ref<TileMapPattern> p_pattern) { - ERR_FAIL_COND_V(p_pattern.is_null(), Vector2i()); - ERR_FAIL_COND_V(!p_pattern->has_cell(p_coords_in_pattern), Vector2i()); - - Vector2i output = p_position_in_tilemap + p_coords_in_pattern; - if (tile_set->get_tile_shape() != TileSet::TILE_SHAPE_SQUARE) { - if (tile_set->get_tile_layout() == TileSet::TILE_LAYOUT_STACKED) { - if (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_HORIZONTAL && bool(p_position_in_tilemap.y % 2) && bool(p_coords_in_pattern.y % 2)) { - output.x += 1; - } else if (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_VERTICAL && bool(p_position_in_tilemap.x % 2) && bool(p_coords_in_pattern.x % 2)) { - output.y += 1; - } - } else if (tile_set->get_tile_layout() == TileSet::TILE_LAYOUT_STACKED_OFFSET) { - if (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_HORIZONTAL && bool(p_position_in_tilemap.y % 2) && bool(p_coords_in_pattern.y % 2)) { - output.x -= 1; - } else if (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_VERTICAL && bool(p_position_in_tilemap.x % 2) && bool(p_coords_in_pattern.x % 2)) { - output.y -= 1; - } - } - } - - return output; + ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2i()); + return tile_set->map_pattern(p_position_in_tilemap, p_coords_in_pattern, p_pattern); } void TileMap::set_pattern(int p_layer, const Vector2i &p_position, const Ref<TileMapPattern> p_pattern) { @@ -700,7 +637,7 @@ TileMapCell TileMap::get_cell(int p_layer, const Vector2i &p_coords, bool p_use_ } Vector2i TileMap::get_coords_for_body_rid(RID p_physics_body) { - for (const Ref<TileMapLayer> &layer : layers) { + for (const TileMapLayer *layer : layers) { if (layer->has_body_rid(p_physics_body)) { return layer->get_coords_for_body_rid(p_physics_body); } @@ -718,7 +655,7 @@ int TileMap::get_layer_for_body_rid(RID p_physics_body) { } void TileMap::fix_invalid_tiles() { - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->fix_invalid_tiles(); } } @@ -728,7 +665,7 @@ void TileMap::clear_layer(int p_layer) { } void TileMap::clear() { - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->clear(); } } @@ -742,7 +679,7 @@ void TileMap::notify_runtime_tile_data_update(int p_layer) { if (p_layer >= 0) { TILEMAP_CALL_FOR_LAYER(p_layer, notify_tile_map_change, TileMapLayer::DIRTY_FLAGS_TILE_MAP_RUNTIME_UPDATE); } else { - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_RUNTIME_UPDATE); } } @@ -780,9 +717,9 @@ bool TileMap::_set(const StringName &p_name, const Variant &p_value) { else if (p_name == "tile_data") { // Kept for compatibility reasons. if (p_value.is_array()) { if (layers.size() == 0) { - Ref<TileMapLayer> new_layer; - new_layer.instantiate(); - new_layer->set_tile_map(this); + TileMapLayer *new_layer = memnew(TileMapLayer); + add_child(new_layer); + new_layer->set_name("Layer0"); new_layer->set_layer_index_in_tile_map_node(0); layers.push_back(new_layer); } @@ -804,9 +741,9 @@ bool TileMap::_set(const StringName &p_name, const Variant &p_value) { if (index >= (int)layers.size()) { while (index >= (int)layers.size()) { - Ref<TileMapLayer> new_layer; - new_layer.instantiate(); - new_layer->set_tile_map(this); + TileMapLayer *new_layer = memnew(TileMapLayer); + add_child(new_layer); + new_layer->set_name(vformat("Layer%d", index)); new_layer->set_layer_index_in_tile_map_node(index); layers.push_back(new_layer); } @@ -985,623 +922,23 @@ bool TileMap::_property_get_revert(const StringName &p_name, Variant &r_property } Vector2 TileMap::map_to_local(const Vector2i &p_pos) const { - // SHOULD RETURN THE CENTER OF THE CELL. ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2()); - - Vector2 ret = p_pos; - TileSet::TileShape tile_shape = tile_set->get_tile_shape(); - TileSet::TileOffsetAxis tile_offset_axis = tile_set->get_tile_offset_axis(); - - if (tile_shape == TileSet::TILE_SHAPE_HALF_OFFSET_SQUARE || tile_shape == TileSet::TILE_SHAPE_HEXAGON || tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { - // Technically, those 3 shapes are equivalent, as they are basically half-offset, but with different levels or overlap. - // square = no overlap, hexagon = 0.25 overlap, isometric = 0.5 overlap. - if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { - switch (tile_set->get_tile_layout()) { - case TileSet::TILE_LAYOUT_STACKED: - ret = Vector2(ret.x + (Math::posmod(ret.y, 2) == 0 ? 0.0 : 0.5), ret.y); - break; - case TileSet::TILE_LAYOUT_STACKED_OFFSET: - ret = Vector2(ret.x + (Math::posmod(ret.y, 2) == 1 ? 0.0 : 0.5), ret.y); - break; - case TileSet::TILE_LAYOUT_STAIRS_RIGHT: - ret = Vector2(ret.x + ret.y / 2, ret.y); - break; - case TileSet::TILE_LAYOUT_STAIRS_DOWN: - ret = Vector2(ret.x / 2, ret.y * 2 + ret.x); - break; - case TileSet::TILE_LAYOUT_DIAMOND_RIGHT: - ret = Vector2((ret.x + ret.y) / 2, ret.y - ret.x); - break; - case TileSet::TILE_LAYOUT_DIAMOND_DOWN: - ret = Vector2((ret.x - ret.y) / 2, ret.y + ret.x); - break; - } - } else { // TILE_OFFSET_AXIS_VERTICAL. - switch (tile_set->get_tile_layout()) { - case TileSet::TILE_LAYOUT_STACKED: - ret = Vector2(ret.x, ret.y + (Math::posmod(ret.x, 2) == 0 ? 0.0 : 0.5)); - break; - case TileSet::TILE_LAYOUT_STACKED_OFFSET: - ret = Vector2(ret.x, ret.y + (Math::posmod(ret.x, 2) == 1 ? 0.0 : 0.5)); - break; - case TileSet::TILE_LAYOUT_STAIRS_RIGHT: - ret = Vector2(ret.x * 2 + ret.y, ret.y / 2); - break; - case TileSet::TILE_LAYOUT_STAIRS_DOWN: - ret = Vector2(ret.x, ret.y + ret.x / 2); - break; - case TileSet::TILE_LAYOUT_DIAMOND_RIGHT: - ret = Vector2(ret.x + ret.y, (ret.y - ret.x) / 2); - break; - case TileSet::TILE_LAYOUT_DIAMOND_DOWN: - ret = Vector2(ret.x - ret.y, (ret.y + ret.x) / 2); - break; - } - } - } - - // Multiply by the overlapping ratio. - double overlapping_ratio = 1.0; - if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { - if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { - overlapping_ratio = 0.5; - } else if (tile_shape == TileSet::TILE_SHAPE_HEXAGON) { - overlapping_ratio = 0.75; - } - ret.y *= overlapping_ratio; - } else { // TILE_OFFSET_AXIS_VERTICAL. - if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { - overlapping_ratio = 0.5; - } else if (tile_shape == TileSet::TILE_SHAPE_HEXAGON) { - overlapping_ratio = 0.75; - } - ret.x *= overlapping_ratio; - } - - return (ret + Vector2(0.5, 0.5)) * tile_set->get_tile_size(); + return tile_set->map_to_local(p_pos); } -Vector2i TileMap::local_to_map(const Vector2 &p_local_position) const { +Vector2i TileMap::local_to_map(const Vector2 &p_pos) const { ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2i()); - - Vector2 ret = p_local_position; - ret /= tile_set->get_tile_size(); - - TileSet::TileShape tile_shape = tile_set->get_tile_shape(); - TileSet::TileOffsetAxis tile_offset_axis = tile_set->get_tile_offset_axis(); - TileSet::TileLayout tile_layout = tile_set->get_tile_layout(); - - // Divide by the overlapping ratio. - double overlapping_ratio = 1.0; - if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { - if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { - overlapping_ratio = 0.5; - } else if (tile_shape == TileSet::TILE_SHAPE_HEXAGON) { - overlapping_ratio = 0.75; - } - ret.y /= overlapping_ratio; - } else { // TILE_OFFSET_AXIS_VERTICAL. - if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { - overlapping_ratio = 0.5; - } else if (tile_shape == TileSet::TILE_SHAPE_HEXAGON) { - overlapping_ratio = 0.75; - } - ret.x /= overlapping_ratio; - } - - // For each half-offset shape, we check if we are in the corner of the tile, and thus should correct the local position accordingly. - if (tile_shape == TileSet::TILE_SHAPE_HALF_OFFSET_SQUARE || tile_shape == TileSet::TILE_SHAPE_HEXAGON || tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { - // Technically, those 3 shapes are equivalent, as they are basically half-offset, but with different levels or overlap. - // square = no overlap, hexagon = 0.25 overlap, isometric = 0.5 overlap. - if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { - // Smart floor of the position - Vector2 raw_pos = ret; - if (Math::posmod(Math::floor(ret.y), 2) ^ (tile_layout == TileSet::TILE_LAYOUT_STACKED_OFFSET)) { - ret = Vector2(Math::floor(ret.x + 0.5) - 0.5, Math::floor(ret.y)); - } else { - ret = ret.floor(); - } - - // Compute the tile offset, and if we might the output for a neighbor top tile. - Vector2 in_tile_pos = raw_pos - ret; - bool in_top_left_triangle = (in_tile_pos - Vector2(0.5, 0.0)).cross(Vector2(-0.5, 1.0 / overlapping_ratio - 1)) <= 0; - bool in_top_right_triangle = (in_tile_pos - Vector2(0.5, 0.0)).cross(Vector2(0.5, 1.0 / overlapping_ratio - 1)) > 0; - - switch (tile_layout) { - case TileSet::TILE_LAYOUT_STACKED: - ret = ret.floor(); - if (in_top_left_triangle) { - ret += Vector2i(Math::posmod(Math::floor(ret.y), 2) ? 0 : -1, -1); - } else if (in_top_right_triangle) { - ret += Vector2i(Math::posmod(Math::floor(ret.y), 2) ? 1 : 0, -1); - } - break; - case TileSet::TILE_LAYOUT_STACKED_OFFSET: - ret = ret.floor(); - if (in_top_left_triangle) { - ret += Vector2i(Math::posmod(Math::floor(ret.y), 2) ? -1 : 0, -1); - } else if (in_top_right_triangle) { - ret += Vector2i(Math::posmod(Math::floor(ret.y), 2) ? 0 : 1, -1); - } - break; - case TileSet::TILE_LAYOUT_STAIRS_RIGHT: - ret = Vector2(ret.x - ret.y / 2, ret.y).floor(); - if (in_top_left_triangle) { - ret += Vector2i(0, -1); - } else if (in_top_right_triangle) { - ret += Vector2i(1, -1); - } - break; - case TileSet::TILE_LAYOUT_STAIRS_DOWN: - ret = Vector2(ret.x * 2, ret.y / 2 - ret.x).floor(); - if (in_top_left_triangle) { - ret += Vector2i(-1, 0); - } else if (in_top_right_triangle) { - ret += Vector2i(1, -1); - } - break; - case TileSet::TILE_LAYOUT_DIAMOND_RIGHT: - ret = Vector2(ret.x - ret.y / 2, ret.y / 2 + ret.x).floor(); - if (in_top_left_triangle) { - ret += Vector2i(0, -1); - } else if (in_top_right_triangle) { - ret += Vector2i(1, 0); - } - break; - case TileSet::TILE_LAYOUT_DIAMOND_DOWN: - ret = Vector2(ret.x + ret.y / 2, ret.y / 2 - ret.x).floor(); - if (in_top_left_triangle) { - ret += Vector2i(-1, 0); - } else if (in_top_right_triangle) { - ret += Vector2i(0, -1); - } - break; - } - } else { // TILE_OFFSET_AXIS_VERTICAL. - // Smart floor of the position. - Vector2 raw_pos = ret; - if (Math::posmod(Math::floor(ret.x), 2) ^ (tile_layout == TileSet::TILE_LAYOUT_STACKED_OFFSET)) { - ret = Vector2(Math::floor(ret.x), Math::floor(ret.y + 0.5) - 0.5); - } else { - ret = ret.floor(); - } - - // Compute the tile offset, and if we might the output for a neighbor top tile. - Vector2 in_tile_pos = raw_pos - ret; - bool in_top_left_triangle = (in_tile_pos - Vector2(0.0, 0.5)).cross(Vector2(1.0 / overlapping_ratio - 1, -0.5)) > 0; - bool in_bottom_left_triangle = (in_tile_pos - Vector2(0.0, 0.5)).cross(Vector2(1.0 / overlapping_ratio - 1, 0.5)) <= 0; - - switch (tile_layout) { - case TileSet::TILE_LAYOUT_STACKED: - ret = ret.floor(); - if (in_top_left_triangle) { - ret += Vector2i(-1, Math::posmod(Math::floor(ret.x), 2) ? 0 : -1); - } else if (in_bottom_left_triangle) { - ret += Vector2i(-1, Math::posmod(Math::floor(ret.x), 2) ? 1 : 0); - } - break; - case TileSet::TILE_LAYOUT_STACKED_OFFSET: - ret = ret.floor(); - if (in_top_left_triangle) { - ret += Vector2i(-1, Math::posmod(Math::floor(ret.x), 2) ? -1 : 0); - } else if (in_bottom_left_triangle) { - ret += Vector2i(-1, Math::posmod(Math::floor(ret.x), 2) ? 0 : 1); - } - break; - case TileSet::TILE_LAYOUT_STAIRS_RIGHT: - ret = Vector2(ret.x / 2 - ret.y, ret.y * 2).floor(); - if (in_top_left_triangle) { - ret += Vector2i(0, -1); - } else if (in_bottom_left_triangle) { - ret += Vector2i(-1, 1); - } - break; - case TileSet::TILE_LAYOUT_STAIRS_DOWN: - ret = Vector2(ret.x, ret.y - ret.x / 2).floor(); - if (in_top_left_triangle) { - ret += Vector2i(-1, 0); - } else if (in_bottom_left_triangle) { - ret += Vector2i(-1, 1); - } - break; - case TileSet::TILE_LAYOUT_DIAMOND_RIGHT: - ret = Vector2(ret.x / 2 - ret.y, ret.y + ret.x / 2).floor(); - if (in_top_left_triangle) { - ret += Vector2i(0, -1); - } else if (in_bottom_left_triangle) { - ret += Vector2i(-1, 0); - } - break; - case TileSet::TILE_LAYOUT_DIAMOND_DOWN: - ret = Vector2(ret.x / 2 + ret.y, ret.y - ret.x / 2).floor(); - if (in_top_left_triangle) { - ret += Vector2i(-1, 0); - } else if (in_bottom_left_triangle) { - ret += Vector2i(0, 1); - } - break; - } - } - } else { - ret = (ret + Vector2(0.00005, 0.00005)).floor(); - } - return Vector2i(ret); + return tile_set->local_to_map(p_pos); } bool TileMap::is_existing_neighbor(TileSet::CellNeighbor p_cell_neighbor) const { ERR_FAIL_COND_V(!tile_set.is_valid(), false); - - TileSet::TileShape shape = tile_set->get_tile_shape(); - if (shape == TileSet::TILE_SHAPE_SQUARE) { - return p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER; - - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC) { - return p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; - } else { - if (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { - return p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; - } else { - return p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE || - p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; - } - } + return tile_set->is_existing_neighbor(p_cell_neighbor); } Vector2i TileMap::get_neighbor_cell(const Vector2i &p_coords, TileSet::CellNeighbor p_cell_neighbor) const { - ERR_FAIL_COND_V(!tile_set.is_valid(), p_coords); - - TileSet::TileShape shape = tile_set->get_tile_shape(); - if (shape == TileSet::TILE_SHAPE_SQUARE) { - switch (p_cell_neighbor) { - case TileSet::CELL_NEIGHBOR_RIGHT_SIDE: - return p_coords + Vector2i(1, 0); - case TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER: - return p_coords + Vector2i(1, 1); - case TileSet::CELL_NEIGHBOR_BOTTOM_SIDE: - return p_coords + Vector2i(0, 1); - case TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER: - return p_coords + Vector2i(-1, 1); - case TileSet::CELL_NEIGHBOR_LEFT_SIDE: - return p_coords + Vector2i(-1, 0); - case TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER: - return p_coords + Vector2i(-1, -1); - case TileSet::CELL_NEIGHBOR_TOP_SIDE: - return p_coords + Vector2i(0, -1); - case TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER: - return p_coords + Vector2i(1, -1); - default: - ERR_FAIL_V(p_coords); - } - } else { // Half-offset shapes (square and hexagon). - switch (tile_set->get_tile_layout()) { - case TileSet::TILE_LAYOUT_STACKED: { - if (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { - bool is_offset = p_coords.y % 2; - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { - return p_coords + Vector2i(1, 0); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(is_offset ? 1 : 0, 1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { - return p_coords + Vector2i(0, 2); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(is_offset ? 0 : -1, 1); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { - return p_coords + Vector2i(-1, 0); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(is_offset ? 0 : -1, -1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { - return p_coords + Vector2i(0, -2); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(is_offset ? 1 : 0, -1); - } else { - ERR_FAIL_V(p_coords); - } - } else { - bool is_offset = p_coords.x % 2; - - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { - return p_coords + Vector2i(0, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(1, is_offset ? 1 : 0); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { - return p_coords + Vector2i(2, 0); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(1, is_offset ? 0 : -1); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { - return p_coords + Vector2i(0, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(-1, is_offset ? 0 : -1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { - return p_coords + Vector2i(-2, 0); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(-1, is_offset ? 1 : 0); - } else { - ERR_FAIL_V(p_coords); - } - } - } break; - case TileSet::TILE_LAYOUT_STACKED_OFFSET: { - if (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { - bool is_offset = p_coords.y % 2; - - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { - return p_coords + Vector2i(1, 0); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(is_offset ? 0 : 1, 1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { - return p_coords + Vector2i(0, 2); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(is_offset ? -1 : 0, 1); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { - return p_coords + Vector2i(-1, 0); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(is_offset ? -1 : 0, -1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { - return p_coords + Vector2i(0, -2); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(is_offset ? 0 : 1, -1); - } else { - ERR_FAIL_V(p_coords); - } - } else { - bool is_offset = p_coords.x % 2; - - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { - return p_coords + Vector2i(0, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(1, is_offset ? 0 : 1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { - return p_coords + Vector2i(2, 0); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(1, is_offset ? -1 : 0); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { - return p_coords + Vector2i(0, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(-1, is_offset ? -1 : 0); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { - return p_coords + Vector2i(-2, 0); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(-1, is_offset ? 0 : 1); - } else { - ERR_FAIL_V(p_coords); - } - } - } break; - case TileSet::TILE_LAYOUT_STAIRS_RIGHT: - case TileSet::TILE_LAYOUT_STAIRS_DOWN: { - if ((tile_set->get_tile_layout() == TileSet::TILE_LAYOUT_STAIRS_RIGHT) ^ (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_VERTICAL)) { - if (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { - return p_coords + Vector2i(1, 0); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(0, 1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { - return p_coords + Vector2i(-1, 2); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(-1, 1); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { - return p_coords + Vector2i(-1, 0); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(0, -1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { - return p_coords + Vector2i(1, -2); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(1, -1); - } else { - ERR_FAIL_V(p_coords); - } - - } else { - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { - return p_coords + Vector2i(0, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(1, 0); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { - return p_coords + Vector2i(2, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(1, -1); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { - return p_coords + Vector2i(0, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(-1, 0); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { - return p_coords + Vector2i(-2, 1); - - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(-1, 1); - } else { - ERR_FAIL_V(p_coords); - } - } - } else { - if (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { - return p_coords + Vector2i(2, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(1, 0); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { - return p_coords + Vector2i(0, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(-1, 1); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { - return p_coords + Vector2i(-2, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(-1, 0); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { - return p_coords + Vector2i(0, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(1, -1); - } else { - ERR_FAIL_V(p_coords); - } - - } else { - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { - return p_coords + Vector2i(-1, 2); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(0, 1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { - return p_coords + Vector2i(1, 0); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(1, -1); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { - return p_coords + Vector2i(1, -2); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(0, -1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { - return p_coords + Vector2i(-1, 0); - - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(-1, 1); - } else { - ERR_FAIL_V(p_coords); - } - } - } - } break; - case TileSet::TILE_LAYOUT_DIAMOND_RIGHT: - case TileSet::TILE_LAYOUT_DIAMOND_DOWN: { - if ((tile_set->get_tile_layout() == TileSet::TILE_LAYOUT_DIAMOND_RIGHT) ^ (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_VERTICAL)) { - if (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { - return p_coords + Vector2i(1, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(0, 1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { - return p_coords + Vector2i(-1, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(-1, 0); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { - return p_coords + Vector2i(-1, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(0, -1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { - return p_coords + Vector2i(1, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(1, 0); - } else { - ERR_FAIL_V(p_coords); - } - - } else { - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { - return p_coords + Vector2i(1, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(1, 0); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { - return p_coords + Vector2i(1, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(0, -1); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { - return p_coords + Vector2i(-1, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(-1, 0); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { - return p_coords + Vector2i(-1, 1); - - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(0, 1); - } else { - ERR_FAIL_V(p_coords); - } - } - } else { - if (tile_set->get_tile_offset_axis() == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { - return p_coords + Vector2i(1, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(1, 0); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { - return p_coords + Vector2i(1, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(0, 1); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { - return p_coords + Vector2i(-1, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(-1, 0); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { - return p_coords + Vector2i(-1, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(0, -1); - } else { - ERR_FAIL_V(p_coords); - } - - } else { - if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { - return p_coords + Vector2i(-1, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { - return p_coords + Vector2i(0, 1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { - return p_coords + Vector2i(1, 1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { - return p_coords + Vector2i(1, 0); - } else if ((shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || - (shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { - return p_coords + Vector2i(1, -1); - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { - return p_coords + Vector2i(0, -1); - } else if (shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { - return p_coords + Vector2i(-1, -1); - - } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { - return p_coords + Vector2i(-1, 0); - } else { - ERR_FAIL_V(p_coords); - } - } - } - } break; - default: - ERR_FAIL_V(p_coords); - } - } + ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2i()); + return tile_set->get_neighbor_cell(p_coords, p_cell_neighbor); } TypedArray<Vector2i> TileMap::get_used_cells(int p_layer) const { @@ -1616,7 +953,7 @@ Rect2i TileMap::get_used_rect() const { // Return the visible rect of the tilemap. bool first = true; Rect2i rect = Rect2i(); - for (const Ref<TileMapLayer> &layer : layers) { + for (const TileMapLayer *layer : layers) { Rect2i layer_rect = layer->get_used_rect(); if (layer_rect == Rect2i()) { continue; @@ -1636,7 +973,7 @@ Rect2i TileMap::get_used_rect() const { void TileMap::set_light_mask(int p_light_mask) { // Occlusion: set light mask. CanvasItem::set_light_mask(p_light_mask); - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_LIGHT_MASK); } } @@ -1646,7 +983,7 @@ void TileMap::set_material(const Ref<Material> &p_material) { CanvasItem::set_material(p_material); // Update material for the whole tilemap. - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_MATERIAL); } } @@ -1656,7 +993,7 @@ void TileMap::set_use_parent_material(bool p_use_parent_material) { CanvasItem::set_use_parent_material(p_use_parent_material); // Update use_parent_material for the whole tilemap. - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_USE_PARENT_MATERIAL); } } @@ -1664,7 +1001,7 @@ void TileMap::set_use_parent_material(bool p_use_parent_material) { void TileMap::set_texture_filter(TextureFilter p_texture_filter) { // Set a default texture filter for the whole tilemap. CanvasItem::set_texture_filter(p_texture_filter); - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_TEXTURE_FILTER); } } @@ -1672,7 +1009,7 @@ void TileMap::set_texture_filter(TextureFilter p_texture_filter) { void TileMap::set_texture_repeat(CanvasItem::TextureRepeat p_texture_repeat) { // Set a default texture repeat for the whole tilemap. CanvasItem::set_texture_repeat(p_texture_repeat); - for (Ref<TileMapLayer> &layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_TEXTURE_REPEAT); } } @@ -1771,14 +1108,14 @@ PackedStringArray TileMap::get_configuration_warnings() const { // Retrieve the set of Z index values with a Y-sorted layer. RBSet<int> y_sorted_z_index; - for (const Ref<TileMapLayer> &layer : layers) { + for (const TileMapLayer *layer : layers) { if (layer->is_y_sort_enabled()) { y_sorted_z_index.insert(layer->get_z_index()); } } // Check if we have a non-sorted layer in a Z-index with a Y-sorted layer. - for (const Ref<TileMapLayer> &layer : layers) { + for (const TileMapLayer *layer : layers) { if (!layer->is_y_sort_enabled() && y_sorted_z_index.has(layer->get_z_index())) { warnings.push_back(RTR("A Y-sorted layer has the same Z-index value as a not Y-sorted layer.\nThis may lead to unwanted behaviors, as a layer that is not Y-sorted will be Y-sorted as a whole with tiles from Y-sorted layers.")); break; @@ -1787,7 +1124,7 @@ PackedStringArray TileMap::get_configuration_warnings() const { if (!is_y_sort_enabled()) { // Check if Y-sort is enabled on a layer but not on the node. - for (const Ref<TileMapLayer> &layer : layers) { + for (const TileMapLayer *layer : layers) { if (layer->is_y_sort_enabled()) { warnings.push_back(RTR("A TileMap layer is set as Y-sorted, but Y-sort is not enabled on the TileMap node itself.")); break; @@ -1796,7 +1133,7 @@ PackedStringArray TileMap::get_configuration_warnings() const { } else { // Check if Y-sort is enabled on the node, but not on any of the layers. bool need_warning = true; - for (const Ref<TileMapLayer> &layer : layers) { + for (const TileMapLayer *layer : layers) { if (layer->is_y_sort_enabled()) { need_warning = false; break; @@ -1811,7 +1148,7 @@ PackedStringArray TileMap::get_configuration_warnings() const { if (tile_set.is_valid() && tile_set->get_tile_shape() == TileSet::TILE_SHAPE_ISOMETRIC) { bool warn = !is_y_sort_enabled(); if (!warn) { - for (const Ref<TileMapLayer> &layer : layers) { + for (const TileMapLayer *layer : layers) { if (!layer->is_y_sort_enabled()) { warn = true; break; @@ -1926,42 +1263,27 @@ void TileMap::_bind_methods() { void TileMap::_tile_set_changed() { emit_signal(CoreStringNames::get_singleton()->changed); - for (Ref<TileMapLayer> layer : layers) { + for (TileMapLayer *layer : layers) { layer->notify_tile_map_change(TileMapLayer::DIRTY_FLAGS_TILE_MAP_TILE_SET); } update_configuration_warnings(); } -void TileMap::_update_notify_local_transform() { - bool notify = collision_animatable || is_y_sort_enabled(); - if (!notify) { - for (const Ref<TileMapLayer> &layer : layers) { - if (layer->is_y_sort_enabled()) { - notify = true; - break; - } - } - } - set_notify_local_transform(notify); -} - TileMap::TileMap() { - set_notify_transform(true); - _update_notify_local_transform(); - - Ref<TileMapLayer> new_layer; - new_layer.instantiate(); - new_layer->set_tile_map(this); + TileMapLayer *new_layer = memnew(TileMapLayer); + add_child(new_layer); + new_layer->set_name("Layer0"); new_layer->set_layer_index_in_tile_map_node(0); layers.push_back(new_layer); - default_layer.instantiate(); + default_layer = memnew(TileMapLayer); } TileMap::~TileMap() { if (tile_set.is_valid()) { tile_set->disconnect_changed(callable_mp(this, &TileMap::_tile_set_changed)); } + memdelete(default_layer); } #undef TILEMAP_CALL_FOR_LAYER diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index 29af0ad2b1..f2b481cdd1 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -71,18 +71,17 @@ private: VisibilityMode navigation_visibility_mode = VISIBILITY_MODE_DEFAULT; // Layers. - LocalVector<Ref<TileMapLayer>> layers; - Ref<TileMapLayer> default_layer; // Dummy layer to fetch default values. + LocalVector<TileMapLayer *> layers; + TileMapLayer *default_layer; // Dummy layer to fetch default values. int selected_layer = -1; bool pending_update = false; + // Transforms for collision_animatable. Transform2D last_valid_transform; Transform2D new_transform; void _tile_set_changed(); - void _update_notify_local_transform(); - protected: bool _set(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_ret) const; @@ -97,6 +96,8 @@ protected: Rect2i _get_used_rect_bind_compat_78328(); void _set_quadrant_size_compat_81070(int p_quadrant_size); int _get_quadrant_size_compat_81070() const; + VisibilityMode _get_collision_visibility_mode_bind_compat_87115(); + VisibilityMode _get_navigation_visibility_mode_bind_compat_87115(); static void _bind_compatibility_methods(); #endif @@ -150,15 +151,15 @@ public: void set_selected_layer(int p_layer_id); // For editor use. int get_selected_layer() const; - void set_collision_animatable(bool p_enabled); + void set_collision_animatable(bool p_collision_animatable); bool is_collision_animatable() const; // Debug visibility modes. void set_collision_visibility_mode(VisibilityMode p_show_collision); - VisibilityMode get_collision_visibility_mode(); + VisibilityMode get_collision_visibility_mode() const; void set_navigation_visibility_mode(VisibilityMode p_show_navigation); - VisibilityMode get_navigation_visibility_mode(); + VisibilityMode get_navigation_visibility_mode() const; // Cells accessors. void set_cell(int p_layer, const Vector2i &p_coords, int p_source_id = TileSet::INVALID_SOURCE, const Vector2i p_atlas_coords = TileSetSource::INVALID_ATLAS_COORDS, int p_alternative_tile = 0); @@ -192,7 +193,6 @@ public: Vector2 map_to_local(const Vector2i &p_pos) const; Vector2i local_to_map(const Vector2 &p_pos) const; - bool is_existing_neighbor(TileSet::CellNeighbor p_cell_neighbor) const; Vector2i get_neighbor_cell(const Vector2i &p_coords, TileSet::CellNeighbor p_cell_neighbor) const; diff --git a/scene/2d/tile_map_layer.cpp b/scene/2d/tile_map_layer.cpp index 4ef47ba174..df79b3fee6 100644 --- a/scene/2d/tile_map_layer.cpp +++ b/scene/2d/tile_map_layer.cpp @@ -40,6 +40,18 @@ #include "servers/navigation_server_3d.h" #endif // DEBUG_ENABLED +TileMap *TileMapLayer::_fetch_tilemap() const { + return TileMap::cast_to<TileMap>(get_parent()); +} + +Ref<TileSet> TileMapLayer::_fetch_tileset() const { + TileMap *tile_map_node = _fetch_tilemap(); + if (!tile_map_node) { + return Ref<TileSet>(); + } + return tile_map_node->get_tileset(); +} + #ifdef DEBUG_ENABLED /////////////////////////////// Debug ////////////////////////////////////////// constexpr int TILE_MAP_DEBUG_QUADRANT_SIZE = 16; @@ -51,11 +63,11 @@ Vector2i TileMapLayer::_coords_to_debug_quadrant_coords(const Vector2i &p_coords } void TileMapLayer::_debug_update() { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); RenderingServer *rs = RenderingServer::get_singleton(); // Check if we should cleanup everything. - bool forced_cleanup = in_destructor || !enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid() || !tile_map_node->is_visible_in_tree(); + bool forced_cleanup = in_destructor || !enabled || !tile_set.is_valid() || !is_visible_in_tree(); if (forced_cleanup) { for (KeyValue<Vector2i, Ref<DebugQuadrant>> &kv : debug_quadrant_map) { @@ -120,10 +132,10 @@ void TileMapLayer::_debug_update() { } else { ci = rs->canvas_item_create(); rs->canvas_item_set_z_index(ci, RS::CANVAS_ITEM_Z_MAX - 1); - rs->canvas_item_set_parent(ci, tile_map_node->get_canvas_item()); + rs->canvas_item_set_parent(ci, get_canvas_item()); } - const Vector2 quadrant_pos = tile_map_node->map_to_local(debug_quadrant.quadrant_coords * TILE_MAP_DEBUG_QUADRANT_SIZE); + const Vector2 quadrant_pos = tile_set->map_to_local(debug_quadrant.quadrant_coords * TILE_MAP_DEBUG_QUADRANT_SIZE); Transform2D xform(0, quadrant_pos); rs->canvas_item_set_transform(ci, xform); @@ -179,48 +191,33 @@ void TileMapLayer::_debug_quadrants_update_cell(CellData &r_cell_data, SelfList< /////////////////////////////// Rendering ////////////////////////////////////// void TileMapLayer::_rendering_update() { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const TileMap *tile_map_node = _fetch_tilemap(); + const Ref<TileSet> &tile_set = _fetch_tileset(); RenderingServer *rs = RenderingServer::get_singleton(); // Check if we should cleanup everything. - bool forced_cleanup = in_destructor || !enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid() || !tile_map_node->is_visible_in_tree(); + bool forced_cleanup = in_destructor || !enabled || !tile_set.is_valid() || !is_visible_in_tree(); // ----------- Layer level processing ----------- - if (forced_cleanup) { - // Cleanup. - if (canvas_item.is_valid()) { - rs->free(canvas_item); - canvas_item = RID(); - } - } else { - // Create/Update the layer's CanvasItem. - if (!canvas_item.is_valid()) { - RID ci = rs->canvas_item_create(); - rs->canvas_item_set_parent(ci, tile_map_node->get_canvas_item()); - canvas_item = ci; - } - RID &ci = canvas_item; - rs->canvas_item_set_draw_index(ci, layer_index_in_tile_map_node - (int64_t)0x80000000); - rs->canvas_item_set_sort_children_by_y(ci, y_sort_enabled); - rs->canvas_item_set_use_parent_material(ci, tile_map_node->get_use_parent_material() || tile_map_node->get_material().is_valid()); - rs->canvas_item_set_z_index(ci, z_index); - rs->canvas_item_set_default_texture_filter(ci, RS::CanvasItemTextureFilter(tile_map_node->get_texture_filter_in_tree())); - rs->canvas_item_set_default_texture_repeat(ci, RS::CanvasItemTextureRepeat(tile_map_node->get_texture_repeat_in_tree())); - rs->canvas_item_set_light_mask(ci, tile_map_node->get_light_mask()); + if (!forced_cleanup) { + // Update the layer's CanvasItem. + set_use_parent_material(true); + set_light_mask(tile_map_node->get_light_mask()); // Modulate the layer. - Color layer_modulate = modulate; + Color layer_modulate = get_modulate(); int selected_layer = tile_map_node->get_selected_layer(); if (selected_layer >= 0 && layer_index_in_tile_map_node != selected_layer) { int z_selected = tile_map_node->get_layer_z_index(selected_layer); - if (z_index < z_selected || (z_index == z_selected && layer_index_in_tile_map_node < selected_layer)) { + int layer_z_index = get_z_index(); + if (layer_z_index < z_selected || (layer_z_index == z_selected && layer_index_in_tile_map_node < selected_layer)) { layer_modulate = layer_modulate.darkened(0.5); - } else if (z_index > z_selected || (z_index == z_selected && layer_index_in_tile_map_node > selected_layer)) { + } else if (layer_z_index > z_selected || (layer_z_index == z_selected && layer_index_in_tile_map_node > selected_layer)) { layer_modulate = layer_modulate.darkened(0.5); layer_modulate.a *= 0.3; } } - rs->canvas_item_set_modulate(ci, layer_modulate); + rs->canvas_item_set_modulate(get_canvas_item(), layer_modulate); } // ----------- Quadrants processing ----------- @@ -231,7 +228,7 @@ void TileMapLayer::_rendering_update() { // Check if anything changed that might change the quadrant shape. // If so, recreate everything. bool quandrant_shape_changed = dirty.flags[DIRTY_FLAGS_TILE_MAP_QUADRANT_SIZE] || - (tile_map_node->is_y_sort_enabled() && y_sort_enabled && (dirty.flags[DIRTY_FLAGS_LAYER_Y_SORT_ENABLED] || dirty.flags[DIRTY_FLAGS_LAYER_Y_SORT_ORIGIN] || dirty.flags[DIRTY_FLAGS_TILE_MAP_Y_SORT_ENABLED] || dirty.flags[DIRTY_FLAGS_TILE_MAP_LOCAL_XFORM] || dirty.flags[DIRTY_FLAGS_TILE_MAP_TILE_SET])); + (is_y_sort_enabled() && (dirty.flags[DIRTY_FLAGS_LAYER_Y_SORT_ENABLED] || dirty.flags[DIRTY_FLAGS_LAYER_Y_SORT_ORIGIN] || dirty.flags[DIRTY_FLAGS_TILE_MAP_Y_SORT_ENABLED] || dirty.flags[DIRTY_FLAGS_LAYER_LOCAL_TRANSFORM] || dirty.flags[DIRTY_FLAGS_TILE_MAP_TILE_SET])); // Free all quadrants. if (forced_cleanup || quandrant_shape_changed) { @@ -250,7 +247,7 @@ void TileMapLayer::_rendering_update() { if (!forced_cleanup) { // List all quadrants to update, recreating them if needed. - if (dirty.flags[DIRTY_FLAGS_TILE_MAP_TILE_SET] || _rendering_was_cleaned_up) { + if (dirty.flags[DIRTY_FLAGS_TILE_MAP_TILE_SET] || dirty.flags[DIRTY_FLAGS_LAYER_IN_TREE] || _rendering_was_cleaned_up) { // Update all cells. for (KeyValue<Vector2i, CellData> &kv : tile_map) { CellData &cell_data = kv.value; @@ -290,7 +287,7 @@ void TileMapLayer::_rendering_update() { rendering_quadrant->canvas_items.clear(); // Sort the quadrant cells. - if (tile_map_node->is_y_sort_enabled() && is_y_sort_enabled()) { + if (is_y_sort_enabled()) { // For compatibility reasons, we use another comparator for Y-sorted layers. rendering_quadrant->cells.sort_custom<CellDataYSortedComparator>(); } else { @@ -330,8 +327,8 @@ void TileMapLayer::_rendering_update() { if (mat.is_valid()) { rs->canvas_item_set_material(ci, mat->get_rid()); } - rs->canvas_item_set_parent(ci, canvas_item); - rs->canvas_item_set_use_parent_material(ci, tile_map_node->get_use_parent_material() || tile_map_node->get_material().is_valid()); + rs->canvas_item_set_parent(ci, get_canvas_item()); + rs->canvas_item_set_use_parent_material(ci, true); Transform2D xform(0, rendering_quadrant->canvas_items_position); rs->canvas_item_set_transform(ci, xform); @@ -340,8 +337,8 @@ void TileMapLayer::_rendering_update() { rs->canvas_item_set_z_as_relative_to_parent(ci, true); rs->canvas_item_set_z_index(ci, tile_z_index); - rs->canvas_item_set_default_texture_filter(ci, RS::CanvasItemTextureFilter(tile_map_node->get_texture_filter_in_tree())); - rs->canvas_item_set_default_texture_repeat(ci, RS::CanvasItemTextureRepeat(tile_map_node->get_texture_repeat_in_tree())); + rs->canvas_item_set_default_texture_filter(ci, RS::CanvasItemTextureFilter(get_texture_filter_in_tree())); + rs->canvas_item_set_default_texture_repeat(ci, RS::CanvasItemTextureRepeat(get_texture_repeat_in_tree())); rendering_quadrant->canvas_items.push_back(ci); @@ -354,7 +351,7 @@ void TileMapLayer::_rendering_update() { ci = prev_ci; } - const Vector2 local_tile_pos = tile_map_node->map_to_local(cell_data.coords); + const Vector2 local_tile_pos = tile_set->map_to_local(cell_data.coords); // Random animation offset. real_t random_animation_offset = 0.0; @@ -366,7 +363,7 @@ void TileMapLayer::_rendering_update() { } // Drawing the tile in the canvas item. - tile_map_node->draw_tile(ci, local_tile_pos - rendering_quadrant->canvas_items_position, tile_set, cell_data.cell.source_id, cell_data.cell.get_atlas_coords(), cell_data.cell.alternative_tile, -1, tile_map_node->get_self_modulate(), tile_data, random_animation_offset); + TileMap::draw_tile(ci, local_tile_pos - rendering_quadrant->canvas_items_position, tile_set, cell_data.cell.source_id, cell_data.cell.get_atlas_coords(), cell_data.cell.alternative_tile, -1, get_self_modulate(), tile_data, random_animation_offset); } } else { // Free the quadrant. @@ -393,7 +390,7 @@ void TileMapLayer::_rendering_update() { RBMap<Vector2, Ref<RenderingQuadrant>, RenderingQuadrant::CoordsWorldComparator> local_to_map; for (KeyValue<Vector2i, Ref<RenderingQuadrant>> &kv : rendering_quadrant_map) { Ref<RenderingQuadrant> &rendering_quadrant = kv.value; - local_to_map[tile_map_node->map_to_local(rendering_quadrant->quadrant_coords)] = rendering_quadrant; + local_to_map[tile_set->map_to_local(rendering_quadrant->quadrant_coords)] = rendering_quadrant; } // Sort the quadrants. @@ -409,14 +406,15 @@ void TileMapLayer::_rendering_update() { dirty.flags[DIRTY_FLAGS_TILE_MAP_USE_PARENT_MATERIAL] || dirty.flags[DIRTY_FLAGS_TILE_MAP_MATERIAL] || dirty.flags[DIRTY_FLAGS_TILE_MAP_TEXTURE_FILTER] || - dirty.flags[DIRTY_FLAGS_TILE_MAP_TEXTURE_REPEAT]) { + dirty.flags[DIRTY_FLAGS_TILE_MAP_TEXTURE_REPEAT] || + dirty.flags[DIRTY_FLAGS_LAYER_SELF_MODULATE]) { for (KeyValue<Vector2i, Ref<RenderingQuadrant>> &kv : rendering_quadrant_map) { Ref<RenderingQuadrant> &rendering_quadrant = kv.value; for (const RID &ci : rendering_quadrant->canvas_items) { rs->canvas_item_set_light_mask(ci, tile_map_node->get_light_mask()); - rs->canvas_item_set_use_parent_material(ci, tile_map_node->get_use_parent_material() || tile_map_node->get_material().is_valid()); - rs->canvas_item_set_default_texture_filter(ci, RS::CanvasItemTextureFilter(tile_map_node->get_texture_filter_in_tree())); - rs->canvas_item_set_default_texture_repeat(ci, RS::CanvasItemTextureRepeat(tile_map_node->get_texture_repeat_in_tree())); + rs->canvas_item_set_default_texture_filter(ci, RS::CanvasItemTextureFilter(get_texture_filter_in_tree())); + rs->canvas_item_set_default_texture_repeat(ci, RS::CanvasItemTextureRepeat(get_texture_repeat_in_tree())); + rs->canvas_item_set_self_modulate(ci, get_self_modulate()); } } } @@ -441,30 +439,37 @@ void TileMapLayer::_rendering_update() { _rendering_occluders_update_cell(cell_data); } } + } - // Updates on TileMap changes. - if (dirty.flags[DIRTY_FLAGS_TILE_MAP_IN_CANVAS] || dirty.flags[DIRTY_FLAGS_TILE_MAP_VISIBILITY]) { + // ----------- + // Mark the rendering state as up to date. + _rendering_was_cleaned_up = forced_cleanup; +} + +void TileMapLayer::_rendering_notification(int p_what) { + RenderingServer *rs = RenderingServer::get_singleton(); + const Ref<TileSet> &tile_set = _fetch_tileset(); + if (p_what == NOTIFICATION_TRANSFORM_CHANGED || p_what == NOTIFICATION_ENTER_CANVAS || p_what == NOTIFICATION_VISIBILITY_CHANGED) { + if (tile_set.is_valid()) { + Transform2D tilemap_xform = get_global_transform(); for (KeyValue<Vector2i, CellData> &kv : tile_map) { - CellData &cell_data = kv.value; + const CellData &cell_data = kv.value; for (const RID &occluder : cell_data.occluders) { if (occluder.is_null()) { continue; } - Transform2D xform(0, tile_map_node->map_to_local(kv.key)); - rs->canvas_light_occluder_attach_to_canvas(occluder, tile_map_node->get_canvas()); - rs->canvas_light_occluder_set_transform(occluder, tile_map_node->get_global_transform() * xform); + Transform2D xform(0, tile_set->map_to_local(kv.key)); + rs->canvas_light_occluder_attach_to_canvas(occluder, get_canvas()); + rs->canvas_light_occluder_set_transform(occluder, tilemap_xform * xform); } } } } - - // ----------- - // Mark the rendering state as up to date. - _rendering_was_cleaned_up = forced_cleanup; } void TileMapLayer::_rendering_quadrants_update_cell(CellData &r_cell_data, SelfList<RenderingQuadrant>::List &r_dirty_rendering_quadrant_list) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const TileMap *tile_map_node = _fetch_tilemap(); + const Ref<TileSet> &tile_set = _fetch_tileset(); // Check if the cell is valid and retrieve its y_sort_origin. bool is_valid = false; @@ -489,8 +494,8 @@ void TileMapLayer::_rendering_quadrants_update_cell(CellData &r_cell_data, SelfL // Get the quadrant coords. Vector2 canvas_items_position; Vector2i quadrant_coords; - if (tile_map_node->is_y_sort_enabled() && is_y_sort_enabled()) { - canvas_items_position = Vector2(0, tile_map_node->map_to_local(r_cell_data.coords).y + tile_y_sort_origin + y_sort_origin); + if (is_y_sort_enabled()) { + canvas_items_position = Vector2(0, tile_set->map_to_local(r_cell_data.coords).y + tile_y_sort_origin + y_sort_origin); quadrant_coords = canvas_items_position * 100; } else { int quad_size = tile_map_node->get_rendering_quadrant_size(); @@ -500,7 +505,7 @@ void TileMapLayer::_rendering_quadrants_update_cell(CellData &r_cell_data, SelfL quadrant_coords = Vector2i( coords.x > 0 ? coords.x / quad_size : (coords.x - (quad_size - 1)) / quad_size, coords.y > 0 ? coords.y / quad_size : (coords.y - (quad_size - 1)) / quad_size); - canvas_items_position = tile_map_node->map_to_local(quad_size * quadrant_coords); + canvas_items_position = tile_set->map_to_local(quad_size * quadrant_coords); } Ref<RenderingQuadrant> rendering_quadrant; @@ -564,8 +569,7 @@ void TileMapLayer::_rendering_occluders_clear_cell(CellData &r_cell_data) { } void TileMapLayer::_rendering_occluders_update_cell(CellData &r_cell_data) { - bool node_visible = tile_map_node->is_visible_in_tree(); - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); RenderingServer *rs = RenderingServer::get_singleton(); // Free unused occluders then resize the occluders array. @@ -606,14 +610,13 @@ void TileMapLayer::_rendering_occluders_update_cell(CellData &r_cell_data) { if (occluder_polygon.is_valid()) { // Create or update occluder. Transform2D xform; - xform.set_origin(tile_map_node->map_to_local(r_cell_data.coords)); + xform.set_origin(tile_set->map_to_local(r_cell_data.coords)); if (!occluder.is_valid()) { occluder = rs->canvas_light_occluder_create(); } - rs->canvas_light_occluder_set_enabled(occluder, node_visible); - rs->canvas_light_occluder_set_transform(occluder, tile_map_node->get_global_transform() * xform); + rs->canvas_light_occluder_set_transform(occluder, get_global_transform() * xform); rs->canvas_light_occluder_set_polygon(occluder, tile_data->get_occluder(occlusion_layer_index, flip_h, flip_v, transpose)->get_rid()); - rs->canvas_light_occluder_attach_to_canvas(occluder, tile_map_node->get_canvas()); + rs->canvas_light_occluder_attach_to_canvas(occluder, get_canvas()); rs->canvas_light_occluder_set_light_mask(occluder, tile_set->get_occlusion_layer_light_mask(occlusion_layer_index)); } else { // Clear occluder. @@ -634,8 +637,8 @@ void TileMapLayer::_rendering_occluders_update_cell(CellData &r_cell_data) { } #ifdef DEBUG_ENABLED -void TileMapLayer::_rendering_draw_cell_debug(const RID &p_canvas_item, const Vector2i &p_quadrant_pos, const CellData &r_cell_data) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); +void TileMapLayer::_rendering_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data) { + const Ref<TileSet> &tile_set = _fetch_tileset(); ERR_FAIL_COND(!tile_set.is_valid()); if (!Engine::get_singleton()->is_editor_hint()) { @@ -671,7 +674,7 @@ void TileMapLayer::_rendering_draw_cell_debug(const RID &p_canvas_item, const Ve // Draw a placeholder tile. Transform2D cell_to_quadrant; - cell_to_quadrant.set_origin(tile_map_node->map_to_local(r_cell_data.coords) - p_quadrant_pos); + cell_to_quadrant.set_origin(tile_set->map_to_local(r_cell_data.coords) - p_quadrant_pos); rs->canvas_item_add_set_transform(p_canvas_item, cell_to_quadrant); rs->canvas_item_add_circle(p_canvas_item, Vector2(), MIN(tile_set->get_tile_size().x, tile_set->get_tile_size().y) / 4.0, color); } @@ -684,17 +687,17 @@ void TileMapLayer::_rendering_draw_cell_debug(const RID &p_canvas_item, const Ve /////////////////////////////// Physics ////////////////////////////////////// void TileMapLayer::_physics_update() { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); // Check if we should cleanup everything. - bool forced_cleanup = in_destructor || !enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid(); + bool forced_cleanup = in_destructor || !enabled || !is_inside_tree() || !tile_set.is_valid(); if (forced_cleanup) { // Clean everything. for (KeyValue<Vector2i, CellData> &kv : tile_map) { _physics_clear_cell(kv.value); } } else { - if (_physics_was_cleaned_up || dirty.flags[DIRTY_FLAGS_TILE_MAP_TILE_SET] || dirty.flags[DIRTY_FLAGS_TILE_MAP_COLLISION_ANIMATABLE]) { + if (_physics_was_cleaned_up || dirty.flags[DIRTY_FLAGS_TILE_MAP_TILE_SET] || dirty.flags[DIRTY_FLAGS_LAYER_USE_KINEMATIC_BODIES] || dirty.flags[DIRTY_FLAGS_LAYER_IN_TREE]) { // Update all cells. for (KeyValue<Vector2i, CellData> &kv : tile_map) { _physics_update_cell(kv.value); @@ -713,60 +716,43 @@ void TileMapLayer::_physics_update() { _physics_was_cleaned_up = forced_cleanup; } -void TileMapLayer::_physics_notify_tilemap_change(TileMapLayer::DirtyFlags p_what) { - Transform2D gl_transform = tile_map_node->get_global_transform(); +void TileMapLayer::_physics_notification(int p_what) { + const Ref<TileSet> &tile_set = _fetch_tileset(); + Transform2D gl_transform = get_global_transform(); PhysicsServer2D *ps = PhysicsServer2D::get_singleton(); - bool in_editor = false; -#ifdef TOOLS_ENABLED - in_editor = Engine::get_singleton()->is_editor_hint(); -#endif - - if (p_what == DIRTY_FLAGS_TILE_MAP_XFORM) { - if (tile_map_node->is_inside_tree() && (!tile_map_node->is_collision_animatable() || in_editor)) { + switch (p_what) { + case NOTIFICATION_TRANSFORM_CHANGED: // Move the collisison shapes along with the TileMap. - for (KeyValue<Vector2i, CellData> &kv : tile_map) { - const CellData &cell_data = kv.value; + if (is_inside_tree() && tile_set.is_valid()) { + for (KeyValue<Vector2i, CellData> &kv : tile_map) { + const CellData &cell_data = kv.value; - for (RID body : cell_data.bodies) { - if (body.is_valid()) { - Transform2D xform(0, tile_map_node->map_to_local(bodies_coords[body])); - xform = gl_transform * xform; - ps->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, xform); - } - } - } - } - } else if (p_what == DIRTY_FLAGS_TILE_MAP_LOCAL_XFORM) { - // With collisions animatable, move the collisison shapes along with the TileMap only on local xform change (they are synchornized on physics tick instead). - if (tile_map_node->is_inside_tree() && tile_map_node->is_collision_animatable() && !in_editor) { - for (KeyValue<Vector2i, CellData> &kv : tile_map) { - const CellData &cell_data = kv.value; - - for (RID body : cell_data.bodies) { - if (body.is_valid()) { - Transform2D xform(0, tile_map_node->map_to_local(bodies_coords[body])); - xform = gl_transform * xform; - ps->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, xform); + for (RID body : cell_data.bodies) { + if (body.is_valid()) { + Transform2D xform(0, tile_set->map_to_local(kv.key)); + xform = gl_transform * xform; + ps->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, xform); + } } } } - } - } else if (p_what == DIRTY_FLAGS_TILE_MAP_IN_TREE) { - // Changes in the tree may cause the space to change (e.g. when reparenting to a SubViewport). - if (tile_map_node->is_inside_tree()) { - RID space = tile_map_node->get_world_2d()->get_space(); + break; + case NOTIFICATION_ENTER_TREE: + // Changes in the tree may cause the space to change (e.g. when reparenting to a SubViewport). + if (is_inside_tree()) { + RID space = get_world_2d()->get_space(); - for (KeyValue<Vector2i, CellData> &kv : tile_map) { - const CellData &cell_data = kv.value; + for (KeyValue<Vector2i, CellData> &kv : tile_map) { + const CellData &cell_data = kv.value; - for (RID body : cell_data.bodies) { - if (body.is_valid()) { - ps->body_set_space(body, space); + for (RID body : cell_data.bodies) { + if (body.is_valid()) { + ps->body_set_space(body, space); + } } } } - } } } @@ -784,9 +770,10 @@ void TileMapLayer::_physics_clear_cell(CellData &r_cell_data) { } void TileMapLayer::_physics_update_cell(CellData &r_cell_data) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); - Transform2D gl_transform = tile_map_node->get_global_transform(); - RID space = tile_map_node->get_world_2d()->get_space(); + const TileMap *tile_map_node = _fetch_tilemap(); + const Ref<TileSet> &tile_set = _fetch_tileset(); + Transform2D gl_transform = get_global_transform(); + RID space = get_world_2d()->get_space(); PhysicsServer2D *ps = PhysicsServer2D::get_singleton(); // Recreate bodies and shapes. @@ -813,10 +800,11 @@ void TileMapLayer::_physics_update_cell(CellData &r_cell_data) { // Free unused bodies then resize the bodies array. for (uint32_t i = tile_set->get_physics_layers_count(); i < r_cell_data.bodies.size(); i++) { - RID body = r_cell_data.bodies[i]; + RID &body = r_cell_data.bodies[i]; if (body.is_valid()) { bodies_coords.erase(body); ps->free(body); + body = RID(); } } r_cell_data.bodies.resize(tile_set->get_physics_layers_count()); @@ -844,7 +832,7 @@ void TileMapLayer::_physics_update_cell(CellData &r_cell_data) { ps->body_set_space(body, space); Transform2D xform; - xform.set_origin(tile_map_node->map_to_local(r_cell_data.coords)); + xform.set_origin(tile_set->map_to_local(r_cell_data.coords)); xform = gl_transform * xform; ps->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, xform); @@ -898,19 +886,20 @@ void TileMapLayer::_physics_update_cell(CellData &r_cell_data) { } #ifdef DEBUG_ENABLED -void TileMapLayer::_physics_draw_cell_debug(const RID &p_canvas_item, const Vector2i &p_quadrant_pos, const CellData &r_cell_data) { +void TileMapLayer::_physics_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data) { // Draw the debug collision shapes. - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + TileMap *tile_map_node = _fetch_tilemap(); + const Ref<TileSet> &tile_set = _fetch_tileset(); ERR_FAIL_COND(!tile_set.is_valid()); - if (!tile_map_node->get_tree()) { + if (!get_tree()) { return; } bool show_collision = false; switch (tile_map_node->get_collision_visibility_mode()) { case TileMap::VISIBILITY_MODE_DEFAULT: - show_collision = !Engine::get_singleton()->is_editor_hint() && tile_map_node->get_tree()->is_debugging_collisions_hint(); + show_collision = !Engine::get_singleton()->is_editor_hint() && get_tree()->is_debugging_collisions_hint(); break; case TileMap::VISIBILITY_MODE_FORCE_HIDE: show_collision = false; @@ -926,12 +915,12 @@ void TileMapLayer::_physics_draw_cell_debug(const RID &p_canvas_item, const Vect RenderingServer *rs = RenderingServer::get_singleton(); PhysicsServer2D *ps = PhysicsServer2D::get_singleton(); - Color debug_collision_color = tile_map_node->get_tree()->get_debug_collisions_color(); + Color debug_collision_color = get_tree()->get_debug_collisions_color(); Vector<Color> color; color.push_back(debug_collision_color); Transform2D quadrant_to_local(0, p_quadrant_pos); - Transform2D global_to_quadrant = (tile_map_node->get_global_transform() * quadrant_to_local).affine_inverse(); + Transform2D global_to_quadrant = (get_global_transform() * quadrant_to_local).affine_inverse(); for (RID body : r_cell_data.bodies) { if (body.is_valid()) { @@ -956,11 +945,11 @@ void TileMapLayer::_physics_draw_cell_debug(const RID &p_canvas_item, const Vect void TileMapLayer::_navigation_update() { ERR_FAIL_NULL(NavigationServer2D::get_singleton()); - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); NavigationServer2D *ns = NavigationServer2D::get_singleton(); // Check if we should cleanup everything. - bool forced_cleanup = in_destructor || !enabled || !navigation_enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid(); + bool forced_cleanup = in_destructor || !enabled || !navigation_enabled || !is_inside_tree() || !tile_set.is_valid(); // ----------- Layer level processing ----------- if (forced_cleanup) { @@ -973,7 +962,7 @@ void TileMapLayer::_navigation_update() { if (!navigation_map.is_valid()) { if (layer_index_in_tile_map_node == 0) { // Use the default World2D navigation map for the first layer when empty. - navigation_map = tile_map_node->get_world_2d()->get_navigation_map(); + navigation_map = get_world_2d()->get_navigation_map(); uses_world_navigation_map = true; } else { RID new_layer_map = ns->map_create(); @@ -993,7 +982,7 @@ void TileMapLayer::_navigation_update() { _navigation_clear_cell(kv.value); } } else { - if (_navigation_was_cleaned_up || dirty.flags[DIRTY_FLAGS_TILE_MAP_TILE_SET]) { + if (_navigation_was_cleaned_up || dirty.flags[DIRTY_FLAGS_TILE_MAP_TILE_SET] || dirty.flags[DIRTY_FLAGS_LAYER_IN_TREE]) { // Update all cells. for (KeyValue<Vector2i, CellData> &kv : tile_map) { _navigation_update_cell(kv.value); @@ -1005,9 +994,18 @@ void TileMapLayer::_navigation_update() { _navigation_update_cell(cell_data); } } + } + + // ----------- + // Mark the navigation state as up to date. + _navigation_was_cleaned_up = forced_cleanup; +} - if (dirty.flags[DIRTY_FLAGS_TILE_MAP_XFORM]) { - Transform2D tilemap_xform = tile_map_node->get_global_transform(); +void TileMapLayer::_navigation_notification(int p_what) { + const Ref<TileSet> &tile_set = _fetch_tileset(); + if (p_what == NOTIFICATION_TRANSFORM_CHANGED) { + if (tile_set.is_valid()) { + Transform2D tilemap_xform = get_global_transform(); for (KeyValue<Vector2i, CellData> &kv : tile_map) { const CellData &cell_data = kv.value; // Update navigation regions transform. @@ -1016,16 +1014,12 @@ void TileMapLayer::_navigation_update() { continue; } Transform2D tile_transform; - tile_transform.set_origin(tile_map_node->map_to_local(kv.key)); + tile_transform.set_origin(tile_set->map_to_local(kv.key)); NavigationServer2D::get_singleton()->region_set_transform(region, tilemap_xform * tile_transform); } } } } - - // ----------- - // Mark the navigation state as up to date. - _navigation_was_cleaned_up = forced_cleanup; } void TileMapLayer::_navigation_clear_cell(CellData &r_cell_data) { @@ -1042,9 +1036,10 @@ void TileMapLayer::_navigation_clear_cell(CellData &r_cell_data) { } void TileMapLayer::_navigation_update_cell(CellData &r_cell_data) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const TileMap *tile_map_node = _fetch_tilemap(); + const Ref<TileSet> &tile_set = _fetch_tileset(); NavigationServer2D *ns = NavigationServer2D::get_singleton(); - Transform2D tilemap_xform = tile_map_node->get_global_transform(); + Transform2D gl_xform = get_global_transform(); // Get the navigation polygons and create regions. TileMapCell &c = r_cell_data.cell; @@ -1088,13 +1083,13 @@ void TileMapLayer::_navigation_update_cell(CellData &r_cell_data) { if (navigation_polygon.is_valid() && (navigation_polygon->get_polygon_count() > 0 || navigation_polygon->get_outline_count() > 0)) { // Create or update regions. Transform2D tile_transform; - tile_transform.set_origin(tile_map_node->map_to_local(r_cell_data.coords)); + tile_transform.set_origin(tile_set->map_to_local(r_cell_data.coords)); if (!region.is_valid()) { region = ns->region_create(); } ns->region_set_owner_id(region, tile_map_node->get_instance_id()); ns->region_set_map(region, navigation_map); - ns->region_set_transform(region, tilemap_xform * tile_transform); + ns->region_set_transform(region, gl_xform * tile_transform); ns->region_set_navigation_layers(region, tile_set->get_navigation_layer_layers(navigation_layer_index)); ns->region_set_navigation_polygon(region, navigation_polygon); } else { @@ -1117,12 +1112,13 @@ void TileMapLayer::_navigation_update_cell(CellData &r_cell_data) { } #ifdef DEBUG_ENABLED -void TileMapLayer::_navigation_draw_cell_debug(const RID &p_canvas_item, const Vector2i &p_quadrant_pos, const CellData &r_cell_data) { +void TileMapLayer::_navigation_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data) { // Draw the debug collision shapes. + const TileMap *tile_map_node = _fetch_tilemap(); bool show_navigation = false; switch (tile_map_node->get_navigation_visibility_mode()) { case TileMap::VISIBILITY_MODE_DEFAULT: - show_navigation = !Engine::get_singleton()->is_editor_hint() && tile_map_node->get_tree()->is_debugging_navigation_hint(); + show_navigation = !Engine::get_singleton()->is_editor_hint() && get_tree()->is_debugging_navigation_hint(); break; case TileMap::VISIBILITY_MODE_FORCE_HIDE: show_navigation = false; @@ -1140,7 +1136,7 @@ void TileMapLayer::_navigation_draw_cell_debug(const RID &p_canvas_item, const V return; } - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); RenderingServer *rs = RenderingServer::get_singleton(); const NavigationServer2D *ns2d = NavigationServer2D::get_singleton(); @@ -1170,7 +1166,7 @@ void TileMapLayer::_navigation_draw_cell_debug(const RID &p_canvas_item, const V } Transform2D cell_to_quadrant; - cell_to_quadrant.set_origin(tile_map_node->map_to_local(r_cell_data.coords) - p_quadrant_pos); + cell_to_quadrant.set_origin(tile_set->map_to_local(r_cell_data.coords) - p_quadrant_pos); rs->canvas_item_add_set_transform(p_canvas_item, cell_to_quadrant); for (int layer_index = 0; layer_index < tile_set->get_navigation_layers_count(); layer_index++) { @@ -1226,10 +1222,10 @@ void TileMapLayer::_navigation_draw_cell_debug(const RID &p_canvas_item, const V /////////////////////////////// Scenes ////////////////////////////////////// void TileMapLayer::_scenes_update() { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); // Check if we should cleanup everything. - bool forced_cleanup = in_destructor || !enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid(); + bool forced_cleanup = in_destructor || !enabled || !is_inside_tree() || !tile_set.is_valid(); if (forced_cleanup) { // Clean everything. @@ -1237,7 +1233,7 @@ void TileMapLayer::_scenes_update() { _scenes_clear_cell(kv.value); } } else { - if (_scenes_was_cleaned_up || dirty.flags[DIRTY_FLAGS_TILE_MAP_TILE_SET]) { + if (_scenes_was_cleaned_up || dirty.flags[DIRTY_FLAGS_TILE_MAP_TILE_SET] || dirty.flags[DIRTY_FLAGS_LAYER_IN_TREE]) { // Update all cells. for (KeyValue<Vector2i, CellData> &kv : tile_map) { _scenes_update_cell(kv.value); @@ -1257,6 +1253,11 @@ void TileMapLayer::_scenes_update() { } void TileMapLayer::_scenes_clear_cell(CellData &r_cell_data) { + const TileMap *tile_map_node = _fetch_tilemap(); + if (!tile_map_node) { + return; + } + // Cleanup existing scene. Node *node = tile_map_node->get_node_or_null(r_cell_data.scene); if (node) { @@ -1266,7 +1267,8 @@ void TileMapLayer::_scenes_clear_cell(CellData &r_cell_data) { } void TileMapLayer::_scenes_update_cell(CellData &r_cell_data) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + TileMap *tile_map_node = _fetch_tilemap(); + const Ref<TileSet> &tile_set = _fetch_tileset(); // Clear the scene in any case. _scenes_clear_cell(r_cell_data); @@ -1287,10 +1289,10 @@ void TileMapLayer::_scenes_update_cell(CellData &r_cell_data) { Control *scene_as_control = Object::cast_to<Control>(scene); Node2D *scene_as_node2d = Object::cast_to<Node2D>(scene); if (scene_as_control) { - scene_as_control->set_position(tile_map_node->map_to_local(r_cell_data.coords) + scene_as_control->get_position()); + scene_as_control->set_position(tile_set->map_to_local(r_cell_data.coords) + scene_as_control->get_position()); } else if (scene_as_node2d) { Transform2D xform; - xform.set_origin(tile_map_node->map_to_local(r_cell_data.coords)); + xform.set_origin(tile_set->map_to_local(r_cell_data.coords)); scene_as_node2d->set_transform(xform * scene_as_node2d->get_transform()); } tile_map_node->add_child(scene); @@ -1302,8 +1304,8 @@ void TileMapLayer::_scenes_update_cell(CellData &r_cell_data) { } #ifdef DEBUG_ENABLED -void TileMapLayer::_scenes_draw_cell_debug(const RID &p_canvas_item, const Vector2i &p_quadrant_pos, const CellData &r_cell_data) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); +void TileMapLayer::_scenes_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data) { + const Ref<TileSet> &tile_set = _fetch_tileset(); ERR_FAIL_COND(!tile_set.is_valid()); if (!Engine::get_singleton()->is_editor_hint()) { @@ -1341,7 +1343,7 @@ void TileMapLayer::_scenes_draw_cell_debug(const RID &p_canvas_item, const Vecto // Draw a placeholder tile. Transform2D cell_to_quadrant; - cell_to_quadrant.set_origin(tile_map_node->map_to_local(r_cell_data.coords) - p_quadrant_pos); + cell_to_quadrant.set_origin(tile_set->map_to_local(r_cell_data.coords) - p_quadrant_pos); rs->canvas_item_add_set_transform(p_canvas_item, cell_to_quadrant); rs->canvas_item_add_circle(p_canvas_item, Vector2(), MIN(tile_set->get_tile_size().x, tile_set->get_tile_size().y) / 4.0, color); } @@ -1353,10 +1355,11 @@ void TileMapLayer::_scenes_draw_cell_debug(const RID &p_canvas_item, const Vecto ///////////////////////////////////////////////////////////////////// void TileMapLayer::_build_runtime_update_tile_data() { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const TileMap *tile_map_node = _fetch_tilemap(); + const Ref<TileSet> &tile_set = _fetch_tileset(); // Check if we should cleanup everything. - bool forced_cleanup = in_destructor || !enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid() || !tile_map_node->is_visible_in_tree(); + bool forced_cleanup = in_destructor || !enabled || !tile_set.is_valid() || !is_visible_in_tree(); if (!forced_cleanup) { if (tile_map_node->GDVIRTUAL_IS_OVERRIDDEN(_use_tile_data_runtime_update) && tile_map_node->GDVIRTUAL_IS_OVERRIDDEN(_tile_data_runtime_update)) { if (_runtime_update_tile_data_was_cleaned_up || dirty.flags[DIRTY_FLAGS_TILE_MAP_TILE_SET]) { @@ -1382,7 +1385,8 @@ void TileMapLayer::_build_runtime_update_tile_data() { } void TileMapLayer::_build_runtime_update_tile_data_for_cell(CellData &r_cell_data, bool p_auto_add_to_dirty_list) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + TileMap *tile_map_node = _fetch_tilemap(); + const Ref<TileSet> &tile_set = _fetch_tileset(); TileMapCell &c = r_cell_data.cell; TileSetSource *source; @@ -1425,7 +1429,7 @@ void TileMapLayer::_clear_runtime_update_tile_data() { } TileSet::TerrainsPattern TileMapLayer::_get_best_terrain_pattern_for_constraints(int p_terrain_set, const Vector2i &p_position, const RBSet<TerrainConstraint> &p_constraints, TileSet::TerrainsPattern p_current_pattern) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); if (!tile_set.is_valid()) { return TileSet::TerrainsPattern(); } @@ -1437,7 +1441,7 @@ TileSet::TerrainsPattern TileMapLayer::_get_best_terrain_pattern_for_constraints int score = 0; // Check the center bit constraint. - TerrainConstraint terrain_constraint = TerrainConstraint(tile_map_node, p_position, terrain_pattern.get_terrain()); + TerrainConstraint terrain_constraint = TerrainConstraint(tile_set, p_position, terrain_pattern.get_terrain()); const RBSet<TerrainConstraint>::Element *in_set_constraint_element = p_constraints.find(terrain_constraint); if (in_set_constraint_element) { if (in_set_constraint_element->get().get_terrain() != terrain_constraint.get_terrain()) { @@ -1453,7 +1457,7 @@ TileSet::TerrainsPattern TileMapLayer::_get_best_terrain_pattern_for_constraints TileSet::CellNeighbor bit = TileSet::CellNeighbor(i); if (tile_set->is_valid_terrain_peering_bit(p_terrain_set, bit)) { // Check if the bit is compatible with the constraints. - TerrainConstraint terrain_bit_constraint = TerrainConstraint(tile_map_node, p_position, bit, terrain_pattern.get_terrain_peering_bit(bit)); + TerrainConstraint terrain_bit_constraint = TerrainConstraint(tile_set, p_position, bit, terrain_pattern.get_terrain_peering_bit(bit)); in_set_constraint_element = p_constraints.find(terrain_bit_constraint); if (in_set_constraint_element) { if (in_set_constraint_element->get().get_terrain() != terrain_bit_constraint.get_terrain()) { @@ -1486,19 +1490,19 @@ TileSet::TerrainsPattern TileMapLayer::_get_best_terrain_pattern_for_constraints } RBSet<TerrainConstraint> TileMapLayer::_get_terrain_constraints_from_added_pattern(const Vector2i &p_position, int p_terrain_set, TileSet::TerrainsPattern p_terrains_pattern) const { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); if (!tile_set.is_valid()) { return RBSet<TerrainConstraint>(); } // Compute the constraints needed from the surrounding tiles. RBSet<TerrainConstraint> output; - output.insert(TerrainConstraint(tile_map_node, p_position, p_terrains_pattern.get_terrain())); + output.insert(TerrainConstraint(tile_set, p_position, p_terrains_pattern.get_terrain())); for (uint32_t i = 0; i < TileSet::CELL_NEIGHBOR_MAX; i++) { TileSet::CellNeighbor side = TileSet::CellNeighbor(i); if (tile_set->is_valid_terrain_peering_bit(p_terrain_set, side)) { - TerrainConstraint c = TerrainConstraint(tile_map_node, p_position, side, p_terrains_pattern.get_terrain_peering_bit(side)); + TerrainConstraint c = TerrainConstraint(tile_set, p_position, side, p_terrains_pattern.get_terrain_peering_bit(side)); output.insert(c); } } @@ -1507,7 +1511,7 @@ RBSet<TerrainConstraint> TileMapLayer::_get_terrain_constraints_from_added_patte } RBSet<TerrainConstraint> TileMapLayer::_get_terrain_constraints_from_painted_cells_list(const RBSet<Vector2i> &p_painted, int p_terrain_set, bool p_ignore_empty_terrains) const { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); if (!tile_set.is_valid()) { return RBSet<TerrainConstraint>(); } @@ -1520,7 +1524,7 @@ RBSet<TerrainConstraint> TileMapLayer::_get_terrain_constraints_from_painted_cel for (int i = 0; i < TileSet::CELL_NEIGHBOR_MAX; i++) { // Iterates over neighbor bits. TileSet::CellNeighbor bit = TileSet::CellNeighbor(i); if (tile_set->is_valid_terrain_peering_bit(p_terrain_set, bit)) { - dummy_constraints.insert(TerrainConstraint(tile_map_node, E, bit, -1)); + dummy_constraints.insert(TerrainConstraint(tile_set, E, bit, -1)); } } } @@ -1587,27 +1591,89 @@ RBSet<TerrainConstraint> TileMapLayer::_get_terrain_constraints_from_painted_cel int terrain = (tile_data && tile_data->get_terrain_set() == p_terrain_set) ? tile_data->get_terrain() : -1; if (!p_ignore_empty_terrains || terrain >= 0) { - constraints.insert(TerrainConstraint(tile_map_node, E_coords, terrain)); + constraints.insert(TerrainConstraint(tile_set, E_coords, terrain)); } } return constraints; } -void TileMapLayer::set_tile_map(TileMap *p_tile_map) { - tile_map_node = p_tile_map; +void TileMapLayer::_renamed() { + TileMap *tile_map_node = _fetch_tilemap(); + tile_map_node->emit_signal(CoreStringNames::get_singleton()->changed); +} + +void TileMapLayer::_update_notify_local_transform() { + TileMap *tile_map_node = _fetch_tilemap(); + bool notify = tile_map_node->is_collision_animatable() || is_y_sort_enabled(); + if (!notify) { + if (is_y_sort_enabled()) { + notify = true; + } + } + set_notify_local_transform(notify); +} + +void TileMapLayer::_notification(int p_what) { + switch (p_what) { + case NOTIFICATION_POSTINITIALIZE: { + connect(SNAME("renamed"), callable_mp(this, &TileMapLayer::_renamed)); + break; + } + case NOTIFICATION_ENTER_TREE: { + _update_notify_local_transform(); + dirty.flags[DIRTY_FLAGS_LAYER_IN_TREE] = true; + TileMap *tile_map_node = _fetch_tilemap(); + tile_map_node->queue_internal_update(); + } break; + + case NOTIFICATION_EXIT_TREE: { + dirty.flags[DIRTY_FLAGS_LAYER_IN_TREE] = true; + TileMap *tile_map_node = _fetch_tilemap(); + tile_map_node->queue_internal_update(); + } break; + + case TileMap::NOTIFICATION_ENTER_CANVAS: { + dirty.flags[DIRTY_FLAGS_LAYER_IN_CANVAS] = true; + TileMap *tile_map_node = _fetch_tilemap(); + tile_map_node->queue_internal_update(); + } break; + + case TileMap::NOTIFICATION_EXIT_CANVAS: { + dirty.flags[DIRTY_FLAGS_LAYER_IN_CANVAS] = true; + TileMap *tile_map_node = _fetch_tilemap(); + tile_map_node->queue_internal_update(); + } break; + + case TileMap::NOTIFICATION_VISIBILITY_CHANGED: { + dirty.flags[DIRTY_FLAGS_LAYER_VISIBILITY] = true; + TileMap *tile_map_node = _fetch_tilemap(); + tile_map_node->queue_internal_update(); + } break; + } + + _rendering_notification(p_what); + _physics_notification(p_what); + _navigation_notification(p_what); } void TileMapLayer::set_layer_index_in_tile_map_node(int p_index) { if (p_index == layer_index_in_tile_map_node) { return; } + TileMap *tile_map_node = _fetch_tilemap(); layer_index_in_tile_map_node = p_index; dirty.flags[DIRTY_FLAGS_LAYER_INDEX_IN_TILE_MAP_NODE] = true; tile_map_node->queue_internal_update(); } Rect2 TileMapLayer::get_rect(bool &r_changed) const { + const Ref<TileSet> &tile_set = _fetch_tileset(); + if (tile_set.is_null()) { + r_changed = rect_cache != Rect2(); + return Rect2(); + } + // Compute the displayed area of the tilemap. r_changed = false; #ifdef DEBUG_ENABLED @@ -1617,7 +1683,7 @@ Rect2 TileMapLayer::get_rect(bool &r_changed) const { bool first = true; for (const KeyValue<Vector2i, CellData> &E : tile_map) { Rect2 r; - r.position = tile_map_node->map_to_local(E.key); + r.position = tile_set->map_to_local(E.key); r.size = Size2(); if (first) { r_total = r; @@ -1637,7 +1703,7 @@ Rect2 TileMapLayer::get_rect(bool &r_changed) const { } HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_constraints(const Vector<Vector2i> &p_to_replace, int p_terrain_set, const RBSet<TerrainConstraint> &p_constraints) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); if (!tile_set.is_valid()) { return HashMap<Vector2i, TileSet::TerrainsPattern>(); } @@ -1686,7 +1752,7 @@ HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_constrain HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_connect(const Vector<Vector2i> &p_coords_array, int p_terrain_set, int p_terrain, bool p_ignore_empty_terrains) { HashMap<Vector2i, TileSet::TerrainsPattern> output; - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); ERR_FAIL_COND_V(!tile_set.is_valid(), output); ERR_FAIL_INDEX_V(p_terrain_set, tile_set->get_terrain_sets_count(), output); @@ -1704,8 +1770,8 @@ HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_connect(c // Find the adequate neighbor. for (int j = 0; j < TileSet::CELL_NEIGHBOR_MAX; j++) { TileSet::CellNeighbor bit = TileSet::CellNeighbor(j); - if (tile_map_node->is_existing_neighbor(bit)) { - Vector2i neighbor = tile_map_node->get_neighbor_cell(coords, bit); + if (tile_set->is_existing_neighbor(bit)) { + Vector2i neighbor = tile_set->get_neighbor_cell(coords, bit); if (!can_modify_set.has(neighbor)) { can_modify_list.push_back(neighbor); can_modify_set.insert(neighbor); @@ -1746,7 +1812,7 @@ HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_connect(c // Add new constraints from the path drawn. for (Vector2i coords : p_coords_array) { // Constraints on the center bit. - TerrainConstraint c = TerrainConstraint(tile_map_node, coords, p_terrain); + TerrainConstraint c = TerrainConstraint(tile_set, coords, p_terrain); c.set_priority(10); constraints.insert(c); @@ -1754,11 +1820,11 @@ HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_connect(c for (int j = 0; j < TileSet::CELL_NEIGHBOR_MAX; j++) { TileSet::CellNeighbor bit = TileSet::CellNeighbor(j); if (tile_set->is_valid_terrain_peering_bit(p_terrain_set, bit)) { - c = TerrainConstraint(tile_map_node, coords, bit, p_terrain); + c = TerrainConstraint(tile_set, coords, bit, p_terrain); c.set_priority(10); if ((int(bit) % 2) == 0) { // Side peering bits: add the constraint if the center is of the same terrain. - Vector2i neighbor = tile_map_node->get_neighbor_cell(coords, bit); + Vector2i neighbor = tile_set->get_neighbor_cell(coords, bit); if (cells_with_terrain_center_bit.has(neighbor)) { constraints.insert(c); } @@ -1792,7 +1858,7 @@ HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_connect(c HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_path(const Vector<Vector2i> &p_coords_array, int p_terrain_set, int p_terrain, bool p_ignore_empty_terrains) { HashMap<Vector2i, TileSet::TerrainsPattern> output; - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); ERR_FAIL_COND_V(!tile_set.is_valid(), output); ERR_FAIL_INDEX_V(p_terrain_set, tile_set->get_terrain_sets_count(), output); @@ -1803,8 +1869,8 @@ HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_path(cons TileSet::CellNeighbor found_bit = TileSet::CELL_NEIGHBOR_MAX; for (int j = 0; j < TileSet::CELL_NEIGHBOR_MAX; j++) { TileSet::CellNeighbor bit = TileSet::CellNeighbor(j); - if (tile_map_node->is_existing_neighbor(bit)) { - if (tile_map_node->get_neighbor_cell(p_coords_array[i], bit) == p_coords_array[i + 1]) { + if (tile_set->is_existing_neighbor(bit)) { + if (tile_set->get_neighbor_cell(p_coords_array[i], bit) == p_coords_array[i + 1]) { found_bit = bit; break; } @@ -1829,7 +1895,7 @@ HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_path(cons for (int j = 0; j < TileSet::CELL_NEIGHBOR_MAX; j++) { TileSet::CellNeighbor bit = TileSet::CellNeighbor(j); if (tile_set->is_valid_terrain_peering_bit(p_terrain_set, bit)) { - Vector2i neighbor = tile_map_node->get_neighbor_cell(coords, bit); + Vector2i neighbor = tile_set->get_neighbor_cell(coords, bit); if (!can_modify_set.has(neighbor)) { can_modify_list.push_back(neighbor); can_modify_set.insert(neighbor); @@ -1843,13 +1909,13 @@ HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_path(cons // Add new constraints from the path drawn. for (Vector2i coords : p_coords_array) { // Constraints on the center bit. - TerrainConstraint c = TerrainConstraint(tile_map_node, coords, p_terrain); + TerrainConstraint c = TerrainConstraint(tile_set, coords, p_terrain); c.set_priority(10); constraints.insert(c); } for (int i = 0; i < p_coords_array.size() - 1; i++) { // Constraints on the peering bits. - TerrainConstraint c = TerrainConstraint(tile_map_node, p_coords_array[i], neighbor_list[i], p_terrain); + TerrainConstraint c = TerrainConstraint(tile_set, p_coords_array[i], neighbor_list[i], p_terrain); c.set_priority(10); constraints.insert(c); } @@ -1866,7 +1932,7 @@ HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_path(cons HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_pattern(const Vector<Vector2i> &p_coords_array, int p_terrain_set, TileSet::TerrainsPattern p_terrains_pattern, bool p_ignore_empty_terrains) { HashMap<Vector2i, TileSet::TerrainsPattern> output; - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); ERR_FAIL_COND_V(!tile_set.is_valid(), output); ERR_FAIL_INDEX_V(p_terrain_set, tile_set->get_terrain_sets_count(), output); @@ -1885,7 +1951,7 @@ HashMap<Vector2i, TileSet::TerrainsPattern> TileMapLayer::terrain_fill_pattern(c for (int j = 0; j < TileSet::CELL_NEIGHBOR_MAX; j++) { TileSet::CellNeighbor bit = TileSet::CellNeighbor(j); if (tile_set->is_valid_terrain_peering_bit(p_terrain_set, bit)) { - Vector2i neighbor = tile_map_node->get_neighbor_cell(coords, bit); + Vector2i neighbor = tile_set->get_neighbor_cell(coords, bit); if (!can_modify_set.has(neighbor)) { can_modify_list.push_back(neighbor); can_modify_set.insert(neighbor); @@ -1922,7 +1988,7 @@ TileMapCell TileMapLayer::get_cell(const Vector2i &p_coords, bool p_use_proxies) return TileMapCell(); } else { TileMapCell c = tile_map.find(p_coords)->value.cell; - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); if (p_use_proxies && tile_set.is_valid()) { Array proxyed = tile_set->map_tile_proxy(c.source_id, c.get_atlas_coords(), c.alternative_tile); c.source_id = proxyed[0]; @@ -1998,7 +2064,7 @@ void TileMapLayer::set_tile_data(TileMapDataFormat p_format, const Vector<int> & coord_y = decode_uint16(&local[10]); } - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); if (tile_set.is_valid()) { Array a = tile_set->compatibility_tilemap_map(v, Vector2i(coord_x, coord_y), flip_h, flip_v, transpose); if (a.size() == 3) { @@ -2039,9 +2105,9 @@ Vector<int> TileMapLayer::get_tile_data() const { } void TileMapLayer::notify_tile_map_change(DirtyFlags p_what) { + TileMap *tile_map_node = _fetch_tilemap(); dirty.flags[p_what] = true; tile_map_node->queue_internal_update(); - _physics_notify_tilemap_change(p_what); } void TileMapLayer::internal_update() { @@ -2124,7 +2190,10 @@ void TileMapLayer::set_cell(const Vector2i &p_coords, int p_source_id, const Vec if (!E->value.dirty_list_element.in_list()) { dirty.cell_list.add(&(E->value.dirty_list_element)); } - tile_map_node->queue_internal_update(); + TileMap *tile_map_node = _fetch_tilemap(); + if (tile_map_node) { // Needed to avoid crashes in destructor. + tile_map_node->queue_internal_update(); + } used_rect_cache_dirty = true; } @@ -2141,7 +2210,7 @@ int TileMapLayer::get_cell_source_id(const Vector2i &p_coords, bool p_use_proxie return TileSet::INVALID_SOURCE; } - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); if (p_use_proxies && tile_set.is_valid()) { Array proxyed = tile_set->map_tile_proxy(E->value.cell.source_id, E->value.cell.get_atlas_coords(), E->value.cell.alternative_tile); return proxyed[0]; @@ -2158,7 +2227,7 @@ Vector2i TileMapLayer::get_cell_atlas_coords(const Vector2i &p_coords, bool p_us return TileSetSource::INVALID_ATLAS_COORDS; } - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); if (p_use_proxies && tile_set.is_valid()) { Array proxyed = tile_set->map_tile_proxy(E->value.cell.source_id, E->value.cell.get_atlas_coords(), E->value.cell.alternative_tile); return proxyed[1]; @@ -2175,7 +2244,7 @@ int TileMapLayer::get_cell_alternative_tile(const Vector2i &p_coords, bool p_use return TileSetSource::INVALID_TILE_ALTERNATIVE; } - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); if (p_use_proxies && tile_set.is_valid()) { Array proxyed = tile_set->map_tile_proxy(E->value.cell.source_id, E->value.cell.get_atlas_coords(), E->value.cell.alternative_tile); return proxyed[2]; @@ -2190,7 +2259,7 @@ TileData *TileMapLayer::get_cell_tile_data(const Vector2i &p_coords, bool p_use_ return nullptr; } - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); Ref<TileSetAtlasSource> source = tile_set->get_source(source_id); if (source.is_valid()) { return source->get_tile_data(get_cell_atlas_coords(p_coords, p_use_proxies), get_cell_alternative_tile(p_coords, p_use_proxies)); @@ -2208,7 +2277,7 @@ void TileMapLayer::clear() { } Ref<TileMapPattern> TileMapLayer::get_pattern(TypedArray<Vector2i> p_coords_array) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); ERR_FAIL_COND_V(!tile_set.is_valid(), nullptr); Ref<TileMapPattern> output; @@ -2262,19 +2331,19 @@ Ref<TileMapPattern> TileMapLayer::get_pattern(TypedArray<Vector2i> p_coords_arra } void TileMapLayer::set_pattern(const Vector2i &p_position, const Ref<TileMapPattern> p_pattern) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); ERR_FAIL_COND(tile_set.is_null()); ERR_FAIL_COND(p_pattern.is_null()); TypedArray<Vector2i> used_cells = p_pattern->get_used_cells(); for (int i = 0; i < used_cells.size(); i++) { - Vector2i coords = tile_map_node->map_pattern(p_position, used_cells[i], p_pattern); + Vector2i coords = tile_set->map_pattern(p_position, used_cells[i], p_pattern); set_cell(coords, p_pattern->get_cell_source_id(used_cells[i]), p_pattern->get_cell_atlas_coords(used_cells[i]), p_pattern->get_cell_alternative_tile(used_cells[i])); } } void TileMapLayer::set_cells_terrain_connect(TypedArray<Vector2i> p_cells, int p_terrain_set, int p_terrain, bool p_ignore_empty_terrains) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); ERR_FAIL_COND(!tile_set.is_valid()); ERR_FAIL_INDEX(p_terrain_set, tile_set->get_terrain_sets_count()); @@ -2314,7 +2383,7 @@ void TileMapLayer::set_cells_terrain_connect(TypedArray<Vector2i> p_cells, int p } void TileMapLayer::set_cells_terrain_path(TypedArray<Vector2i> p_path, int p_terrain_set, int p_terrain, bool p_ignore_empty_terrains) { - const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); + const Ref<TileSet> &tile_set = _fetch_tileset(); ERR_FAIL_COND(!tile_set.is_valid()); ERR_FAIL_INDEX(p_terrain_set, tile_set->get_terrain_sets_count()); @@ -2415,24 +2484,13 @@ Rect2i TileMapLayer::get_used_rect() const { return used_rect_cache; } -void TileMapLayer::set_name(String p_name) { - if (name == p_name) { - return; - } - name = p_name; - tile_map_node->emit_signal(CoreStringNames::get_singleton()->changed); -} - -String TileMapLayer::get_name() const { - return name; -} - void TileMapLayer::set_enabled(bool p_enabled) { if (enabled == p_enabled) { return; } enabled = p_enabled; dirty.flags[DIRTY_FLAGS_LAYER_ENABLED] = true; + TileMap *tile_map_node = _fetch_tilemap(); tile_map_node->queue_internal_update(); tile_map_node->emit_signal(CoreStringNames::get_singleton()->changed); @@ -2443,34 +2501,29 @@ bool TileMapLayer::is_enabled() const { return enabled; } -void TileMapLayer::set_modulate(Color p_modulate) { - if (modulate == p_modulate) { +void TileMapLayer::set_self_modulate(const Color &p_self_modulate) { + if (get_self_modulate() == p_self_modulate) { return; } - modulate = p_modulate; - dirty.flags[DIRTY_FLAGS_LAYER_MODULATE] = true; + CanvasItem::set_self_modulate(p_self_modulate); + dirty.flags[DIRTY_FLAGS_LAYER_SELF_MODULATE] = true; + TileMap *tile_map_node = _fetch_tilemap(); tile_map_node->queue_internal_update(); tile_map_node->emit_signal(CoreStringNames::get_singleton()->changed); } -Color TileMapLayer::get_modulate() const { - return modulate; -} - void TileMapLayer::set_y_sort_enabled(bool p_y_sort_enabled) { - if (y_sort_enabled == p_y_sort_enabled) { + if (is_y_sort_enabled() == p_y_sort_enabled) { return; } - y_sort_enabled = p_y_sort_enabled; + CanvasItem::set_y_sort_enabled(p_y_sort_enabled); dirty.flags[DIRTY_FLAGS_LAYER_Y_SORT_ENABLED] = true; + TileMap *tile_map_node = _fetch_tilemap(); tile_map_node->queue_internal_update(); tile_map_node->emit_signal(CoreStringNames::get_singleton()->changed); tile_map_node->update_configuration_warnings(); -} - -bool TileMapLayer::is_y_sort_enabled() const { - return y_sort_enabled; + _update_notify_local_transform(); } void TileMapLayer::set_y_sort_origin(int p_y_sort_origin) { @@ -2479,6 +2532,7 @@ void TileMapLayer::set_y_sort_origin(int p_y_sort_origin) { } y_sort_origin = p_y_sort_origin; dirty.flags[DIRTY_FLAGS_LAYER_Y_SORT_ORIGIN] = true; + TileMap *tile_map_node = _fetch_tilemap(); tile_map_node->queue_internal_update(); tile_map_node->emit_signal(CoreStringNames::get_singleton()->changed); } @@ -2488,19 +2542,28 @@ int TileMapLayer::get_y_sort_origin() const { } void TileMapLayer::set_z_index(int p_z_index) { - if (z_index == p_z_index) { + if (get_z_index() == p_z_index) { return; } - z_index = p_z_index; + CanvasItem::set_z_index(p_z_index); dirty.flags[DIRTY_FLAGS_LAYER_Z_INDEX] = true; + TileMap *tile_map_node = _fetch_tilemap(); tile_map_node->queue_internal_update(); tile_map_node->emit_signal(CoreStringNames::get_singleton()->changed); tile_map_node->update_configuration_warnings(); } -int TileMapLayer::get_z_index() const { - return z_index; +void TileMapLayer::set_use_kinematic_bodies(bool p_use_kinematic_bodies) { + use_kinematic_bodies = p_use_kinematic_bodies; + dirty.flags[DIRTY_FLAGS_LAYER_USE_KINEMATIC_BODIES] = p_use_kinematic_bodies; + TileMap *tile_map_node = _fetch_tilemap(); + tile_map_node->queue_internal_update(); + tile_map_node->emit_signal(CoreStringNames::get_singleton()->changed); +} + +bool TileMapLayer::is_using_kinematic_bodies() const { + return use_kinematic_bodies; } void TileMapLayer::set_navigation_enabled(bool p_enabled) { @@ -2509,6 +2572,7 @@ void TileMapLayer::set_navigation_enabled(bool p_enabled) { } navigation_enabled = p_enabled; dirty.flags[DIRTY_FLAGS_LAYER_NAVIGATION_ENABLED] = true; + TileMap *tile_map_node = _fetch_tilemap(); tile_map_node->queue_internal_update(); tile_map_node->emit_signal(CoreStringNames::get_singleton()->changed); } @@ -2518,9 +2582,9 @@ bool TileMapLayer::is_navigation_enabled() const { } void TileMapLayer::set_navigation_map(RID p_map) { - ERR_FAIL_COND_MSG(!tile_map_node->is_inside_tree(), "A TileMap navigation map can only be changed while inside the SceneTree."); + ERR_FAIL_COND_MSG(!is_inside_tree(), "A TileMap navigation map can only be changed while inside the SceneTree."); navigation_map = p_map; - uses_world_navigation_map = p_map == tile_map_node->get_world_2d()->get_navigation_map(); + uses_world_navigation_map = p_map == get_world_2d()->get_navigation_map(); } RID TileMapLayer::get_navigation_map() const { @@ -2531,7 +2595,7 @@ RID TileMapLayer::get_navigation_map() const { } void TileMapLayer::fix_invalid_tiles() { - Ref<TileSet> tileset = tile_map_node->get_tileset(); + Ref<TileSet> tileset = _fetch_tileset(); ERR_FAIL_COND_MSG(tileset.is_null(), "Cannot call fix_invalid_tiles() on a TileMap without a valid TileSet."); RBSet<Vector2i> coords; @@ -2554,12 +2618,11 @@ Vector2i TileMapLayer::get_coords_for_body_rid(RID p_physics_body) const { return bodies_coords[p_physics_body]; } -TileMapLayer::~TileMapLayer() { - if (!tile_map_node) { - // Temporary layer. - return; - } +TileMapLayer::TileMapLayer() { + set_notify_transform(true); +} +TileMapLayer::~TileMapLayer() { in_destructor = true; clear(); internal_update(); @@ -2569,26 +2632,24 @@ HashMap<Vector2i, TileSet::CellNeighbor> TerrainConstraint::get_overlapping_coor HashMap<Vector2i, TileSet::CellNeighbor> output; ERR_FAIL_COND_V(is_center_bit(), output); + ERR_FAIL_COND_V(!tile_set.is_valid(), output); - Ref<TileSet> ts = tile_map->get_tileset(); - ERR_FAIL_COND_V(!ts.is_valid(), output); - - TileSet::TileShape shape = ts->get_tile_shape(); + TileSet::TileShape shape = tile_set->get_tile_shape(); if (shape == TileSet::TILE_SHAPE_SQUARE) { switch (bit) { case 1: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_RIGHT_SIDE; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_LEFT_SIDE; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_LEFT_SIDE; break; case 2: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER; break; case 3: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_SIDE; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_SIDE; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_SIDE; break; default: ERR_FAIL_V(output); @@ -2597,47 +2658,47 @@ HashMap<Vector2i, TileSet::CellNeighbor> TerrainConstraint::get_overlapping_coor switch (bit) { case 1: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE; break; case 2: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_LEFT_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_CORNER)] = TileSet::CELL_NEIGHBOR_TOP_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_RIGHT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_LEFT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_CORNER)] = TileSet::CELL_NEIGHBOR_TOP_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_RIGHT_CORNER; break; case 3: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; break; default: ERR_FAIL_V(output); } } else { // Half offset shapes. - TileSet::TileOffsetAxis offset_axis = ts->get_tile_offset_axis(); + TileSet::TileOffsetAxis offset_axis = tile_set->get_tile_offset_axis(); if (offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { switch (bit) { case 1: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_RIGHT_SIDE; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_LEFT_SIDE; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_LEFT_SIDE; break; case 2: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_CORNER; break; case 3: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE; break; case 4: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER; break; case 5: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; break; default: ERR_FAIL_V(output); @@ -2646,25 +2707,25 @@ HashMap<Vector2i, TileSet::CellNeighbor> TerrainConstraint::get_overlapping_coor switch (bit) { case 1: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_RIGHT_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER; break; case 2: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE; break; case 3: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_LEFT_CORNER; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_LEFT_CORNER; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER; break; case 4: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_SIDE; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_SIDE; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_SIDE; break; case 5: output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE; - output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; + output[tile_set->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; break; default: ERR_FAIL_V(output); @@ -2674,25 +2735,20 @@ HashMap<Vector2i, TileSet::CellNeighbor> TerrainConstraint::get_overlapping_coor return output; } -TerrainConstraint::TerrainConstraint(const TileMap *p_tile_map, const Vector2i &p_position, int p_terrain) { - tile_map = p_tile_map; - - Ref<TileSet> ts = tile_map->get_tileset(); - ERR_FAIL_COND(!ts.is_valid()); - +TerrainConstraint::TerrainConstraint(Ref<TileSet> p_tile_set, const Vector2i &p_position, int p_terrain) { + ERR_FAIL_COND(!p_tile_set.is_valid()); + tile_set = p_tile_set; bit = 0; base_cell_coords = p_position; terrain = p_terrain; } -TerrainConstraint::TerrainConstraint(const TileMap *p_tile_map, const Vector2i &p_position, const TileSet::CellNeighbor &p_bit, int p_terrain) { +TerrainConstraint::TerrainConstraint(Ref<TileSet> p_tile_set, const Vector2i &p_position, const TileSet::CellNeighbor &p_bit, int p_terrain) { // The way we build the constraint make it easy to detect conflicting constraints. - tile_map = p_tile_map; - - Ref<TileSet> ts = tile_map->get_tileset(); - ERR_FAIL_COND(!ts.is_valid()); + ERR_FAIL_COND(!p_tile_set.is_valid()); + tile_set = p_tile_set; - TileSet::TileShape shape = ts->get_tile_shape(); + TileSet::TileShape shape = tile_set->get_tile_shape(); if (shape == TileSet::TILE_SHAPE_SQUARE) { switch (p_bit) { case TileSet::CELL_NEIGHBOR_RIGHT_SIDE: @@ -2709,23 +2765,23 @@ TerrainConstraint::TerrainConstraint(const TileMap *p_tile_map, const Vector2i & break; case TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER: bit = 2; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_LEFT_SIDE: bit = 1; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER: bit = 2; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER); break; case TileSet::CELL_NEIGHBOR_TOP_SIDE: bit = 3; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER: bit = 2; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_SIDE); break; default: ERR_FAIL(); @@ -2735,7 +2791,7 @@ TerrainConstraint::TerrainConstraint(const TileMap *p_tile_map, const Vector2i & switch (p_bit) { case TileSet::CELL_NEIGHBOR_RIGHT_CORNER: bit = 2; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE); break; case TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE: bit = 1; @@ -2751,19 +2807,19 @@ TerrainConstraint::TerrainConstraint(const TileMap *p_tile_map, const Vector2i & break; case TileSet::CELL_NEIGHBOR_LEFT_CORNER: bit = 2; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE: bit = 1; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_CORNER: bit = 2; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_CORNER); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_CORNER); break; case TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE: bit = 3; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE); break; default: ERR_FAIL(); @@ -2771,7 +2827,7 @@ TerrainConstraint::TerrainConstraint(const TileMap *p_tile_map, const Vector2i & } } else { // Half-offset shapes. - TileSet::TileOffsetAxis offset_axis = ts->get_tile_offset_axis(); + TileSet::TileOffsetAxis offset_axis = tile_set->get_tile_offset_axis(); if (offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { switch (p_bit) { case TileSet::CELL_NEIGHBOR_RIGHT_SIDE: @@ -2796,31 +2852,31 @@ TerrainConstraint::TerrainConstraint(const TileMap *p_tile_map, const Vector2i & break; case TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER: bit = 2; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_LEFT_SIDE: bit = 1; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER: bit = 4; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE: bit = 3; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_CORNER: bit = 2; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE: bit = 5; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER: bit = 4; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE); break; default: ERR_FAIL(); @@ -2846,7 +2902,7 @@ TerrainConstraint::TerrainConstraint(const TileMap *p_tile_map, const Vector2i & break; case TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER: bit = 1; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE: bit = 5; @@ -2854,27 +2910,27 @@ TerrainConstraint::TerrainConstraint(const TileMap *p_tile_map, const Vector2i & break; case TileSet::CELL_NEIGHBOR_LEFT_CORNER: bit = 3; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE: bit = 2; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER: bit = 1; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_SIDE: bit = 4; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER: bit = 3; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_SIDE); break; case TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE: bit = 5; - base_cell_coords = p_tile_map->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE); + base_cell_coords = tile_set->get_neighbor_cell(p_position, TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE); break; default: ERR_FAIL(); diff --git a/scene/2d/tile_map_layer.h b/scene/2d/tile_map_layer.h index 3125fcb488..2cc57f50d1 100644 --- a/scene/2d/tile_map_layer.h +++ b/scene/2d/tile_map_layer.h @@ -38,7 +38,7 @@ class TileSetAtlasSource; class TerrainConstraint { private: - const TileMap *tile_map = nullptr; + Ref<TileSet> tile_set; Vector2i base_cell_coords; int bit = -1; int terrain = -1; @@ -83,8 +83,8 @@ public: return priority; } - TerrainConstraint(const TileMap *p_tile_map, const Vector2i &p_position, int p_terrain); // For the center terrain bit - TerrainConstraint(const TileMap *p_tile_map, const Vector2i &p_position, const TileSet::CellNeighbor &p_bit, int p_terrain); // For peering bits + TerrainConstraint(Ref<TileSet> p_tile_set, const Vector2i &p_position, int p_terrain); // For the center terrain bit + TerrainConstraint(Ref<TileSet> p_tile_set, const Vector2i &p_position, const TileSet::CellNeighbor &p_bit, int p_terrain); // For peering bits TerrainConstraint(){}; }; @@ -214,23 +214,24 @@ public: } }; -class TileMapLayer : public RefCounted { - GDCLASS(TileMapLayer, RefCounted); +class TileMapLayer : public Node2D { + GDCLASS(TileMapLayer, Node2D); public: enum DirtyFlags { DIRTY_FLAGS_LAYER_ENABLED = 0, - DIRTY_FLAGS_LAYER_MODULATE, + DIRTY_FLAGS_LAYER_IN_TREE, + DIRTY_FLAGS_LAYER_IN_CANVAS, + DIRTY_FLAGS_LAYER_LOCAL_TRANSFORM, + DIRTY_FLAGS_LAYER_VISIBILITY, + DIRTY_FLAGS_LAYER_SELF_MODULATE, DIRTY_FLAGS_LAYER_Y_SORT_ENABLED, DIRTY_FLAGS_LAYER_Y_SORT_ORIGIN, DIRTY_FLAGS_LAYER_Z_INDEX, + DIRTY_FLAGS_LAYER_USE_KINEMATIC_BODIES, DIRTY_FLAGS_LAYER_NAVIGATION_ENABLED, DIRTY_FLAGS_LAYER_INDEX_IN_TILE_MAP_NODE, - DIRTY_FLAGS_TILE_MAP_IN_TREE, - DIRTY_FLAGS_TILE_MAP_IN_CANVAS, - DIRTY_FLAGS_TILE_MAP_VISIBILITY, - DIRTY_FLAGS_TILE_MAP_XFORM, - DIRTY_FLAGS_TILE_MAP_LOCAL_XFORM, + DIRTY_FLAGS_TILE_MAP_SELECTED_LAYER, DIRTY_FLAGS_TILE_MAP_LIGHT_MASK, DIRTY_FLAGS_TILE_MAP_MATERIAL, @@ -239,7 +240,6 @@ public: DIRTY_FLAGS_TILE_MAP_TEXTURE_REPEAT, DIRTY_FLAGS_TILE_MAP_TILE_SET, DIRTY_FLAGS_TILE_MAP_QUADRANT_SIZE, - DIRTY_FLAGS_TILE_MAP_COLLISION_ANIMATABLE, DIRTY_FLAGS_TILE_MAP_COLLISION_VISIBILITY_MODE, DIRTY_FLAGS_TILE_MAP_NAVIGATION_VISIBILITY_MODE, DIRTY_FLAGS_TILE_MAP_Y_SORT_ENABLED, @@ -249,20 +249,15 @@ public: private: // Exposed properties. - String name; bool enabled = true; - Color modulate = Color(1, 1, 1, 1); - bool y_sort_enabled = false; int y_sort_origin = 0; - int z_index = 0; + bool use_kinematic_bodies = false; bool navigation_enabled = true; RID navigation_map; bool uses_world_navigation_map = false; // Internal. - TileMap *tile_map_node = nullptr; int layer_index_in_tile_map_node = -1; - RID canvas_item; HashMap<Vector2i, CellData> tile_map; // Dirty flag. Allows knowing what was modified since the last update. @@ -278,6 +273,10 @@ private: mutable Rect2i used_rect_cache; mutable bool used_rect_cache_dirty = true; + // Method to fetch the TileSet to use + TileMap *_fetch_tilemap() const; + Ref<TileSet> _fetch_tileset() const; + // Runtime tile data. bool _runtime_update_tile_data_was_cleaned_up = false; void _build_runtime_update_tile_data(); @@ -296,29 +295,31 @@ private: HashMap<Vector2i, Ref<RenderingQuadrant>> rendering_quadrant_map; bool _rendering_was_cleaned_up = false; void _rendering_update(); + void _rendering_notification(int p_what); void _rendering_quadrants_update_cell(CellData &r_cell_data, SelfList<RenderingQuadrant>::List &r_dirty_rendering_quadrant_list); void _rendering_occluders_clear_cell(CellData &r_cell_data); void _rendering_occluders_update_cell(CellData &r_cell_data); #ifdef DEBUG_ENABLED - void _rendering_draw_cell_debug(const RID &p_canvas_item, const Vector2i &p_quadrant_pos, const CellData &r_cell_data); + void _rendering_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data); #endif // DEBUG_ENABLED HashMap<RID, Vector2i> bodies_coords; // Mapping for RID to coords. bool _physics_was_cleaned_up = false; void _physics_update(); - void _physics_notify_tilemap_change(DirtyFlags p_what); + void _physics_notification(int p_what); void _physics_clear_cell(CellData &r_cell_data); void _physics_update_cell(CellData &r_cell_data); #ifdef DEBUG_ENABLED - void _physics_draw_cell_debug(const RID &p_canvas_item, const Vector2i &p_quadrant_pos, const CellData &r_cell_data); + void _physics_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data); #endif // DEBUG_ENABLED bool _navigation_was_cleaned_up = false; void _navigation_update(); + void _navigation_notification(int p_what); void _navigation_clear_cell(CellData &r_cell_data); void _navigation_update_cell(CellData &r_cell_data); #ifdef DEBUG_ENABLED - void _navigation_draw_cell_debug(const RID &p_canvas_item, const Vector2i &p_quadrant_pos, const CellData &r_cell_data); + void _navigation_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data); #endif // DEBUG_ENABLED bool _scenes_was_cleaned_up = false; @@ -326,7 +327,7 @@ private: void _scenes_clear_cell(CellData &r_cell_data); void _scenes_update_cell(CellData &r_cell_data); #ifdef DEBUG_ENABLED - void _scenes_draw_cell_debug(const RID &p_canvas_item, const Vector2i &p_quadrant_pos, const CellData &r_cell_data); + void _scenes_draw_cell_debug(const RID &p_canvas_item, const Vector2 &p_quadrant_pos, const CellData &r_cell_data); #endif // DEBUG_ENABLED // Terrains. @@ -334,9 +335,14 @@ private: RBSet<TerrainConstraint> _get_terrain_constraints_from_added_pattern(const Vector2i &p_position, int p_terrain_set, TileSet::TerrainsPattern p_terrains_pattern) const; RBSet<TerrainConstraint> _get_terrain_constraints_from_painted_cells_list(const RBSet<Vector2i> &p_painted, int p_terrain_set, bool p_ignore_empty_terrains) const; + void _renamed(); + void _update_notify_local_transform(); + +protected: + void _notification(int p_what); + public: // TileMap node. - void set_tile_map(TileMap *p_tile_map); void set_layer_index_in_tile_map_node(int p_index); // Rect caching. @@ -383,18 +389,15 @@ public: Rect2i get_used_rect() const; // Layer properties. - void set_name(String p_name); - String get_name() const; void set_enabled(bool p_enabled); bool is_enabled() const; - void set_modulate(Color p_modulate); - Color get_modulate() const; - void set_y_sort_enabled(bool p_y_sort_enabled); - bool is_y_sort_enabled() const; + virtual void set_self_modulate(const Color &p_self_modulate) override; + virtual void set_y_sort_enabled(bool p_y_sort_enabled) override; void set_y_sort_origin(int p_y_sort_origin); int get_y_sort_origin() const; - void set_z_index(int p_z_index); - int get_z_index() const; + virtual void set_z_index(int p_z_index) override; + void set_use_kinematic_bodies(bool p_use_kinematic_bodies); + bool is_using_kinematic_bodies() const; void set_navigation_enabled(bool p_enabled); bool is_navigation_enabled() const; void set_navigation_map(RID p_map); @@ -407,6 +410,7 @@ public: bool has_body_rid(RID p_physics_body) const; Vector2i get_coords_for_body_rid(RID p_physics_body) const; // For finding tiles from collision. + TileMapLayer(); ~TileMapLayer(); }; diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 3971e615a1..b01be4dffb 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -34,8 +34,10 @@ #include "scene/3d/area_3d.h" #include "scene/3d/audio_listener_3d.h" #include "scene/3d/camera_3d.h" +#include "scene/3d/velocity_tracker_3d.h" +#include "scene/audio/audio_stream_player_internal.h" #include "scene/main/viewport.h" -#include "scene/scene_string_names.h" +#include "servers/audio/audio_stream.h" // Based on "A Novel Multichannel Panning Method for Standard and Arbitrary Loudspeaker Configurations" by Ramy Sadek and Chris Kyriakakis (2004) // Speaker-Placement Correction Amplitude Panning (SPCAP) @@ -229,7 +231,7 @@ float AudioStreamPlayer3D::_get_attenuation_db(float p_distance) const { } } - att += volume_db; + att += internal->volume_db; if (att > max_db) { att = max_db; } @@ -242,32 +244,12 @@ void AudioStreamPlayer3D::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { velocity_tracker->reset(get_global_transform().origin); AudioServer::get_singleton()->add_listener_changed_callback(_listener_changed_cb, this); - if (autoplay && !Engine::get_singleton()->is_editor_hint()) { - play(); - } - set_stream_paused(!can_process()); } break; case NOTIFICATION_EXIT_TREE: { - set_stream_paused(true); AudioServer::get_singleton()->remove_listener_changed_callback(_listener_changed_cb, this); } break; - case NOTIFICATION_PREDELETE: { - stop(); - } break; - - case NOTIFICATION_PAUSED: { - if (!can_process()) { - // Node can't process so we start fading out to silence. - set_stream_paused(true); - } - } break; - - case NOTIFICATION_UNPAUSED: { - set_stream_paused(false); - } break; - case NOTIFICATION_TRANSFORM_CHANGED: { if (doppler_tracking != DOPPLER_TRACKING_DISABLED) { velocity_tracker->update_position(get_global_transform().origin); @@ -277,13 +259,13 @@ void AudioStreamPlayer3D::_notification(int p_what) { case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { // Update anything related to position first, if possible of course. Vector<AudioFrame> volume_vector; - if (setplay.get() > 0 || (active.is_set() && last_mix_count != AudioServer::get_singleton()->get_mix_count()) || force_update_panning) { + if (setplay.get() > 0 || (internal->active.is_set() && last_mix_count != AudioServer::get_singleton()->get_mix_count()) || force_update_panning) { force_update_panning = false; volume_vector = _update_panning(); } if (setplayback.is_valid() && setplay.get() >= 0) { - active.set(); + internal->active.set(); HashMap<StringName, Vector<AudioFrame>> bus_map; bus_map[_get_actual_bus()] = volume_vector; AudioServer::get_singleton()->start_playback_stream(setplayback, bus_map, setplay.get(), actual_pitch_scale, linear_attenuation, attenuation_filter_cutoff_hz); @@ -291,32 +273,10 @@ void AudioStreamPlayer3D::_notification(int p_what) { setplay.set(-1); } - if (!stream_playbacks.is_empty() && active.is_set()) { - // Stop playing if no longer active. - Vector<Ref<AudioStreamPlayback>> playbacks_to_remove; - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - if (playback.is_valid() && !AudioServer::get_singleton()->is_playback_active(playback) && !AudioServer::get_singleton()->is_playback_paused(playback)) { - playbacks_to_remove.push_back(playback); - } - } - // Now go through and remove playbacks that have finished. Removing elements from a Vector in a range based for is asking for trouble. - for (Ref<AudioStreamPlayback> &playback : playbacks_to_remove) { - stream_playbacks.erase(playback); - } - if (!playbacks_to_remove.is_empty() && stream_playbacks.is_empty()) { - // This node is no longer actively playing audio. - active.clear(); - set_physics_process_internal(false); - } - if (!playbacks_to_remove.is_empty()) { - emit_signal(SNAME("finished")); - } - } - - while (stream_playbacks.size() > max_polyphony) { - AudioServer::get_singleton()->stop_playback_stream(stream_playbacks[0]); - stream_playbacks.remove_at(0); + if (!internal->stream_playbacks.is_empty() && internal->active.is_set()) { + internal->process(); } + internal->ensure_playback_limit(); } break; } } @@ -360,16 +320,16 @@ Area3D *AudioStreamPlayer3D::_get_overriding_area() { return nullptr; } -// Interacts with PhysicsServer3D, so can only be called during _physics_process +// Interacts with PhysicsServer3D, so can only be called during _physics_process. StringName AudioStreamPlayer3D::_get_actual_bus() { Area3D *overriding_area = _get_overriding_area(); if (overriding_area && overriding_area->is_overriding_audio_bus() && !overriding_area->is_using_reverb_bus()) { return overriding_area->get_audio_bus_name(); } - return bus; + return internal->bus; } -// Interacts with PhysicsServer3D, so can only be called during _physics_process +// Interacts with PhysicsServer3D, so can only be called during _physics_process. Vector<AudioFrame> AudioStreamPlayer3D::_update_panning() { Vector<AudioFrame> output_volume_vector; output_volume_vector.resize(4); @@ -377,7 +337,7 @@ Vector<AudioFrame> AudioStreamPlayer3D::_update_panning() { frame = AudioFrame(0, 0); } - if (!active.is_set() || stream.is_null()) { + if (!internal->active.is_set() || internal->stream.is_null()) { return output_volume_vector; } @@ -461,7 +421,7 @@ Vector<AudioFrame> AudioStreamPlayer3D::_update_panning() { } linear_attenuation = Math::db_to_linear(db_att); - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { + for (Ref<AudioStreamPlayback> &playback : internal->stream_playbacks) { AudioServer::get_singleton()->set_playback_highshelf_params(playback, linear_attenuation, attenuation_filter_cutoff_hz); } // Bake in a constant factor here to allow the project setting defaults for 2d and 3d to be normalized to 1.0. @@ -487,10 +447,10 @@ Vector<AudioFrame> AudioStreamPlayer3D::_update_panning() { bus_volumes[reverb_bus_name] = reverb_vol; } } else { - bus_volumes[bus] = output_volume_vector; + bus_volumes[internal->bus] = output_volume_vector; } - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { + for (Ref<AudioStreamPlayback> &playback : internal->stream_playbacks) { AudioServer::get_singleton()->set_playback_bus_volumes_linear(playback, bus_volumes); } @@ -508,17 +468,17 @@ Vector<AudioFrame> AudioStreamPlayer3D::_update_panning() { float velocity = local_velocity.length(); float speed_of_sound = 343.0; - float doppler_pitch_scale = pitch_scale * speed_of_sound / (speed_of_sound + velocity * approaching); + float doppler_pitch_scale = internal->pitch_scale * speed_of_sound / (speed_of_sound + velocity * approaching); doppler_pitch_scale = CLAMP(doppler_pitch_scale, (1 / 8.0), 8.0); //avoid crazy stuff actual_pitch_scale = doppler_pitch_scale; } else { - actual_pitch_scale = pitch_scale; + actual_pitch_scale = internal->pitch_scale; } } else { - actual_pitch_scale = pitch_scale; + actual_pitch_scale = internal->pitch_scale; } - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { + for (Ref<AudioStreamPlayback> &playback : internal->stream_playbacks) { AudioServer::get_singleton()->set_playback_pitch_scale(playback, actual_pitch_scale); } } @@ -526,20 +486,19 @@ Vector<AudioFrame> AudioStreamPlayer3D::_update_panning() { } void AudioStreamPlayer3D::set_stream(Ref<AudioStream> p_stream) { - stop(); - stream = p_stream; + internal->set_stream(p_stream); } Ref<AudioStream> AudioStreamPlayer3D::get_stream() const { - return stream; + return internal->stream; } void AudioStreamPlayer3D::set_volume_db(float p_volume) { - volume_db = p_volume; + internal->volume_db = p_volume; } float AudioStreamPlayer3D::get_volume_db() const { - return volume_db; + return internal->volume_db; } void AudioStreamPlayer3D::set_unit_size(float p_volume) { @@ -560,30 +519,20 @@ float AudioStreamPlayer3D::get_max_db() const { } void AudioStreamPlayer3D::set_pitch_scale(float p_pitch_scale) { - ERR_FAIL_COND(!(p_pitch_scale > 0.0)); - pitch_scale = p_pitch_scale; + internal->set_pitch_scale(p_pitch_scale); } float AudioStreamPlayer3D::get_pitch_scale() const { - return pitch_scale; + return internal->pitch_scale; } void AudioStreamPlayer3D::play(float p_from_pos) { - if (stream.is_null()) { + Ref<AudioStreamPlayback> stream_playback = internal->play_basic(); + if (stream_playback.is_null()) { return; } - ERR_FAIL_COND_MSG(!is_inside_tree(), "Playback can only happen when a node is inside the scene tree"); - if (stream->is_monophonic() && is_playing()) { - stop(); - } - Ref<AudioStreamPlayback> stream_playback = stream->instantiate_playback(); - ERR_FAIL_COND_MSG(stream_playback.is_null(), "Failed to instantiate playback."); - - stream_playbacks.push_back(stream_playback); setplayback = stream_playback; setplay.set(p_from_pos); - active.set(); - set_physics_process_internal(true); } void AudioStreamPlayer3D::seek(float p_seconds) { @@ -595,83 +544,46 @@ void AudioStreamPlayer3D::seek(float p_seconds) { void AudioStreamPlayer3D::stop() { setplay.set(-1); - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - AudioServer::get_singleton()->stop_playback_stream(playback); - } - stream_playbacks.clear(); - active.clear(); - set_physics_process_internal(false); + internal->stop(); } bool AudioStreamPlayer3D::is_playing() const { - for (const Ref<AudioStreamPlayback> &playback : stream_playbacks) { - if (AudioServer::get_singleton()->is_playback_active(playback)) { - return true; - } - } if (setplay.get() >= 0) { return true; // play() has been called this frame, but no playback exists just yet. } - return false; + return internal->is_playing(); } float AudioStreamPlayer3D::get_playback_position() { - // Return the playback position of the most recently started playback stream. - if (!stream_playbacks.is_empty()) { - return AudioServer::get_singleton()->get_playback_position(stream_playbacks[stream_playbacks.size() - 1]); - } - return 0; + return internal->get_playback_position(); } void AudioStreamPlayer3D::set_bus(const StringName &p_bus) { - //if audio is active, must lock this - AudioServer::get_singleton()->lock(); - bus = p_bus; - AudioServer::get_singleton()->unlock(); + internal->bus = p_bus; // This will be pushed to the audio server during the next physics timestep, which is fast enough. } StringName AudioStreamPlayer3D::get_bus() const { - for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { - if (AudioServer::get_singleton()->get_bus_name(i) == bus) { - return bus; - } - } - return SceneStringNames::get_singleton()->Master; + return internal->get_bus(); } void AudioStreamPlayer3D::set_autoplay(bool p_enable) { - autoplay = p_enable; + internal->autoplay = p_enable; } bool AudioStreamPlayer3D::is_autoplay_enabled() { - return autoplay; + return internal->autoplay; } void AudioStreamPlayer3D::_set_playing(bool p_enable) { - if (p_enable) { - play(); - } else { - stop(); - } + internal->set_playing(p_enable); } bool AudioStreamPlayer3D::_is_active() const { - return active.is_set(); + return internal->is_active(); } void AudioStreamPlayer3D::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "bus") { - String options; - for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { - if (i > 0) { - options += ","; - } - String name = AudioServer::get_singleton()->get_bus_name(i); - options += name; - } - - p_property.hint_string = options; - } + internal->validate_property(p_property); } void AudioStreamPlayer3D::set_max_distance(float p_metres) { @@ -768,37 +680,27 @@ AudioStreamPlayer3D::DopplerTracking AudioStreamPlayer3D::get_doppler_tracking() } void AudioStreamPlayer3D::set_stream_paused(bool p_pause) { - // TODO this does not have perfect recall, fix that maybe? If there are zero playbacks registered with the AudioServer, this bool isn't persisted. - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - AudioServer::get_singleton()->set_playback_paused(playback, p_pause); - } + internal->set_stream_paused(p_pause); } bool AudioStreamPlayer3D::get_stream_paused() const { - // There's currently no way to pause some playback streams but not others. Check the first and don't bother looking at the rest. - if (!stream_playbacks.is_empty()) { - return AudioServer::get_singleton()->is_playback_paused(stream_playbacks[0]); - } - return false; + return internal->get_stream_paused(); } bool AudioStreamPlayer3D::has_stream_playback() { - return !stream_playbacks.is_empty(); + return internal->has_stream_playback(); } Ref<AudioStreamPlayback> AudioStreamPlayer3D::get_stream_playback() { - ERR_FAIL_COND_V_MSG(stream_playbacks.is_empty(), Ref<AudioStreamPlayback>(), "Player is inactive. Call play() before requesting get_stream_playback()."); - return stream_playbacks[stream_playbacks.size() - 1]; + return internal->get_stream_playback(); } void AudioStreamPlayer3D::set_max_polyphony(int p_max_polyphony) { - if (p_max_polyphony > 0) { - max_polyphony = p_max_polyphony; - } + internal->set_max_polyphony(p_max_polyphony); } int AudioStreamPlayer3D::get_max_polyphony() const { - return max_polyphony; + return internal->max_polyphony; } void AudioStreamPlayer3D::set_panning_strength(float p_panning_strength) { @@ -810,12 +712,16 @@ float AudioStreamPlayer3D::get_panning_strength() const { return panning_strength; } -void AudioStreamPlayer3D::_on_bus_layout_changed() { - notify_property_list_changed(); +bool AudioStreamPlayer3D::_set(const StringName &p_name, const Variant &p_value) { + return internal->set(p_name, p_value); +} + +bool AudioStreamPlayer3D::_get(const StringName &p_name, Variant &r_ret) const { + return internal->get(p_name, r_ret); } -void AudioStreamPlayer3D::_on_bus_renamed(int p_bus_index, const StringName &p_old_name, const StringName &p_new_name) { - notify_property_list_changed(); +void AudioStreamPlayer3D::_get_property_list(List<PropertyInfo> *p_list) const { + internal->get_property_list(p_list); } void AudioStreamPlayer3D::_bind_methods() { @@ -926,12 +832,12 @@ void AudioStreamPlayer3D::_bind_methods() { } AudioStreamPlayer3D::AudioStreamPlayer3D() { + internal = memnew(AudioStreamPlayerInternal(this, callable_mp(this, &AudioStreamPlayer3D::play), true)); velocity_tracker.instantiate(); - AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp(this, &AudioStreamPlayer3D::_on_bus_layout_changed)); - AudioServer::get_singleton()->connect("bus_renamed", callable_mp(this, &AudioStreamPlayer3D::_on_bus_renamed)); set_disable_scale(true); cached_global_panning_strength = GLOBAL_GET("audio/general/3d_panning_strength"); } AudioStreamPlayer3D::~AudioStreamPlayer3D() { + memdelete(internal); } diff --git a/scene/3d/audio_stream_player_3d.h b/scene/3d/audio_stream_player_3d.h index f20170e63b..3cc1efaf67 100644 --- a/scene/3d/audio_stream_player_3d.h +++ b/scene/3d/audio_stream_player_3d.h @@ -31,15 +31,16 @@ #ifndef AUDIO_STREAM_PLAYER_3D_H #define AUDIO_STREAM_PLAYER_3D_H -#include "core/os/mutex.h" -#include "scene/3d/area_3d.h" #include "scene/3d/node_3d.h" -#include "scene/3d/velocity_tracker_3d.h" -#include "servers/audio/audio_filter_sw.h" -#include "servers/audio/audio_stream.h" -#include "servers/audio_server.h" +class Area3D; +struct AudioFrame; +class AudioStream; +class AudioStreamPlayback; +class AudioStreamPlayerInternal; class Camera3D; +class VelocityTracker3D; + class AudioStreamPlayer3D : public Node3D { GDCLASS(AudioStreamPlayer3D, Node3D); @@ -64,23 +65,16 @@ private: }; - Vector<Ref<AudioStreamPlayback>> stream_playbacks; - Ref<AudioStream> stream; + AudioStreamPlayerInternal *internal = nullptr; - SafeFlag active{ false }; SafeNumeric<float> setplay{ -1.0 }; Ref<AudioStreamPlayback> setplayback; AttenuationModel attenuation_model = ATTENUATION_INVERSE_DISTANCE; - float volume_db = 0.0; float unit_size = 10.0; float max_db = 3.0; - float pitch_scale = 1.0; // Internally used to take doppler tracking into account. float actual_pitch_scale = 1.0; - bool autoplay = false; - StringName bus = SNAME("Master"); - int max_polyphony = 1; uint64_t last_mix_count = -1; bool force_update_panning = false; @@ -97,9 +91,6 @@ private: Area3D *_get_overriding_area(); Vector<AudioFrame> _update_panning(); - void _on_bus_layout_changed(); - void _on_bus_renamed(int p_bus_index, const StringName &p_old_name, const StringName &p_new_name); - uint32_t area_mask = 1; bool emission_angle_enabled = false; @@ -126,6 +117,10 @@ protected: void _notification(int p_what); static void _bind_methods(); + bool _set(const StringName &p_name, const Variant &p_value); + bool _get(const StringName &p_name, Variant &r_ret) const; + void _get_property_list(List<PropertyInfo> *p_list) const; + public: void set_stream(Ref<AudioStream> p_stream); Ref<AudioStream> get_stream() const; diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp index 97b1e282ad..0cfe0f8cb7 100644 --- a/scene/3d/collision_object_3d.cpp +++ b/scene/3d/collision_object_3d.cpp @@ -624,6 +624,7 @@ void CollisionObject3D::shape_owner_add_shape(uint32_t p_owner, const Ref<Shape3 total_subshapes++; _update_shape_data(p_owner); + update_gizmos(); } int CollisionObject3D::shape_owner_get_shape_count(uint32_t p_owner) const { @@ -687,6 +688,8 @@ void CollisionObject3D::shape_owner_clear_shapes(uint32_t p_owner) { while (shape_owner_get_shape_count(p_owner) > 0) { shape_owner_remove_shape(p_owner, 0); } + + update_gizmos(); } uint32_t CollisionObject3D::shape_find_owner(int p_shape_index) const { diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp index f3c986f9b3..d7582526a3 100644 --- a/scene/audio/audio_stream_player.cpp +++ b/scene/audio/audio_stream_player.cpp @@ -30,185 +30,104 @@ #include "audio_stream_player.h" -#include "core/config/engine.h" -#include "core/math/audio_frame.h" -#include "servers/audio_server.h" +#include "scene/audio/audio_stream_player_internal.h" +#include "servers/audio/audio_stream.h" void AudioStreamPlayer::_notification(int p_what) { - switch (p_what) { - case NOTIFICATION_ENTER_TREE: { - if (autoplay && !Engine::get_singleton()->is_editor_hint()) { - play(); - } - set_stream_paused(!can_process()); - } break; - - case NOTIFICATION_INTERNAL_PROCESS: { - Vector<Ref<AudioStreamPlayback>> playbacks_to_remove; - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - if (playback.is_valid() && !AudioServer::get_singleton()->is_playback_active(playback) && !AudioServer::get_singleton()->is_playback_paused(playback)) { - playbacks_to_remove.push_back(playback); - } - } - // Now go through and remove playbacks that have finished. Removing elements from a Vector in a range based for is asking for trouble. - for (Ref<AudioStreamPlayback> &playback : playbacks_to_remove) { - stream_playbacks.erase(playback); - } - if (!playbacks_to_remove.is_empty() && stream_playbacks.is_empty()) { - // This node is no longer actively playing audio. - active.clear(); - set_process_internal(false); - } - if (!playbacks_to_remove.is_empty()) { - emit_signal(SNAME("finished")); - } - } break; - - case NOTIFICATION_EXIT_TREE: { - set_stream_paused(true); - } break; - - case NOTIFICATION_PREDELETE: { - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - AudioServer::get_singleton()->stop_playback_stream(playback); - } - stream_playbacks.clear(); - } break; - - case NOTIFICATION_PAUSED: { - if (!can_process()) { - // Node can't process so we start fading out to silence - set_stream_paused(true); - } - } break; - - case NOTIFICATION_UNPAUSED: { - set_stream_paused(false); - } break; - } + internal->notification(p_what); } void AudioStreamPlayer::set_stream(Ref<AudioStream> p_stream) { - stop(); - stream = p_stream; + internal->set_stream(p_stream); +} + +bool AudioStreamPlayer::_set(const StringName &p_name, const Variant &p_value) { + return internal->set(p_name, p_value); +} + +bool AudioStreamPlayer::_get(const StringName &p_name, Variant &r_ret) const { + return internal->get(p_name, r_ret); +} + +void AudioStreamPlayer::_get_property_list(List<PropertyInfo> *p_list) const { + internal->get_property_list(p_list); } Ref<AudioStream> AudioStreamPlayer::get_stream() const { - return stream; + return internal->stream; } void AudioStreamPlayer::set_volume_db(float p_volume) { - volume_db = p_volume; + internal->volume_db = p_volume; Vector<AudioFrame> volume_vector = _get_volume_vector(); - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { + for (Ref<AudioStreamPlayback> &playback : internal->stream_playbacks) { AudioServer::get_singleton()->set_playback_all_bus_volumes_linear(playback, volume_vector); } } float AudioStreamPlayer::get_volume_db() const { - return volume_db; + return internal->volume_db; } void AudioStreamPlayer::set_pitch_scale(float p_pitch_scale) { - ERR_FAIL_COND(!(p_pitch_scale > 0.0)); - pitch_scale = p_pitch_scale; - - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - AudioServer::get_singleton()->set_playback_pitch_scale(playback, pitch_scale); - } + internal->set_pitch_scale(p_pitch_scale); } float AudioStreamPlayer::get_pitch_scale() const { - return pitch_scale; + return internal->pitch_scale; } void AudioStreamPlayer::set_max_polyphony(int p_max_polyphony) { - if (p_max_polyphony > 0) { - max_polyphony = p_max_polyphony; - } + internal->set_max_polyphony(p_max_polyphony); } int AudioStreamPlayer::get_max_polyphony() const { - return max_polyphony; + return internal->max_polyphony; } void AudioStreamPlayer::play(float p_from_pos) { - if (stream.is_null()) { + Ref<AudioStreamPlayback> stream_playback = internal->play_basic(); + if (stream_playback.is_null()) { return; } - ERR_FAIL_COND_MSG(!is_inside_tree(), "Playback can only happen when a node is inside the scene tree"); - if (stream->is_monophonic() && is_playing()) { - stop(); - } - Ref<AudioStreamPlayback> stream_playback = stream->instantiate_playback(); - ERR_FAIL_COND_MSG(stream_playback.is_null(), "Failed to instantiate playback."); - - AudioServer::get_singleton()->start_playback_stream(stream_playback, bus, _get_volume_vector(), p_from_pos, pitch_scale); - stream_playbacks.push_back(stream_playback); - active.set(); - set_process_internal(true); - while (stream_playbacks.size() > max_polyphony) { - AudioServer::get_singleton()->stop_playback_stream(stream_playbacks[0]); - stream_playbacks.remove_at(0); - } + AudioServer::get_singleton()->start_playback_stream(stream_playback, internal->bus, _get_volume_vector(), p_from_pos, internal->pitch_scale); + internal->ensure_playback_limit(); } void AudioStreamPlayer::seek(float p_seconds) { - if (is_playing()) { - stop(); - play(p_seconds); - } + internal->seek(p_seconds); } void AudioStreamPlayer::stop() { - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - AudioServer::get_singleton()->stop_playback_stream(playback); - } - stream_playbacks.clear(); - active.clear(); - set_process_internal(false); + internal->stop(); } bool AudioStreamPlayer::is_playing() const { - for (const Ref<AudioStreamPlayback> &playback : stream_playbacks) { - if (AudioServer::get_singleton()->is_playback_active(playback)) { - return true; - } - } - return false; + return internal->is_playing(); } float AudioStreamPlayer::get_playback_position() { - // Return the playback position of the most recently started playback stream. - if (!stream_playbacks.is_empty()) { - return AudioServer::get_singleton()->get_playback_position(stream_playbacks[stream_playbacks.size() - 1]); - } - return 0; + return internal->get_playback_position(); } void AudioStreamPlayer::set_bus(const StringName &p_bus) { - bus = p_bus; - for (const Ref<AudioStreamPlayback> &playback : stream_playbacks) { + internal->bus = p_bus; + for (const Ref<AudioStreamPlayback> &playback : internal->stream_playbacks) { AudioServer::get_singleton()->set_playback_bus_exclusive(playback, p_bus, _get_volume_vector()); } } StringName AudioStreamPlayer::get_bus() const { - for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { - if (AudioServer::get_singleton()->get_bus_name(i) == String(bus)) { - return bus; - } - } - return SceneStringNames::get_singleton()->Master; + return internal->get_bus(); } void AudioStreamPlayer::set_autoplay(bool p_enable) { - autoplay = p_enable; + internal->autoplay = p_enable; } bool AudioStreamPlayer::is_autoplay_enabled() { - return autoplay; + return internal->autoplay; } void AudioStreamPlayer::set_mix_target(MixTarget p_target) { @@ -220,43 +139,19 @@ AudioStreamPlayer::MixTarget AudioStreamPlayer::get_mix_target() const { } void AudioStreamPlayer::_set_playing(bool p_enable) { - if (p_enable) { - play(); - } else { - stop(); - } + internal->set_playing(p_enable); } bool AudioStreamPlayer::_is_active() const { - for (const Ref<AudioStreamPlayback> &playback : stream_playbacks) { - if (AudioServer::get_singleton()->is_playback_active(playback)) { - return true; - } - } - return false; -} - -void AudioStreamPlayer::_on_bus_layout_changed() { - notify_property_list_changed(); -} - -void AudioStreamPlayer::_on_bus_renamed(int p_bus_index, const StringName &p_old_name, const StringName &p_new_name) { - notify_property_list_changed(); + return internal->is_active(); } void AudioStreamPlayer::set_stream_paused(bool p_pause) { - // TODO this does not have perfect recall, fix that maybe? If there are zero playbacks registered with the AudioServer, this bool isn't persisted. - for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { - AudioServer::get_singleton()->set_playback_paused(playback, p_pause); - } + internal->set_stream_paused(p_pause); } bool AudioStreamPlayer::get_stream_paused() const { - // There's currently no way to pause some playback streams but not others. Check the first and don't bother looking at the rest. - if (!stream_playbacks.is_empty()) { - return AudioServer::get_singleton()->is_playback_paused(stream_playbacks[0]); - } - return false; + return internal->get_stream_paused(); } Vector<AudioFrame> AudioStreamPlayer::_get_volume_vector() { @@ -269,7 +164,7 @@ Vector<AudioFrame> AudioStreamPlayer::_get_volume_vector() { channel_volume_db = AudioFrame(0, 0); } - float volume_linear = Math::db_to_linear(volume_db); + float volume_linear = Math::db_to_linear(internal->volume_db); // Set the volume vector up according to the speaker mode and mix target. // TODO do we need to scale the volume down when we output to more channels? @@ -297,27 +192,15 @@ Vector<AudioFrame> AudioStreamPlayer::_get_volume_vector() { } void AudioStreamPlayer::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "bus") { - String options; - for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { - if (i > 0) { - options += ","; - } - String name = AudioServer::get_singleton()->get_bus_name(i); - options += name; - } - - p_property.hint_string = options; - } + internal->validate_property(p_property); } bool AudioStreamPlayer::has_stream_playback() { - return !stream_playbacks.is_empty(); + return internal->has_stream_playback(); } Ref<AudioStreamPlayback> AudioStreamPlayer::get_stream_playback() { - ERR_FAIL_COND_V_MSG(stream_playbacks.is_empty(), Ref<AudioStreamPlayback>(), "Player is inactive. Call play() before requesting get_stream_playback()."); - return stream_playbacks[stream_playbacks.size() - 1]; + return internal->get_stream_playback(); } void AudioStreamPlayer::_bind_methods() { @@ -376,9 +259,9 @@ void AudioStreamPlayer::_bind_methods() { } AudioStreamPlayer::AudioStreamPlayer() { - AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp(this, &AudioStreamPlayer::_on_bus_layout_changed)); - AudioServer::get_singleton()->connect("bus_renamed", callable_mp(this, &AudioStreamPlayer::_on_bus_renamed)); + internal = memnew(AudioStreamPlayerInternal(this, callable_mp(this, &AudioStreamPlayer::play), false)); } AudioStreamPlayer::~AudioStreamPlayer() { + memdelete(internal); } diff --git a/scene/audio/audio_stream_player.h b/scene/audio/audio_stream_player.h index 9dbdccdc69..754e670553 100644 --- a/scene/audio/audio_stream_player.h +++ b/scene/audio/audio_stream_player.h @@ -31,10 +31,12 @@ #ifndef AUDIO_STREAM_PLAYER_H #define AUDIO_STREAM_PLAYER_H -#include "core/templates/safe_refcount.h" #include "scene/main/node.h" -#include "scene/scene_string_names.h" -#include "servers/audio/audio_stream.h" + +struct AudioFrame; +class AudioStream; +class AudioStreamPlayback; +class AudioStreamPlayerInternal; class AudioStreamPlayer : public Node { GDCLASS(AudioStreamPlayer, Node); @@ -47,25 +49,13 @@ public: }; private: - Vector<Ref<AudioStreamPlayback>> stream_playbacks; - Ref<AudioStream> stream; - - SafeFlag active; - - float pitch_scale = 1.0; - float volume_db = 0.0; - bool autoplay = false; - StringName bus = SceneStringNames::get_singleton()->Master; - int max_polyphony = 1; + AudioStreamPlayerInternal *internal = nullptr; MixTarget mix_target = MIX_TARGET_STEREO; void _set_playing(bool p_enable); bool _is_active() const; - void _on_bus_layout_changed(); - void _on_bus_renamed(int p_bus_index, const StringName &p_old_name, const StringName &p_new_name); - Vector<AudioFrame> _get_volume_vector(); protected: @@ -73,6 +63,10 @@ protected: void _notification(int p_what); static void _bind_methods(); + bool _set(const StringName &p_name, const Variant &p_value); + bool _get(const StringName &p_name, Variant &r_ret) const; + void _get_property_list(List<PropertyInfo> *p_list) const; + public: void set_stream(Ref<AudioStream> p_stream); Ref<AudioStream> get_stream() const; diff --git a/scene/audio/audio_stream_player_internal.cpp b/scene/audio/audio_stream_player_internal.cpp new file mode 100644 index 0000000000..d5f6f91c88 --- /dev/null +++ b/scene/audio/audio_stream_player_internal.cpp @@ -0,0 +1,321 @@ +/**************************************************************************/ +/* audio_stream_player_internal.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "audio_stream_player_internal.h" + +#include "scene/main/node.h" +#include "scene/scene_string_names.h" +#include "servers/audio/audio_stream.h" + +void AudioStreamPlayerInternal::_set_process(bool p_enabled) { + if (physical) { + node->set_physics_process_internal(p_enabled); + } else { + node->set_process(p_enabled); + } +} + +void AudioStreamPlayerInternal::_update_stream_parameters() { + if (stream.is_null()) { + return; + } + + List<AudioStream::Parameter> parameters; + stream->get_parameter_list(¶meters); + for (const AudioStream::Parameter &K : parameters) { + const PropertyInfo &pi = K.property; + StringName key = PARAM_PREFIX + pi.name; + if (!playback_parameters.has(key)) { + ParameterData pd; + pd.path = pi.name; + pd.value = K.default_value; + playback_parameters.insert(key, pd); + } + } +} + +void AudioStreamPlayerInternal::process() { + Vector<Ref<AudioStreamPlayback>> playbacks_to_remove; + for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { + if (playback.is_valid() && !AudioServer::get_singleton()->is_playback_active(playback) && !AudioServer::get_singleton()->is_playback_paused(playback)) { + playbacks_to_remove.push_back(playback); + } + } + // Now go through and remove playbacks that have finished. Removing elements from a Vector in a range based for is asking for trouble. + for (Ref<AudioStreamPlayback> &playback : playbacks_to_remove) { + stream_playbacks.erase(playback); + } + if (!playbacks_to_remove.is_empty() && stream_playbacks.is_empty()) { + // This node is no longer actively playing audio. + active.clear(); + _set_process(false); + } + if (!playbacks_to_remove.is_empty()) { + node->emit_signal(SNAME("finished")); + } +} + +void AudioStreamPlayerInternal::ensure_playback_limit() { + while (stream_playbacks.size() > max_polyphony) { + AudioServer::get_singleton()->stop_playback_stream(stream_playbacks[0]); + stream_playbacks.remove_at(0); + } +} + +void AudioStreamPlayerInternal::notification(int p_what) { + switch (p_what) { + case Node::NOTIFICATION_ENTER_TREE: { + if (autoplay && !Engine::get_singleton()->is_editor_hint()) { + play_callable.call(0.0); + } + set_stream_paused(!node->can_process()); + } break; + + case Node::NOTIFICATION_EXIT_TREE: { + set_stream_paused(true); + } break; + + case Node::NOTIFICATION_INTERNAL_PROCESS: { + process(); + } break; + + case Node::NOTIFICATION_PREDELETE: { + for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { + AudioServer::get_singleton()->stop_playback_stream(playback); + } + stream_playbacks.clear(); + } break; + + case Node::NOTIFICATION_PAUSED: { + if (!node->can_process()) { + // Node can't process so we start fading out to silence + set_stream_paused(true); + } + } break; + + case Node::NOTIFICATION_UNPAUSED: { + set_stream_paused(false); + } break; + } +} + +Ref<AudioStreamPlayback> AudioStreamPlayerInternal::play_basic() { + Ref<AudioStreamPlayback> stream_playback; + if (stream.is_null()) { + return stream_playback; + } + ERR_FAIL_COND_V_MSG(!node->is_inside_tree(), stream_playback, "Playback can only happen when a node is inside the scene tree"); + if (stream->is_monophonic() && is_playing()) { + stop(); + } + stream_playback = stream->instantiate_playback(); + ERR_FAIL_COND_V_MSG(stream_playback.is_null(), stream_playback, "Failed to instantiate playback."); + + for (const KeyValue<StringName, ParameterData> &K : playback_parameters) { + stream_playback->set_parameter(K.value.path, K.value.value); + } + + stream_playbacks.push_back(stream_playback); + active.set(); + _set_process(true); + return stream_playback; +} + +void AudioStreamPlayerInternal::set_stream_paused(bool p_pause) { + // TODO this does not have perfect recall, fix that maybe? If there are zero playbacks registered with the AudioServer, this bool isn't persisted. + for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { + AudioServer::get_singleton()->set_playback_paused(playback, p_pause); + } +} + +bool AudioStreamPlayerInternal::get_stream_paused() const { + // There's currently no way to pause some playback streams but not others. Check the first and don't bother looking at the rest. + if (!stream_playbacks.is_empty()) { + return AudioServer::get_singleton()->is_playback_paused(stream_playbacks[0]); + } + return false; +} + +void AudioStreamPlayerInternal::validate_property(PropertyInfo &p_property) const { + if (p_property.name == "bus") { + String options; + for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { + if (i > 0) { + options += ","; + } + String name = AudioServer::get_singleton()->get_bus_name(i); + options += name; + } + + p_property.hint_string = options; + } +} + +bool AudioStreamPlayerInternal::set(const StringName &p_name, const Variant &p_value) { + ParameterData *pd = playback_parameters.getptr(p_name); + if (!pd) { + return false; + } + pd->value = p_value; + for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { + playback->set_parameter(pd->path, pd->value); + } + return true; +} + +bool AudioStreamPlayerInternal::get(const StringName &p_name, Variant &r_ret) const { + const ParameterData *pd = playback_parameters.getptr(p_name); + if (!pd) { + return false; + } + r_ret = pd->value; + return true; +} + +void AudioStreamPlayerInternal::get_property_list(List<PropertyInfo> *p_list) const { + if (stream.is_null()) { + return; + } + List<AudioStream::Parameter> parameters; + stream->get_parameter_list(¶meters); + for (const AudioStream::Parameter &K : parameters) { + PropertyInfo pi = K.property; + pi.name = PARAM_PREFIX + pi.name; + + const ParameterData *pd = playback_parameters.getptr(pi.name); + if (pd && pd->value == K.default_value) { + pi.usage &= ~PROPERTY_USAGE_STORAGE; + } + + p_list->push_back(pi); + } +} + +void AudioStreamPlayerInternal::set_stream(Ref<AudioStream> p_stream) { + if (stream.is_valid()) { + stream->disconnect(SNAME("parameter_list_changed"), callable_mp(this, &AudioStreamPlayerInternal::_update_stream_parameters)); + } + stop(); + stream = p_stream; + _update_stream_parameters(); + if (stream.is_valid()) { + stream->connect(SNAME("parameter_list_changed"), callable_mp(this, &AudioStreamPlayerInternal::_update_stream_parameters)); + } + node->notify_property_list_changed(); +} + +void AudioStreamPlayerInternal::seek(float p_seconds) { + if (is_playing()) { + stop(); + play_callable.call(p_seconds); + } +} + +void AudioStreamPlayerInternal::stop() { + for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { + AudioServer::get_singleton()->stop_playback_stream(playback); + } + stream_playbacks.clear(); + active.clear(); + _set_process(false); +} + +bool AudioStreamPlayerInternal::is_playing() const { + for (const Ref<AudioStreamPlayback> &playback : stream_playbacks) { + if (AudioServer::get_singleton()->is_playback_active(playback)) { + return true; + } + } + return false; +} + +float AudioStreamPlayerInternal::get_playback_position() { + // Return the playback position of the most recently started playback stream. + if (!stream_playbacks.is_empty()) { + return AudioServer::get_singleton()->get_playback_position(stream_playbacks[stream_playbacks.size() - 1]); + } + return 0; +} + +void AudioStreamPlayerInternal::set_playing(bool p_enable) { + if (p_enable) { + play_callable.call(0.0); + } else { + stop(); + } +} + +bool AudioStreamPlayerInternal::is_active() const { + return active.is_set(); +} + +void AudioStreamPlayerInternal::set_pitch_scale(float p_pitch_scale) { + ERR_FAIL_COND(p_pitch_scale <= 0.0); + pitch_scale = p_pitch_scale; + + for (Ref<AudioStreamPlayback> &playback : stream_playbacks) { + AudioServer::get_singleton()->set_playback_pitch_scale(playback, pitch_scale); + } +} + +void AudioStreamPlayerInternal::set_max_polyphony(int p_max_polyphony) { + if (p_max_polyphony > 0) { + max_polyphony = p_max_polyphony; + } +} + +bool AudioStreamPlayerInternal::has_stream_playback() { + return !stream_playbacks.is_empty(); +} + +Ref<AudioStreamPlayback> AudioStreamPlayerInternal::get_stream_playback() { + ERR_FAIL_COND_V_MSG(stream_playbacks.is_empty(), Ref<AudioStreamPlayback>(), "Player is inactive. Call play() before requesting get_stream_playback()."); + return stream_playbacks[stream_playbacks.size() - 1]; +} + +StringName AudioStreamPlayerInternal::get_bus() const { + const String bus_name = bus; + for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { + if (AudioServer::get_singleton()->get_bus_name(i) == bus_name) { + return bus; + } + } + return SceneStringNames::get_singleton()->Master; +} + +AudioStreamPlayerInternal::AudioStreamPlayerInternal(Node *p_node, const Callable &p_play_callable, bool p_physical) { + node = p_node; + play_callable = p_play_callable; + physical = p_physical; + bus = SceneStringNames::get_singleton()->Master; + + AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp((Object *)node, &Object::notify_property_list_changed)); + AudioServer::get_singleton()->connect("bus_renamed", callable_mp((Object *)node, &Object::notify_property_list_changed).unbind(3)); +} diff --git a/scene/audio/audio_stream_player_internal.h b/scene/audio/audio_stream_player_internal.h new file mode 100644 index 0000000000..3662752441 --- /dev/null +++ b/scene/audio/audio_stream_player_internal.h @@ -0,0 +1,105 @@ +/**************************************************************************/ +/* audio_stream_player_internal.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#ifndef AUDIO_STREAM_PLAYER_INTERNAL_H +#define AUDIO_STREAM_PLAYER_INTERNAL_H + +#include "core/object/ref_counted.h" +#include "core/templates/safe_refcount.h" + +class AudioStream; +class AudioStreamPlayback; +class Node; + +class AudioStreamPlayerInternal : public Object { + GDCLASS(AudioStreamPlayerInternal, Object); + + struct ParameterData { + StringName path; + Variant value; + }; + + static inline const String PARAM_PREFIX = "parameters/"; + + Node *node = nullptr; + Callable play_callable; + bool physical = false; + + HashMap<StringName, ParameterData> playback_parameters; + + void _set_process(bool p_enabled); + void _update_stream_parameters(); + +public: + Vector<Ref<AudioStreamPlayback>> stream_playbacks; + Ref<AudioStream> stream; + + SafeFlag active; + + float pitch_scale = 1.0; + float volume_db = 0.0; + bool autoplay = false; + StringName bus; + int max_polyphony = 1; + + void process(); + void ensure_playback_limit(); + + void notification(int p_what); + void validate_property(PropertyInfo &p_property) const; + bool set(const StringName &p_name, const Variant &p_value); + bool get(const StringName &p_name, Variant &r_ret) const; + void get_property_list(List<PropertyInfo> *p_list) const; + + void set_stream(Ref<AudioStream> p_stream); + void set_pitch_scale(float p_pitch_scale); + void set_max_polyphony(int p_max_polyphony); + + StringName get_bus() const; + + Ref<AudioStreamPlayback> play_basic(); + void seek(float p_seconds); + void stop(); + bool is_playing() const; + float get_playback_position(); + + void set_playing(bool p_enable); + bool is_active() const; + + void set_stream_paused(bool p_pause); + bool get_stream_paused() const; + + bool has_stream_playback(); + Ref<AudioStreamPlayback> get_stream_playback(); + + AudioStreamPlayerInternal(Node *p_node, const Callable &p_play_callable, bool p_physical); +}; + +#endif // AUDIO_STREAM_PLAYER_INTERNAL_H diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index d11c4813b2..a6109a3925 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -1227,9 +1227,10 @@ void LineEdit::undo() { TextOperation op = undo_stack_pos->get(); text = op.text; scroll_offset = op.scroll_offset; - set_caret_column(op.caret_column); _shape(); + set_caret_column(op.caret_column); + _emit_text_change(); } @@ -1251,9 +1252,10 @@ void LineEdit::redo() { TextOperation op = undo_stack_pos->get(); text = op.text; scroll_offset = op.scroll_offset; - set_caret_column(op.caret_column); _shape(); + set_caret_column(op.caret_column); + _emit_text_change(); } diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 12e8d3eba9..2414278e52 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -287,8 +287,7 @@ int PopupMenu::_get_items_total_height() const { items_total_height += _get_item_height(i) + theme_cache.v_separation; } - // Subtract a separator which is not needed for the last item. - return items_total_height - theme_cache.v_separation; + return items_total_height; } int PopupMenu::_get_mouse_over(const Point2 &p_over) const { @@ -297,14 +296,14 @@ int PopupMenu::_get_mouse_over(const Point2 &p_over) const { } // Accounts for margin in the margin container - Point2 ofs = theme_cache.panel_style->get_offset() + Point2(0, theme_cache.v_separation / 2); + Point2 ofs = theme_cache.panel_style->get_offset(); if (ofs.y > p_over.y) { return -1; } for (int i = 0; i < items.size(); i++) { - ofs.y += i > 0 ? theme_cache.v_separation : (float)theme_cache.v_separation / 2; + ofs.y += theme_cache.v_separation; ofs.y += _get_item_height(i); @@ -2425,7 +2424,8 @@ void PopupMenu::clear(bool p_free_submenus) { } if (!global_menu_name.is_empty()) { - for (int i = 0; i < items.size(); i++) { + DisplayServer *ds = DisplayServer::get_singleton(); + for (int i = items.size() - 1; i >= 0; i--) { Item &item = items.write[i]; if (!item.submenu.is_empty()) { PopupMenu *pm = Object::cast_to<PopupMenu>(get_node_or_null(item.submenu)); @@ -2434,8 +2434,8 @@ void PopupMenu::clear(bool p_free_submenus) { } item.submenu_bound = false; } + ds->global_menu_remove_item(global_menu_name, i); } - DisplayServer::get_singleton()->global_menu_clear(global_menu_name); } items.clear(); diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index c5d1a6cd3c..fd481e1067 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -3151,7 +3151,7 @@ void RichTextLabel::_add_item(Item *p_item, bool p_enter, bool p_ensure_newline) queue_redraw(); } -void RichTextLabel::_remove_item(Item *p_item, const int p_line, const int p_subitem_line) { +void RichTextLabel::_remove_item(Item *p_item, const int p_line) { int size = p_item->subitems.size(); if (size == 0) { p_item->parent->subitems.erase(p_item); @@ -3160,7 +3160,7 @@ void RichTextLabel::_remove_item(Item *p_item, const int p_line, const int p_sub current_frame->lines.remove_at(p_line); if (p_line < (int)current_frame->lines.size() && current_frame->lines[p_line].from) { for (List<Item *>::Element *E = current_frame->lines[p_line].from->E; E; E = E->next()) { - if (E->get()->line > p_subitem_line) { + if (E->get()->line > p_line) { E->get()->line--; } } @@ -3169,7 +3169,7 @@ void RichTextLabel::_remove_item(Item *p_item, const int p_line, const int p_sub } else { // First, remove all child items for the provided item. while (p_item->subitems.size()) { - _remove_item(p_item->subitems.front()->get(), p_line, p_subitem_line); + _remove_item(p_item->subitems.front()->get(), p_line); } // Then remove the provided item itself. p_item->parent->subitems.erase(p_item); @@ -3377,7 +3377,10 @@ bool RichTextLabel::remove_paragraph(const int p_paragraph) { for (int i = subitem_to_remove.size() - 1; i >= 0; i--) { List<Item *>::Element *subitem = subitem_to_remove[i]; had_newline = had_newline || subitem->get()->type == ITEM_NEWLINE; - _remove_item(subitem->get(), subitem->get()->line, p_paragraph); + if (subitem->get() == current) { + pop(); + } + _remove_item(subitem->get(), p_paragraph); } if (!had_newline) { diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 2f48600583..5c8585565d 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -461,7 +461,7 @@ private: _FORCE_INLINE_ float _update_scroll_exceeds(float p_total_height, float p_ctrl_height, float p_width, int p_idx, float p_old_scroll, float p_text_rect_height); void _add_item(Item *p_item, bool p_enter = false, bool p_ensure_newline = false); - void _remove_item(Item *p_item, const int p_line, const int p_subitem_line); + void _remove_item(Item *p_item, const int p_line); String language; TextDirection text_direction = TEXT_DIRECTION_AUTO; diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index 06b32b548f..5f4586a6d5 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -39,7 +39,7 @@ void SplitContainerDragger::gui_input(const Ref<InputEvent> &p_event) { SplitContainer *sc = Object::cast_to<SplitContainer>(get_parent()); - if (sc->collapsed || !sc->_getch(0) || !sc->_getch(1) || sc->dragger_visibility != SplitContainer::DRAGGER_VISIBLE) { + if (sc->collapsed || !sc->get_containable_child(0) || !sc->get_containable_child(1) || sc->dragger_visibility != SplitContainer::DRAGGER_VISIBLE) { return; } @@ -122,7 +122,7 @@ void SplitContainerDragger::_notification(int p_what) { } } -Control *SplitContainer::_getch(int p_idx) const { +Control *SplitContainer::get_containable_child(int p_idx) const { int idx = 0; for (int i = 0; i < get_child_count(false); i++) { @@ -157,8 +157,8 @@ Ref<Texture2D> SplitContainer::_get_grabber_icon() const { } void SplitContainer::_compute_middle_sep(bool p_clamp) { - Control *first = _getch(0); - Control *second = _getch(1); + Control *first = get_containable_child(0); + Control *second = get_containable_child(1); // Determine expanded children. bool first_expanded = (vertical ? first->get_v_size_flags() : first->get_h_size_flags()) & SIZE_EXPAND; @@ -199,8 +199,8 @@ void SplitContainer::_compute_middle_sep(bool p_clamp) { } void SplitContainer::_resort() { - Control *first = _getch(0); - Control *second = _getch(1); + Control *first = get_containable_child(0); + Control *second = get_containable_child(1); // If we have only one element. if (!first || !second) { @@ -261,7 +261,7 @@ Size2 SplitContainer::get_minimum_size() const { int sep = (dragger_visibility != DRAGGER_HIDDEN_COLLAPSED) ? MAX(theme_cache.separation, vertical ? g->get_height() : g->get_width()) : 0; for (int i = 0; i < 2; i++) { - if (!_getch(i)) { + if (!get_containable_child(i)) { break; } @@ -273,7 +273,7 @@ Size2 SplitContainer::get_minimum_size() const { } } - Size2 ms = _getch(i)->get_combined_minimum_size(); + Size2 ms = get_containable_child(i)->get_combined_minimum_size(); if (vertical) { minimum.height += ms.height; @@ -325,7 +325,7 @@ int SplitContainer::get_split_offset() const { } void SplitContainer::clamp_split_offset() { - if (!_getch(0) || !_getch(1)) { + if (!get_containable_child(0) || !get_containable_child(1)) { return; } diff --git a/scene/gui/split_container.h b/scene/gui/split_container.h index f008d2678b..0f45ef166d 100644 --- a/scene/gui/split_container.h +++ b/scene/gui/split_container.h @@ -79,8 +79,6 @@ private: Ref<Texture2D> grabber_icon_v; } theme_cache; - Control *_getch(int p_idx) const; - Ref<Texture2D> _get_grabber_icon() const; void _compute_middle_sep(bool p_clamp); void _resort(); @@ -88,6 +86,8 @@ private: protected: bool is_fixed = false; + Control *get_containable_child(int p_idx) const; + void _notification(int p_what); void _validate_property(PropertyInfo &p_property) const; static void _bind_methods(); diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index a35ee17868..7fff2f90fb 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -277,6 +277,8 @@ void CanvasItem::_notification(int p_what) { ERR_MAIN_THREAD_GUARD; ERR_FAIL_COND(!is_inside_tree()); + _set_global_invalid(true); + Node *parent = get_parent(); if (parent) { CanvasItem *ci = Object::cast_to<CanvasItem>(parent); @@ -314,6 +316,7 @@ void CanvasItem::_notification(int p_what) { } } + _set_global_invalid(true); _enter_canvas(); RenderingServer::get_singleton()->canvas_item_set_visible(canvas_item, is_visible_in_tree()); // The visibility of the parent may change. diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h index 36f0e17924..ce1dbce6c3 100644 --- a/scene/main/canvas_item.h +++ b/scene/main/canvas_item.h @@ -237,7 +237,7 @@ public: Color get_modulate() const; Color get_modulate_in_tree() const; - void set_self_modulate(const Color &p_self_modulate); + virtual void set_self_modulate(const Color &p_self_modulate); Color get_self_modulate() const; void set_visibility_layer(uint32_t p_visibility_layer); @@ -248,7 +248,7 @@ public: /* ORDERING */ - void set_z_index(int p_z); + virtual void set_z_index(int p_z); int get_z_index() const; int get_effective_z_index() const; diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 1972e62659..fa14ad5b3c 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -503,7 +503,9 @@ void HTTPRequest::_notification(int p_what) { void HTTPRequest::set_use_threads(bool p_use) { ERR_FAIL_COND(get_http_client_status() != HTTPClient::STATUS_DISCONNECTED); +#ifdef THREADS_ENABLED use_threads.set_to(p_use); +#endif } bool HTTPRequest::is_using_threads() const { diff --git a/scene/main/node.cpp b/scene/main/node.cpp index a6b7ca8188..f7d695bf31 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -3088,6 +3088,10 @@ static void _add_nodes_to_options(const Node *p_base, const Node *p_node, List<S if (p_node != p_base && !p_node->get_owner()) { return; } + if (p_node->is_unique_name_in_owner() && p_node->get_owner() == p_base) { + String n = "%" + p_node->get_name(); + r_options->push_back(n.quote()); + } String n = p_base->get_path_to(p_node); r_options->push_back(n.quote()); for (int i = 0; i < p_node->get_child_count(); i++) { diff --git a/scene/main/window.cpp b/scene/main/window.cpp index c8e9fd4e2d..70b70b8928 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -520,15 +520,12 @@ void Window::request_attention() { } } +#ifndef DISABLE_DEPRECATED void Window::move_to_foreground() { - ERR_MAIN_THREAD_GUARD; - if (embedder) { - embedder->_sub_window_grab_focus(this); - - } else if (window_id != DisplayServer::INVALID_WINDOW_ID) { - DisplayServer::get_singleton()->window_move_to_foreground(window_id); - } + WARN_DEPRECATED_MSG(R"*(The "move_to_foreground()" method is deprecated, use "grab_focus()" instead.)*"); + grab_focus(); } +#endif // DISABLE_DEPRECATED bool Window::can_draw() const { ERR_READ_THREAD_GUARD_V(false); @@ -573,6 +570,10 @@ bool Window::is_in_edited_scene_root() const { void Window::_make_window() { ERR_FAIL_COND(window_id != DisplayServer::INVALID_WINDOW_ID); + if (transient && transient_to_focused) { + _make_transient(); + } + uint32_t f = 0; for (int i = 0; i < FLAG_MAX; i++) { if (flags[i]) { @@ -665,6 +666,10 @@ void Window::_clear_window() { _update_viewport_size(); RS::get_singleton()->viewport_set_update_mode(get_viewport_rid(), RS::VIEWPORT_UPDATE_DISABLED); + + if (transient && transient_to_focused) { + _clear_transient(); + } } void Window::_rect_changed_callback(const Rect2i &p_callback) { @@ -864,18 +869,29 @@ void Window::_make_transient() { return; } //find transient parent - Viewport *vp = get_parent()->get_viewport(); + Window *window = nullptr; - while (vp) { - window = Object::cast_to<Window>(vp); - if (window) { - break; - } - if (!vp->get_parent()) { - break; + + if (!is_embedded() && transient_to_focused) { + DisplayServer::WindowID focused_window_id = DisplayServer::get_singleton()->get_focused_window(); + if (focused_window_id != DisplayServer::INVALID_WINDOW_ID) { + window = Object::cast_to<Window>(ObjectDB::get_instance(DisplayServer::get_singleton()->window_get_attached_instance_id(focused_window_id))); } + } - vp = vp->get_parent()->get_viewport(); + if (!window) { + Viewport *vp = get_parent()->get_viewport(); + while (vp) { + window = Object::cast_to<Window>(vp); + if (window) { + break; + } + if (!vp->get_parent()) { + break; + } + + vp = vp->get_parent()->get_viewport(); + } } if (window) { @@ -919,17 +935,32 @@ void Window::set_transient(bool p_transient) { } if (transient) { - _make_transient(); + if (!transient_to_focused) { + _make_transient(); + } } else { _clear_transient(); } } bool Window::is_transient() const { - ERR_READ_THREAD_GUARD_V(false); return transient; } +void Window::set_transient_to_focused(bool p_transient_to_focused) { + ERR_MAIN_THREAD_GUARD; + if (transient_to_focused == p_transient_to_focused) { + return; + } + + transient_to_focused = p_transient_to_focused; +} + +bool Window::is_transient_to_focused() const { + ERR_READ_THREAD_GUARD_V(false); + return transient_to_focused; +} + void Window::set_exclusive(bool p_exclusive) { ERR_MAIN_THREAD_GUARD; if (exclusive == p_exclusive) { @@ -1262,7 +1293,7 @@ void Window::_notification(int p_what) { } } - if (transient) { + if (transient && !transient_to_focused) { _make_transient(); } if (visible) { @@ -2745,7 +2776,9 @@ void Window::_bind_methods() { ClassDB::bind_method(D_METHOD("request_attention"), &Window::request_attention); +#ifndef DISABLE_DEPRECATED ClassDB::bind_method(D_METHOD("move_to_foreground"), &Window::move_to_foreground); +#endif // DISABLE_DEPRECATED ClassDB::bind_method(D_METHOD("set_visible", "visible"), &Window::set_visible); ClassDB::bind_method(D_METHOD("is_visible"), &Window::is_visible); @@ -2756,6 +2789,9 @@ void Window::_bind_methods() { ClassDB::bind_method(D_METHOD("set_transient", "transient"), &Window::set_transient); ClassDB::bind_method(D_METHOD("is_transient"), &Window::is_transient); + ClassDB::bind_method(D_METHOD("set_transient_to_focused", "enable"), &Window::set_transient_to_focused); + ClassDB::bind_method(D_METHOD("is_transient_to_focused"), &Window::is_transient_to_focused); + ClassDB::bind_method(D_METHOD("set_exclusive", "exclusive"), &Window::set_exclusive); ClassDB::bind_method(D_METHOD("is_exclusive"), &Window::is_exclusive); @@ -2884,6 +2920,7 @@ void Window::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "visible"), "set_visible", "is_visible"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "wrap_controls"), "set_wrap_controls", "is_wrapping_controls"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "transient"), "set_transient", "is_transient"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "transient_to_focused"), "set_transient_to_focused", "is_transient_to_focused"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "exclusive"), "set_exclusive", "is_exclusive"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "unresizable"), "set_flag", "get_flag", FLAG_RESIZE_DISABLED); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "borderless"), "set_flag", "get_flag", FLAG_BORDERLESS); diff --git a/scene/main/window.h b/scene/main/window.h index 5f5b99ff51..4ae535848a 100644 --- a/scene/main/window.h +++ b/scene/main/window.h @@ -127,6 +127,7 @@ private: bool use_font_oversampling = false; bool transient = false; + bool transient_to_focused = false; bool exclusive = false; bool wrap_controls = false; bool updating_child_controls = false; @@ -301,7 +302,9 @@ public: bool is_maximize_allowed() const; void request_attention(); +#ifndef DISABLE_DEPRECATED void move_to_foreground(); +#endif // DISABLE_DEPRECATED virtual void set_visible(bool p_visible); bool is_visible() const; @@ -314,6 +317,9 @@ public: void set_transient(bool p_transient); bool is_transient() const; + void set_transient_to_focused(bool p_transient_to_focused); + bool is_transient_to_focused() const; + void set_exclusive(bool p_exclusive); bool is_exclusive() const; diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index a99102e847..66e1b7bcf9 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -1563,6 +1563,632 @@ void TileSet::draw_tile_shape(CanvasItem *p_canvas_item, Transform2D p_transform } } +Vector2 TileSet::map_to_local(const Vector2i &p_pos) const { + // SHOULD RETURN THE CENTER OF THE CELL. + Vector2 ret = p_pos; + + if (tile_shape == TileSet::TILE_SHAPE_HALF_OFFSET_SQUARE || tile_shape == TileSet::TILE_SHAPE_HEXAGON || tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { + // Technically, those 3 shapes are equivalent, as they are basically half-offset, but with different levels or overlap. + // square = no overlap, hexagon = 0.25 overlap, isometric = 0.5 overlap. + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { + switch (tile_layout) { + case TileSet::TILE_LAYOUT_STACKED: + ret = Vector2(ret.x + (Math::posmod(ret.y, 2) == 0 ? 0.0 : 0.5), ret.y); + break; + case TileSet::TILE_LAYOUT_STACKED_OFFSET: + ret = Vector2(ret.x + (Math::posmod(ret.y, 2) == 1 ? 0.0 : 0.5), ret.y); + break; + case TileSet::TILE_LAYOUT_STAIRS_RIGHT: + ret = Vector2(ret.x + ret.y / 2, ret.y); + break; + case TileSet::TILE_LAYOUT_STAIRS_DOWN: + ret = Vector2(ret.x / 2, ret.y * 2 + ret.x); + break; + case TileSet::TILE_LAYOUT_DIAMOND_RIGHT: + ret = Vector2((ret.x + ret.y) / 2, ret.y - ret.x); + break; + case TileSet::TILE_LAYOUT_DIAMOND_DOWN: + ret = Vector2((ret.x - ret.y) / 2, ret.y + ret.x); + break; + } + } else { // TILE_OFFSET_AXIS_VERTICAL. + switch (tile_layout) { + case TileSet::TILE_LAYOUT_STACKED: + ret = Vector2(ret.x, ret.y + (Math::posmod(ret.x, 2) == 0 ? 0.0 : 0.5)); + break; + case TileSet::TILE_LAYOUT_STACKED_OFFSET: + ret = Vector2(ret.x, ret.y + (Math::posmod(ret.x, 2) == 1 ? 0.0 : 0.5)); + break; + case TileSet::TILE_LAYOUT_STAIRS_RIGHT: + ret = Vector2(ret.x * 2 + ret.y, ret.y / 2); + break; + case TileSet::TILE_LAYOUT_STAIRS_DOWN: + ret = Vector2(ret.x, ret.y + ret.x / 2); + break; + case TileSet::TILE_LAYOUT_DIAMOND_RIGHT: + ret = Vector2(ret.x + ret.y, (ret.y - ret.x) / 2); + break; + case TileSet::TILE_LAYOUT_DIAMOND_DOWN: + ret = Vector2(ret.x - ret.y, (ret.y + ret.x) / 2); + break; + } + } + } + + // Multiply by the overlapping ratio. + double overlapping_ratio = 1.0; + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { + if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { + overlapping_ratio = 0.5; + } else if (tile_shape == TileSet::TILE_SHAPE_HEXAGON) { + overlapping_ratio = 0.75; + } + ret.y *= overlapping_ratio; + } else { // TILE_OFFSET_AXIS_VERTICAL. + if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { + overlapping_ratio = 0.5; + } else if (tile_shape == TileSet::TILE_SHAPE_HEXAGON) { + overlapping_ratio = 0.75; + } + ret.x *= overlapping_ratio; + } + + return (ret + Vector2(0.5, 0.5)) * tile_size; +} + +Vector2i TileSet::local_to_map(const Vector2 &p_local_position) const { + Vector2 ret = p_local_position; + ret /= tile_size; + + // Divide by the overlapping ratio. + double overlapping_ratio = 1.0; + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { + if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { + overlapping_ratio = 0.5; + } else if (tile_shape == TileSet::TILE_SHAPE_HEXAGON) { + overlapping_ratio = 0.75; + } + ret.y /= overlapping_ratio; + } else { // TILE_OFFSET_AXIS_VERTICAL. + if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { + overlapping_ratio = 0.5; + } else if (tile_shape == TileSet::TILE_SHAPE_HEXAGON) { + overlapping_ratio = 0.75; + } + ret.x /= overlapping_ratio; + } + + // For each half-offset shape, we check if we are in the corner of the tile, and thus should correct the local position accordingly. + if (tile_shape == TileSet::TILE_SHAPE_HALF_OFFSET_SQUARE || tile_shape == TileSet::TILE_SHAPE_HEXAGON || tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { + // Technically, those 3 shapes are equivalent, as they are basically half-offset, but with different levels or overlap. + // square = no overlap, hexagon = 0.25 overlap, isometric = 0.5 overlap. + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { + // Smart floor of the position + Vector2 raw_pos = ret; + if (Math::posmod(Math::floor(ret.y), 2) ^ (tile_layout == TileSet::TILE_LAYOUT_STACKED_OFFSET)) { + ret = Vector2(Math::floor(ret.x + 0.5) - 0.5, Math::floor(ret.y)); + } else { + ret = ret.floor(); + } + + // Compute the tile offset, and if we might the output for a neighbor top tile. + Vector2 in_tile_pos = raw_pos - ret; + bool in_top_left_triangle = (in_tile_pos - Vector2(0.5, 0.0)).cross(Vector2(-0.5, 1.0 / overlapping_ratio - 1)) <= 0; + bool in_top_right_triangle = (in_tile_pos - Vector2(0.5, 0.0)).cross(Vector2(0.5, 1.0 / overlapping_ratio - 1)) > 0; + + switch (tile_layout) { + case TileSet::TILE_LAYOUT_STACKED: + ret = ret.floor(); + if (in_top_left_triangle) { + ret += Vector2i(Math::posmod(Math::floor(ret.y), 2) ? 0 : -1, -1); + } else if (in_top_right_triangle) { + ret += Vector2i(Math::posmod(Math::floor(ret.y), 2) ? 1 : 0, -1); + } + break; + case TileSet::TILE_LAYOUT_STACKED_OFFSET: + ret = ret.floor(); + if (in_top_left_triangle) { + ret += Vector2i(Math::posmod(Math::floor(ret.y), 2) ? -1 : 0, -1); + } else if (in_top_right_triangle) { + ret += Vector2i(Math::posmod(Math::floor(ret.y), 2) ? 0 : 1, -1); + } + break; + case TileSet::TILE_LAYOUT_STAIRS_RIGHT: + ret = Vector2(ret.x - ret.y / 2, ret.y).floor(); + if (in_top_left_triangle) { + ret += Vector2i(0, -1); + } else if (in_top_right_triangle) { + ret += Vector2i(1, -1); + } + break; + case TileSet::TILE_LAYOUT_STAIRS_DOWN: + ret = Vector2(ret.x * 2, ret.y / 2 - ret.x).floor(); + if (in_top_left_triangle) { + ret += Vector2i(-1, 0); + } else if (in_top_right_triangle) { + ret += Vector2i(1, -1); + } + break; + case TileSet::TILE_LAYOUT_DIAMOND_RIGHT: + ret = Vector2(ret.x - ret.y / 2, ret.y / 2 + ret.x).floor(); + if (in_top_left_triangle) { + ret += Vector2i(0, -1); + } else if (in_top_right_triangle) { + ret += Vector2i(1, 0); + } + break; + case TileSet::TILE_LAYOUT_DIAMOND_DOWN: + ret = Vector2(ret.x + ret.y / 2, ret.y / 2 - ret.x).floor(); + if (in_top_left_triangle) { + ret += Vector2i(-1, 0); + } else if (in_top_right_triangle) { + ret += Vector2i(0, -1); + } + break; + } + } else { // TILE_OFFSET_AXIS_VERTICAL. + // Smart floor of the position. + Vector2 raw_pos = ret; + if (Math::posmod(Math::floor(ret.x), 2) ^ (tile_layout == TileSet::TILE_LAYOUT_STACKED_OFFSET)) { + ret = Vector2(Math::floor(ret.x), Math::floor(ret.y + 0.5) - 0.5); + } else { + ret = ret.floor(); + } + + // Compute the tile offset, and if we might the output for a neighbor top tile. + Vector2 in_tile_pos = raw_pos - ret; + bool in_top_left_triangle = (in_tile_pos - Vector2(0.0, 0.5)).cross(Vector2(1.0 / overlapping_ratio - 1, -0.5)) > 0; + bool in_bottom_left_triangle = (in_tile_pos - Vector2(0.0, 0.5)).cross(Vector2(1.0 / overlapping_ratio - 1, 0.5)) <= 0; + + switch (tile_layout) { + case TileSet::TILE_LAYOUT_STACKED: + ret = ret.floor(); + if (in_top_left_triangle) { + ret += Vector2i(-1, Math::posmod(Math::floor(ret.x), 2) ? 0 : -1); + } else if (in_bottom_left_triangle) { + ret += Vector2i(-1, Math::posmod(Math::floor(ret.x), 2) ? 1 : 0); + } + break; + case TileSet::TILE_LAYOUT_STACKED_OFFSET: + ret = ret.floor(); + if (in_top_left_triangle) { + ret += Vector2i(-1, Math::posmod(Math::floor(ret.x), 2) ? -1 : 0); + } else if (in_bottom_left_triangle) { + ret += Vector2i(-1, Math::posmod(Math::floor(ret.x), 2) ? 0 : 1); + } + break; + case TileSet::TILE_LAYOUT_STAIRS_RIGHT: + ret = Vector2(ret.x / 2 - ret.y, ret.y * 2).floor(); + if (in_top_left_triangle) { + ret += Vector2i(0, -1); + } else if (in_bottom_left_triangle) { + ret += Vector2i(-1, 1); + } + break; + case TileSet::TILE_LAYOUT_STAIRS_DOWN: + ret = Vector2(ret.x, ret.y - ret.x / 2).floor(); + if (in_top_left_triangle) { + ret += Vector2i(-1, 0); + } else if (in_bottom_left_triangle) { + ret += Vector2i(-1, 1); + } + break; + case TileSet::TILE_LAYOUT_DIAMOND_RIGHT: + ret = Vector2(ret.x / 2 - ret.y, ret.y + ret.x / 2).floor(); + if (in_top_left_triangle) { + ret += Vector2i(0, -1); + } else if (in_bottom_left_triangle) { + ret += Vector2i(-1, 0); + } + break; + case TileSet::TILE_LAYOUT_DIAMOND_DOWN: + ret = Vector2(ret.x / 2 + ret.y, ret.y - ret.x / 2).floor(); + if (in_top_left_triangle) { + ret += Vector2i(-1, 0); + } else if (in_bottom_left_triangle) { + ret += Vector2i(0, 1); + } + break; + } + } + } else { + ret = (ret + Vector2(0.00005, 0.00005)).floor(); + } + return Vector2i(ret); +} + +bool TileSet::is_existing_neighbor(TileSet::CellNeighbor p_cell_neighbor) const { + if (tile_shape == TileSet::TILE_SHAPE_SQUARE) { + return p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER; + + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC) { + return p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; + } else { + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { + return p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; + } else { + return p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE || + p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE; + } + } +} + +Vector2i TileSet::get_neighbor_cell(const Vector2i &p_coords, TileSet::CellNeighbor p_cell_neighbor) const { + if (tile_shape == TileSet::TILE_SHAPE_SQUARE) { + switch (p_cell_neighbor) { + case TileSet::CELL_NEIGHBOR_RIGHT_SIDE: + return p_coords + Vector2i(1, 0); + case TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER: + return p_coords + Vector2i(1, 1); + case TileSet::CELL_NEIGHBOR_BOTTOM_SIDE: + return p_coords + Vector2i(0, 1); + case TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER: + return p_coords + Vector2i(-1, 1); + case TileSet::CELL_NEIGHBOR_LEFT_SIDE: + return p_coords + Vector2i(-1, 0); + case TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER: + return p_coords + Vector2i(-1, -1); + case TileSet::CELL_NEIGHBOR_TOP_SIDE: + return p_coords + Vector2i(0, -1); + case TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER: + return p_coords + Vector2i(1, -1); + default: + ERR_FAIL_V(p_coords); + } + } else { // Half-offset shapes (square and hexagon). + switch (tile_layout) { + case TileSet::TILE_LAYOUT_STACKED: { + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { + bool is_offset = p_coords.y % 2; + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { + return p_coords + Vector2i(1, 0); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(is_offset ? 1 : 0, 1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { + return p_coords + Vector2i(0, 2); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(is_offset ? 0 : -1, 1); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { + return p_coords + Vector2i(-1, 0); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(is_offset ? 0 : -1, -1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { + return p_coords + Vector2i(0, -2); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(is_offset ? 1 : 0, -1); + } else { + ERR_FAIL_V(p_coords); + } + } else { + bool is_offset = p_coords.x % 2; + + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { + return p_coords + Vector2i(0, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(1, is_offset ? 1 : 0); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { + return p_coords + Vector2i(2, 0); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(1, is_offset ? 0 : -1); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { + return p_coords + Vector2i(0, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(-1, is_offset ? 0 : -1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { + return p_coords + Vector2i(-2, 0); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(-1, is_offset ? 1 : 0); + } else { + ERR_FAIL_V(p_coords); + } + } + } break; + case TileSet::TILE_LAYOUT_STACKED_OFFSET: { + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { + bool is_offset = p_coords.y % 2; + + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { + return p_coords + Vector2i(1, 0); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(is_offset ? 0 : 1, 1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { + return p_coords + Vector2i(0, 2); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(is_offset ? -1 : 0, 1); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { + return p_coords + Vector2i(-1, 0); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(is_offset ? -1 : 0, -1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { + return p_coords + Vector2i(0, -2); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(is_offset ? 0 : 1, -1); + } else { + ERR_FAIL_V(p_coords); + } + } else { + bool is_offset = p_coords.x % 2; + + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { + return p_coords + Vector2i(0, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(1, is_offset ? 0 : 1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { + return p_coords + Vector2i(2, 0); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(1, is_offset ? -1 : 0); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { + return p_coords + Vector2i(0, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(-1, is_offset ? -1 : 0); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { + return p_coords + Vector2i(-2, 0); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(-1, is_offset ? 0 : 1); + } else { + ERR_FAIL_V(p_coords); + } + } + } break; + case TileSet::TILE_LAYOUT_STAIRS_RIGHT: + case TileSet::TILE_LAYOUT_STAIRS_DOWN: { + if ((tile_layout == TileSet::TILE_LAYOUT_STAIRS_RIGHT) ^ (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_VERTICAL)) { + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { + return p_coords + Vector2i(1, 0); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(0, 1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { + return p_coords + Vector2i(-1, 2); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(-1, 1); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { + return p_coords + Vector2i(-1, 0); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(0, -1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { + return p_coords + Vector2i(1, -2); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(1, -1); + } else { + ERR_FAIL_V(p_coords); + } + + } else { + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { + return p_coords + Vector2i(0, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(1, 0); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { + return p_coords + Vector2i(2, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(1, -1); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { + return p_coords + Vector2i(0, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(-1, 0); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { + return p_coords + Vector2i(-2, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(-1, 1); + } else { + ERR_FAIL_V(p_coords); + } + } + } else { + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { + return p_coords + Vector2i(2, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(1, 0); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { + return p_coords + Vector2i(0, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(-1, 1); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { + return p_coords + Vector2i(-2, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(-1, 0); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { + return p_coords + Vector2i(0, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(1, -1); + } else { + ERR_FAIL_V(p_coords); + } + + } else { + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { + return p_coords + Vector2i(-1, 2); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(0, 1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { + return p_coords + Vector2i(1, 0); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(1, -1); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { + return p_coords + Vector2i(1, -2); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(0, -1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { + return p_coords + Vector2i(-1, 0); + + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(-1, 1); + } else { + ERR_FAIL_V(p_coords); + } + } + } + } break; + case TileSet::TILE_LAYOUT_DIAMOND_RIGHT: + case TileSet::TILE_LAYOUT_DIAMOND_DOWN: { + if ((tile_layout == TileSet::TILE_LAYOUT_DIAMOND_RIGHT) ^ (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_VERTICAL)) { + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { + return p_coords + Vector2i(1, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(0, 1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { + return p_coords + Vector2i(-1, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(-1, 0); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { + return p_coords + Vector2i(-1, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(0, -1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { + return p_coords + Vector2i(1, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(1, 0); + } else { + ERR_FAIL_V(p_coords); + } + + } else { + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { + return p_coords + Vector2i(1, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(1, 0); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { + return p_coords + Vector2i(1, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(0, -1); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { + return p_coords + Vector2i(-1, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(-1, 0); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { + return p_coords + Vector2i(-1, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(0, 1); + } else { + ERR_FAIL_V(p_coords); + } + } + } else { + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) { + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_SIDE)) { + return p_coords + Vector2i(1, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(1, 0); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) { + return p_coords + Vector2i(1, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(0, 1); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_SIDE)) { + return p_coords + Vector2i(-1, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(-1, 0); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) { + return p_coords + Vector2i(-1, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(0, -1); + } else { + ERR_FAIL_V(p_coords); + } + + } else { + if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_SIDE)) { + return p_coords + Vector2i(-1, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE) { + return p_coords + Vector2i(0, 1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_RIGHT_CORNER) { + return p_coords + Vector2i(1, 1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE) { + return p_coords + Vector2i(1, 0); + } else if ((tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_CORNER) || + (tile_shape != TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_SIDE)) { + return p_coords + Vector2i(1, -1); + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE) { + return p_coords + Vector2i(0, -1); + } else if (tile_shape == TileSet::TILE_SHAPE_ISOMETRIC && p_cell_neighbor == TileSet::CELL_NEIGHBOR_LEFT_CORNER) { + return p_coords + Vector2i(-1, -1); + + } else if (p_cell_neighbor == TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE) { + return p_coords + Vector2i(-1, 0); + } else { + ERR_FAIL_V(p_coords); + } + } + } + } break; + default: + ERR_FAIL_V(p_coords); + } + } +} + +Vector2i TileSet::map_pattern(const Vector2i &p_position_in_tilemap, const Vector2i &p_coords_in_pattern, Ref<TileMapPattern> p_pattern) { + ERR_FAIL_COND_V(p_pattern.is_null(), Vector2i()); + ERR_FAIL_COND_V(!p_pattern->has_cell(p_coords_in_pattern), Vector2i()); + + Vector2i output = p_position_in_tilemap + p_coords_in_pattern; + if (tile_shape != TileSet::TILE_SHAPE_SQUARE) { + if (tile_layout == TileSet::TILE_LAYOUT_STACKED) { + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL && bool(p_position_in_tilemap.y % 2) && bool(p_coords_in_pattern.y % 2)) { + output.x += 1; + } else if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_VERTICAL && bool(p_position_in_tilemap.x % 2) && bool(p_coords_in_pattern.x % 2)) { + output.y += 1; + } + } else if (tile_layout == TileSet::TILE_LAYOUT_STACKED_OFFSET) { + if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL && bool(p_position_in_tilemap.y % 2) && bool(p_coords_in_pattern.y % 2)) { + output.x -= 1; + } else if (tile_offset_axis == TileSet::TILE_OFFSET_AXIS_VERTICAL && bool(p_position_in_tilemap.x % 2) && bool(p_coords_in_pattern.x % 2)) { + output.y -= 1; + } + } + } + + return output; +} + Vector<Point2> TileSet::get_terrain_polygon(int p_terrain_set) { if (tile_shape == TileSet::TILE_SHAPE_SQUARE) { return _get_square_terrain_polygon(tile_size); diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index a71982cd56..0a6d879047 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -530,6 +530,13 @@ public: Vector<Vector2> get_tile_shape_polygon(); void draw_tile_shape(CanvasItem *p_canvas_item, Transform2D p_transform, Color p_color, bool p_filled = false, Ref<Texture2D> p_texture = Ref<Texture2D>()); + // Used by TileMap/TileMapLayer + Vector2 map_to_local(const Vector2i &p_pos) const; + Vector2i local_to_map(const Vector2 &p_pos) const; + bool is_existing_neighbor(TileSet::CellNeighbor p_cell_neighbor) const; + Vector2i get_neighbor_cell(const Vector2i &p_coords, TileSet::CellNeighbor p_cell_neighbor) const; + Vector2i map_pattern(const Vector2i &p_position_in_tilemap, const Vector2i &p_coords_in_pattern, Ref<TileMapPattern> p_pattern); + Vector<Point2> get_terrain_polygon(int p_terrain_set); Vector<Point2> get_terrain_peering_bit_polygon(int p_terrain_set, TileSet::CellNeighbor p_bit); void draw_terrains(CanvasItem *p_canvas_item, Transform2D p_transform, const TileData *p_tile_data); diff --git a/scene/theme/default_theme.cpp b/scene/theme/default_theme.cpp index 2a1894e690..005a88d391 100644 --- a/scene/theme/default_theme.cpp +++ b/scene/theme/default_theme.cpp @@ -78,7 +78,7 @@ static Ref<StyleBoxFlat> sb_expand(Ref<StyleBoxFlat> p_sbox, float p_left, float return p_sbox; } -// See also `editor_generate_icon()` in `editor/editor_themes.cpp`. +// See also `editor_generate_icon()` in `editor/themes/editor_icons.cpp`. static Ref<ImageTexture> generate_icon(int p_index) { Ref<Image> img = memnew(Image); diff --git a/scene/theme/default_theme_builders.py b/scene/theme/default_theme_builders.py index 0455d6d246..b8bb579d1c 100644 --- a/scene/theme/default_theme_builders.py +++ b/scene/theme/default_theme_builders.py @@ -1,8 +1,10 @@ -"""Functions used to generate source files during build time +""" +Functions used to generate source files during build time All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os import os.path from platform_methods import subprocess_main diff --git a/scene/theme/icons/default_theme_icons_builders.py b/scene/theme/icons/default_theme_icons_builders.py index c4d132294c..c915c52cbd 100644 --- a/scene/theme/icons/default_theme_icons_builders.py +++ b/scene/theme/icons/default_theme_icons_builders.py @@ -1,4 +1,5 @@ -"""Functions used to generate source files during build time +""" +Functions used to generate source files during build time All such functions are invoked in a subprocess on Windows to prevent build flakiness. diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index 65d88a0eba..3e3a7d2381 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -80,6 +80,16 @@ void AudioStreamPlayback::tag_used_streams() { GDVIRTUAL_CALL(_tag_used_streams); } +void AudioStreamPlayback::set_parameter(const StringName &p_name, const Variant &p_value) { + GDVIRTUAL_CALL(_set_parameter, p_name, p_value); +} + +Variant AudioStreamPlayback::get_parameter(const StringName &p_name) const { + Variant ret; + GDVIRTUAL_CALL(_get_parameter, p_name, ret); + return ret; +} + void AudioStreamPlayback::_bind_methods() { GDVIRTUAL_BIND(_start, "from_pos") GDVIRTUAL_BIND(_stop) @@ -89,6 +99,8 @@ void AudioStreamPlayback::_bind_methods() { GDVIRTUAL_BIND(_seek, "position") GDVIRTUAL_BIND(_mix, "buffer", "rate_scale", "frames"); GDVIRTUAL_BIND(_tag_used_streams); + GDVIRTUAL_BIND(_set_parameter, "name", "value"); + GDVIRTUAL_BIND(_get_parameter, "name"); } ////////////////////////////// @@ -249,6 +261,16 @@ float AudioStream::get_tagged_frame_offset(int p_index) const { return tagged_offsets[p_index]; } +void AudioStream::get_parameter_list(List<Parameter> *r_parameters) { + TypedArray<Dictionary> ret; + GDVIRTUAL_CALL(_get_parameter_list, ret); + for (int i = 0; i < ret.size(); i++) { + Dictionary d = ret[i]; + ERR_CONTINUE(!d.has("default_value")); + r_parameters->push_back(Parameter(PropertyInfo::from_dict(d), d["default_value"])); + } +} + void AudioStream::_bind_methods() { ClassDB::bind_method(D_METHOD("get_length"), &AudioStream::get_length); ClassDB::bind_method(D_METHOD("is_monophonic"), &AudioStream::is_monophonic); @@ -259,6 +281,9 @@ void AudioStream::_bind_methods() { GDVIRTUAL_BIND(_is_monophonic); GDVIRTUAL_BIND(_get_bpm) GDVIRTUAL_BIND(_get_beat_count) + GDVIRTUAL_BIND(_get_parameter_list) + + ADD_SIGNAL(MethodInfo("parameter_list_changed")); } //////////////////////////////// diff --git a/servers/audio/audio_stream.h b/servers/audio/audio_stream.h index 015e89fc8e..f8123fbe15 100644 --- a/servers/audio/audio_stream.h +++ b/servers/audio/audio_stream.h @@ -38,6 +38,7 @@ #include "core/object/gdvirtual.gen.inc" #include "core/variant/native_ptr.h" +#include "core/variant/typed_array.h" class AudioStream; @@ -54,6 +55,9 @@ protected: GDVIRTUAL1(_seek, double) GDVIRTUAL3R(int, _mix, GDExtensionPtr<AudioFrame>, float, int) GDVIRTUAL0(_tag_used_streams) + GDVIRTUAL2(_set_parameter, const StringName &, const Variant &) + GDVIRTUAL1RC(Variant, _get_parameter, const StringName &) + public: virtual void start(double p_from_pos = 0.0); virtual void stop(); @@ -66,6 +70,9 @@ public: virtual void tag_used_streams(); + virtual void set_parameter(const StringName &p_name, const Variant &p_value); + virtual Variant get_parameter(const StringName &p_name) const; + virtual int mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames); }; @@ -124,6 +131,7 @@ protected: GDVIRTUAL0RC(bool, _has_loop) GDVIRTUAL0RC(int, _get_bar_beats) GDVIRTUAL0RC(int, _get_beat_count) + GDVIRTUAL0RC(TypedArray<Dictionary>, _get_parameter_list) public: virtual Ref<AudioStreamPlayback> instantiate_playback(); @@ -141,6 +149,17 @@ public: uint64_t get_tagged_frame() const; uint32_t get_tagged_frame_count() const; float get_tagged_frame_offset(int p_index) const; + + struct Parameter { + PropertyInfo property; + Variant default_value; + Parameter(const PropertyInfo &p_info = PropertyInfo(), const Variant &p_default_value = Variant()) { + property = p_info; + default_value = p_default_value; + } + }; + + virtual void get_parameter_list(List<Parameter> *r_parameters); }; // Microphone diff --git a/servers/display_server.cpp b/servers/display_server.cpp index bb28bc0eb8..a587f72d02 100644 --- a/servers/display_server.cpp +++ b/servers/display_server.cpp @@ -596,6 +596,10 @@ DisplayServer::VSyncMode DisplayServer::window_get_vsync_mode(WindowID p_window) return VSyncMode::VSYNC_ENABLED; } +DisplayServer::WindowID DisplayServer::get_focused_window() const { + return MAIN_WINDOW_ID; // Proper value for single windows. +} + void DisplayServer::set_context(Context p_context) { } diff --git a/servers/display_server.h b/servers/display_server.h index 4450677f71..92a4a4a699 100644 --- a/servers/display_server.h +++ b/servers/display_server.h @@ -436,6 +436,8 @@ public: virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) = 0; virtual bool window_is_focused(WindowID p_window = MAIN_WINDOW_ID) const = 0; + virtual WindowID get_focused_window() const; + virtual void window_set_window_buttons_offset(const Vector2i &p_offset, WindowID p_window = MAIN_WINDOW_ID) {} virtual Vector3i window_get_safe_title_margins(WindowID p_window = MAIN_WINDOW_ID) const { return Vector3i(); } diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 2beab44f91..0ee2984a8c 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -88,7 +88,11 @@ ShaderTypes *shader_types = nullptr; static PhysicsServer3D *_createGodotPhysics3DCallback() { +#ifdef THREADS_ENABLED bool using_threads = GLOBAL_GET("physics/3d/run_on_separate_thread"); +#else + bool using_threads = false; +#endif PhysicsServer3D *physics_server_3d = memnew(GodotPhysicsServer3D(using_threads)); @@ -96,7 +100,11 @@ static PhysicsServer3D *_createGodotPhysics3DCallback() { } static PhysicsServer2D *_createGodotPhysics2DCallback() { +#ifdef THREADS_ENABLED bool using_threads = GLOBAL_GET("physics/2d/run_on_separate_thread"); +#else + bool using_threads = false; +#endif PhysicsServer2D *physics_server_2d = memnew(GodotPhysicsServer2D(using_threads)); diff --git a/servers/rendering/renderer_rd/shader_rd.cpp b/servers/rendering/renderer_rd/shader_rd.cpp index db2ca29474..1c54ce5657 100644 --- a/servers/rendering/renderer_rd/shader_rd.cpp +++ b/servers/rendering/renderer_rd/shader_rd.cpp @@ -463,6 +463,7 @@ bool ShaderRD::_load_from_cache(Version *p_version, int p_group) { } void ShaderRD::_save_to_cache(Version *p_version, int p_group) { + ERR_FAIL_COND(!shader_cache_dir_valid); String sha1 = _version_get_sha1(p_version); String path = shader_cache_dir.path_join(name).path_join(group_sha256[p_group]).path_join(sha1) + ".cache"; diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp index f7620ad5dc..bf8ab27722 100644 --- a/servers/rendering/rendering_server_default.cpp +++ b/servers/rendering/rendering_server_default.cpp @@ -395,15 +395,19 @@ RenderingServerDefault::RenderingServerDefault(bool p_create_thread) : command_queue(p_create_thread) { RenderingServer::init(); +#ifdef THREADS_ENABLED create_thread = p_create_thread; - - if (!p_create_thread) { + if (!create_thread) { server_thread = Thread::get_caller_id(); } else { server_thread = 0; } +#else + create_thread = false; + server_thread = Thread::get_main_id(); +#endif + RSG::threaded = create_thread; - RSG::threaded = p_create_thread; RSG::canvas = memnew(RendererCanvasCull); RSG::viewport = memnew(RendererViewport); RendererSceneCull *sr = memnew(RendererSceneCull); diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index 11ec670280..e8b20692f0 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -78,7 +78,7 @@ class RenderingServerDefault : public RenderingServer { static void _thread_callback(void *_instance); void _thread_loop(); - Thread::ID server_thread; + Thread::ID server_thread = 0; SafeFlag exit; Thread thread; SafeFlag draw_thread_up; diff --git a/servers/rendering/shader_compiler.cpp b/servers/rendering/shader_compiler.cpp index 6875400d1e..2b49d42f9e 100644 --- a/servers/rendering/shader_compiler.cpp +++ b/servers/rendering/shader_compiler.cpp @@ -1340,7 +1340,7 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene if (is_screen_texture && !texture_func_returns_data && actions.apply_luminance_multiplier) { code = "(" + code + " * vec4(vec3(sc_luminance_multiplier), 1.0))"; } - if (is_normal_roughness_texture) { + if (is_normal_roughness_texture && !texture_func_returns_data) { code = "normal_roughness_compatibility(" + code + ")"; } } break; diff --git a/tests/core/math/test_aabb.h b/tests/core/math/test_aabb.h index d3560ff6b6..b9f84cca24 100644 --- a/tests/core/math/test_aabb.h +++ b/tests/core/math/test_aabb.h @@ -228,11 +228,20 @@ TEST_CASE("[AABB] Merging") { TEST_CASE("[AABB] Encloses") { const AABB aabb_big = AABB(Vector3(-1.5, 2, -2.5), Vector3(4, 5, 6)); + CHECK_MESSAGE( + aabb_big.encloses(aabb_big), + "encloses() with itself should return the expected result."); + AABB aabb_small = AABB(Vector3(-1.5, 2, -2.5), Vector3(1, 1, 1)); CHECK_MESSAGE( aabb_big.encloses(aabb_small), "encloses() with fully contained AABB (touching the edge) should return the expected result."); + aabb_small = AABB(Vector3(1.5, 6, 2.5), Vector3(1, 1, 1)); + CHECK_MESSAGE( + aabb_big.encloses(aabb_small), + "encloses() with fully contained AABB (touching the edge) should return the expected result."); + aabb_small = AABB(Vector3(0.5, 1.5, -2), Vector3(1, 1, 1)); CHECK_MESSAGE( !aabb_big.encloses(aabb_small), diff --git a/tests/scene/test_audio_stream_wav.h b/tests/scene/test_audio_stream_wav.h index e36f049136..ed1697929e 100644 --- a/tests/scene/test_audio_stream_wav.h +++ b/tests/scene/test_audio_stream_wav.h @@ -148,7 +148,7 @@ void run_test(String file_name, AudioStreamWAV::Format data_format, bool stereo, Ref<FileAccess> wav_file = FileAccess::open(save_path, FileAccess::READ, &error); REQUIRE(error == OK); -#if TOOLS_ENABLED +#ifdef TOOLS_ENABLED // The WAV importer can be used if enabled to check that the saved file is valid. Ref<ResourceImporterWAV> wav_importer = memnew(ResourceImporterWAV); diff --git a/tests/servers/test_text_server.h b/tests/servers/test_text_server.h index 0f23929e1e..334c642d26 100644 --- a/tests/servers/test_text_server.h +++ b/tests/servers/test_text_server.h @@ -33,7 +33,7 @@ #ifdef TOOLS_ENABLED -#include "editor/builtin_fonts.gen.h" +#include "editor/themes/builtin_fonts.gen.h" #include "servers/text_server.h" #include "tests/test_macros.h" diff --git a/thirdparty/README.md b/thirdparty/README.md index 51ba9f1df4..666e53375c 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -342,7 +342,7 @@ See the patches in the `patches` directory. ## glslang - Upstream: https://github.com/KhronosGroup/glslang -- Version: sdk-1.3.261.1 (76b52ebf77833908dc4c0dd6c70a9c357ac720bd, 2023) +- Version: vulkan-sdk-1.3.268.0 (36d08c0d940cf307a23928299ef52c7970d8cee6, 2023) - License: glslang Version should be kept in sync with the one of the used Vulkan SDK (see `vulkan` @@ -811,7 +811,7 @@ proposed by these libraries and better integrate them with Godot. ## spirv-reflect - Upstream: https://github.com/KhronosGroup/SPIRV-Reflect -- Version: sdk-1.3.261.1 (d7e316e7d592d16ac58f1fe39b1df7babfe65c0d, 2023) +- Version: vulkan-sdk-1.3.268.0 (3f468129720eded0cef4077302e491036d099856, 2023) - License: Apache 2.0 Version should be kept in sync with the one of the used Vulkan SDK (see `vulkan` @@ -861,7 +861,7 @@ instead of `miniz.h` as an external dependency. ## thorvg - Upstream: https://github.com/thorvg/thorvg -- Version: 0.12.0 (25ea242d3867ed66807714f5a52d080984d3c8cc, 2024) +- Version: 0.12.1 (d761e3c5622c0ffba2e5bb40da05751e2451e495, 2024) - License: MIT Files extracted from upstream source: @@ -890,7 +890,7 @@ folder. ## volk - Upstream: https://github.com/zeux/volk -- Version: sdk-1.3.261.1 (c1fc502109e539078d53c90ee1da9f32abbb0054, 2023) +- Version: vulkan-sdk-1.3.268.0 (cdd08788bb7062031606d3da51e268f6bd491864, 2023) - License: MIT Unless there is a specific reason to package a more recent version, please stick @@ -909,7 +909,7 @@ Files extracted from upstream source: ## vulkan - Upstream: https://github.com/KhronosGroup/Vulkan-Headers -- Version: sdk-1.3.261.1 (85c2334e92e215cce34e8e0ed8b2dce4700f4a50, 2023) +- Version: vulkan-sdk-1.3.268.0 (7b3466a1f47a9251ac1113efbe022ff016e2f95b, 2023) - License: Apache 2.0 The vendored version should be kept in sync with volk, see above. @@ -919,8 +919,8 @@ Files extracted from upstream source: - `include/` - `LICENSE.md` -`vk_enum_string_helper.h` is taken from the matching `Vulkan-ValidationLayers` -SDK release: https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/main/layers/vulkan/generated/vk_enum_string_helper.h +`vk_enum_string_helper.h` is taken from the matching `Vulkan-Utility-Libraries` +SDK release: https://github.com/KhronosGroup/Vulkan-Utility-Libraries/blob/main/include/vulkan/vk_enum_string_helper.h `vk_mem_alloc.h` is taken from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator Version: git (e88fff957b94f4b541ccac67a4290f07e52aa610), as advised by upstream: diff --git a/thirdparty/glslang/SPIRV/GLSL.ext.NV.h b/thirdparty/glslang/SPIRV/GLSL.ext.NV.h index 5b0f7eb17e..9889bc9f9b 100644 --- a/thirdparty/glslang/SPIRV/GLSL.ext.NV.h +++ b/thirdparty/glslang/SPIRV/GLSL.ext.NV.h @@ -84,4 +84,7 @@ const char* const E_SPV_NV_shader_sm_builtins = "SPV_NV_shader_sm_builtins"; //SPV_NV_shader_execution_reorder const char* const E_SPV_NV_shader_invocation_reorder = "SPV_NV_shader_invocation_reorder"; +//SPV_NV_displacement_micromap +const char* const E_SPV_NV_displacement_micromap = "SPV_NV_displacement_micromap"; + #endif // #ifndef GLSLextNV_H diff --git a/thirdparty/glslang/SPIRV/GLSL.ext.QCOM.h b/thirdparty/glslang/SPIRV/GLSL.ext.QCOM.h new file mode 100644 index 0000000000..f13bb69359 --- /dev/null +++ b/thirdparty/glslang/SPIRV/GLSL.ext.QCOM.h @@ -0,0 +1,41 @@ +/* +** Copyright (c) 2021 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLextQCOM_H +#define GLSLextQCOM_H + +enum BuiltIn; +enum Decoration; +enum Op; +enum Capability; + +static const int GLSLextQCOMVersion = 100; +static const int GLSLextQCOMRevision = 1; + +//SPV_QCOM_image_processing +const char* const E_SPV_QCOM_image_processing = "SPV_QCOM_image_processing"; + +#endif // #ifndef GLSLextQCOM_H diff --git a/thirdparty/glslang/SPIRV/GlslangToSpv.cpp b/thirdparty/glslang/SPIRV/GlslangToSpv.cpp index a3047cbd48..576c680f96 100755 --- a/thirdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/thirdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -50,6 +50,7 @@ namespace spv { #include "GLSL.ext.AMD.h" #include "GLSL.ext.NV.h" #include "GLSL.ext.ARM.h" + #include "GLSL.ext.QCOM.h" #include "NonSemanticDebugPrintf.h" } @@ -132,7 +133,7 @@ public: bool visitLoop(glslang::TVisit, glslang::TIntermLoop*); bool visitBranch(glslang::TVisit visit, glslang::TIntermBranch*); - void finishSpv(); + void finishSpv(bool compileOnly); void dumpSpv(std::vector<unsigned int>& out); protected: @@ -166,6 +167,7 @@ protected: bool filterMember(const glslang::TType& member); spv::Id convertGlslangStructToSpvType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, const glslang::TQualifier&); + spv::LinkageType convertGlslangLinkageToSpv(glslang::TLinkType glslangLinkType); void decorateStructType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, const glslang::TQualifier&, spv::Id, const std::vector<spv::Id>& spvMembers); spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim, bool allowZero = false); @@ -220,6 +222,7 @@ protected: spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId); spv::Id getSymbolId(const glslang::TIntermSymbol* node); void addMeshNVDecoration(spv::Id id, int member, const glslang::TQualifier & qualifier); + void addImageProcessingQCOMDecoration(spv::Id id, spv::Decoration decor); spv::Id createSpvConstant(const glslang::TIntermTyped&); spv::Id createSpvConstantFromConstUnionArray(const glslang::TType& type, const glslang::TConstUnionArray&, int& nextConst, bool specConstant); @@ -1006,6 +1009,22 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI builder.addExtension(spv::E_SPV_NV_ray_tracing_motion_blur); builder.addCapability(spv::CapabilityRayTracingMotionBlurNV); return spv::BuiltInCurrentRayTimeNV; + case glslang::EbvMicroTrianglePositionNV: + builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltInHitMicroTriangleVertexPositionsNV; + case glslang::EbvMicroTriangleBaryNV: + builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltInHitMicroTriangleVertexBarycentricsNV; + case glslang::EbvHitKindFrontFacingMicroTriangleNV: + builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltInHitKindFrontFacingMicroTriangleNV; + case glslang::EbvHitKindBackFacingMicroTriangleNV: + builder.addCapability(spv::CapabilityRayTracingDisplacementMicromapNV); + builder.addExtension("SPV_NV_displacement_micromap"); + return spv::BuiltInHitKindBackFacingMicroTriangleNV; // barycentrics case glslang::EbvBaryCoordNV: @@ -1586,8 +1605,12 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, builder.addCapability(spv::CapabilityVariablePointers); } - shaderEntry = builder.makeEntryPoint(glslangIntermediate->getEntryPointName().c_str()); - entryPoint = builder.addEntryPoint(executionModel, shaderEntry, glslangIntermediate->getEntryPointName().c_str()); + // If not linking, there is no entry point + if (!options.compileOnly) { + shaderEntry = builder.makeEntryPoint(glslangIntermediate->getEntryPointName().c_str()); + entryPoint = + builder.addEntryPoint(executionModel, shaderEntry, glslangIntermediate->getEntryPointName().c_str()); + } // Add the source extensions const auto& sourceExtensions = glslangIntermediate->getRequestedExtensions(); @@ -1718,23 +1741,31 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, } break; - case EShLangCompute: + case EShLangCompute: { builder.addCapability(spv::CapabilityShader); - if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) { - std::vector<spv::Id> dimConstId; - for (int dim = 0; dim < 3; ++dim) { - bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); - dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); - if (specConst) { - builder.addDecoration(dimConstId.back(), spv::DecorationSpecId, - glslangIntermediate->getLocalSizeSpecId(dim)); + bool needSizeId = false; + for (int dim = 0; dim < 3; ++dim) { + if ((glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet)) { + needSizeId = true; + break; + } + } + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6 && needSizeId) { + std::vector<spv::Id> dimConstId; + for (int dim = 0; dim < 3; ++dim) { + bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); + dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); + if (specConst) { + builder.addDecoration(dimConstId.back(), spv::DecorationSpecId, + glslangIntermediate->getLocalSizeSpecId(dim)); + needSizeId = true; + } } - } - builder.addExecutionModeId(shaderEntry, spv::ExecutionModeLocalSizeId, dimConstId); + builder.addExecutionModeId(shaderEntry, spv::ExecutionModeLocalSizeId, dimConstId); } else { - builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0), - glslangIntermediate->getLocalSize(1), - glslangIntermediate->getLocalSize(2)); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0), + glslangIntermediate->getLocalSize(1), + glslangIntermediate->getLocalSize(2)); } if (glslangIntermediate->getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupQuads) { builder.addCapability(spv::CapabilityComputeDerivativeGroupQuadsNV); @@ -1746,6 +1777,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives); } break; + } case EShLangTessEvaluation: case EShLangTessControl: builder.addCapability(spv::CapabilityTessellation); @@ -1937,23 +1969,26 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, } // Finish creating SPV, after the traversal is complete. -void TGlslangToSpvTraverser::finishSpv() +void TGlslangToSpvTraverser::finishSpv(bool compileOnly) { - // Finish the entry point function - if (! entryPointTerminated) { - builder.setBuildPoint(shaderEntry->getLastBlock()); - builder.leaveFunction(); - } + // If not linking, an entry point is not expected + if (!compileOnly) { + // Finish the entry point function + if (!entryPointTerminated) { + builder.setBuildPoint(shaderEntry->getLastBlock()); + builder.leaveFunction(); + } - // finish off the entry-point SPV instruction by adding the Input/Output <id> - for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it) - entryPoint->addIdOperand(*it); + // finish off the entry-point SPV instruction by adding the Input/Output <id> + for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it) + entryPoint->addIdOperand(*it); + } // Add capabilities, extensions, remove unneeded decorations, etc., // based on the resulting SPIR-V. // Note: WebGPU code generation must have the opportunity to aggressively // prune unreachable merge blocks and continue targets. - builder.postProcess(); + builder.postProcess(compileOnly); } // Write the SPV into 'out'. @@ -2012,7 +2047,7 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) spv::StorageClass sc = builder.getStorageClass(id); // Before SPIR-V 1.4, we only want to include Input and Output. // Starting with SPIR-V 1.4, we want all globals. - if ((glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4 && builder.isGlobalStorage(id)) || + if ((glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4 && builder.isGlobalVariable(id)) || (sc == spv::StorageClassInput || sc == spv::StorageClassOutput)) { iOSet.insert(id); } @@ -2838,9 +2873,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt // In all cases, still let the traverser visit the children for us. makeFunctions(node->getAsAggregate()->getSequence()); - // Also, we want all globals initializers to go into the beginning of the entry point, before - // anything else gets there, so visit out of order, doing them all now. - makeGlobalInitializers(node->getAsAggregate()->getSequence()); + // Global initializers is specific to the shader entry point, which does not exist in compile-only mode + if (!options.compileOnly) { + // Also, we want all globals initializers to go into the beginning of the entry point, before + // anything else gets there, so visit out of order, doing them all now. + makeGlobalInitializers(node->getAsAggregate()->getSequence()); + } //Pre process linker objects for ray tracing stages if (glslangIntermediate->isRayTracingStage()) @@ -3276,6 +3314,26 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt noReturnValue = true; break; + case glslang::EOpImageSampleWeightedQCOM: + builder.addCapability(spv::CapabilityTextureSampleWeightedQCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing); + break; + case glslang::EOpImageBoxFilterQCOM: + builder.addCapability(spv::CapabilityTextureBoxFilterQCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing); + break; + case glslang::EOpImageBlockMatchSADQCOM: + case glslang::EOpImageBlockMatchSSDQCOM: + builder.addCapability(spv::CapabilityTextureBlockMatchQCOM); + builder.addExtension(spv::E_SPV_QCOM_image_processing); + break; + + case glslang::EOpFetchMicroTriangleVertexPositionNV: + case glslang::EOpFetchMicroTriangleVertexBarycentricNV: + builder.addExtension(spv::E_SPV_NV_displacement_micromap); + builder.addCapability(spv::CapabilityDisplacementMicromapNV); + break; + case glslang::EOpDebugPrintf: noReturnValue = true; break; @@ -3640,7 +3698,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt spv::Id typeId = builder.makeArrayType(builder.makeVectorType(builder.makeFloatType(32), 3), builder.makeUintConstant(3), 0); // do the op - spv::Id result = builder.createOp(spv::OpRayQueryGetIntersectionTriangleVertexPositionsKHR, typeId, idImmOps); + + spv::Op spvOp = spv::OpRayQueryGetIntersectionTriangleVertexPositionsKHR; + + spv::Id result = builder.createOp(spvOp, typeId, idImmOps); // store the result to the pointer (out param 'm') builder.createStore(result, operands[2]); result = 0; @@ -4313,6 +4374,16 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty return convertGlslangToSpvType(type, getExplicitLayout(type), type.getQualifier(), false, forwardReferenceOnly); } +spv::LinkageType TGlslangToSpvTraverser::convertGlslangLinkageToSpv(glslang::TLinkType linkType) +{ + switch (linkType) { + case glslang::ELinkExport: + return spv::LinkageTypeExport; + default: + return spv::LinkageTypeMax; + } +} + // Do full recursive conversion of an arbitrary glslang type to a SPIR-V Id. // explicitLayout can be kept the same throughout the hierarchical recursive walk. // Mutually recursive with convertGlslangStructToSpvType(). @@ -4476,26 +4547,27 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty std::vector<spv::IdImmediate> operands; for (const auto& typeParam : spirvType.typeParams) { - if (typeParam.constant != nullptr) { + if (typeParam.getAsConstant() != nullptr) { // Constant expression - if (typeParam.constant->isLiteral()) { - if (typeParam.constant->getBasicType() == glslang::EbtFloat) { - float floatValue = static_cast<float>(typeParam.constant->getConstArray()[0].getDConst()); + auto constant = typeParam.getAsConstant(); + if (constant->isLiteral()) { + if (constant->getBasicType() == glslang::EbtFloat) { + float floatValue = static_cast<float>(constant->getConstArray()[0].getDConst()); unsigned literal; static_assert(sizeof(literal) == sizeof(floatValue), "sizeof(unsigned) != sizeof(float)"); memcpy(&literal, &floatValue, sizeof(literal)); operands.push_back({false, literal}); - } else if (typeParam.constant->getBasicType() == glslang::EbtInt) { - unsigned literal = typeParam.constant->getConstArray()[0].getIConst(); + } else if (constant->getBasicType() == glslang::EbtInt) { + unsigned literal = constant->getConstArray()[0].getIConst(); operands.push_back({false, literal}); - } else if (typeParam.constant->getBasicType() == glslang::EbtUint) { - unsigned literal = typeParam.constant->getConstArray()[0].getUConst(); + } else if (constant->getBasicType() == glslang::EbtUint) { + unsigned literal = constant->getConstArray()[0].getUConst(); operands.push_back({false, literal}); - } else if (typeParam.constant->getBasicType() == glslang::EbtBool) { - unsigned literal = typeParam.constant->getConstArray()[0].getBConst(); + } else if (constant->getBasicType() == glslang::EbtBool) { + unsigned literal = constant->getConstArray()[0].getBConst(); operands.push_back({false, literal}); - } else if (typeParam.constant->getBasicType() == glslang::EbtString) { - auto str = typeParam.constant->getConstArray()[0].getSConst()->c_str(); + } else if (constant->getBasicType() == glslang::EbtString) { + auto str = constant->getConstArray()[0].getSConst()->c_str(); unsigned literal = 0; char* literalPtr = reinterpret_cast<char*>(&literal); unsigned charCount = 0; @@ -4520,11 +4592,11 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty } else assert(0); // Unexpected type } else - operands.push_back({true, createSpvConstant(*typeParam.constant)}); + operands.push_back({true, createSpvConstant(*constant)}); } else { // Type specifier - assert(typeParam.type != nullptr); - operands.push_back({true, convertGlslangToSpvType(*typeParam.type)}); + assert(typeParam.getAsType() != nullptr); + operands.push_back({true, convertGlslangToSpvType(*typeParam.getAsType())}); } } @@ -5379,10 +5451,10 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF } spv::Block* functionBlock; - spv::Function *function = builder.makeFunctionEntry(TranslatePrecisionDecoration(glslFunction->getType()), - convertGlslangToSpvType(glslFunction->getType()), - glslFunction->getName().c_str(), paramTypes, paramNames, - paramDecorations, &functionBlock); + spv::Function* function = builder.makeFunctionEntry( + TranslatePrecisionDecoration(glslFunction->getType()), convertGlslangToSpvType(glslFunction->getType()), + glslFunction->getName().c_str(), convertGlslangLinkageToSpv(glslFunction->getLinkType()), paramTypes, + paramNames, paramDecorations, &functionBlock); if (implicitThis) function->setImplicitThis(); @@ -7161,6 +7233,14 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe unaryOp = spv::OpHitObjectGetShaderRecordBufferHandleNV; break; + case glslang::EOpFetchMicroTriangleVertexPositionNV: + unaryOp = spv::OpFetchMicroTriangleVertexPositionNV; + break; + + case glslang::EOpFetchMicroTriangleVertexBarycentricNV: + unaryOp = spv::OpFetchMicroTriangleVertexBarycentricNV; + break; + case glslang::EOpCopyObject: unaryOp = spv::OpCopyObject; break; @@ -9023,7 +9103,39 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: return 0; } + + case glslang::EOpImageSampleWeightedQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::OpImageSampleWeightedQCOM; + addImageProcessingQCOMDecoration(operands[2], spv::DecorationWeightTextureQCOM); + break; + case glslang::EOpImageBoxFilterQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::OpImageBoxFilterQCOM; + break; + case glslang::EOpImageBlockMatchSADQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::OpImageBlockMatchSADQCOM; + addImageProcessingQCOMDecoration(operands[0], spv::DecorationBlockMatchTextureQCOM); + addImageProcessingQCOMDecoration(operands[2], spv::DecorationBlockMatchTextureQCOM); + break; + case glslang::EOpImageBlockMatchSSDQCOM: + typeId = builder.makeVectorType(builder.makeFloatType(32), 4); + opCode = spv::OpImageBlockMatchSSDQCOM; + addImageProcessingQCOMDecoration(operands[0], spv::DecorationBlockMatchTextureQCOM); + addImageProcessingQCOMDecoration(operands[2], spv::DecorationBlockMatchTextureQCOM); + break; + + case glslang::EOpFetchMicroTriangleVertexBarycentricNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 2); + opCode = spv::OpFetchMicroTriangleVertexBarycentricNV; break; + + case glslang::EOpFetchMicroTriangleVertexPositionNV: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::OpFetchMicroTriangleVertexPositionNV; + break; + default: return 0; } @@ -9568,6 +9680,20 @@ void TGlslangToSpvTraverser::addMeshNVDecoration(spv::Id id, int member, const g } } +void TGlslangToSpvTraverser::addImageProcessingQCOMDecoration(spv::Id id, spv::Decoration decor) +{ + spv::Op opc = builder.getOpCode(id); + if (opc == spv::OpSampledImage) { + id = builder.getIdOperand(id, 0); + opc = builder.getOpCode(id); + } + + if (opc == spv::OpLoad) { + spv::Id texid = builder.getIdOperand(id, 0); + builder.addDecoration(texid, decor); + } +} + // Make a full tree of instructions to build a SPIR-V specialization constant, // or regular constant if possible. // @@ -10050,7 +10176,7 @@ void GlslangToSpv(const TIntermediate& intermediate, std::vector<unsigned int>& TGlslangToSpvTraverser it(intermediate.getSpv().spv, &intermediate, logger, *options); root->traverse(&it); - it.finishSpv(); + it.finishSpv(options->compileOnly); it.dumpSpv(spirv); #if ENABLE_OPT diff --git a/thirdparty/glslang/SPIRV/SpvBuilder.cpp b/thirdparty/glslang/SPIRV/SpvBuilder.cpp index 57e03d5d6b..d42f728816 100644 --- a/thirdparty/glslang/SPIRV/SpvBuilder.cpp +++ b/thirdparty/glslang/SPIRV/SpvBuilder.cpp @@ -859,11 +859,19 @@ Id Builder::makeBoolDebugType(int const size) Id Builder::makeIntegerDebugType(int const width, bool const hasSign) { + const char* typeName = nullptr; + switch (width) { + case 8: typeName = hasSign ? "int8_t" : "uint8_t"; break; + case 16: typeName = hasSign ? "int16_t" : "uint16_t"; break; + case 64: typeName = hasSign ? "int64_t" : "uint64_t"; break; + default: typeName = hasSign ? "int" : "uint"; + } + auto nameId = getStringId(typeName); // try to find it Instruction* type; for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; - if (type->getIdOperand(0) == (hasSign ? getStringId("int") : getStringId("uint")) && + if (type->getIdOperand(0) == nameId && type->getIdOperand(1) == static_cast<unsigned int>(width) && type->getIdOperand(2) == (hasSign ? NonSemanticShaderDebugInfo100Signed : NonSemanticShaderDebugInfo100Unsigned)) return type->getResultId(); @@ -873,11 +881,7 @@ Id Builder::makeIntegerDebugType(int const width, bool const hasSign) type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); - if(hasSign == true) { - type->addIdOperand(getStringId("int")); // name id - } else { - type->addIdOperand(getStringId("uint")); // name id - } + type->addIdOperand(nameId); // name id type->addIdOperand(makeUintConstant(width)); // size id if(hasSign == true) { type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Signed)); // encoding id @@ -895,11 +899,18 @@ Id Builder::makeIntegerDebugType(int const width, bool const hasSign) Id Builder::makeFloatDebugType(int const width) { + const char* typeName = nullptr; + switch (width) { + case 16: typeName = "float16_t"; break; + case 64: typeName = "double"; break; + default: typeName = "float"; break; + } + auto nameId = getStringId(typeName); // try to find it Instruction* type; for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; - if (type->getIdOperand(0) == getStringId("float") && + if (type->getIdOperand(0) == nameId && type->getIdOperand(1) == static_cast<unsigned int>(width) && type->getIdOperand(2) == NonSemanticShaderDebugInfo100Float) return type->getResultId(); @@ -909,7 +920,7 @@ Id Builder::makeFloatDebugType(int const width) type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); - type->addIdOperand(getStringId("float")); // name id + type->addIdOperand(nameId); // name id type->addIdOperand(makeUintConstant(width)); // size id type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Float)); // encoding id type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id @@ -1018,7 +1029,10 @@ Id Builder::makeCompositeDebugType(std::vector<Id> const& memberTypes, char cons for(auto const memberType : memberTypes) { assert(debugTypeLocs.find(memberType) != debugTypeLocs.end()); - memberDebugTypes.emplace_back(makeMemberDebugType(memberType, debugTypeLocs[memberType])); + // There _should_ be debug types for all the member types but currently buffer references + // do not have member debug info generated. + if (debugId[memberType]) + memberDebugTypes.emplace_back(makeMemberDebugType(memberType, debugTypeLocs[memberType])); // TODO: Need to rethink this method of passing location information. // debugTypeLocs.erase(memberType); @@ -1824,6 +1838,10 @@ Instruction* Builder::addEntryPoint(ExecutionModel model, Function* function, co // Currently relying on the fact that all 'value' of interest are small non-negative values. void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, int value1, int value2, int value3) { + // entryPoint can be null if we are in compile-only mode + if (!entryPoint) + return; + Instruction* instr = new Instruction(OpExecutionMode); instr->addIdOperand(entryPoint->getId()); instr->addImmediateOperand(mode); @@ -1839,6 +1857,10 @@ void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, int val void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, const std::vector<unsigned>& literals) { + // entryPoint can be null if we are in compile-only mode + if (!entryPoint) + return; + Instruction* instr = new Instruction(OpExecutionMode); instr->addIdOperand(entryPoint->getId()); instr->addImmediateOperand(mode); @@ -1850,6 +1872,10 @@ void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, const s void Builder::addExecutionModeId(Function* entryPoint, ExecutionMode mode, const std::vector<Id>& operandIds) { + // entryPoint can be null if we are in compile-only mode + if (!entryPoint) + return; + Instruction* instr = new Instruction(OpExecutionModeId); instr->addIdOperand(entryPoint->getId()); instr->addImmediateOperand(mode); @@ -1933,6 +1959,16 @@ void Builder::addDecoration(Id id, Decoration decoration, const std::vector<cons decorations.push_back(std::unique_ptr<Instruction>(dec)); } +void Builder::addLinkageDecoration(Id id, const char* name, spv::LinkageType linkType) { + Instruction* dec = new Instruction(OpDecorate); + dec->addIdOperand(id); + dec->addImmediateOperand(spv::DecorationLinkageAttributes); + dec->addStringOperand(name); + dec->addImmediateOperand(linkType); + + decorations.push_back(std::unique_ptr<Instruction>(dec)); +} + void Builder::addDecorationId(Id id, Decoration decoration, Id idDecoration) { if (decoration == spv::DecorationMax) @@ -2037,7 +2073,7 @@ Function* Builder::makeEntryPoint(const char* entryPoint) emitNonSemanticShaderDebugInfo = false; } - entryPointFunction = makeFunctionEntry(NoPrecision, returnType, entryPoint, paramsTypes, paramNames, decorations, &entry); + entryPointFunction = makeFunctionEntry(NoPrecision, returnType, entryPoint, LinkageTypeMax, paramsTypes, paramNames, decorations, &entry); emitNonSemanticShaderDebugInfo = restoreNonSemanticShaderDebugInfo; @@ -2045,7 +2081,7 @@ Function* Builder::makeEntryPoint(const char* entryPoint) } // Comments in header -Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const char* name, +Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const char* name, LinkageType linkType, const std::vector<Id>& paramTypes, const std::vector<char const*>& paramNames, const std::vector<std::vector<Decoration>>& decorations, Block **entry) { @@ -2053,7 +2089,7 @@ Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const Id typeId = makeFunctionType(returnType, paramTypes); Id firstParamId = paramTypes.size() == 0 ? 0 : getUniqueIds((int)paramTypes.size()); Id funcId = getUniqueId(); - Function* function = new Function(funcId, returnType, typeId, firstParamId, module); + Function* function = new Function(funcId, returnType, typeId, firstParamId, linkType, name, module); // Set up the precisions setPrecision(function->getId(), precision); @@ -2223,6 +2259,12 @@ void Builder::enterFunction(Function const* function) defInst->addIdOperand(funcId); buildPoint->addInstruction(std::unique_ptr<Instruction>(defInst)); } + + if (auto linkType = function->getLinkType(); linkType != LinkageTypeMax) { + Id funcId = function->getFuncId(); + addCapability(CapabilityLinkage); + addLinkageDecoration(funcId, function->getExportName(), linkType); + } } // Comments in header diff --git a/thirdparty/glslang/SPIRV/SpvBuilder.h b/thirdparty/glslang/SPIRV/SpvBuilder.h index 1f38e7899d..2e1c07d49d 100644 --- a/thirdparty/glslang/SPIRV/SpvBuilder.h +++ b/thirdparty/glslang/SPIRV/SpvBuilder.h @@ -261,6 +261,7 @@ public: ImageFormat getImageTypeFormat(Id typeId) const { return (ImageFormat)module.getInstruction(typeId)->getImmediateOperand(6); } Id getResultingAccessChainType() const; + Id getIdOperand(Id resultId, int idx) { return module.getInstruction(resultId)->getIdOperand(idx); } bool isPointer(Id resultId) const { return isPointerType(getTypeId(resultId)); } bool isScalar(Id resultId) const { return isScalarType(getTypeId(resultId)); } @@ -392,6 +393,7 @@ public: void addDecoration(Id, Decoration, const char*); void addDecoration(Id, Decoration, const std::vector<unsigned>& literals); void addDecoration(Id, Decoration, const std::vector<const char*>& strings); + void addLinkageDecoration(Id id, const char* name, spv::LinkageType linkType); void addDecorationId(Id id, Decoration, Id idDecoration); void addDecorationId(Id id, Decoration, const std::vector<Id>& operandIds); void addMemberDecoration(Id, unsigned int member, Decoration, int num = -1); @@ -416,7 +418,8 @@ public: // Return the function, pass back the entry. // The returned pointer is only valid for the lifetime of this builder. Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, - const std::vector<Id>& paramTypes, const std::vector<char const*>& paramNames, + LinkageType linkType, const std::vector<Id>& paramTypes, + const std::vector<char const*>& paramNames, const std::vector<std::vector<Decoration>>& precisions, Block **entry = nullptr); // Create a return. An 'implicit' return is one not appearing in the source @@ -827,7 +830,7 @@ public: // Add capabilities, extensions, remove unneeded decorations, etc., // based on the resulting SPIR-V. - void postProcess(); + void postProcess(bool compileOnly); // Prune unreachable blocks in the CFG and remove unneeded decorations. void postProcessCFG(); diff --git a/thirdparty/glslang/SPIRV/SpvPostProcess.cpp b/thirdparty/glslang/SPIRV/SpvPostProcess.cpp index c4be365527..13001a67a1 100644 --- a/thirdparty/glslang/SPIRV/SpvPostProcess.cpp +++ b/thirdparty/glslang/SPIRV/SpvPostProcess.cpp @@ -53,6 +53,7 @@ namespace spv { #include "GLSL.ext.AMD.h" #include "GLSL.ext.NV.h" #include "GLSL.ext.ARM.h" + #include "GLSL.ext.QCOM.h" } namespace spv { @@ -482,9 +483,13 @@ void Builder::postProcessFeatures() { } // comment in header -void Builder::postProcess() { - postProcessCFG(); - postProcessFeatures(); +void Builder::postProcess(bool compileOnly) +{ + // postProcessCFG needs an entrypoint to determine what is reachable, but if we are not creating an "executable" shader, we don't have an entrypoint + if (!compileOnly) + postProcessCFG(); + + postProcessFeatures(); } }; // end spv namespace diff --git a/thirdparty/glslang/SPIRV/SpvTools.h b/thirdparty/glslang/SPIRV/SpvTools.h index 6fc4e40b02..a4ce11b887 100644 --- a/thirdparty/glslang/SPIRV/SpvTools.h +++ b/thirdparty/glslang/SPIRV/SpvTools.h @@ -61,6 +61,7 @@ struct SpvOptions { bool validate {false}; bool emitNonSemanticShaderDebugInfo {false}; bool emitNonSemanticShaderDebugSource{ false }; + bool compileOnly{false}; }; #if ENABLE_OPT diff --git a/thirdparty/glslang/SPIRV/disassemble.cpp b/thirdparty/glslang/SPIRV/disassemble.cpp index 479f4a64eb..c5e961cf02 100644 --- a/thirdparty/glslang/SPIRV/disassemble.cpp +++ b/thirdparty/glslang/SPIRV/disassemble.cpp @@ -56,6 +56,7 @@ namespace spv { #include "GLSL.ext.NV.h" #include "GLSL.ext.ARM.h" #include "NonSemanticShaderDebugInfo100.h" + #include "GLSL.ext.QCOM.h" } } const char* GlslStd450DebugNames[spv::GLSLstd450Count]; diff --git a/thirdparty/glslang/SPIRV/doc.cpp b/thirdparty/glslang/SPIRV/doc.cpp index b7f0053dd6..53ce9e152b 100755 --- a/thirdparty/glslang/SPIRV/doc.cpp +++ b/thirdparty/glslang/SPIRV/doc.cpp @@ -55,6 +55,7 @@ namespace spv { #include "GLSL.ext.AMD.h" #include "GLSL.ext.NV.h" #include "GLSL.ext.ARM.h" + #include "GLSL.ext.QCOM.h" } } @@ -311,7 +312,9 @@ const char* DecorationString(int decoration) case DecorationCeiling: default: return "Bad"; - case DecorationExplicitInterpAMD: return "ExplicitInterpAMD"; + case DecorationWeightTextureQCOM: return "DecorationWeightTextureQCOM"; + case DecorationBlockMatchTextureQCOM: return "DecorationBlockMatchTextureQCOM"; + case DecorationExplicitInterpAMD: return "ExplicitInterpAMD"; case DecorationOverrideCoverageNV: return "OverrideCoverageNV"; case DecorationPassthroughNV: return "PassthroughNV"; case DecorationViewportRelativeNV: return "ViewportRelativeNV"; @@ -411,6 +414,10 @@ const char* BuiltInString(int builtIn) case BuiltInRayTmaxKHR: return "RayTmaxKHR"; case BuiltInCullMaskKHR: return "CullMaskKHR"; case BuiltInHitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR"; + case BuiltInHitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV"; + case BuiltInHitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV"; + case BuiltInHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case BuiltInHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; case BuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; case BuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR"; case BuiltInObjectToWorldKHR: return "ObjectToWorldKHR"; @@ -974,6 +981,8 @@ const char* CapabilityString(int info) case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; case CapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR"; case CapabilityRayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; + case CapabilityDisplacementMicromapNV: return "DisplacementMicromapNV"; + case CapabilityRayTracingDisplacementMicromapNV: return "CapabilityRayTracingDisplacementMicromapNV"; case CapabilityRayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; case CapabilityComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV"; case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV"; @@ -1040,6 +1049,11 @@ const char* CapabilityString(int info) case CapabilityCoreBuiltinsARM: return "CoreBuiltinsARM"; case CapabilityShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; + + case CapabilityTextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM"; + case CapabilityTextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; + case CapabilityTextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; + default: return "Bad"; } } @@ -1534,10 +1548,18 @@ const char* OpcodeString(int op) case OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV"; case OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV"; + case OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV"; + case OpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV"; + case OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; case OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; case OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; + case OpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM"; + case OpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM"; + case OpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM"; + case OpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM"; + default: return "Bad"; } @@ -3069,7 +3091,7 @@ void Parameterize() InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].operands.push(OperandId, "'RayQuery'"); InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].operands.push(OperandId, "'Committed'"); - InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].setResultAndType(true, true); + InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].setResultAndType(true, true); InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Coordinate'"); @@ -3335,10 +3357,52 @@ void Parameterize() InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Payload'"); InstructionDesc[OpHitObjectTraceRayMotionNV].setResultAndType(false, false); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Instance ID'"); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Geometry Index'"); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Primitive Index'"); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].operands.push(OperandId, "'Barycentrics'"); + InstructionDesc[OpFetchMicroTriangleVertexBarycentricNV].setResultAndType(true, true); + + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Instance ID'"); + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Geometry Index'"); + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Primitive Index'"); + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].operands.push(OperandId, "'Barycentrics'"); + InstructionDesc[OpFetchMicroTriangleVertexPositionNV].setResultAndType(true, true); + InstructionDesc[OpColorAttachmentReadEXT].operands.push(OperandId, "'Attachment'"); InstructionDesc[OpColorAttachmentReadEXT].operands.push(OperandId, "'Sample'", true); InstructionDesc[OpStencilAttachmentReadEXT].operands.push(OperandId, "'Sample'", true); InstructionDesc[OpDepthAttachmentReadEXT].operands.push(OperandId, "'Sample'", true); + + InstructionDesc[OpImageSampleWeightedQCOM].operands.push(OperandId, "'source texture'"); + InstructionDesc[OpImageSampleWeightedQCOM].operands.push(OperandId, "'texture coordinates'"); + InstructionDesc[OpImageSampleWeightedQCOM].operands.push(OperandId, "'weights texture'"); + InstructionDesc[OpImageSampleWeightedQCOM].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSampleWeightedQCOM].setResultAndType(true, true); + + InstructionDesc[OpImageBoxFilterQCOM].operands.push(OperandId, "'source texture'"); + InstructionDesc[OpImageBoxFilterQCOM].operands.push(OperandId, "'texture coordinates'"); + InstructionDesc[OpImageBoxFilterQCOM].operands.push(OperandId, "'box size'"); + InstructionDesc[OpImageBoxFilterQCOM].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageBoxFilterQCOM].setResultAndType(true, true); + + InstructionDesc[OpImageBlockMatchSADQCOM].operands.push(OperandId, "'target texture'"); + InstructionDesc[OpImageBlockMatchSADQCOM].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[OpImageBlockMatchSADQCOM].operands.push(OperandId, "'reference texture'"); + InstructionDesc[OpImageBlockMatchSADQCOM].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[OpImageBlockMatchSADQCOM].operands.push(OperandId, "'block size'"); + InstructionDesc[OpImageBlockMatchSADQCOM].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageBlockMatchSADQCOM].setResultAndType(true, true); + + InstructionDesc[OpImageBlockMatchSSDQCOM].operands.push(OperandId, "'target texture'"); + InstructionDesc[OpImageBlockMatchSSDQCOM].operands.push(OperandId, "'target coordinates'"); + InstructionDesc[OpImageBlockMatchSSDQCOM].operands.push(OperandId, "'reference texture'"); + InstructionDesc[OpImageBlockMatchSSDQCOM].operands.push(OperandId, "'reference coordinates'"); + InstructionDesc[OpImageBlockMatchSSDQCOM].operands.push(OperandId, "'block size'"); + InstructionDesc[OpImageBlockMatchSSDQCOM].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageBlockMatchSSDQCOM].setResultAndType(true, true); }); } diff --git a/thirdparty/glslang/SPIRV/spirv.hpp b/thirdparty/glslang/SPIRV/spirv.hpp index 4fb721ef18..02c1eded73 100644 --- a/thirdparty/glslang/SPIRV/spirv.hpp +++ b/thirdparty/glslang/SPIRV/spirv.hpp @@ -513,6 +513,8 @@ enum Decoration { DecorationMaxByteOffsetId = 47, DecorationNoSignedWrap = 4469, DecorationNoUnsignedWrap = 4470, + DecorationWeightTextureQCOM = 4487, + DecorationBlockMatchTextureQCOM = 4488, DecorationExplicitInterpAMD = 4999, DecorationOverrideCoverageNV = 5248, DecorationPassthroughNV = 5250, @@ -718,6 +720,10 @@ enum BuiltIn { BuiltInHitKindNV = 5333, BuiltInCurrentRayTimeNV = 5334, BuiltInHitTriangleVertexPositionsKHR = 5335, + BuiltInHitMicroTriangleVertexPositionsNV = 5337, + BuiltInHitMicroTriangleVertexBarycentricsNV = 5344, + BuiltInHitKindFrontFacingMicroTriangleNV = 5405, + BuiltInHitKindBackFacingMicroTriangleNV = 5406, BuiltInIncomingRayFlagsKHR = 5351, BuiltInIncomingRayFlagsNV = 5351, BuiltInRayGeometryIndexKHR = 5352, @@ -1023,6 +1029,9 @@ enum Capability { CapabilityRayQueryKHR = 4472, CapabilityRayTraversalPrimitiveCullingKHR = 4478, CapabilityRayTracingKHR = 4479, + CapabilityTextureSampleWeightedQCOM = 4484, + CapabilityTextureBoxFilterQCOM = 4485, + CapabilityTextureBlockMatchQCOM = 4486, CapabilityFloat16ImageAMD = 5008, CapabilityImageGatherBiasLodAMD = 5009, CapabilityFragmentMaskAMD = 5010, @@ -1089,6 +1098,8 @@ enum Capability { CapabilityFragmentShaderPixelInterlockEXT = 5378, CapabilityDemoteToHelperInvocation = 5379, CapabilityDemoteToHelperInvocationEXT = 5379, + CapabilityDisplacementMicromapNV = 5380, + CapabilityRayTracingDisplacementMicromapNV = 5409, CapabilityRayTracingOpacityMicromapEXT = 5381, CapabilityShaderInvocationReorderNV = 5383, CapabilityBindlessTextureNV = 5390, @@ -1678,6 +1689,10 @@ enum Op { OpRayQueryConfirmIntersectionKHR = 4476, OpRayQueryProceedKHR = 4477, OpRayQueryGetIntersectionTypeKHR = 4479, + OpImageSampleWeightedQCOM = 4480, + OpImageBoxFilterQCOM = 4481, + OpImageBlockMatchSSDQCOM = 4482, + OpImageBlockMatchSADQCOM = 4483, OpGroupIAddNonUniformAMD = 5000, OpGroupFAddNonUniformAMD = 5001, OpGroupFMinNonUniformAMD = 5002, @@ -1727,6 +1742,8 @@ enum Op { OpSetMeshOutputsEXT = 5295, OpGroupNonUniformPartitionNV = 5296, OpWritePackedPrimitiveIndices4x8NV = 5299, + OpFetchMicroTriangleVertexPositionNV = 5300, + OpFetchMicroTriangleVertexBarycentricNV = 5301, OpReportIntersectionKHR = 5334, OpReportIntersectionNV = 5334, OpIgnoreIntersectionNV = 5335, @@ -2395,6 +2412,10 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; case OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; case OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; + case OpImageSampleWeightedQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; + case OpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; case OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; diff --git a/thirdparty/glslang/SPIRV/spvIR.h b/thirdparty/glslang/SPIRV/spvIR.h index 5cbffec25f..1f8e28ff46 100644 --- a/thirdparty/glslang/SPIRV/spvIR.h +++ b/thirdparty/glslang/SPIRV/spvIR.h @@ -323,7 +323,7 @@ void inReadableOrder(Block* root, std::function<void(Block*, ReachReason, Block* class Function { public: - Function(Id id, Id resultType, Id functionType, Id firstParam, Module& parent); + Function(Id id, Id resultType, Id functionType, Id firstParam, LinkageType linkage, const std::string& name, Module& parent); virtual ~Function() { for (int i = 0; i < (int)parameterInstructions.size(); ++i) @@ -402,6 +402,9 @@ public: end.dump(out); } + LinkageType getLinkType() const { return linkType; } + const char* getExportName() const { return exportName.c_str(); } + protected: Function(const Function&); Function& operator=(Function&); @@ -414,6 +417,8 @@ protected: bool implicitThis; // true if this is a member function expecting to be passed a 'this' as the first argument bool reducedPrecisionReturn; std::set<int> reducedPrecisionParams; // list of parameter indexes that need a relaxed precision arg + LinkageType linkType; + std::string exportName; }; // @@ -473,10 +478,11 @@ protected: // Add both // - the OpFunction instruction // - all the OpFunctionParameter instructions -__inline Function::Function(Id id, Id resultType, Id functionType, Id firstParamId, Module& parent) +__inline Function::Function(Id id, Id resultType, Id functionType, Id firstParamId, LinkageType linkage, const std::string& name, Module& parent) : parent(parent), lineInstruction(nullptr), functionInstruction(id, resultType, OpFunction), implicitThis(false), - reducedPrecisionReturn(false) + reducedPrecisionReturn(false), + linkType(linkage) { // OpFunction functionInstruction.addImmediateOperand(FunctionControlMaskNone); @@ -492,6 +498,11 @@ __inline Function::Function(Id id, Id resultType, Id functionType, Id firstParam parent.mapInstruction(param); parameterInstructions.push_back(param); } + + // If importing/exporting, save the function name (without the mangled parameters) for the linkage decoration + if (linkType != LinkageTypeMax) { + exportName = name.substr(0, name.find_first_of('(')); + } } __inline void Function::addLocalVariable(std::unique_ptr<Instruction> inst) diff --git a/thirdparty/glslang/glslang/Include/BaseTypes.h b/thirdparty/glslang/glslang/Include/BaseTypes.h index ae49a936a1..64bffa8926 100755 --- a/thirdparty/glslang/glslang/Include/BaseTypes.h +++ b/thirdparty/glslang/glslang/Include/BaseTypes.h @@ -290,6 +290,12 @@ enum TBuiltInVariable { EbvLayerPerViewNV, EbvMeshViewCountNV, EbvMeshViewIndicesNV, + + EbvMicroTrianglePositionNV, + EbvMicroTriangleBaryNV, + EbvHitKindFrontFacingMicroTriangleNV, + EbvHitKindBackFacingMicroTriangleNV, + //GL_EXT_mesh_shader EbvPrimitivePointIndicesEXT, EbvPrimitiveLineIndicesEXT, @@ -523,6 +529,9 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvShadingRateKHR: return "ShadingRateKHR"; case EbvPrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR"; + case EbvHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV"; + case EbvHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV"; + default: return "unknown built-in variable"; } } diff --git a/thirdparty/glslang/glslang/Include/PoolAlloc.h b/thirdparty/glslang/glslang/Include/PoolAlloc.h index 3e67d6edff..e84ac52cd2 100644 --- a/thirdparty/glslang/glslang/Include/PoolAlloc.h +++ b/thirdparty/glslang/glslang/Include/PoolAlloc.h @@ -118,11 +118,16 @@ private: unsigned char* mem; // beginning of our allocation (pts to header) TAllocation* prevAlloc; // prior allocation in the chain - const static unsigned char guardBlockBeginVal; - const static unsigned char guardBlockEndVal; - const static unsigned char userDataFill; + static inline constexpr unsigned char guardBlockBeginVal = 0xfb; + static inline constexpr unsigned char guardBlockEndVal = 0xfe; + static inline constexpr unsigned char userDataFill = 0xcd; + +# ifdef GUARD_BLOCKS + static inline constexpr size_t guardBlockSize = 16; +# else + static inline constexpr size_t guardBlockSize = 0; +# endif - const static size_t guardBlockSize; # ifdef GUARD_BLOCKS inline static size_t headerSize() { return sizeof(TAllocation); } # else diff --git a/thirdparty/glslang/glslang/Include/SpirvIntrinsics.h b/thirdparty/glslang/glslang/Include/SpirvIntrinsics.h index bfb551e445..0082a4d4eb 100644 --- a/thirdparty/glslang/glslang/Include/SpirvIntrinsics.h +++ b/thirdparty/glslang/glslang/Include/SpirvIntrinsics.h @@ -39,6 +39,7 @@ // GL_EXT_spirv_intrinsics // #include "Common.h" +#include <variant> namespace glslang { @@ -96,23 +97,27 @@ struct TSpirvInstruction { struct TSpirvTypeParameter { POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - TSpirvTypeParameter(const TIntermConstantUnion* arg) + TSpirvTypeParameter(const TIntermConstantUnion* arg) { value = arg; } + TSpirvTypeParameter(const TType* arg) { value = arg; } + + const TIntermConstantUnion* getAsConstant() const { - constant = arg; - type = nullptr; + if (value.index() == 0) + return std::get<const TIntermConstantUnion*>(value); + return nullptr; } - - TSpirvTypeParameter(const TType *arg) + const TType* getAsType() const { - constant = nullptr; - type = arg; + if (value.index() == 1) + return std::get<const TType*>(value); + return nullptr; } bool operator==(const TSpirvTypeParameter& rhs) const; bool operator!=(const TSpirvTypeParameter& rhs) const { return !operator==(rhs); } - const TIntermConstantUnion* constant; // Constant expression - const TType* type; // Type specifier + // Parameter value: constant expression or type specifier + std::variant<const TIntermConstantUnion*, const TType*> value; }; typedef TVector<TSpirvTypeParameter> TSpirvTypeParameters; diff --git a/thirdparty/glslang/glslang/Include/intermediate.h b/thirdparty/glslang/glslang/Include/intermediate.h index b002ce889d..9d311d60b5 100644 --- a/thirdparty/glslang/glslang/Include/intermediate.h +++ b/thirdparty/glslang/glslang/Include/intermediate.h @@ -1006,6 +1006,8 @@ enum TOperator { EOpHitObjectGetAttributesNV, EOpHitObjectGetCurrentTimeNV, EOpReorderThreadNV, + EOpFetchMicroTriangleVertexPositionNV, + EOpFetchMicroTriangleVertexBarycentricNV, // HLSL operations // @@ -1100,6 +1102,17 @@ enum TOperator { // Shader tile image ops EOpStencilAttachmentReadEXT, // Fragment only EOpDepthAttachmentReadEXT, // Fragment only + + // Image processing + EOpImageSampleWeightedQCOM, + EOpImageBoxFilterQCOM, + EOpImageBlockMatchSADQCOM, + EOpImageBlockMatchSSDQCOM, +}; + +enum TLinkType { + ELinkNone, + ELinkExport, }; class TIntermTraverser; @@ -1319,9 +1332,11 @@ public: virtual const TString& getMethodName() const { return method; } virtual TIntermTyped* getObject() const { return object; } virtual void traverse(TIntermTraverser*); + void setExport() { linkType = ELinkExport; } protected: TIntermTyped* object; TString method; + TLinkType linkType; }; // @@ -1694,6 +1709,9 @@ public: const TPragmaTable& getPragmaTable() const { return *pragmaTable; } void setSpirvInstruction(const TSpirvInstruction& inst) { spirvInst = inst; } const TSpirvInstruction& getSpirvInstruction() const { return spirvInst; } + + void setLinkType(TLinkType l) { linkType = l; } + TLinkType getLinkType() const { return linkType; } protected: TIntermAggregate(const TIntermAggregate&); // disallow copy constructor TIntermAggregate& operator=(const TIntermAggregate&); // disallow assignment operator @@ -1705,6 +1723,7 @@ protected: bool debug; TPragmaTable* pragmaTable; TSpirvInstruction spirvInst; + TLinkType linkType = ELinkNone; }; // diff --git a/thirdparty/glslang/glslang/MachineIndependent/Initialize.cpp b/thirdparty/glslang/glslang/MachineIndependent/Initialize.cpp index 3c7aaea3ff..8d5ce9af8c 100755 --- a/thirdparty/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/Initialize.cpp @@ -51,7 +51,6 @@ // including identifying what extensions are needed if a version does not allow a symbol // -#include "../Include/intermediate.h" #include "Initialize.h" namespace glslang { @@ -61,10 +60,6 @@ const bool ARBCompatibility = true; const bool ForwardCompatibility = false; -// change this back to false if depending on textual spellings of texturing calls when consuming the AST -// Using PureOperatorBuiltins=false is deprecated. -bool PureOperatorBuiltins = true; - namespace { // @@ -4113,6 +4108,19 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + // Builtins for GL_EXT_texture_shadow_lod + if ((profile == EEsProfile && version >= 300) || ((profile != EEsProfile && version >= 130))) { + commonBuiltins.append( + "float texture(sampler2DArrayShadow, vec4, float);" + "float texture(samplerCubeArrayShadow, vec4, float, float);" + "float textureLod(sampler2DArrayShadow, vec4, float);" + "float textureLod(samplerCubeShadow, vec4, float);" + "float textureLod(samplerCubeArrayShadow, vec4, float, float);" + "float textureLodOffset(sampler2DArrayShadow, vec4, float, ivec2);" + "float textureOffset(sampler2DArrayShadow, vec4 , ivec2, float);" + "\n"); + } + if (profile != EEsProfile && version >= 450) { stageBuiltins[EShLangFragment].append(derivativesAndControl64bits); stageBuiltins[EShLangFragment].append( @@ -4135,6 +4143,18 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV } + // QCOM_image_processing + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + commonBuiltins.append( + "vec4 textureWeightedQCOM(sampler2D, vec2, sampler2DArray);" + "vec4 textureWeightedQCOM(sampler2D, vec2, sampler1DArray);" + "vec4 textureBoxFilterQCOM(sampler2D, vec2, vec2);" + "vec4 textureBlockMatchSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + "vec4 textureBlockMatchSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" + "\n"); + } + //============================================================================ // // Prototypes for built-in functions seen by vertex shaders only. @@ -4624,7 +4644,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "uvec4 fragmentFetchAMD(usubpassInputMS, uint);" "\n"); - } + } // Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query/ // GL_NV_shader_invocation_reorder/GL_KHR_ray_tracing_position_Fetch @@ -4694,6 +4714,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "void reorderThreadNV(uint, uint);" "void reorderThreadNV(hitObjectNV);" "void reorderThreadNV(hitObjectNV, uint, uint);" + "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" + "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" "\n"); stageBuiltins[EShLangIntersect].append( "bool reportIntersectionNV(float, uint);" @@ -4811,6 +4833,20 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "void SetMeshOutputsEXT(uint, uint);" "\n"); } + // Builtins for GL_NV_displacement_micromap + if ((profile != EEsProfile && version >= 460) || (profile == EEsProfile && version >= 320)) { + stageBuiltins[EShLangMesh].append( + "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" + "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" + "\n"); + + stageBuiltins[EShLangCompute].append( + "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" + "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" + "\n"); + + } + //============================================================================ // @@ -5993,6 +6029,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "const uint gl_RayFlagsForceOpacityMicromap2StateEXT = 1024U;" "const uint gl_HitKindFrontFacingTriangleEXT = 254U;" "const uint gl_HitKindBackFacingTriangleEXT = 255U;" + "in uint gl_HitKindFrontFacingMicroTriangleNV;" + "in uint gl_HitKindBackFacingMicroTriangleNV;" "\n"; const char *constRayQueryIntersection = @@ -6081,7 +6119,10 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in float gl_CurrentRayTimeNV;" "in uint gl_CullMaskEXT;" "in vec3 gl_HitTriangleVertexPositionsEXT[3];" + "in vec3 gl_HitMicroTriangleVertexPositionsNV[3];" + "in vec2 gl_HitMicroTriangleVertexBarycentricsNV[3];" "\n"; + const char *missDecls = "in uvec3 gl_LaunchIDNV;" "in uvec3 gl_LaunchIDEXT;" @@ -8095,7 +8136,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); } - if (profile != EEsProfile) { + if (profile != EEsProfile) { BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); @@ -8725,6 +8766,14 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("stencilAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); symbolTable.setFunctionExtensions("depthAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); symbolTable.setFunctionExtensions("colorAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.setFunctionExtensions("textureWeightedQCOM", 1, &E_GL_QCOM_image_processing); + symbolTable.setFunctionExtensions("textureBoxFilterQCOM", 1, &E_GL_QCOM_image_processing); + symbolTable.setFunctionExtensions("textureBlockMatchSADQCOM", 1, &E_GL_QCOM_image_processing); + symbolTable.setFunctionExtensions("textureBlockMatchSSDQCOM", 1, &E_GL_QCOM_image_processing); + } break; case EShLangCompute: @@ -8885,6 +8934,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); } + + if ((profile != EEsProfile && version >= 460)) { + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); + } break; case EShLangRayGen: @@ -8931,6 +8985,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_IncomingRayFlagsEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_CurrentRayTimeNV", 1, &E_GL_NV_ray_tracing_motion_blur); symbolTable.setVariableExtensions("gl_HitTriangleVertexPositionsEXT", 1, &E_GL_EXT_ray_tracing_position_fetch); + symbolTable.setVariableExtensions("gl_HitMicroTriangleVertexPositionsNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setVariableExtensions("gl_HitMicroTriangleVertexBarycentricsNV", 1, &E_GL_NV_displacement_micromap); symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); @@ -8976,6 +9032,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("hitObjectGetShaderBindingTableRecordIndexNV", 1, &E_GL_NV_shader_invocation_reorder); symbolTable.setFunctionExtensions("hitObjectGetShaderRecordBufferHandleNV", 1, &E_GL_NV_shader_invocation_reorder); symbolTable.setFunctionExtensions("reorderThreadNV", 1, &E_GL_NV_shader_invocation_reorder); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); BuiltInVariable("gl_LaunchIDNV", EbvLaunchId, symbolTable); @@ -9015,6 +9073,10 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); BuiltInVariable("gl_CurrentRayTimeNV", EbvCurrentRayTimeNV, symbolTable); BuiltInVariable("gl_HitTriangleVertexPositionsEXT", EbvPositionFetch, symbolTable); + BuiltInVariable("gl_HitMicroTriangleVertexPositionsNV", EbvMicroTrianglePositionNV, symbolTable); + BuiltInVariable("gl_HitMicroTriangleVertexBarycentricsNV", EbvMicroTriangleBaryNV, symbolTable); + BuiltInVariable("gl_HitKindFrontFacingMicroTriangleNV", EbvHitKindFrontFacingMicroTriangleNV, symbolTable); + BuiltInVariable("gl_HitKindBackFacingMicroTriangleNV", EbvHitKindBackFacingMicroTriangleNV, symbolTable); // GL_ARB_shader_ballot symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); @@ -9316,6 +9378,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); } + + // Builtins for GL_NV_displacment_micromap + if ((profile != EEsProfile && version >= 460)) { + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); + symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); + } + break; case EShLangTask: @@ -9890,6 +9959,14 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("shadow2DEXT", EOpTexture); symbolTable.relateToOperator("shadow2DProjEXT", EOpTextureProj); } + + if ((profile == EEsProfile && version >= 310) || + (profile != EEsProfile && version >= 140)) { + symbolTable.relateToOperator("textureWeightedQCOM", EOpImageSampleWeightedQCOM); + symbolTable.relateToOperator("textureBoxFilterQCOM", EOpImageBoxFilterQCOM); + symbolTable.relateToOperator("textureBlockMatchSADQCOM", EOpImageBlockMatchSADQCOM); + symbolTable.relateToOperator("textureBlockMatchSSDQCOM", EOpImageBlockMatchSSDQCOM); + } } switch(language) { @@ -9981,9 +10058,18 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("coopMatLoad", EOpCooperativeMatrixLoad); symbolTable.relateToOperator("coopMatStore", EOpCooperativeMatrixStore); symbolTable.relateToOperator("coopMatMulAdd", EOpCooperativeMatrixMulAdd); + + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); + symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); + } break; case EShLangRayGen: + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); + symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); + } // fallthrough case EShLangClosestHit: case EShLangMiss: if (profile != EEsProfile && version >= 460) { @@ -10030,7 +10116,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion if (profile != EEsProfile && version >= 460) { symbolTable.relateToOperator("reportIntersectionNV", EOpReportIntersection); symbolTable.relateToOperator("reportIntersectionEXT", EOpReportIntersection); - } + } break; case EShLangAnyHit: if (profile != EEsProfile && version >= 460) { @@ -10055,6 +10141,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion if (profile != EEsProfile && version >= 450) { symbolTable.relateToOperator("SetMeshOutputsEXT", EOpSetMeshOutputsEXT); } + + if (profile != EEsProfile && version >= 460) { + // Builtins for GL_NV_displacement_micromap. + symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); + symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); + } break; case EShLangTask: if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { diff --git a/thirdparty/glslang/glslang/MachineIndependent/Initialize.h b/thirdparty/glslang/glslang/MachineIndependent/Initialize.h index ac8ec33e99..42c32ddbb7 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/Initialize.h +++ b/thirdparty/glslang/glslang/MachineIndependent/Initialize.h @@ -107,6 +107,9 @@ protected: int dimMap[EsdNumDims]; }; +// change this back to false if depending on textual spellings of texturing calls when consuming the AST +// Using PureOperatorBuiltins=false is deprecated. +constexpr bool PureOperatorBuiltins = true; } // end namespace glslang #endif // _INITIALIZE_INCLUDED_ diff --git a/thirdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/thirdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index b8c64e0985..592e9aa8ad 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -38,6 +38,7 @@ // #include "ParseHelper.h" +#include "Initialize.h" #include "Scan.h" #include "../OSDependent/osinclude.h" @@ -1242,6 +1243,8 @@ TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, error(loc, "function cannot take any parameter(s)", function.getName().c_str(), ""); if (function.getType().getBasicType() != EbtVoid) error(loc, "", function.getType().getBasicTypeString().c_str(), "entry point cannot return a value"); + if (function.getLinkType() != ELinkNone) + error(loc, "main function cannot be exported", "", ""); } // @@ -1278,6 +1281,7 @@ TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, } else paramNodes = intermediate.growAggregate(paramNodes, intermediate.addSymbol(*param.type, loc), loc); } + paramNodes->setLinkType(function.getLinkType()); intermediate.setAggregateOperator(paramNodes, EOpParameters, TType(EbtVoid), loc); loopNestingLevel = 0; statementNestingLevel = 0; @@ -2168,6 +2172,37 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } break; } + + case EOpTexture: + case EOpTextureLod: + { + if ((fnCandidate.getParamCount() > 2) && ((*argp)[1]->getAsTyped()->getType().getBasicType() == EbtFloat) && + ((*argp)[1]->getAsTyped()->getType().getVectorSize() == 4) && fnCandidate[0].type->getSampler().shadow) { + featureString = fnCandidate.getName(); + if (callNode.getOp() == EOpTexture) + featureString += "(..., float bias)"; + else + featureString += "(..., float lod)"; + feature = featureString.c_str(); + + if ((fnCandidate[0].type->getSampler().dim == Esd2D && fnCandidate[0].type->getSampler().arrayed) || //2D Array Shadow + (fnCandidate[0].type->getSampler().dim == EsdCube && fnCandidate[0].type->getSampler().arrayed && fnCandidate.getParamCount() > 3) || // Cube Array Shadow + (fnCandidate[0].type->getSampler().dim == EsdCube && callNode.getOp() == EOpTextureLod)) { // Cube Shadow + requireExtensions(loc, 1, &E_GL_EXT_texture_shadow_lod, feature); + if (isEsProfile()) { + if (version < 320 && + !extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array)) + error(loc, "GL_EXT_texture_shadow_lod not supported for this ES version", feature, ""); + else + profileRequires(loc, EEsProfile, 320, nullptr, feature); + } else { // Desktop + profileRequires(loc, ~EEsProfile, 130, nullptr, feature); + } + } + } + break; + } + case EOpSparseTextureGather: case EOpSparseTextureGatherOffset: case EOpSparseTextureGatherOffsets: @@ -2282,12 +2317,36 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan if (callNode.getOp() == EOpTextureOffset) { TSampler s = arg0->getType().getSampler(); if (s.is2D() && s.isArrayed() && s.isShadow()) { - if (isEsProfile()) + if ( + ((*argp)[1]->getAsTyped()->getType().getBasicType() == EbtFloat) && + ((*argp)[1]->getAsTyped()->getType().getVectorSize() == 4) && + (fnCandidate.getParamCount() == 4)) { + featureString = fnCandidate.getName() + " for sampler2DArrayShadow"; + feature = featureString.c_str(); + requireExtensions(loc, 1, &E_GL_EXT_texture_shadow_lod, feature); + profileRequires(loc, EEsProfile, 300, nullptr, feature); + profileRequires(loc, ~EEsProfile, 130, nullptr, feature); + } + else if (isEsProfile()) error(loc, "TextureOffset does not support sampler2DArrayShadow : ", "sampler", "ES Profile"); else if (version <= 420) error(loc, "TextureOffset does not support sampler2DArrayShadow : ", "sampler", "version <= 420"); } } + + if (callNode.getOp() == EOpTextureLodOffset) { + TSampler s = arg0->getType().getSampler(); + if (s.is2D() && s.isArrayed() && s.isShadow() && + ((*argp)[1]->getAsTyped()->getType().getBasicType() == EbtFloat) && + ((*argp)[1]->getAsTyped()->getType().getVectorSize() == 4) && + (fnCandidate.getParamCount() == 4)) { + featureString = fnCandidate.getName() + " for sampler2DArrayShadow"; + feature = featureString.c_str(); + profileRequires(loc, EEsProfile, 300, nullptr, feature); + profileRequires(loc, ~EEsProfile, 130, nullptr, feature); + requireExtensions(loc, 1, &E_GL_EXT_texture_shadow_lod, feature); + } + } } break; @@ -2513,11 +2572,18 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } const TIntermTyped* base = TIntermediate::findLValueBase(arg0, true , true); - const TType* refType = (base->getType().isReference()) ? base->getType().getReferentType() : nullptr; - const TQualifier& qualifier = (refType != nullptr) ? refType->getQualifier() : base->getType().getQualifier(); - if (qualifier.storage != EvqShared && qualifier.storage != EvqBuffer && qualifier.storage != EvqtaskPayloadSharedEXT) - error(loc,"Atomic memory function can only be used for shader storage block member or shared variable.", - fnCandidate.getName().c_str(), ""); + const char* errMsg = "Only l-values corresponding to shader block storage or shared variables can be used with " + "atomic memory functions."; + if (base) { + const TType* refType = (base->getType().isReference()) ? base->getType().getReferentType() : nullptr; + const TQualifier& qualifier = + (refType != nullptr) ? refType->getQualifier() : base->getType().getQualifier(); + if (qualifier.storage != EvqShared && qualifier.storage != EvqBuffer && + qualifier.storage != EvqtaskPayloadSharedEXT) + error(loc, errMsg, fnCandidate.getName().c_str(), ""); + } else { + error(loc, errMsg, fnCandidate.getName().c_str(), ""); + } break; } @@ -2685,7 +2751,6 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } } -extern bool PureOperatorBuiltins; // Deprecated! Use PureOperatorBuiltins == true instead, in which case this // functionality is handled in builtInOpCheck() instead of here. @@ -6324,9 +6389,6 @@ void TParseContext::layoutMemberLocationArrayCheck(const TSourceLoc& loc, bool m // Do layout error checking with respect to a type. void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) { - if (extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) - return; // Skip any check if GL_EXT_spirv_intrinsics is turned on - const TQualifier& qualifier = type.getQualifier(); // first, intra-layout qualifier-only error checking @@ -6380,6 +6442,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) case EvqCallableData: case EvqCallableDataIn: case EvqHitObjectAttrNV: + case EvqSpirvStorageClass: break; case EvqTileImageEXT: break; @@ -6436,7 +6499,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) // an array of size N, all elements of the array from binding through binding + N - 1 must be within this // range." // - if (! type.isOpaque() && type.getBasicType() != EbtBlock) + if (!type.isOpaque() && type.getBasicType() != EbtBlock && type.getBasicType() != EbtSpirvType) error(loc, "requires block, or sampler/image, or atomic-counter type", "binding", ""); if (type.getBasicType() == EbtSampler) { int lastBinding = qualifier.layoutBinding; diff --git a/thirdparty/glslang/glslang/MachineIndependent/ParseHelper.h b/thirdparty/glslang/glslang/MachineIndependent/ParseHelper.h index d74662939f..05ebca275d 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/thirdparty/glslang/glslang/MachineIndependent/ParseHelper.h @@ -196,6 +196,7 @@ public: struct TPragma contextPragma; int beginInvocationInterlockCount; int endInvocationInterlockCount; + bool compileOnly = false; protected: TParseContextBase(TParseContextBase&); diff --git a/thirdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp b/thirdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp index 471a980409..5d7173c9db 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp @@ -131,16 +131,6 @@ TPoolAllocator::~TPoolAllocator() } } -const unsigned char TAllocation::guardBlockBeginVal = 0xfb; -const unsigned char TAllocation::guardBlockEndVal = 0xfe; -const unsigned char TAllocation::userDataFill = 0xcd; - -# ifdef GUARD_BLOCKS - const size_t TAllocation::guardBlockSize = 16; -# else - const size_t TAllocation::guardBlockSize = 0; -# endif - // // Check a single guard block for damage // diff --git a/thirdparty/glslang/glslang/MachineIndependent/Scan.cpp b/thirdparty/glslang/glslang/MachineIndependent/Scan.cpp index 99c9ecbbba..5c7e2e662e 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/Scan.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/Scan.cpp @@ -1073,12 +1073,18 @@ int TScanContext::tokenizeIdentifier() parseContext.extensionTurnedOn(E_GL_NV_ray_tracing)) return keyword; return identifierOrType(); + case ACCSTRUCTEXT: + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_ray_tracing) || + parseContext.extensionTurnedOn(E_GL_EXT_ray_query) || + parseContext.extensionTurnedOn(E_GL_NV_displacement_micromap)) + return keyword; + return identifierOrType(); case PAYLOADEXT: case PAYLOADINEXT: case HITATTREXT: case CALLDATAEXT: case CALLDATAINEXT: - case ACCSTRUCTEXT: if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_EXT_ray_tracing) || parseContext.extensionTurnedOn(E_GL_EXT_ray_query)) diff --git a/thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp index 51c524bbec..9a42acae91 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -796,7 +796,8 @@ bool ProcessDeferred( bool requireNonempty, TShader::Includer& includer, const std::string sourceEntryPointName = "", - const TEnvironment* environment = nullptr) // optional way of fully setting all versions, overriding the above + const TEnvironment* environment = nullptr, // optional way of fully setting all versions, overriding the above + bool compileOnly = false) { // This must be undone (.pop()) by the caller, after it finishes consuming the created tree. GetThreadPoolAllocator().push(); @@ -942,6 +943,7 @@ bool ProcessDeferred( std::unique_ptr<TParseContextBase> parseContext(CreateParseContext(*symbolTable, intermediate, version, profile, source, stage, compiler->infoSink, spvVersion, forwardCompatible, messages, false, sourceEntryPointName)); + parseContext->compileOnly = compileOnly; TPpContext ppContext(*parseContext, names[numPre] ? names[numPre] : "", includer); // only GLSL (bison triggered, really) needs an externally set scan context @@ -1066,8 +1068,8 @@ struct DoPreprocessing { EShOptimizationLevel, EShMessages) { // This is a list of tokens that do not require a space before or after. - static const std::string unNeededSpaceTokens = ";()[]"; - static const std::string noSpaceBeforeTokens = ","; + static const std::string noNeededSpaceBeforeTokens = ";)[].,"; + static const std::string noNeededSpaceAfterTokens = ".(["; glslang::TPpToken ppToken; parseContext.setScanner(&input); @@ -1140,6 +1142,7 @@ struct DoPreprocessing { }); int lastToken = EndOfInput; // lastToken records the last token processed. + std::string lastTokenName; do { int token = ppContext.tokenize(ppToken); if (token == EndOfInput) @@ -1158,12 +1161,23 @@ struct DoPreprocessing { // Output a space in between tokens, but not at the start of a line, // and also not around special tokens. This helps with readability // and consistency. - if (!isNewString && !isNewLine && lastToken != EndOfInput && - (unNeededSpaceTokens.find((char)token) == std::string::npos) && - (unNeededSpaceTokens.find((char)lastToken) == std::string::npos) && - (noSpaceBeforeTokens.find((char)token) == std::string::npos)) { - outputBuffer += ' '; + if (!isNewString && !isNewLine && lastToken != EndOfInput) { + // left parenthesis need a leading space, except it is in a function-call-like context. + // examples: `for (xxx)`, `a * (b + c)`, `vec(2.0)`, `foo(x, y, z)` + if (token == '(') { + if (lastToken != PpAtomIdentifier || + lastTokenName == "if" || + lastTokenName == "for" || + lastTokenName == "while" || + lastTokenName == "switch") + outputBuffer += ' '; + } else if ((noNeededSpaceBeforeTokens.find((char)token) == std::string::npos) && + (noNeededSpaceAfterTokens.find((char)lastToken) == std::string::npos)) { + outputBuffer += ' '; + } } + if (token == PpAtomIdentifier) + lastTokenName = ppToken.name; lastToken = token; if (token == PpAtomConstString) outputBuffer += "\""; @@ -1279,14 +1293,15 @@ bool CompileDeferred( TIntermediate& intermediate,// returned tree, etc. TShader::Includer& includer, const std::string sourceEntryPointName = "", - TEnvironment* environment = nullptr) + TEnvironment* environment = nullptr, + bool compileOnly = false) { DoFullParse parser; return ProcessDeferred(compiler, shaderStrings, numStrings, inputLengths, stringNames, preamble, optLevel, resources, defaultVersion, defaultProfile, forceDefaultVersionAndProfile, overrideVersion, forwardCompatible, messages, intermediate, parser, - true, includer, sourceEntryPointName, environment); + true, includer, sourceEntryPointName, environment, compileOnly); } } // end anonymous namespace for local functions @@ -1867,7 +1882,7 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion preamble, EShOptNone, builtInResources, defaultVersion, defaultProfile, forceDefaultVersionAndProfile, overrideVersion, forwardCompatible, messages, *intermediate, includer, sourceEntryPointName, - &environment); + &environment, compileOnly); } // Fill in a string with the result of preprocessing ShaderStrings diff --git a/thirdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp b/thirdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp index 4e130c31be..1d08797ac2 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp @@ -45,11 +45,11 @@ namespace glslang { bool TSpirvTypeParameter::operator==(const TSpirvTypeParameter& rhs) const { - if (constant != nullptr) - return constant->getConstArray() == rhs.constant->getConstArray(); + if (getAsConstant() != nullptr) + return getAsConstant()->getConstArray() == rhs.getAsConstant()->getConstArray(); - assert(type != nullptr); - return *type == *rhs.type; + assert(getAsType() != nullptr); + return *getAsType() == *rhs.getAsType(); } // diff --git a/thirdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp b/thirdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp index 1e007a7120..dae5a8b918 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -318,6 +318,16 @@ void TSymbolTableLevel::setFunctionExtensions(const char* name, int num, const c } } +// Make a single function require an extension(s). i.e., this will only set the extensions for the symbol that matches 'name' exactly. +// This is different from setFunctionExtensions, which uses std::map::lower_bound to effectively set all symbols that start with 'name'. +// Should only be used for a version/profile that actually needs the extension(s). +void TSymbolTableLevel::setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]) +{ + if (auto candidate = level.find(name); candidate != level.end()) { + candidate->second->setExtensions(num, extensions); + } +} + // // Make all symbols in this table level read only. // diff --git a/thirdparty/glslang/glslang/MachineIndependent/SymbolTable.h b/thirdparty/glslang/glslang/MachineIndependent/SymbolTable.h index fc86ad6229..94c3929da2 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/SymbolTable.h +++ b/thirdparty/glslang/glslang/MachineIndependent/SymbolTable.h @@ -246,7 +246,8 @@ public: TSymbol(name), mangledName(*name + '('), op(tOp), - defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0) + defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0), + linkType(ELinkNone) { returnType.shallowCopy(retType); declaredBuiltIn = retType.getQualifier().builtIn; @@ -326,6 +327,9 @@ public: virtual void dump(TInfoSink& infoSink, bool complete = false) const override; + void setExport() { linkType = ELinkExport; } + TLinkType getLinkType() const { return linkType; } + protected: explicit TFunction(const TFunction&); TFunction& operator=(const TFunction&); @@ -347,6 +351,7 @@ protected: int defaultParamCount; TSpirvInstruction spirvInst; // SPIR-V instruction qualifiers + TLinkType linkType; }; // @@ -571,6 +576,7 @@ public: void relateToOperator(const char* name, TOperator op); void setFunctionExtensions(const char* name, int num, const char* const extensions[]); + void setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]); void dump(TInfoSink& infoSink, bool complete = false) const; TSymbolTableLevel* clone() const; void readOnly(); @@ -872,6 +878,12 @@ public: table[level]->setFunctionExtensions(name, num, extensions); } + void setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]) + { + for (unsigned int level = 0; level < table.size(); ++level) + table[level]->setSingleFunctionExtensions(name, num, extensions); + } + void setVariableExtensions(const char* name, int numExts, const char* const extensions[]) { TSymbol* symbol = find(TString(name)); diff --git a/thirdparty/glslang/glslang/MachineIndependent/Versions.cpp b/thirdparty/glslang/glslang/MachineIndependent/Versions.cpp index 40cf3ed81e..bede71604e 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/Versions.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/Versions.cpp @@ -297,16 +297,18 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_NV_compute_shader_derivatives] = EBhDisable; extensionBehavior[E_GL_NV_shader_texture_footprint] = EBhDisable; extensionBehavior[E_GL_NV_mesh_shader] = EBhDisable; - extensionBehavior[E_GL_NV_cooperative_matrix] = EBhDisable; extensionBehavior[E_GL_NV_shader_sm_builtins] = EBhDisable; extensionBehavior[E_GL_NV_integer_cooperative_matrix] = EBhDisable; - extensionBehavior[E_GL_NV_shader_invocation_reorder] = EBhDisable; + extensionBehavior[E_GL_NV_displacement_micromap] = EBhDisable; // ARM extensionBehavior[E_GL_ARM_shader_core_builtins] = EBhDisable; + // QCOM + extensionBehavior[E_GL_QCOM_image_processing] = EBhDisable; + // AEP extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable; extensionBehavior[E_GL_KHR_blend_equation_advanced] = EBhDisable; @@ -356,6 +358,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_opacity_micromap] = EBhDisable; extensionBehavior[E_GL_EXT_ray_tracing_position_fetch] = EBhDisable; extensionBehavior[E_GL_EXT_shader_tile_image] = EBhDisable; + extensionBehavior[E_GL_EXT_texture_shadow_lod] = EBhDisable; // OVR extensions extensionBehavior[E_GL_OVR_multiview] = EBhDisable; @@ -431,6 +434,8 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_OES_texture_buffer 1\n" "#define GL_OES_texture_cube_map_array 1\n" "#define GL_EXT_shader_non_constant_global_initializers 1\n" + + "#define GL_QCOM_image_processing 1\n" ; if (version >= 300) { @@ -555,6 +560,8 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_NV_integer_cooperative_matrix 1\n" "#define GL_NV_shader_invocation_reorder 1\n" + "#define GL_QCOM_image_processing 1\n" + "#define GL_EXT_shader_explicit_arithmetic_types 1\n" "#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n" "#define GL_EXT_shader_explicit_arithmetic_types_int16 1\n" diff --git a/thirdparty/glslang/glslang/MachineIndependent/Versions.h b/thirdparty/glslang/glslang/MachineIndependent/Versions.h index 29ebed248e..0ebace9bb2 100755 --- a/thirdparty/glslang/glslang/MachineIndependent/Versions.h +++ b/thirdparty/glslang/glslang/MachineIndependent/Versions.h @@ -266,7 +266,12 @@ const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragmen const char* const E_GL_NV_compute_shader_derivatives = "GL_NV_compute_shader_derivatives"; const char* const E_GL_NV_shader_texture_footprint = "GL_NV_shader_texture_footprint"; const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_shader"; +const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix"; +const char* const E_GL_NV_shader_sm_builtins = "GL_NV_shader_sm_builtins"; +const char* const E_GL_NV_integer_cooperative_matrix = "GL_NV_integer_cooperative_matrix"; +const char* const E_GL_NV_shader_invocation_reorder = "GL_NV_shader_invocation_reorder"; const char* const E_GL_EXT_ray_tracing_position_fetch = "GL_EXT_ray_tracing_position_fetch"; +const char* const E_GL_NV_displacement_micromap = "GL_NV_displacement_micromap"; // ARM const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader_core_builtins"; @@ -276,10 +281,8 @@ const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader const char* const viewportEXTs[] = { E_GL_ARB_shader_viewport_layer_array, E_GL_NV_viewport_array2 }; const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]); -const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix"; -const char* const E_GL_NV_shader_sm_builtins = "GL_NV_shader_sm_builtins"; -const char* const E_GL_NV_integer_cooperative_matrix = "GL_NV_integer_cooperative_matrix"; -const char* const E_GL_NV_shader_invocation_reorder = "GL_NV_shader_invocation_reorder"; + +const char* const E_GL_QCOM_image_processing = "GL_QCOM_image_processing"; // AEP const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a"; @@ -331,6 +334,8 @@ const char* const E_GL_EXT_shader_atomic_float2 = "GL_EXT_shader_atomic_float2"; const char* const E_GL_EXT_shader_tile_image = "GL_EXT_shader_tile_image"; +const char* const E_GL_EXT_texture_shadow_lod = "GL_EXT_texture_shadow_lod"; + // Arrays of extensions for the above AEP duplications const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader }; diff --git a/thirdparty/glslang/glslang/MachineIndependent/attribute.cpp b/thirdparty/glslang/glslang/MachineIndependent/attribute.cpp index 21ef736870..a167c494fb 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/attribute.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/attribute.cpp @@ -123,6 +123,8 @@ TAttributeType TParseContext::attributeFromName(const TString& name) const return EatPartialCount; else if (name == "subgroup_uniform_control_flow") return EatSubgroupUniformControlFlow; + else if (name == "export") + return EatExport; else return EatNone; } @@ -355,6 +357,7 @@ void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttri switch (it->name) { case EatSubgroupUniformControlFlow: + requireExtensions(loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); intermediate.setSubgroupUniformControlFlow(); break; default: diff --git a/thirdparty/glslang/glslang/MachineIndependent/attribute.h b/thirdparty/glslang/glslang/MachineIndependent/attribute.h index c5b29176c4..a0c4c43d45 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/attribute.h +++ b/thirdparty/glslang/glslang/MachineIndependent/attribute.h @@ -120,6 +120,7 @@ namespace glslang { EatNonWritable, EatNonReadable, EatSubgroupUniformControlFlow, + EatExport, }; class TIntermAggregate; diff --git a/thirdparty/glslang/glslang/MachineIndependent/glslang.y b/thirdparty/glslang/glslang/MachineIndependent/glslang.y index d47f29259a..99f0d388bc 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/glslang.y +++ b/thirdparty/glslang/glslang/MachineIndependent/glslang.y @@ -941,24 +941,25 @@ identifier_list function_prototype : function_declarator RIGHT_PAREN { $$.function = $1; + if (parseContext.compileOnly) $$.function->setExport(); $$.loc = $2.loc; } | function_declarator RIGHT_PAREN attribute { $$.function = $1; + if (parseContext.compileOnly) $$.function->setExport(); $$.loc = $2.loc; - parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes($2.loc, *$3); } | attribute function_declarator RIGHT_PAREN { $$.function = $2; + if (parseContext.compileOnly) $$.function->setExport(); $$.loc = $3.loc; - parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes($3.loc, *$1); } | attribute function_declarator RIGHT_PAREN attribute { $$.function = $2; + if (parseContext.compileOnly) $$.function->setExport(); $$.loc = $3.loc; - parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes($3.loc, *$1); parseContext.handleFunctionAttributes($3.loc, *$4); } @@ -4088,6 +4089,7 @@ function_definition parseContext.error($1.loc, "function does not return a value:", "", $1.function->getName().c_str()); parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); $$ = parseContext.intermediate.growAggregate($1.intermNode, $3); + $$->getAsAggregate()->setLinkType($1.function->getLinkType()); parseContext.intermediate.setAggregateOperator($$, EOpFunction, $1.function->getType(), $1.loc); $$->getAsAggregate()->setName($1.function->getMangledName().c_str()); diff --git a/thirdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp b/thirdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp index a265abc802..534bee13cb 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -67,7 +67,7 @@ /* First part of user prologue. */ -#line 69 "MachineIndependent/glslang.y" +#line 44 "MachineIndependent/glslang.y" /* Based on: @@ -723,7 +723,7 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; /* Second part of user prologue. */ -#line 136 "MachineIndependent/glslang.y" +#line 111 "MachineIndependent/glslang.y" /* windows only pragma */ @@ -1167,77 +1167,77 @@ static const yytype_int16 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 395, 395, 401, 404, 409, 412, 415, 419, 423, - 426, 430, 434, 438, 442, 446, 450, 456, 464, 467, - 470, 473, 476, 481, 489, 496, 503, 509, 513, 520, - 523, 529, 536, 546, 554, 559, 587, 596, 602, 606, - 610, 630, 631, 632, 633, 639, 640, 645, 650, 659, - 660, 665, 673, 674, 680, 689, 690, 695, 700, 705, - 713, 714, 723, 735, 736, 745, 746, 755, 756, 765, - 766, 774, 775, 783, 784, 792, 793, 793, 811, 812, - 828, 832, 836, 840, 845, 849, 853, 857, 861, 865, - 869, 876, 879, 890, 897, 903, 910, 916, 921, 928, - 932, 936, 940, 945, 950, 959, 959, 970, 974, 981, - 985, 991, 997, 1007, 1010, 1017, 1025, 1045, 1068, 1083, - 1108, 1119, 1129, 1139, 1149, 1158, 1161, 1165, 1169, 1174, - 1182, 1189, 1194, 1199, 1204, 1213, 1223, 1250, 1259, 1266, - 1274, 1281, 1288, 1296, 1304, 1314, 1324, 1331, 1342, 1348, - 1351, 1358, 1362, 1366, 1375, 1385, 1388, 1399, 1402, 1405, - 1409, 1413, 1418, 1422, 1425, 1430, 1434, 1439, 1448, 1452, - 1457, 1463, 1469, 1476, 1481, 1486, 1494, 1500, 1512, 1526, - 1532, 1537, 1545, 1553, 1561, 1569, 1577, 1585, 1593, 1601, - 1609, 1616, 1623, 1627, 1632, 1637, 1642, 1647, 1652, 1657, - 1661, 1665, 1669, 1673, 1679, 1685, 1697, 1704, 1707, 1716, - 1723, 1734, 1739, 1747, 1751, 1761, 1764, 1770, 1776, 1781, - 1789, 1799, 1803, 1807, 1811, 1816, 1820, 1825, 1830, 1835, - 1840, 1845, 1850, 1855, 1860, 1865, 1871, 1877, 1883, 1888, - 1893, 1898, 1903, 1908, 1913, 1918, 1923, 1928, 1933, 1938, - 1944, 1951, 1956, 1961, 1966, 1971, 1976, 1981, 1986, 1991, - 1996, 2001, 2006, 2014, 2022, 2030, 2036, 2042, 2048, 2054, - 2060, 2066, 2072, 2078, 2084, 2090, 2096, 2102, 2108, 2114, - 2120, 2126, 2132, 2138, 2144, 2150, 2156, 2162, 2168, 2174, - 2180, 2186, 2192, 2198, 2204, 2210, 2216, 2222, 2228, 2236, - 2244, 2252, 2260, 2268, 2276, 2284, 2292, 2300, 2308, 2316, - 2324, 2330, 2336, 2342, 2348, 2354, 2360, 2366, 2372, 2378, - 2384, 2390, 2396, 2402, 2408, 2414, 2420, 2426, 2432, 2438, - 2444, 2450, 2456, 2462, 2468, 2474, 2480, 2486, 2492, 2498, - 2504, 2510, 2516, 2522, 2528, 2534, 2540, 2544, 2548, 2552, - 2557, 2563, 2568, 2573, 2578, 2583, 2588, 2593, 2599, 2604, - 2609, 2614, 2619, 2624, 2630, 2636, 2642, 2648, 2654, 2660, - 2666, 2672, 2678, 2684, 2690, 2696, 2702, 2708, 2713, 2718, - 2723, 2728, 2733, 2738, 2744, 2749, 2754, 2759, 2764, 2769, - 2774, 2779, 2785, 2790, 2795, 2800, 2805, 2810, 2815, 2820, - 2825, 2830, 2835, 2840, 2845, 2850, 2855, 2861, 2866, 2871, - 2877, 2883, 2888, 2893, 2898, 2904, 2909, 2914, 2919, 2925, - 2930, 2935, 2940, 2946, 2951, 2956, 2961, 2967, 2973, 2979, - 2985, 2990, 2996, 3002, 3008, 3013, 3018, 3023, 3028, 3033, - 3039, 3044, 3049, 3054, 3060, 3065, 3070, 3075, 3081, 3086, - 3091, 3096, 3102, 3107, 3112, 3117, 3123, 3128, 3133, 3138, - 3144, 3149, 3154, 3159, 3165, 3170, 3175, 3180, 3186, 3191, - 3196, 3201, 3207, 3212, 3217, 3222, 3228, 3233, 3238, 3243, - 3249, 3254, 3259, 3264, 3270, 3275, 3280, 3285, 3291, 3296, - 3301, 3306, 3312, 3317, 3322, 3327, 3333, 3338, 3343, 3348, - 3353, 3358, 3363, 3368, 3373, 3378, 3383, 3388, 3393, 3398, - 3403, 3408, 3413, 3418, 3423, 3428, 3433, 3438, 3443, 3448, - 3453, 3459, 3465, 3471, 3477, 3483, 3489, 3495, 3502, 3509, - 3515, 3521, 3527, 3533, 3540, 3547, 3554, 3561, 3565, 3570, - 3575, 3591, 3596, 3601, 3609, 3609, 3620, 3620, 3630, 3633, - 3646, 3668, 3695, 3699, 3705, 3710, 3721, 3725, 3731, 3737, - 3748, 3751, 3758, 3762, 3763, 3769, 3770, 3771, 3772, 3773, - 3774, 3775, 3777, 3783, 3792, 3793, 3797, 3793, 3809, 3810, - 3814, 3814, 3821, 3821, 3835, 3838, 3846, 3854, 3865, 3866, - 3870, 3874, 3882, 3889, 3893, 3901, 3905, 3918, 3922, 3930, - 3930, 3950, 3953, 3959, 3971, 3983, 3987, 3995, 3995, 4010, - 4010, 4028, 4028, 4049, 4052, 4058, 4061, 4067, 4071, 4078, - 4083, 4088, 4095, 4098, 4102, 4107, 4111, 4121, 4125, 4134, - 4137, 4141, 4150, 4150, 4192, 4197, 4200, 4205, 4208, 4215, - 4218, 4223, 4226, 4231, 4234, 4239, 4242, 4247, 4251, 4256, - 4260, 4265, 4269, 4276, 4279, 4284, 4287, 4290, 4293, 4296, - 4301, 4310, 4321, 4326, 4334, 4338, 4343, 4347, 4352, 4356, - 4361, 4365, 4372, 4375, 4380, 4383, 4386, 4389, 4394, 4397, - 4402, 4408, 4411, 4414, 4417, 4422, 4426, 4431, 4435, 4440, - 4444, 4451, 4454, 4459, 4462, 4467, 4470, 4476, 4479, 4484, - 4487 + 0, 362, 362, 368, 371, 376, 379, 382, 386, 389, + 392, 396, 400, 404, 408, 412, 416, 422, 429, 432, + 435, 438, 441, 446, 454, 461, 468, 474, 478, 485, + 488, 494, 501, 511, 519, 524, 551, 559, 565, 569, + 573, 593, 594, 595, 596, 602, 603, 608, 613, 622, + 623, 628, 636, 637, 643, 652, 653, 658, 663, 668, + 676, 677, 686, 698, 699, 708, 709, 718, 719, 728, + 729, 737, 738, 746, 747, 755, 756, 756, 774, 775, + 791, 795, 799, 803, 808, 812, 816, 820, 824, 828, + 832, 839, 842, 853, 860, 865, 872, 877, 882, 889, + 893, 897, 901, 906, 911, 920, 920, 931, 935, 942, + 947, 953, 959, 969, 972, 979, 987, 1007, 1030, 1045, + 1070, 1081, 1091, 1101, 1111, 1120, 1123, 1127, 1131, 1136, + 1144, 1149, 1154, 1159, 1164, 1173, 1183, 1210, 1219, 1226, + 1233, 1240, 1247, 1255, 1263, 1273, 1283, 1290, 1300, 1306, + 1309, 1316, 1320, 1324, 1332, 1341, 1344, 1355, 1358, 1361, + 1365, 1369, 1373, 1377, 1380, 1385, 1389, 1394, 1402, 1406, + 1411, 1417, 1423, 1430, 1435, 1440, 1448, 1453, 1465, 1479, + 1485, 1490, 1498, 1506, 1514, 1522, 1530, 1538, 1546, 1554, + 1562, 1569, 1576, 1580, 1585, 1590, 1595, 1600, 1605, 1610, + 1614, 1618, 1622, 1626, 1632, 1638, 1648, 1655, 1658, 1666, + 1673, 1684, 1689, 1697, 1701, 1711, 1714, 1720, 1726, 1731, + 1739, 1749, 1753, 1757, 1761, 1766, 1770, 1775, 1780, 1785, + 1790, 1795, 1800, 1805, 1810, 1815, 1821, 1827, 1833, 1838, + 1843, 1848, 1853, 1858, 1863, 1868, 1873, 1878, 1883, 1888, + 1893, 1900, 1905, 1910, 1915, 1920, 1925, 1930, 1935, 1940, + 1945, 1950, 1955, 1963, 1971, 1979, 1985, 1991, 1997, 2003, + 2009, 2015, 2021, 2027, 2033, 2039, 2045, 2051, 2057, 2063, + 2069, 2075, 2081, 2087, 2093, 2099, 2105, 2111, 2117, 2123, + 2129, 2135, 2141, 2147, 2153, 2159, 2165, 2171, 2177, 2185, + 2193, 2201, 2209, 2217, 2225, 2233, 2241, 2249, 2257, 2265, + 2273, 2279, 2285, 2291, 2297, 2303, 2309, 2315, 2321, 2327, + 2333, 2339, 2345, 2351, 2357, 2363, 2369, 2375, 2381, 2387, + 2393, 2399, 2405, 2411, 2417, 2423, 2429, 2435, 2441, 2447, + 2453, 2459, 2465, 2471, 2477, 2483, 2489, 2493, 2497, 2501, + 2506, 2511, 2516, 2521, 2526, 2531, 2536, 2541, 2546, 2551, + 2556, 2561, 2566, 2571, 2577, 2583, 2589, 2595, 2601, 2607, + 2613, 2619, 2625, 2631, 2637, 2643, 2649, 2654, 2659, 2664, + 2669, 2674, 2679, 2684, 2689, 2694, 2699, 2704, 2709, 2714, + 2719, 2724, 2729, 2734, 2739, 2744, 2749, 2754, 2759, 2764, + 2769, 2774, 2779, 2784, 2789, 2794, 2799, 2804, 2809, 2814, + 2820, 2826, 2831, 2836, 2841, 2847, 2852, 2857, 2862, 2868, + 2873, 2878, 2883, 2889, 2894, 2899, 2904, 2910, 2916, 2922, + 2928, 2933, 2939, 2945, 2951, 2956, 2961, 2966, 2971, 2976, + 2982, 2987, 2992, 2997, 3003, 3008, 3013, 3018, 3024, 3029, + 3034, 3039, 3045, 3050, 3055, 3060, 3066, 3071, 3076, 3081, + 3087, 3092, 3097, 3102, 3108, 3113, 3118, 3123, 3129, 3134, + 3139, 3144, 3150, 3155, 3160, 3165, 3171, 3176, 3181, 3186, + 3192, 3197, 3202, 3207, 3213, 3218, 3223, 3228, 3234, 3239, + 3244, 3249, 3255, 3260, 3265, 3270, 3276, 3281, 3286, 3291, + 3296, 3301, 3306, 3311, 3316, 3321, 3326, 3331, 3336, 3341, + 3346, 3351, 3356, 3361, 3366, 3371, 3376, 3381, 3386, 3391, + 3396, 3402, 3408, 3414, 3420, 3426, 3432, 3438, 3445, 3452, + 3458, 3464, 3470, 3476, 3483, 3490, 3497, 3504, 3508, 3512, + 3517, 3533, 3538, 3543, 3551, 3551, 3562, 3562, 3572, 3575, + 3588, 3610, 3637, 3641, 3647, 3652, 3663, 3666, 3672, 3678, + 3687, 3690, 3696, 3700, 3701, 3707, 3708, 3709, 3710, 3711, + 3712, 3713, 3714, 3718, 3726, 3727, 3731, 3727, 3743, 3744, + 3748, 3748, 3755, 3755, 3769, 3772, 3780, 3788, 3799, 3800, + 3804, 3807, 3814, 3821, 3825, 3833, 3837, 3850, 3853, 3860, + 3860, 3880, 3883, 3889, 3901, 3913, 3916, 3923, 3923, 3938, + 3938, 3956, 3956, 3977, 3980, 3986, 3989, 3995, 3999, 4006, + 4011, 4016, 4023, 4026, 4030, 4034, 4038, 4047, 4051, 4060, + 4063, 4066, 4074, 4074, 4116, 4121, 4124, 4129, 4132, 4137, + 4140, 4145, 4148, 4153, 4156, 4161, 4164, 4169, 4173, 4178, + 4182, 4187, 4191, 4198, 4201, 4206, 4209, 4212, 4215, 4218, + 4223, 4232, 4243, 4248, 4256, 4260, 4265, 4269, 4274, 4278, + 4283, 4287, 4294, 4297, 4302, 4305, 4308, 4311, 4316, 4319, + 4324, 4330, 4333, 4336, 4339, 4344, 4348, 4353, 4357, 4362, + 4366, 4373, 4376, 4381, 4384, 4389, 4392, 4398, 4401, 4406, + 4409 }; #endif @@ -5210,7 +5210,7 @@ yyreduce: switch (yyn) { case 2: /* variable_identifier: IDENTIFIER */ -#line 395 "MachineIndependent/glslang.y" +#line 362 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); } @@ -5218,7 +5218,7 @@ yyreduce: break; case 3: /* primary_expression: variable_identifier */ -#line 401 "MachineIndependent/glslang.y" +#line 368 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } @@ -5226,7 +5226,7 @@ yyreduce: break; case 4: /* primary_expression: LEFT_PAREN expression RIGHT_PAREN */ -#line 404 "MachineIndependent/glslang.y" +#line 371 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) @@ -5236,7 +5236,7 @@ yyreduce: break; case 5: /* primary_expression: FLOATCONSTANT */ -#line 409 "MachineIndependent/glslang.y" +#line 376 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } @@ -5244,7 +5244,7 @@ yyreduce: break; case 6: /* primary_expression: INTCONSTANT */ -#line 412 "MachineIndependent/glslang.y" +#line 379 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } @@ -5252,7 +5252,7 @@ yyreduce: break; case 7: /* primary_expression: UINTCONSTANT */ -#line 415 "MachineIndependent/glslang.y" +#line 382 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); @@ -5261,7 +5261,7 @@ yyreduce: break; case 8: /* primary_expression: BOOLCONSTANT */ -#line 419 "MachineIndependent/glslang.y" +#line 386 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } @@ -5269,7 +5269,7 @@ yyreduce: break; case 9: /* primary_expression: STRING_LITERAL */ -#line 423 "MachineIndependent/glslang.y" +#line 389 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } @@ -5277,7 +5277,7 @@ yyreduce: break; case 10: /* primary_expression: INT32CONSTANT */ -#line 426 "MachineIndependent/glslang.y" +#line 392 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); @@ -5286,7 +5286,7 @@ yyreduce: break; case 11: /* primary_expression: UINT32CONSTANT */ -#line 430 "MachineIndependent/glslang.y" +#line 396 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); @@ -5295,7 +5295,7 @@ yyreduce: break; case 12: /* primary_expression: INT64CONSTANT */ -#line 434 "MachineIndependent/glslang.y" +#line 400 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); @@ -5304,7 +5304,7 @@ yyreduce: break; case 13: /* primary_expression: UINT64CONSTANT */ -#line 438 "MachineIndependent/glslang.y" +#line 404 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); @@ -5313,7 +5313,7 @@ yyreduce: break; case 14: /* primary_expression: INT16CONSTANT */ -#line 442 "MachineIndependent/glslang.y" +#line 408 "MachineIndependent/glslang.y" { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); @@ -5322,7 +5322,7 @@ yyreduce: break; case 15: /* primary_expression: UINT16CONSTANT */ -#line 446 "MachineIndependent/glslang.y" +#line 412 "MachineIndependent/glslang.y" { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); @@ -5331,7 +5331,7 @@ yyreduce: break; case 16: /* primary_expression: DOUBLECONSTANT */ -#line 450 "MachineIndependent/glslang.y" +#line 416 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double literal"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -5342,7 +5342,7 @@ yyreduce: break; case 17: /* primary_expression: FLOAT16CONSTANT */ -#line 456 "MachineIndependent/glslang.y" +#line 422 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); @@ -5351,7 +5351,7 @@ yyreduce: break; case 18: /* postfix_expression: primary_expression */ -#line 464 "MachineIndependent/glslang.y" +#line 429 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } @@ -5359,7 +5359,7 @@ yyreduce: break; case 19: /* postfix_expression: postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET */ -#line 467 "MachineIndependent/glslang.y" +#line 432 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); } @@ -5367,7 +5367,7 @@ yyreduce: break; case 20: /* postfix_expression: function_call */ -#line 470 "MachineIndependent/glslang.y" +#line 435 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } @@ -5375,7 +5375,7 @@ yyreduce: break; case 21: /* postfix_expression: postfix_expression DOT IDENTIFIER */ -#line 473 "MachineIndependent/glslang.y" +#line 438 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); } @@ -5383,7 +5383,7 @@ yyreduce: break; case 22: /* postfix_expression: postfix_expression INC_OP */ -#line 476 "MachineIndependent/glslang.y" +#line 441 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); @@ -5393,7 +5393,7 @@ yyreduce: break; case 23: /* postfix_expression: postfix_expression DEC_OP */ -#line 481 "MachineIndependent/glslang.y" +#line 446 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); @@ -5403,7 +5403,7 @@ yyreduce: break; case 24: /* integer_expression: expression */ -#line 489 "MachineIndependent/glslang.y" +#line 454 "MachineIndependent/glslang.y" { parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); @@ -5412,7 +5412,7 @@ yyreduce: break; case 25: /* function_call: function_call_or_method */ -#line 496 "MachineIndependent/glslang.y" +#line 461 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); delete (yyvsp[0].interm).function; @@ -5421,7 +5421,7 @@ yyreduce: break; case 26: /* function_call_or_method: function_call_generic */ -#line 503 "MachineIndependent/glslang.y" +#line 468 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } @@ -5429,7 +5429,7 @@ yyreduce: break; case 27: /* function_call_generic: function_call_header_with_parameters RIGHT_PAREN */ -#line 509 "MachineIndependent/glslang.y" +#line 474 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; @@ -5438,7 +5438,7 @@ yyreduce: break; case 28: /* function_call_generic: function_call_header_no_parameters RIGHT_PAREN */ -#line 513 "MachineIndependent/glslang.y" +#line 478 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; @@ -5447,7 +5447,7 @@ yyreduce: break; case 29: /* function_call_header_no_parameters: function_call_header VOID */ -#line 520 "MachineIndependent/glslang.y" +#line 485 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); } @@ -5455,7 +5455,7 @@ yyreduce: break; case 30: /* function_call_header_no_parameters: function_call_header */ -#line 523 "MachineIndependent/glslang.y" +#line 488 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } @@ -5463,7 +5463,7 @@ yyreduce: break; case 31: /* function_call_header_with_parameters: function_call_header assignment_expression */ -#line 529 "MachineIndependent/glslang.y" +#line 494 "MachineIndependent/glslang.y" { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -5475,7 +5475,7 @@ yyreduce: break; case 32: /* function_call_header_with_parameters: function_call_header_with_parameters COMMA assignment_expression */ -#line 536 "MachineIndependent/glslang.y" +#line 501 "MachineIndependent/glslang.y" { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -5487,7 +5487,7 @@ yyreduce: break; case 33: /* function_call_header: function_identifier LEFT_PAREN */ -#line 546 "MachineIndependent/glslang.y" +#line 511 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); } @@ -5495,7 +5495,7 @@ yyreduce: break; case 34: /* function_identifier: type_specifier */ -#line 554 "MachineIndependent/glslang.y" +#line 519 "MachineIndependent/glslang.y" { // Constructor (yyval.interm).intermNode = 0; @@ -5505,7 +5505,7 @@ yyreduce: break; case 35: /* function_identifier: postfix_expression */ -#line 559 "MachineIndependent/glslang.y" +#line 524 "MachineIndependent/glslang.y" { // // Should be a method or subroutine call, but we haven't recognized the arguments yet. @@ -5537,7 +5537,7 @@ yyreduce: break; case 36: /* function_identifier: non_uniform_qualifier */ -#line 587 "MachineIndependent/glslang.y" +#line 551 "MachineIndependent/glslang.y" { // Constructor (yyval.interm).intermNode = 0; @@ -5547,7 +5547,7 @@ yyreduce: break; case 37: /* unary_expression: postfix_expression */ -#line 596 "MachineIndependent/glslang.y" +#line 559 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); @@ -5558,7 +5558,7 @@ yyreduce: break; case 38: /* unary_expression: INC_OP unary_expression */ -#line 602 "MachineIndependent/glslang.y" +#line 565 "MachineIndependent/glslang.y" { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); @@ -5567,7 +5567,7 @@ yyreduce: break; case 39: /* unary_expression: DEC_OP unary_expression */ -#line 606 "MachineIndependent/glslang.y" +#line 569 "MachineIndependent/glslang.y" { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); @@ -5576,7 +5576,7 @@ yyreduce: break; case 40: /* unary_expression: unary_operator unary_expression */ -#line 610 "MachineIndependent/glslang.y" +#line 573 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm).op != EOpNull) { char errorOp[2] = {0, 0}; @@ -5597,38 +5597,38 @@ yyreduce: break; case 41: /* unary_operator: PLUS */ -#line 630 "MachineIndependent/glslang.y" +#line 593 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } #line 5603 "MachineIndependent/glslang_tab.cpp" break; case 42: /* unary_operator: DASH */ -#line 631 "MachineIndependent/glslang.y" +#line 594 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } #line 5609 "MachineIndependent/glslang_tab.cpp" break; case 43: /* unary_operator: BANG */ -#line 632 "MachineIndependent/glslang.y" +#line 595 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } #line 5615 "MachineIndependent/glslang_tab.cpp" break; case 44: /* unary_operator: TILDE */ -#line 633 "MachineIndependent/glslang.y" +#line 596 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } #line 5622 "MachineIndependent/glslang_tab.cpp" break; case 45: /* multiplicative_expression: unary_expression */ -#line 639 "MachineIndependent/glslang.y" +#line 602 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5628 "MachineIndependent/glslang_tab.cpp" break; case 46: /* multiplicative_expression: multiplicative_expression STAR unary_expression */ -#line 640 "MachineIndependent/glslang.y" +#line 603 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) @@ -5638,7 +5638,7 @@ yyreduce: break; case 47: /* multiplicative_expression: multiplicative_expression SLASH unary_expression */ -#line 645 "MachineIndependent/glslang.y" +#line 608 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) @@ -5648,7 +5648,7 @@ yyreduce: break; case 48: /* multiplicative_expression: multiplicative_expression PERCENT unary_expression */ -#line 650 "MachineIndependent/glslang.y" +#line 613 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); @@ -5659,13 +5659,13 @@ yyreduce: break; case 49: /* additive_expression: multiplicative_expression */ -#line 659 "MachineIndependent/glslang.y" +#line 622 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5665 "MachineIndependent/glslang_tab.cpp" break; case 50: /* additive_expression: additive_expression PLUS multiplicative_expression */ -#line 660 "MachineIndependent/glslang.y" +#line 623 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) @@ -5675,7 +5675,7 @@ yyreduce: break; case 51: /* additive_expression: additive_expression DASH multiplicative_expression */ -#line 665 "MachineIndependent/glslang.y" +#line 628 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) @@ -5685,13 +5685,13 @@ yyreduce: break; case 52: /* shift_expression: additive_expression */ -#line 673 "MachineIndependent/glslang.y" +#line 636 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5691 "MachineIndependent/glslang_tab.cpp" break; case 53: /* shift_expression: shift_expression LEFT_OP additive_expression */ -#line 674 "MachineIndependent/glslang.y" +#line 637 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); @@ -5702,7 +5702,7 @@ yyreduce: break; case 54: /* shift_expression: shift_expression RIGHT_OP additive_expression */ -#line 680 "MachineIndependent/glslang.y" +#line 643 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); @@ -5713,13 +5713,13 @@ yyreduce: break; case 55: /* relational_expression: shift_expression */ -#line 689 "MachineIndependent/glslang.y" +#line 652 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5719 "MachineIndependent/glslang_tab.cpp" break; case 56: /* relational_expression: relational_expression LEFT_ANGLE shift_expression */ -#line 690 "MachineIndependent/glslang.y" +#line 653 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) @@ -5729,7 +5729,7 @@ yyreduce: break; case 57: /* relational_expression: relational_expression RIGHT_ANGLE shift_expression */ -#line 695 "MachineIndependent/glslang.y" +#line 658 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) @@ -5739,7 +5739,7 @@ yyreduce: break; case 58: /* relational_expression: relational_expression LE_OP shift_expression */ -#line 700 "MachineIndependent/glslang.y" +#line 663 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) @@ -5749,7 +5749,7 @@ yyreduce: break; case 59: /* relational_expression: relational_expression GE_OP shift_expression */ -#line 705 "MachineIndependent/glslang.y" +#line 668 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) @@ -5759,13 +5759,13 @@ yyreduce: break; case 60: /* equality_expression: relational_expression */ -#line 713 "MachineIndependent/glslang.y" +#line 676 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5765 "MachineIndependent/glslang_tab.cpp" break; case 61: /* equality_expression: equality_expression EQ_OP relational_expression */ -#line 714 "MachineIndependent/glslang.y" +#line 677 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); @@ -5779,7 +5779,7 @@ yyreduce: break; case 62: /* equality_expression: equality_expression NE_OP relational_expression */ -#line 723 "MachineIndependent/glslang.y" +#line 686 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); @@ -5793,13 +5793,13 @@ yyreduce: break; case 63: /* and_expression: equality_expression */ -#line 735 "MachineIndependent/glslang.y" +#line 698 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5799 "MachineIndependent/glslang_tab.cpp" break; case 64: /* and_expression: and_expression AMPERSAND equality_expression */ -#line 736 "MachineIndependent/glslang.y" +#line 699 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); @@ -5810,13 +5810,13 @@ yyreduce: break; case 65: /* exclusive_or_expression: and_expression */ -#line 745 "MachineIndependent/glslang.y" +#line 708 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5816 "MachineIndependent/glslang_tab.cpp" break; case 66: /* exclusive_or_expression: exclusive_or_expression CARET and_expression */ -#line 746 "MachineIndependent/glslang.y" +#line 709 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); @@ -5827,13 +5827,13 @@ yyreduce: break; case 67: /* inclusive_or_expression: exclusive_or_expression */ -#line 755 "MachineIndependent/glslang.y" +#line 718 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5833 "MachineIndependent/glslang_tab.cpp" break; case 68: /* inclusive_or_expression: inclusive_or_expression VERTICAL_BAR exclusive_or_expression */ -#line 756 "MachineIndependent/glslang.y" +#line 719 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); @@ -5844,13 +5844,13 @@ yyreduce: break; case 69: /* logical_and_expression: inclusive_or_expression */ -#line 765 "MachineIndependent/glslang.y" +#line 728 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5850 "MachineIndependent/glslang_tab.cpp" break; case 70: /* logical_and_expression: logical_and_expression AND_OP inclusive_or_expression */ -#line 766 "MachineIndependent/glslang.y" +#line 729 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) @@ -5860,13 +5860,13 @@ yyreduce: break; case 71: /* logical_xor_expression: logical_and_expression */ -#line 774 "MachineIndependent/glslang.y" +#line 737 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5866 "MachineIndependent/glslang_tab.cpp" break; case 72: /* logical_xor_expression: logical_xor_expression XOR_OP logical_and_expression */ -#line 775 "MachineIndependent/glslang.y" +#line 738 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) @@ -5876,13 +5876,13 @@ yyreduce: break; case 73: /* logical_or_expression: logical_xor_expression */ -#line 783 "MachineIndependent/glslang.y" +#line 746 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5882 "MachineIndependent/glslang_tab.cpp" break; case 74: /* logical_or_expression: logical_or_expression OR_OP logical_xor_expression */ -#line 784 "MachineIndependent/glslang.y" +#line 747 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) @@ -5892,13 +5892,13 @@ yyreduce: break; case 75: /* conditional_expression: logical_or_expression */ -#line 792 "MachineIndependent/glslang.y" +#line 755 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5898 "MachineIndependent/glslang_tab.cpp" break; case 76: /* $@1: %empty */ -#line 793 "MachineIndependent/glslang.y" +#line 756 "MachineIndependent/glslang.y" { ++parseContext.controlFlowNestingLevel; } @@ -5906,7 +5906,7 @@ yyreduce: break; case 77: /* conditional_expression: logical_or_expression QUESTION $@1 expression COLON assignment_expression */ -#line 796 "MachineIndependent/glslang.y" +#line 759 "MachineIndependent/glslang.y" { --parseContext.controlFlowNestingLevel; parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); @@ -5923,13 +5923,13 @@ yyreduce: break; case 78: /* assignment_expression: conditional_expression */ -#line 811 "MachineIndependent/glslang.y" +#line 774 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } #line 5929 "MachineIndependent/glslang_tab.cpp" break; case 79: /* assignment_expression: unary_expression assignment_operator assignment_expression */ -#line 812 "MachineIndependent/glslang.y" +#line 775 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); @@ -5947,7 +5947,7 @@ yyreduce: break; case 80: /* assignment_operator: EQUAL */ -#line 828 "MachineIndependent/glslang.y" +#line 791 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAssign; @@ -5956,7 +5956,7 @@ yyreduce: break; case 81: /* assignment_operator: MUL_ASSIGN */ -#line 832 "MachineIndependent/glslang.y" +#line 795 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpMulAssign; @@ -5965,7 +5965,7 @@ yyreduce: break; case 82: /* assignment_operator: DIV_ASSIGN */ -#line 836 "MachineIndependent/glslang.y" +#line 799 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpDivAssign; @@ -5974,7 +5974,7 @@ yyreduce: break; case 83: /* assignment_operator: MOD_ASSIGN */ -#line 840 "MachineIndependent/glslang.y" +#line 803 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); (yyval.interm).loc = (yyvsp[0].lex).loc; @@ -5984,7 +5984,7 @@ yyreduce: break; case 84: /* assignment_operator: ADD_ASSIGN */ -#line 845 "MachineIndependent/glslang.y" +#line 808 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAddAssign; @@ -5993,7 +5993,7 @@ yyreduce: break; case 85: /* assignment_operator: SUB_ASSIGN */ -#line 849 "MachineIndependent/glslang.y" +#line 812 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpSubAssign; @@ -6002,7 +6002,7 @@ yyreduce: break; case 86: /* assignment_operator: LEFT_ASSIGN */ -#line 853 "MachineIndependent/glslang.y" +#line 816 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; @@ -6011,7 +6011,7 @@ yyreduce: break; case 87: /* assignment_operator: RIGHT_ASSIGN */ -#line 857 "MachineIndependent/glslang.y" +#line 820 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; @@ -6020,7 +6020,7 @@ yyreduce: break; case 88: /* assignment_operator: AND_ASSIGN */ -#line 861 "MachineIndependent/glslang.y" +#line 824 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; @@ -6029,7 +6029,7 @@ yyreduce: break; case 89: /* assignment_operator: XOR_ASSIGN */ -#line 865 "MachineIndependent/glslang.y" +#line 828 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; @@ -6038,7 +6038,7 @@ yyreduce: break; case 90: /* assignment_operator: OR_ASSIGN */ -#line 869 "MachineIndependent/glslang.y" +#line 832 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; @@ -6047,7 +6047,7 @@ yyreduce: break; case 91: /* expression: assignment_expression */ -#line 876 "MachineIndependent/glslang.y" +#line 839 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } @@ -6055,7 +6055,7 @@ yyreduce: break; case 92: /* expression: expression COMMA assignment_expression */ -#line 879 "MachineIndependent/glslang.y" +#line 842 "MachineIndependent/glslang.y" { parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); @@ -6068,7 +6068,7 @@ yyreduce: break; case 93: /* constant_expression: conditional_expression */ -#line 890 "MachineIndependent/glslang.y" +#line 853 "MachineIndependent/glslang.y" { parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); @@ -6077,7 +6077,7 @@ yyreduce: break; case 94: /* declaration: function_prototype SEMICOLON */ -#line 897 "MachineIndependent/glslang.y" +#line 860 "MachineIndependent/glslang.y" { parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); (yyval.interm.intermNode) = 0; @@ -6087,7 +6087,7 @@ yyreduce: break; case 95: /* declaration: spirv_instruction_qualifier function_prototype SEMICOLON */ -#line 903 "MachineIndependent/glslang.y" +#line 865 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[-1].interm).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier"); (yyvsp[-1].interm).function->setSpirvInstruction(*(yyvsp[-2].interm.spirvInst)); // Attach SPIR-V intruction qualifier @@ -6099,7 +6099,7 @@ yyreduce: break; case 96: /* declaration: spirv_execution_mode_qualifier SEMICOLON */ -#line 910 "MachineIndependent/glslang.y" +#line 872 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "SPIR-V execution mode qualifier"); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier"); @@ -6109,7 +6109,7 @@ yyreduce: break; case 97: /* declaration: init_declarator_list SEMICOLON */ -#line 916 "MachineIndependent/glslang.y" +#line 877 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); @@ -6119,7 +6119,7 @@ yyreduce: break; case 98: /* declaration: PRECISION precision_qualifier type_specifier SEMICOLON */ -#line 921 "MachineIndependent/glslang.y" +#line 882 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope @@ -6131,7 +6131,7 @@ yyreduce: break; case 99: /* declaration: block_structure SEMICOLON */ -#line 928 "MachineIndependent/glslang.y" +#line 889 "MachineIndependent/glslang.y" { parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); (yyval.interm.intermNode) = 0; @@ -6140,7 +6140,7 @@ yyreduce: break; case 100: /* declaration: block_structure IDENTIFIER SEMICOLON */ -#line 932 "MachineIndependent/glslang.y" +#line 893 "MachineIndependent/glslang.y" { parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; @@ -6149,7 +6149,7 @@ yyreduce: break; case 101: /* declaration: block_structure IDENTIFIER array_specifier SEMICOLON */ -#line 936 "MachineIndependent/glslang.y" +#line 897 "MachineIndependent/glslang.y" { parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); (yyval.interm.intermNode) = 0; @@ -6158,7 +6158,7 @@ yyreduce: break; case 102: /* declaration: type_qualifier SEMICOLON */ -#line 940 "MachineIndependent/glslang.y" +#line 901 "MachineIndependent/glslang.y" { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); @@ -6168,7 +6168,7 @@ yyreduce: break; case 103: /* declaration: type_qualifier IDENTIFIER SEMICOLON */ -#line 945 "MachineIndependent/glslang.y" +#line 906 "MachineIndependent/glslang.y" { parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); @@ -6178,7 +6178,7 @@ yyreduce: break; case 104: /* declaration: type_qualifier IDENTIFIER identifier_list SEMICOLON */ -#line 950 "MachineIndependent/glslang.y" +#line 911 "MachineIndependent/glslang.y" { parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); @@ -6189,13 +6189,13 @@ yyreduce: break; case 105: /* $@2: %empty */ -#line 959 "MachineIndependent/glslang.y" +#line 920 "MachineIndependent/glslang.y" { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } #line 6195 "MachineIndependent/glslang_tab.cpp" break; case 106: /* block_structure: type_qualifier IDENTIFIER LEFT_BRACE $@2 struct_declaration_list RIGHT_BRACE */ -#line 959 "MachineIndependent/glslang.y" +#line 920 "MachineIndependent/glslang.y" { --parseContext.blockNestingLevel; parseContext.blockName = (yyvsp[-4].lex).string; @@ -6209,7 +6209,7 @@ yyreduce: break; case 107: /* identifier_list: COMMA IDENTIFIER */ -#line 970 "MachineIndependent/glslang.y" +#line 931 "MachineIndependent/glslang.y" { (yyval.interm.identifierList) = new TIdentifierList; (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); @@ -6218,7 +6218,7 @@ yyreduce: break; case 108: /* identifier_list: identifier_list COMMA IDENTIFIER */ -#line 974 "MachineIndependent/glslang.y" +#line 935 "MachineIndependent/glslang.y" { (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); @@ -6227,66 +6227,67 @@ yyreduce: break; case 109: /* function_prototype: function_declarator RIGHT_PAREN */ -#line 981 "MachineIndependent/glslang.y" +#line 942 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-1].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 6236 "MachineIndependent/glslang_tab.cpp" +#line 6237 "MachineIndependent/glslang_tab.cpp" break; case 110: /* function_prototype: function_declarator RIGHT_PAREN attribute */ -#line 985 "MachineIndependent/glslang.y" +#line 947 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-2].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); (yyval.interm).loc = (yyvsp[-1].lex).loc; - parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6247 "MachineIndependent/glslang_tab.cpp" +#line 6248 "MachineIndependent/glslang_tab.cpp" break; case 111: /* function_prototype: attribute function_declarator RIGHT_PAREN */ -#line 991 "MachineIndependent/glslang.y" +#line 953 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-1].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); (yyval.interm).loc = (yyvsp[0].lex).loc; - parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes((yyvsp[0].lex).loc, *(yyvsp[-2].interm.attributes)); } -#line 6258 "MachineIndependent/glslang_tab.cpp" +#line 6259 "MachineIndependent/glslang_tab.cpp" break; case 112: /* function_prototype: attribute function_declarator RIGHT_PAREN attribute */ -#line 997 "MachineIndependent/glslang.y" +#line 959 "MachineIndependent/glslang.y" { (yyval.interm).function = (yyvsp[-2].interm.function); + if (parseContext.compileOnly) (yyval.interm).function->setExport(); (yyval.interm).loc = (yyvsp[-1].lex).loc; - parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[-3].interm.attributes)); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6270 "MachineIndependent/glslang_tab.cpp" +#line 6271 "MachineIndependent/glslang_tab.cpp" break; case 113: /* function_declarator: function_header */ -#line 1007 "MachineIndependent/glslang.y" +#line 969 "MachineIndependent/glslang.y" { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6278 "MachineIndependent/glslang_tab.cpp" +#line 6279 "MachineIndependent/glslang_tab.cpp" break; case 114: /* function_declarator: function_header_with_parameters */ -#line 1010 "MachineIndependent/glslang.y" +#line 972 "MachineIndependent/glslang.y" { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6286 "MachineIndependent/glslang_tab.cpp" +#line 6287 "MachineIndependent/glslang_tab.cpp" break; case 115: /* function_header_with_parameters: function_header parameter_declaration */ -#line 1017 "MachineIndependent/glslang.y" +#line 979 "MachineIndependent/glslang.y" { // Add the parameter (yyval.interm.function) = (yyvsp[-1].interm.function); @@ -6295,11 +6296,11 @@ yyreduce: else delete (yyvsp[0].interm).param.type; } -#line 6299 "MachineIndependent/glslang_tab.cpp" +#line 6300 "MachineIndependent/glslang_tab.cpp" break; case 116: /* function_header_with_parameters: function_header_with_parameters COMMA parameter_declaration */ -#line 1025 "MachineIndependent/glslang.y" +#line 987 "MachineIndependent/glslang.y" { // // Only first parameter of one-parameter functions can be void @@ -6317,11 +6318,11 @@ yyreduce: (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); } } -#line 6321 "MachineIndependent/glslang_tab.cpp" +#line 6322 "MachineIndependent/glslang_tab.cpp" break; case 117: /* function_header: fully_specified_type IDENTIFIER LEFT_PAREN */ -#line 1045 "MachineIndependent/glslang.y" +#line 1007 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", @@ -6341,11 +6342,11 @@ yyreduce: function = new TFunction((yyvsp[-1].lex).string, type); (yyval.interm.function) = function; } -#line 6345 "MachineIndependent/glslang_tab.cpp" +#line 6346 "MachineIndependent/glslang_tab.cpp" break; case 118: /* parameter_declarator: type_specifier IDENTIFIER */ -#line 1068 "MachineIndependent/glslang.y" +#line 1030 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -6361,11 +6362,11 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).param = param; } -#line 6365 "MachineIndependent/glslang_tab.cpp" +#line 6366 "MachineIndependent/glslang_tab.cpp" break; case 119: /* parameter_declarator: type_specifier IDENTIFIER array_specifier */ -#line 1083 "MachineIndependent/glslang.y" +#line 1045 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -6385,11 +6386,11 @@ yyreduce: (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).param = param; } -#line 6389 "MachineIndependent/glslang_tab.cpp" +#line 6390 "MachineIndependent/glslang_tab.cpp" break; case 120: /* parameter_declaration: type_qualifier parameter_declarator */ -#line 1108 "MachineIndependent/glslang.y" +#line 1070 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -6401,11 +6402,11 @@ yyreduce: parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6405 "MachineIndependent/glslang_tab.cpp" +#line 6406 "MachineIndependent/glslang_tab.cpp" break; case 121: /* parameter_declaration: parameter_declarator */ -#line 1119 "MachineIndependent/glslang.y" +#line 1081 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); @@ -6413,11 +6414,11 @@ yyreduce: parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->isCoopMat()); } -#line 6417 "MachineIndependent/glslang_tab.cpp" +#line 6418 "MachineIndependent/glslang_tab.cpp" break; case 122: /* parameter_declaration: type_qualifier parameter_type_specifier */ -#line 1129 "MachineIndependent/glslang.y" +#line 1091 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -6428,11 +6429,11 @@ yyreduce: parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6432 "MachineIndependent/glslang_tab.cpp" +#line 6433 "MachineIndependent/glslang_tab.cpp" break; case 123: /* parameter_declaration: parameter_type_specifier */ -#line 1139 "MachineIndependent/glslang.y" +#line 1101 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); @@ -6440,120 +6441,118 @@ yyreduce: parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->isCoopMat()); } -#line 6444 "MachineIndependent/glslang_tab.cpp" +#line 6445 "MachineIndependent/glslang_tab.cpp" break; case 124: /* parameter_type_specifier: type_specifier */ -#line 1149 "MachineIndependent/glslang.y" +#line 1111 "MachineIndependent/glslang.y" { TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; (yyval.interm).param = param; if ((yyvsp[0].interm.type).arraySizes) parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } -#line 6455 "MachineIndependent/glslang_tab.cpp" +#line 6456 "MachineIndependent/glslang_tab.cpp" break; case 125: /* init_declarator_list: single_declaration */ -#line 1158 "MachineIndependent/glslang.y" +#line 1120 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 6463 "MachineIndependent/glslang_tab.cpp" +#line 6464 "MachineIndependent/glslang_tab.cpp" break; case 126: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER */ -#line 1161 "MachineIndependent/glslang.y" +#line 1123 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-2].interm); parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } -#line 6472 "MachineIndependent/glslang_tab.cpp" +#line 6473 "MachineIndependent/glslang_tab.cpp" break; case 127: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier */ -#line 1165 "MachineIndependent/glslang.y" +#line 1127 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-3].interm); parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } -#line 6481 "MachineIndependent/glslang_tab.cpp" +#line 6482 "MachineIndependent/glslang_tab.cpp" break; case 128: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer */ -#line 1169 "MachineIndependent/glslang.y" +#line 1131 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-5].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 6491 "MachineIndependent/glslang_tab.cpp" +#line 6492 "MachineIndependent/glslang_tab.cpp" break; case 129: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER EQUAL initializer */ -#line 1174 "MachineIndependent/glslang.y" +#line 1136 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-4].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 6501 "MachineIndependent/glslang_tab.cpp" +#line 6502 "MachineIndependent/glslang_tab.cpp" break; case 130: /* single_declaration: fully_specified_type */ -#line 1182 "MachineIndependent/glslang.y" +#line 1144 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[0].interm.type); (yyval.interm).intermNode = 0; - parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); - } -#line 6513 "MachineIndependent/glslang_tab.cpp" +#line 6512 "MachineIndependent/glslang_tab.cpp" break; case 131: /* single_declaration: fully_specified_type IDENTIFIER */ -#line 1189 "MachineIndependent/glslang.y" +#line 1149 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-1].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } -#line 6523 "MachineIndependent/glslang_tab.cpp" +#line 6522 "MachineIndependent/glslang_tab.cpp" break; case 132: /* single_declaration: fully_specified_type IDENTIFIER array_specifier */ -#line 1194 "MachineIndependent/glslang.y" +#line 1154 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-2].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } -#line 6533 "MachineIndependent/glslang_tab.cpp" +#line 6532 "MachineIndependent/glslang_tab.cpp" break; case 133: /* single_declaration: fully_specified_type IDENTIFIER array_specifier EQUAL initializer */ -#line 1199 "MachineIndependent/glslang.y" +#line 1159 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-4].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 6543 "MachineIndependent/glslang_tab.cpp" +#line 6542 "MachineIndependent/glslang_tab.cpp" break; case 134: /* single_declaration: fully_specified_type IDENTIFIER EQUAL initializer */ -#line 1204 "MachineIndependent/glslang.y" +#line 1164 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-3].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 6553 "MachineIndependent/glslang_tab.cpp" +#line 6552 "MachineIndependent/glslang_tab.cpp" break; case 135: /* fully_specified_type: type_specifier */ -#line 1213 "MachineIndependent/glslang.y" +#line 1173 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); @@ -6564,11 +6563,11 @@ yyreduce: } parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier, (yyval.interm.type).isCoopmat()); } -#line 6568 "MachineIndependent/glslang_tab.cpp" +#line 6567 "MachineIndependent/glslang_tab.cpp" break; case 136: /* fully_specified_type: type_qualifier type_specifier */ -#line 1223 "MachineIndependent/glslang.y" +#line 1183 "MachineIndependent/glslang.y" { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, false, &(yyvsp[0].interm.type)); parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); @@ -6593,22 +6592,22 @@ yyreduce: (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) (yyval.interm.type).qualifier.smooth = true; } -#line 6597 "MachineIndependent/glslang_tab.cpp" +#line 6596 "MachineIndependent/glslang_tab.cpp" break; case 137: /* invariant_qualifier: INVARIANT */ -#line 1250 "MachineIndependent/glslang.y" +#line 1210 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.invariant = true; } -#line 6608 "MachineIndependent/glslang_tab.cpp" +#line 6607 "MachineIndependent/glslang_tab.cpp" break; case 138: /* interpolation_qualifier: SMOOTH */ -#line 1259 "MachineIndependent/glslang.y" +#line 1219 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); @@ -6616,11 +6615,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.smooth = true; } -#line 6620 "MachineIndependent/glslang_tab.cpp" +#line 6619 "MachineIndependent/glslang_tab.cpp" break; case 139: /* interpolation_qualifier: FLAT */ -#line 1266 "MachineIndependent/glslang.y" +#line 1226 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); @@ -6628,11 +6627,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.flat = true; } -#line 6632 "MachineIndependent/glslang_tab.cpp" +#line 6631 "MachineIndependent/glslang_tab.cpp" break; case 140: /* interpolation_qualifier: NOPERSPECTIVE */ -#line 1274 "MachineIndependent/glslang.y" +#line 1233 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); @@ -6640,11 +6639,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nopersp = true; } -#line 6644 "MachineIndependent/glslang_tab.cpp" +#line 6643 "MachineIndependent/glslang_tab.cpp" break; case 141: /* interpolation_qualifier: EXPLICITINTERPAMD */ -#line 1281 "MachineIndependent/glslang.y" +#line 1240 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); @@ -6652,11 +6651,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.explicitInterp = true; } -#line 6656 "MachineIndependent/glslang_tab.cpp" +#line 6655 "MachineIndependent/glslang_tab.cpp" break; case 142: /* interpolation_qualifier: PERVERTEXNV */ -#line 1288 "MachineIndependent/glslang.y" +#line 1247 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexNV"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); @@ -6665,11 +6664,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexNV = true; } -#line 6669 "MachineIndependent/glslang_tab.cpp" +#line 6668 "MachineIndependent/glslang_tab.cpp" break; case 143: /* interpolation_qualifier: PERVERTEXEXT */ -#line 1296 "MachineIndependent/glslang.y" +#line 1255 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexEXT"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric"); @@ -6678,11 +6677,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexEXT = true; } -#line 6682 "MachineIndependent/glslang_tab.cpp" +#line 6681 "MachineIndependent/glslang_tab.cpp" break; case 144: /* interpolation_qualifier: PERPRIMITIVENV */ -#line 1304 "MachineIndependent/glslang.y" +#line 1263 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveNV"); @@ -6693,11 +6692,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6697 "MachineIndependent/glslang_tab.cpp" +#line 6696 "MachineIndependent/glslang_tab.cpp" break; case 145: /* interpolation_qualifier: PERPRIMITIVEEXT */ -#line 1314 "MachineIndependent/glslang.y" +#line 1273 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveEXT"); @@ -6708,11 +6707,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6712 "MachineIndependent/glslang_tab.cpp" +#line 6711 "MachineIndependent/glslang_tab.cpp" break; case 146: /* interpolation_qualifier: PERVIEWNV */ -#line 1324 "MachineIndependent/glslang.y" +#line 1283 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perviewNV"); @@ -6720,11 +6719,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perViewNV = true; } -#line 6724 "MachineIndependent/glslang_tab.cpp" +#line 6723 "MachineIndependent/glslang_tab.cpp" break; case 147: /* interpolation_qualifier: PERTASKNV */ -#line 1331 "MachineIndependent/glslang.y" +#line 1290 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "taskNV"); @@ -6732,84 +6731,84 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perTaskNV = true; } -#line 6736 "MachineIndependent/glslang_tab.cpp" +#line 6735 "MachineIndependent/glslang_tab.cpp" break; case 148: /* layout_qualifier: LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN */ -#line 1342 "MachineIndependent/glslang.y" +#line 1300 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); } -#line 6744 "MachineIndependent/glslang_tab.cpp" +#line 6743 "MachineIndependent/glslang_tab.cpp" break; case 149: /* layout_qualifier_id_list: layout_qualifier_id */ -#line 1348 "MachineIndependent/glslang.y" +#line 1306 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6752 "MachineIndependent/glslang_tab.cpp" +#line 6751 "MachineIndependent/glslang_tab.cpp" break; case 150: /* layout_qualifier_id_list: layout_qualifier_id_list COMMA layout_qualifier_id */ -#line 1351 "MachineIndependent/glslang.y" +#line 1309 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-2].interm.type); (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6762 "MachineIndependent/glslang_tab.cpp" +#line 6761 "MachineIndependent/glslang_tab.cpp" break; case 151: /* layout_qualifier_id: IDENTIFIER */ -#line 1358 "MachineIndependent/glslang.y" +#line 1316 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } -#line 6771 "MachineIndependent/glslang_tab.cpp" +#line 6770 "MachineIndependent/glslang_tab.cpp" break; case 152: /* layout_qualifier_id: IDENTIFIER EQUAL constant_expression */ -#line 1362 "MachineIndependent/glslang.y" +#line 1320 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-2].lex).loc); parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } -#line 6780 "MachineIndependent/glslang_tab.cpp" +#line 6779 "MachineIndependent/glslang_tab.cpp" break; case 153: /* layout_qualifier_id: SHARED */ -#line 1366 "MachineIndependent/glslang.y" +#line 1324 "MachineIndependent/glslang.y" { // because "shared" is both an identifier and a keyword (yyval.interm.type).init((yyvsp[0].lex).loc); TString strShared("shared"); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } -#line 6790 "MachineIndependent/glslang_tab.cpp" +#line 6789 "MachineIndependent/glslang_tab.cpp" break; case 154: /* precise_qualifier: PRECISE */ -#line 1375 "MachineIndependent/glslang.y" +#line 1332 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.noContraction = true; } -#line 6801 "MachineIndependent/glslang_tab.cpp" +#line 6800 "MachineIndependent/glslang_tab.cpp" break; case 155: /* type_qualifier: single_type_qualifier */ -#line 1385 "MachineIndependent/glslang.y" +#line 1341 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6809 "MachineIndependent/glslang_tab.cpp" +#line 6808 "MachineIndependent/glslang_tab.cpp" break; case 156: /* type_qualifier: type_qualifier single_type_qualifier */ -#line 1388 "MachineIndependent/glslang.y" +#line 1344 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); if ((yyval.interm.type).basicType == EbtVoid) @@ -6818,151 +6817,151 @@ yyreduce: (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6822 "MachineIndependent/glslang_tab.cpp" +#line 6821 "MachineIndependent/glslang_tab.cpp" break; case 157: /* single_type_qualifier: storage_qualifier */ -#line 1399 "MachineIndependent/glslang.y" +#line 1355 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6830 "MachineIndependent/glslang_tab.cpp" +#line 6829 "MachineIndependent/glslang_tab.cpp" break; case 158: /* single_type_qualifier: layout_qualifier */ -#line 1402 "MachineIndependent/glslang.y" +#line 1358 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6838 "MachineIndependent/glslang_tab.cpp" +#line 6837 "MachineIndependent/glslang_tab.cpp" break; case 159: /* single_type_qualifier: precision_qualifier */ -#line 1405 "MachineIndependent/glslang.y" +#line 1361 "MachineIndependent/glslang.y" { parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6847 "MachineIndependent/glslang_tab.cpp" +#line 6846 "MachineIndependent/glslang_tab.cpp" break; case 160: /* single_type_qualifier: interpolation_qualifier */ -#line 1409 "MachineIndependent/glslang.y" +#line 1365 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6856 "MachineIndependent/glslang_tab.cpp" +#line 6855 "MachineIndependent/glslang_tab.cpp" break; case 161: /* single_type_qualifier: invariant_qualifier */ -#line 1413 "MachineIndependent/glslang.y" +#line 1369 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6865 "MachineIndependent/glslang_tab.cpp" +#line 6864 "MachineIndependent/glslang_tab.cpp" break; case 162: /* single_type_qualifier: precise_qualifier */ -#line 1418 "MachineIndependent/glslang.y" +#line 1373 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6874 "MachineIndependent/glslang_tab.cpp" +#line 6873 "MachineIndependent/glslang_tab.cpp" break; case 163: /* single_type_qualifier: non_uniform_qualifier */ -#line 1422 "MachineIndependent/glslang.y" +#line 1377 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6882 "MachineIndependent/glslang_tab.cpp" +#line 6881 "MachineIndependent/glslang_tab.cpp" break; case 164: /* single_type_qualifier: spirv_storage_class_qualifier */ -#line 1425 "MachineIndependent/glslang.y" +#line 1380 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].interm.type).loc, "spirv_storage_class"); parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6892 "MachineIndependent/glslang_tab.cpp" +#line 6891 "MachineIndependent/glslang_tab.cpp" break; case 165: /* single_type_qualifier: spirv_decorate_qualifier */ -#line 1430 "MachineIndependent/glslang.y" +#line 1385 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6901 "MachineIndependent/glslang_tab.cpp" +#line 6900 "MachineIndependent/glslang_tab.cpp" break; case 166: /* single_type_qualifier: SPIRV_BY_REFERENCE */ -#line 1434 "MachineIndependent/glslang.y" +#line 1389 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_reference"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvByReference(); } -#line 6911 "MachineIndependent/glslang_tab.cpp" +#line 6910 "MachineIndependent/glslang_tab.cpp" break; case 167: /* single_type_qualifier: SPIRV_LITERAL */ -#line 1439 "MachineIndependent/glslang.y" +#line 1394 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_literal"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvLiteral(); } -#line 6921 "MachineIndependent/glslang_tab.cpp" +#line 6920 "MachineIndependent/glslang_tab.cpp" break; case 168: /* storage_qualifier: CONST */ -#line 1448 "MachineIndependent/glslang.y" +#line 1402 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant } -#line 6930 "MachineIndependent/glslang_tab.cpp" +#line 6929 "MachineIndependent/glslang_tab.cpp" break; case 169: /* storage_qualifier: INOUT */ -#line 1452 "MachineIndependent/glslang.y" +#line 1406 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqInOut; } -#line 6940 "MachineIndependent/glslang_tab.cpp" +#line 6939 "MachineIndependent/glslang_tab.cpp" break; case 170: /* storage_qualifier: IN */ -#line 1457 "MachineIndependent/glslang.y" +#line 1411 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "in"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqIn; } -#line 6951 "MachineIndependent/glslang_tab.cpp" +#line 6950 "MachineIndependent/glslang_tab.cpp" break; case 171: /* storage_qualifier: OUT */ -#line 1463 "MachineIndependent/glslang.y" +#line 1417 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "out"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqOut; } -#line 6962 "MachineIndependent/glslang_tab.cpp" +#line 6961 "MachineIndependent/glslang_tab.cpp" break; case 172: /* storage_qualifier: CENTROID */ -#line 1469 "MachineIndependent/glslang.y" +#line 1423 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); @@ -6970,31 +6969,31 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.centroid = true; } -#line 6974 "MachineIndependent/glslang_tab.cpp" +#line 6973 "MachineIndependent/glslang_tab.cpp" break; case 173: /* storage_qualifier: UNIFORM */ -#line 1476 "MachineIndependent/glslang.y" +#line 1430 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqUniform; } -#line 6984 "MachineIndependent/glslang_tab.cpp" +#line 6983 "MachineIndependent/glslang_tab.cpp" break; case 174: /* storage_qualifier: TILEIMAGEEXT */ -#line 1481 "MachineIndependent/glslang.y" +#line 1435 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "tileImageEXT"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqTileImageEXT; } -#line 6994 "MachineIndependent/glslang_tab.cpp" +#line 6993 "MachineIndependent/glslang_tab.cpp" break; case 175: /* storage_qualifier: SHARED */ -#line 1486 "MachineIndependent/glslang.y" +#line 1440 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); @@ -7003,21 +7002,21 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqShared; } -#line 7007 "MachineIndependent/glslang_tab.cpp" +#line 7006 "MachineIndependent/glslang_tab.cpp" break; case 176: /* storage_qualifier: BUFFER */ -#line 1494 "MachineIndependent/glslang.y" +#line 1448 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqBuffer; } -#line 7017 "MachineIndependent/glslang_tab.cpp" +#line 7016 "MachineIndependent/glslang_tab.cpp" break; case 177: /* storage_qualifier: ATTRIBUTE */ -#line 1500 "MachineIndependent/glslang.y" +#line 1453 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); @@ -7030,11 +7029,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7034 "MachineIndependent/glslang_tab.cpp" +#line 7033 "MachineIndependent/glslang_tab.cpp" break; case 178: /* storage_qualifier: VARYING */ -#line 1512 "MachineIndependent/glslang.y" +#line 1465 "MachineIndependent/glslang.y" { parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); @@ -7049,32 +7048,32 @@ yyreduce: else (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7053 "MachineIndependent/glslang_tab.cpp" +#line 7052 "MachineIndependent/glslang_tab.cpp" break; case 179: /* storage_qualifier: PATCH */ -#line 1526 "MachineIndependent/glslang.y" +#line 1479 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.patch = true; } -#line 7064 "MachineIndependent/glslang_tab.cpp" +#line 7063 "MachineIndependent/glslang_tab.cpp" break; case 180: /* storage_qualifier: SAMPLE */ -#line 1532 "MachineIndependent/glslang.y" +#line 1485 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.sample = true; } -#line 7074 "MachineIndependent/glslang_tab.cpp" +#line 7073 "MachineIndependent/glslang_tab.cpp" break; case 181: /* storage_qualifier: HITATTRNV */ -#line 1537 "MachineIndependent/glslang.y" +#line 1490 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -7083,11 +7082,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7087 "MachineIndependent/glslang_tab.cpp" +#line 7086 "MachineIndependent/glslang_tab.cpp" break; case 182: /* storage_qualifier: HITOBJECTATTRNV */ -#line 1545 "MachineIndependent/glslang.y" +#line 1498 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask @@ -7096,11 +7095,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitObjectAttrNV; } -#line 7100 "MachineIndependent/glslang_tab.cpp" +#line 7099 "MachineIndependent/glslang_tab.cpp" break; case 183: /* storage_qualifier: HITATTREXT */ -#line 1553 "MachineIndependent/glslang.y" +#line 1506 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -7109,11 +7108,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7113 "MachineIndependent/glslang_tab.cpp" +#line 7112 "MachineIndependent/glslang_tab.cpp" break; case 184: /* storage_qualifier: PAYLOADNV */ -#line 1561 "MachineIndependent/glslang.y" +#line 1514 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | @@ -7122,11 +7121,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7126 "MachineIndependent/glslang_tab.cpp" +#line 7125 "MachineIndependent/glslang_tab.cpp" break; case 185: /* storage_qualifier: PAYLOADEXT */ -#line 1569 "MachineIndependent/glslang.y" +#line 1522 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | @@ -7135,11 +7134,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7139 "MachineIndependent/glslang_tab.cpp" +#line 7138 "MachineIndependent/glslang_tab.cpp" break; case 186: /* storage_qualifier: PAYLOADINNV */ -#line 1577 "MachineIndependent/glslang.y" +#line 1530 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | @@ -7148,11 +7147,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7152 "MachineIndependent/glslang_tab.cpp" +#line 7151 "MachineIndependent/glslang_tab.cpp" break; case 187: /* storage_qualifier: PAYLOADINEXT */ -#line 1585 "MachineIndependent/glslang.y" +#line 1538 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | @@ -7161,11 +7160,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7165 "MachineIndependent/glslang_tab.cpp" +#line 7164 "MachineIndependent/glslang_tab.cpp" break; case 188: /* storage_qualifier: CALLDATANV */ -#line 1593 "MachineIndependent/glslang.y" +#line 1546 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | @@ -7174,11 +7173,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7178 "MachineIndependent/glslang_tab.cpp" +#line 7177 "MachineIndependent/glslang_tab.cpp" break; case 189: /* storage_qualifier: CALLDATAEXT */ -#line 1601 "MachineIndependent/glslang.y" +#line 1554 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | @@ -7187,11 +7186,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7191 "MachineIndependent/glslang_tab.cpp" +#line 7190 "MachineIndependent/glslang_tab.cpp" break; case 190: /* storage_qualifier: CALLDATAINNV */ -#line 1609 "MachineIndependent/glslang.y" +#line 1562 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV"); @@ -7199,11 +7198,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7203 "MachineIndependent/glslang_tab.cpp" +#line 7202 "MachineIndependent/glslang_tab.cpp" break; case 191: /* storage_qualifier: CALLDATAINEXT */ -#line 1616 "MachineIndependent/glslang.y" +#line 1569 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT"); @@ -7211,138 +7210,138 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7215 "MachineIndependent/glslang_tab.cpp" +#line 7214 "MachineIndependent/glslang_tab.cpp" break; case 192: /* storage_qualifier: COHERENT */ -#line 1623 "MachineIndependent/glslang.y" +#line 1576 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.coherent = true; } -#line 7224 "MachineIndependent/glslang_tab.cpp" +#line 7223 "MachineIndependent/glslang_tab.cpp" break; case 193: /* storage_qualifier: DEVICECOHERENT */ -#line 1627 "MachineIndependent/glslang.y" +#line 1580 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); (yyval.interm.type).qualifier.devicecoherent = true; } -#line 7234 "MachineIndependent/glslang_tab.cpp" +#line 7233 "MachineIndependent/glslang_tab.cpp" break; case 194: /* storage_qualifier: QUEUEFAMILYCOHERENT */ -#line 1632 "MachineIndependent/glslang.y" +#line 1585 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); (yyval.interm.type).qualifier.queuefamilycoherent = true; } -#line 7244 "MachineIndependent/glslang_tab.cpp" +#line 7243 "MachineIndependent/glslang_tab.cpp" break; case 195: /* storage_qualifier: WORKGROUPCOHERENT */ -#line 1637 "MachineIndependent/glslang.y" +#line 1590 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); (yyval.interm.type).qualifier.workgroupcoherent = true; } -#line 7254 "MachineIndependent/glslang_tab.cpp" +#line 7253 "MachineIndependent/glslang_tab.cpp" break; case 196: /* storage_qualifier: SUBGROUPCOHERENT */ -#line 1642 "MachineIndependent/glslang.y" +#line 1595 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); (yyval.interm.type).qualifier.subgroupcoherent = true; } -#line 7264 "MachineIndependent/glslang_tab.cpp" +#line 7263 "MachineIndependent/glslang_tab.cpp" break; case 197: /* storage_qualifier: NONPRIVATE */ -#line 1647 "MachineIndependent/glslang.y" +#line 1600 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); (yyval.interm.type).qualifier.nonprivate = true; } -#line 7274 "MachineIndependent/glslang_tab.cpp" +#line 7273 "MachineIndependent/glslang_tab.cpp" break; case 198: /* storage_qualifier: SHADERCALLCOHERENT */ -#line 1652 "MachineIndependent/glslang.y" +#line 1605 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent"); (yyval.interm.type).qualifier.shadercallcoherent = true; } -#line 7284 "MachineIndependent/glslang_tab.cpp" +#line 7283 "MachineIndependent/glslang_tab.cpp" break; case 199: /* storage_qualifier: VOLATILE */ -#line 1657 "MachineIndependent/glslang.y" +#line 1610 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.volatil = true; } -#line 7293 "MachineIndependent/glslang_tab.cpp" +#line 7292 "MachineIndependent/glslang_tab.cpp" break; case 200: /* storage_qualifier: RESTRICT */ -#line 1661 "MachineIndependent/glslang.y" +#line 1614 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.restrict = true; } -#line 7302 "MachineIndependent/glslang_tab.cpp" +#line 7301 "MachineIndependent/glslang_tab.cpp" break; case 201: /* storage_qualifier: READONLY */ -#line 1665 "MachineIndependent/glslang.y" +#line 1618 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.readonly = true; } -#line 7311 "MachineIndependent/glslang_tab.cpp" +#line 7310 "MachineIndependent/glslang_tab.cpp" break; case 202: /* storage_qualifier: WRITEONLY */ -#line 1669 "MachineIndependent/glslang.y" +#line 1622 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.writeonly = true; } -#line 7320 "MachineIndependent/glslang_tab.cpp" +#line 7319 "MachineIndependent/glslang_tab.cpp" break; case 203: /* storage_qualifier: SUBROUTINE */ -#line 1673 "MachineIndependent/glslang.y" +#line 1626 "MachineIndependent/glslang.y" { parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[0].lex).loc); } -#line 7331 "MachineIndependent/glslang_tab.cpp" +#line 7330 "MachineIndependent/glslang_tab.cpp" break; case 204: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */ -#line 1679 "MachineIndependent/glslang.y" +#line 1632 "MachineIndependent/glslang.y" { parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[-3].lex).loc); } -#line 7342 "MachineIndependent/glslang_tab.cpp" +#line 7341 "MachineIndependent/glslang_tab.cpp" break; case 205: /* storage_qualifier: TASKPAYLOADWORKGROUPEXT */ -#line 1685 "MachineIndependent/glslang.y" +#line 1638 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "taskPayloadSharedEXT"); @@ -7350,38 +7349,38 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqtaskPayloadSharedEXT; } -#line 7354 "MachineIndependent/glslang_tab.cpp" +#line 7353 "MachineIndependent/glslang_tab.cpp" break; case 206: /* non_uniform_qualifier: NONUNIFORM */ -#line 1697 "MachineIndependent/glslang.y" +#line 1648 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nonUniform = true; } -#line 7363 "MachineIndependent/glslang_tab.cpp" +#line 7362 "MachineIndependent/glslang_tab.cpp" break; case 207: /* type_name_list: IDENTIFIER */ -#line 1704 "MachineIndependent/glslang.y" +#line 1655 "MachineIndependent/glslang.y" { // TODO } -#line 7371 "MachineIndependent/glslang_tab.cpp" +#line 7370 "MachineIndependent/glslang_tab.cpp" break; case 208: /* type_name_list: type_name_list COMMA IDENTIFIER */ -#line 1707 "MachineIndependent/glslang.y" +#line 1658 "MachineIndependent/glslang.y" { // TODO: 4.0 semantics: subroutines // 1) make sure each identifier is a type declared earlier with SUBROUTINE // 2) save all of the identifiers for future comparison with the declared function } -#line 7381 "MachineIndependent/glslang_tab.cpp" +#line 7380 "MachineIndependent/glslang_tab.cpp" break; case 209: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */ -#line 1716 "MachineIndependent/glslang.y" +#line 1666 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); @@ -7389,11 +7388,11 @@ yyreduce: parseContext.coopMatTypeParametersCheck((yyvsp[-1].interm.type).loc, (yyval.interm.type)); } -#line 7393 "MachineIndependent/glslang_tab.cpp" +#line 7392 "MachineIndependent/glslang_tab.cpp" break; case 210: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */ -#line 1723 "MachineIndependent/glslang.y" +#line 1673 "MachineIndependent/glslang.y" { parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes); (yyval.interm.type) = (yyvsp[-2].interm.type); @@ -7402,21 +7401,21 @@ yyreduce: (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; parseContext.coopMatTypeParametersCheck((yyvsp[-2].interm.type).loc, (yyval.interm.type)); } -#line 7406 "MachineIndependent/glslang_tab.cpp" +#line 7405 "MachineIndependent/glslang_tab.cpp" break; case 211: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */ -#line 1734 "MachineIndependent/glslang.y" +#line 1684 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).arraySizes = new TArraySizes; (yyval.interm).arraySizes->addInnerSize(); } -#line 7416 "MachineIndependent/glslang_tab.cpp" +#line 7415 "MachineIndependent/glslang_tab.cpp" break; case 212: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */ -#line 1739 "MachineIndependent/glslang.y" +#line 1689 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[-2].lex).loc; (yyval.interm).arraySizes = new TArraySizes; @@ -7425,20 +7424,20 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7429 "MachineIndependent/glslang_tab.cpp" +#line 7428 "MachineIndependent/glslang_tab.cpp" break; case 213: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */ -#line 1747 "MachineIndependent/glslang.y" +#line 1697 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-2].interm); (yyval.interm).arraySizes->addInnerSize(); } -#line 7438 "MachineIndependent/glslang_tab.cpp" +#line 7437 "MachineIndependent/glslang_tab.cpp" break; case 214: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */ -#line 1751 "MachineIndependent/glslang.y" +#line 1701 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-3].interm); @@ -7446,45 +7445,45 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7450 "MachineIndependent/glslang_tab.cpp" +#line 7449 "MachineIndependent/glslang_tab.cpp" break; case 215: /* type_parameter_specifier_opt: type_parameter_specifier */ -#line 1761 "MachineIndependent/glslang.y" +#line 1711 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[0].interm.typeParameters); } -#line 7458 "MachineIndependent/glslang_tab.cpp" +#line 7457 "MachineIndependent/glslang_tab.cpp" break; case 216: /* type_parameter_specifier_opt: %empty */ -#line 1764 "MachineIndependent/glslang.y" +#line 1714 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = 0; } -#line 7466 "MachineIndependent/glslang_tab.cpp" +#line 7465 "MachineIndependent/glslang_tab.cpp" break; case 217: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */ -#line 1770 "MachineIndependent/glslang.y" +#line 1720 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[-1].interm.typeParameters); } -#line 7474 "MachineIndependent/glslang_tab.cpp" +#line 7473 "MachineIndependent/glslang_tab.cpp" break; case 218: /* type_parameter_specifier_list: type_specifier */ -#line 1776 "MachineIndependent/glslang.y" +#line 1726 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = new TTypeParameters; (yyval.interm.typeParameters)->arraySizes = new TArraySizes; (yyval.interm.typeParameters)->basicType = (yyvsp[0].interm.type).basicType; } -#line 7484 "MachineIndependent/glslang_tab.cpp" +#line 7483 "MachineIndependent/glslang_tab.cpp" break; case 219: /* type_parameter_specifier_list: unary_expression */ -#line 1781 "MachineIndependent/glslang.y" +#line 1731 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = new TTypeParameters; (yyval.interm.typeParameters)->arraySizes = new TArraySizes; @@ -7493,11 +7492,11 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter", true); (yyval.interm.typeParameters)->arraySizes->addInnerSize(size); } -#line 7497 "MachineIndependent/glslang_tab.cpp" +#line 7496 "MachineIndependent/glslang_tab.cpp" break; case 220: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */ -#line 1789 "MachineIndependent/glslang.y" +#line 1739 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[-2].interm.typeParameters); @@ -7505,300 +7504,300 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter", true); (yyval.interm.typeParameters)->arraySizes->addInnerSize(size); } -#line 7509 "MachineIndependent/glslang_tab.cpp" +#line 7508 "MachineIndependent/glslang_tab.cpp" break; case 221: /* type_specifier_nonarray: VOID */ -#line 1799 "MachineIndependent/glslang.y" +#line 1749 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtVoid; } -#line 7518 "MachineIndependent/glslang_tab.cpp" +#line 7517 "MachineIndependent/glslang_tab.cpp" break; case 222: /* type_specifier_nonarray: FLOAT */ -#line 1803 "MachineIndependent/glslang.y" +#line 1753 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 7527 "MachineIndependent/glslang_tab.cpp" +#line 7526 "MachineIndependent/glslang_tab.cpp" break; case 223: /* type_specifier_nonarray: INT */ -#line 1807 "MachineIndependent/glslang.y" +#line 1757 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 7536 "MachineIndependent/glslang_tab.cpp" +#line 7535 "MachineIndependent/glslang_tab.cpp" break; case 224: /* type_specifier_nonarray: UINT */ -#line 1811 "MachineIndependent/glslang.y" +#line 1761 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 7546 "MachineIndependent/glslang_tab.cpp" +#line 7545 "MachineIndependent/glslang_tab.cpp" break; case 225: /* type_specifier_nonarray: BOOL */ -#line 1816 "MachineIndependent/glslang.y" +#line 1766 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; } -#line 7555 "MachineIndependent/glslang_tab.cpp" +#line 7554 "MachineIndependent/glslang_tab.cpp" break; case 226: /* type_specifier_nonarray: VEC2 */ -#line 1820 "MachineIndependent/glslang.y" +#line 1770 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 7565 "MachineIndependent/glslang_tab.cpp" +#line 7564 "MachineIndependent/glslang_tab.cpp" break; case 227: /* type_specifier_nonarray: VEC3 */ -#line 1825 "MachineIndependent/glslang.y" +#line 1775 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 7575 "MachineIndependent/glslang_tab.cpp" +#line 7574 "MachineIndependent/glslang_tab.cpp" break; case 228: /* type_specifier_nonarray: VEC4 */ -#line 1830 "MachineIndependent/glslang.y" +#line 1780 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 7585 "MachineIndependent/glslang_tab.cpp" +#line 7584 "MachineIndependent/glslang_tab.cpp" break; case 229: /* type_specifier_nonarray: BVEC2 */ -#line 1835 "MachineIndependent/glslang.y" +#line 1785 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(2); } -#line 7595 "MachineIndependent/glslang_tab.cpp" +#line 7594 "MachineIndependent/glslang_tab.cpp" break; case 230: /* type_specifier_nonarray: BVEC3 */ -#line 1840 "MachineIndependent/glslang.y" +#line 1790 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(3); } -#line 7605 "MachineIndependent/glslang_tab.cpp" +#line 7604 "MachineIndependent/glslang_tab.cpp" break; case 231: /* type_specifier_nonarray: BVEC4 */ -#line 1845 "MachineIndependent/glslang.y" +#line 1795 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; (yyval.interm.type).setVector(4); } -#line 7615 "MachineIndependent/glslang_tab.cpp" +#line 7614 "MachineIndependent/glslang_tab.cpp" break; case 232: /* type_specifier_nonarray: IVEC2 */ -#line 1850 "MachineIndependent/glslang.y" +#line 1800 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 7625 "MachineIndependent/glslang_tab.cpp" +#line 7624 "MachineIndependent/glslang_tab.cpp" break; case 233: /* type_specifier_nonarray: IVEC3 */ -#line 1855 "MachineIndependent/glslang.y" +#line 1805 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 7635 "MachineIndependent/glslang_tab.cpp" +#line 7634 "MachineIndependent/glslang_tab.cpp" break; case 234: /* type_specifier_nonarray: IVEC4 */ -#line 1860 "MachineIndependent/glslang.y" +#line 1810 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 7645 "MachineIndependent/glslang_tab.cpp" +#line 7644 "MachineIndependent/glslang_tab.cpp" break; case 235: /* type_specifier_nonarray: UVEC2 */ -#line 1865 "MachineIndependent/glslang.y" +#line 1815 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 7656 "MachineIndependent/glslang_tab.cpp" +#line 7655 "MachineIndependent/glslang_tab.cpp" break; case 236: /* type_specifier_nonarray: UVEC3 */ -#line 1871 "MachineIndependent/glslang.y" +#line 1821 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 7667 "MachineIndependent/glslang_tab.cpp" +#line 7666 "MachineIndependent/glslang_tab.cpp" break; case 237: /* type_specifier_nonarray: UVEC4 */ -#line 1877 "MachineIndependent/glslang.y" +#line 1827 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 7678 "MachineIndependent/glslang_tab.cpp" +#line 7677 "MachineIndependent/glslang_tab.cpp" break; case 238: /* type_specifier_nonarray: MAT2 */ -#line 1883 "MachineIndependent/glslang.y" +#line 1833 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7688 "MachineIndependent/glslang_tab.cpp" +#line 7687 "MachineIndependent/glslang_tab.cpp" break; case 239: /* type_specifier_nonarray: MAT3 */ -#line 1888 "MachineIndependent/glslang.y" +#line 1838 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7698 "MachineIndependent/glslang_tab.cpp" +#line 7697 "MachineIndependent/glslang_tab.cpp" break; case 240: /* type_specifier_nonarray: MAT4 */ -#line 1893 "MachineIndependent/glslang.y" +#line 1843 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7708 "MachineIndependent/glslang_tab.cpp" +#line 7707 "MachineIndependent/glslang_tab.cpp" break; case 241: /* type_specifier_nonarray: MAT2X2 */ -#line 1898 "MachineIndependent/glslang.y" +#line 1848 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7718 "MachineIndependent/glslang_tab.cpp" +#line 7717 "MachineIndependent/glslang_tab.cpp" break; case 242: /* type_specifier_nonarray: MAT2X3 */ -#line 1903 "MachineIndependent/glslang.y" +#line 1853 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 7728 "MachineIndependent/glslang_tab.cpp" +#line 7727 "MachineIndependent/glslang_tab.cpp" break; case 243: /* type_specifier_nonarray: MAT2X4 */ -#line 1908 "MachineIndependent/glslang.y" +#line 1858 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 7738 "MachineIndependent/glslang_tab.cpp" +#line 7737 "MachineIndependent/glslang_tab.cpp" break; case 244: /* type_specifier_nonarray: MAT3X2 */ -#line 1913 "MachineIndependent/glslang.y" +#line 1863 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 7748 "MachineIndependent/glslang_tab.cpp" +#line 7747 "MachineIndependent/glslang_tab.cpp" break; case 245: /* type_specifier_nonarray: MAT3X3 */ -#line 1918 "MachineIndependent/glslang.y" +#line 1868 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7758 "MachineIndependent/glslang_tab.cpp" +#line 7757 "MachineIndependent/glslang_tab.cpp" break; case 246: /* type_specifier_nonarray: MAT3X4 */ -#line 1923 "MachineIndependent/glslang.y" +#line 1873 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 7768 "MachineIndependent/glslang_tab.cpp" +#line 7767 "MachineIndependent/glslang_tab.cpp" break; case 247: /* type_specifier_nonarray: MAT4X2 */ -#line 1928 "MachineIndependent/glslang.y" +#line 1878 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 7778 "MachineIndependent/glslang_tab.cpp" +#line 7777 "MachineIndependent/glslang_tab.cpp" break; case 248: /* type_specifier_nonarray: MAT4X3 */ -#line 1933 "MachineIndependent/glslang.y" +#line 1883 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 7788 "MachineIndependent/glslang_tab.cpp" +#line 7787 "MachineIndependent/glslang_tab.cpp" break; case 249: /* type_specifier_nonarray: MAT4X4 */ -#line 1938 "MachineIndependent/glslang.y" +#line 1888 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7798 "MachineIndependent/glslang_tab.cpp" +#line 7797 "MachineIndependent/glslang_tab.cpp" break; case 250: /* type_specifier_nonarray: DOUBLE */ -#line 1944 "MachineIndependent/glslang.y" +#line 1893 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7806,121 +7805,121 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 7810 "MachineIndependent/glslang_tab.cpp" +#line 7809 "MachineIndependent/glslang_tab.cpp" break; case 251: /* type_specifier_nonarray: FLOAT16_T */ -#line 1951 "MachineIndependent/glslang.y" +#line 1900 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; } -#line 7820 "MachineIndependent/glslang_tab.cpp" +#line 7819 "MachineIndependent/glslang_tab.cpp" break; case 252: /* type_specifier_nonarray: FLOAT32_T */ -#line 1956 "MachineIndependent/glslang.y" +#line 1905 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 7830 "MachineIndependent/glslang_tab.cpp" +#line 7829 "MachineIndependent/glslang_tab.cpp" break; case 253: /* type_specifier_nonarray: FLOAT64_T */ -#line 1961 "MachineIndependent/glslang.y" +#line 1910 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 7840 "MachineIndependent/glslang_tab.cpp" +#line 7839 "MachineIndependent/glslang_tab.cpp" break; case 254: /* type_specifier_nonarray: INT8_T */ -#line 1966 "MachineIndependent/glslang.y" +#line 1915 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; } -#line 7850 "MachineIndependent/glslang_tab.cpp" +#line 7849 "MachineIndependent/glslang_tab.cpp" break; case 255: /* type_specifier_nonarray: UINT8_T */ -#line 1971 "MachineIndependent/glslang.y" +#line 1920 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; } -#line 7860 "MachineIndependent/glslang_tab.cpp" +#line 7859 "MachineIndependent/glslang_tab.cpp" break; case 256: /* type_specifier_nonarray: INT16_T */ -#line 1976 "MachineIndependent/glslang.y" +#line 1925 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; } -#line 7870 "MachineIndependent/glslang_tab.cpp" +#line 7869 "MachineIndependent/glslang_tab.cpp" break; case 257: /* type_specifier_nonarray: UINT16_T */ -#line 1981 "MachineIndependent/glslang.y" +#line 1930 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; } -#line 7880 "MachineIndependent/glslang_tab.cpp" +#line 7879 "MachineIndependent/glslang_tab.cpp" break; case 258: /* type_specifier_nonarray: INT32_T */ -#line 1986 "MachineIndependent/glslang.y" +#line 1935 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 7890 "MachineIndependent/glslang_tab.cpp" +#line 7889 "MachineIndependent/glslang_tab.cpp" break; case 259: /* type_specifier_nonarray: UINT32_T */ -#line 1991 "MachineIndependent/glslang.y" +#line 1940 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 7900 "MachineIndependent/glslang_tab.cpp" +#line 7899 "MachineIndependent/glslang_tab.cpp" break; case 260: /* type_specifier_nonarray: INT64_T */ -#line 1996 "MachineIndependent/glslang.y" +#line 1945 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; } -#line 7910 "MachineIndependent/glslang_tab.cpp" +#line 7909 "MachineIndependent/glslang_tab.cpp" break; case 261: /* type_specifier_nonarray: UINT64_T */ -#line 2001 "MachineIndependent/glslang.y" +#line 1950 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; } -#line 7920 "MachineIndependent/glslang_tab.cpp" +#line 7919 "MachineIndependent/glslang_tab.cpp" break; case 262: /* type_specifier_nonarray: DVEC2 */ -#line 2006 "MachineIndependent/glslang.y" +#line 1955 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7929,11 +7928,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 7933 "MachineIndependent/glslang_tab.cpp" +#line 7932 "MachineIndependent/glslang_tab.cpp" break; case 263: /* type_specifier_nonarray: DVEC3 */ -#line 2014 "MachineIndependent/glslang.y" +#line 1963 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7942,11 +7941,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 7946 "MachineIndependent/glslang_tab.cpp" +#line 7945 "MachineIndependent/glslang_tab.cpp" break; case 264: /* type_specifier_nonarray: DVEC4 */ -#line 2022 "MachineIndependent/glslang.y" +#line 1971 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7955,374 +7954,374 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 7959 "MachineIndependent/glslang_tab.cpp" +#line 7958 "MachineIndependent/glslang_tab.cpp" break; case 265: /* type_specifier_nonarray: F16VEC2 */ -#line 2030 "MachineIndependent/glslang.y" +#line 1979 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(2); } -#line 7970 "MachineIndependent/glslang_tab.cpp" +#line 7969 "MachineIndependent/glslang_tab.cpp" break; case 266: /* type_specifier_nonarray: F16VEC3 */ -#line 2036 "MachineIndependent/glslang.y" +#line 1985 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(3); } -#line 7981 "MachineIndependent/glslang_tab.cpp" +#line 7980 "MachineIndependent/glslang_tab.cpp" break; case 267: /* type_specifier_nonarray: F16VEC4 */ -#line 2042 "MachineIndependent/glslang.y" +#line 1991 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setVector(4); } -#line 7992 "MachineIndependent/glslang_tab.cpp" +#line 7991 "MachineIndependent/glslang_tab.cpp" break; case 268: /* type_specifier_nonarray: F32VEC2 */ -#line 2048 "MachineIndependent/glslang.y" +#line 1997 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 8003 "MachineIndependent/glslang_tab.cpp" +#line 8002 "MachineIndependent/glslang_tab.cpp" break; case 269: /* type_specifier_nonarray: F32VEC3 */ -#line 2054 "MachineIndependent/glslang.y" +#line 2003 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 8014 "MachineIndependent/glslang_tab.cpp" +#line 8013 "MachineIndependent/glslang_tab.cpp" break; case 270: /* type_specifier_nonarray: F32VEC4 */ -#line 2060 "MachineIndependent/glslang.y" +#line 2009 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 8025 "MachineIndependent/glslang_tab.cpp" +#line 8024 "MachineIndependent/glslang_tab.cpp" break; case 271: /* type_specifier_nonarray: F64VEC2 */ -#line 2066 "MachineIndependent/glslang.y" +#line 2015 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 8036 "MachineIndependent/glslang_tab.cpp" +#line 8035 "MachineIndependent/glslang_tab.cpp" break; case 272: /* type_specifier_nonarray: F64VEC3 */ -#line 2072 "MachineIndependent/glslang.y" +#line 2021 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 8047 "MachineIndependent/glslang_tab.cpp" +#line 8046 "MachineIndependent/glslang_tab.cpp" break; case 273: /* type_specifier_nonarray: F64VEC4 */ -#line 2078 "MachineIndependent/glslang.y" +#line 2027 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 8058 "MachineIndependent/glslang_tab.cpp" +#line 8057 "MachineIndependent/glslang_tab.cpp" break; case 274: /* type_specifier_nonarray: I8VEC2 */ -#line 2084 "MachineIndependent/glslang.y" +#line 2033 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(2); } -#line 8069 "MachineIndependent/glslang_tab.cpp" +#line 8068 "MachineIndependent/glslang_tab.cpp" break; case 275: /* type_specifier_nonarray: I8VEC3 */ -#line 2090 "MachineIndependent/glslang.y" +#line 2039 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(3); } -#line 8080 "MachineIndependent/glslang_tab.cpp" +#line 8079 "MachineIndependent/glslang_tab.cpp" break; case 276: /* type_specifier_nonarray: I8VEC4 */ -#line 2096 "MachineIndependent/glslang.y" +#line 2045 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(4); } -#line 8091 "MachineIndependent/glslang_tab.cpp" +#line 8090 "MachineIndependent/glslang_tab.cpp" break; case 277: /* type_specifier_nonarray: I16VEC2 */ -#line 2102 "MachineIndependent/glslang.y" +#line 2051 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(2); } -#line 8102 "MachineIndependent/glslang_tab.cpp" +#line 8101 "MachineIndependent/glslang_tab.cpp" break; case 278: /* type_specifier_nonarray: I16VEC3 */ -#line 2108 "MachineIndependent/glslang.y" +#line 2057 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(3); } -#line 8113 "MachineIndependent/glslang_tab.cpp" +#line 8112 "MachineIndependent/glslang_tab.cpp" break; case 279: /* type_specifier_nonarray: I16VEC4 */ -#line 2114 "MachineIndependent/glslang.y" +#line 2063 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(4); } -#line 8124 "MachineIndependent/glslang_tab.cpp" +#line 8123 "MachineIndependent/glslang_tab.cpp" break; case 280: /* type_specifier_nonarray: I32VEC2 */ -#line 2120 "MachineIndependent/glslang.y" +#line 2069 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(2); } -#line 8135 "MachineIndependent/glslang_tab.cpp" +#line 8134 "MachineIndependent/glslang_tab.cpp" break; case 281: /* type_specifier_nonarray: I32VEC3 */ -#line 2126 "MachineIndependent/glslang.y" +#line 2075 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 8146 "MachineIndependent/glslang_tab.cpp" +#line 8145 "MachineIndependent/glslang_tab.cpp" break; case 282: /* type_specifier_nonarray: I32VEC4 */ -#line 2132 "MachineIndependent/glslang.y" +#line 2081 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 8157 "MachineIndependent/glslang_tab.cpp" +#line 8156 "MachineIndependent/glslang_tab.cpp" break; case 283: /* type_specifier_nonarray: I64VEC2 */ -#line 2138 "MachineIndependent/glslang.y" +#line 2087 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(2); } -#line 8168 "MachineIndependent/glslang_tab.cpp" +#line 8167 "MachineIndependent/glslang_tab.cpp" break; case 284: /* type_specifier_nonarray: I64VEC3 */ -#line 2144 "MachineIndependent/glslang.y" +#line 2093 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(3); } -#line 8179 "MachineIndependent/glslang_tab.cpp" +#line 8178 "MachineIndependent/glslang_tab.cpp" break; case 285: /* type_specifier_nonarray: I64VEC4 */ -#line 2150 "MachineIndependent/glslang.y" +#line 2099 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(4); } -#line 8190 "MachineIndependent/glslang_tab.cpp" +#line 8189 "MachineIndependent/glslang_tab.cpp" break; case 286: /* type_specifier_nonarray: U8VEC2 */ -#line 2156 "MachineIndependent/glslang.y" +#line 2105 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(2); } -#line 8201 "MachineIndependent/glslang_tab.cpp" +#line 8200 "MachineIndependent/glslang_tab.cpp" break; case 287: /* type_specifier_nonarray: U8VEC3 */ -#line 2162 "MachineIndependent/glslang.y" +#line 2111 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(3); } -#line 8212 "MachineIndependent/glslang_tab.cpp" +#line 8211 "MachineIndependent/glslang_tab.cpp" break; case 288: /* type_specifier_nonarray: U8VEC4 */ -#line 2168 "MachineIndependent/glslang.y" +#line 2117 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(4); } -#line 8223 "MachineIndependent/glslang_tab.cpp" +#line 8222 "MachineIndependent/glslang_tab.cpp" break; case 289: /* type_specifier_nonarray: U16VEC2 */ -#line 2174 "MachineIndependent/glslang.y" +#line 2123 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(2); } -#line 8234 "MachineIndependent/glslang_tab.cpp" +#line 8233 "MachineIndependent/glslang_tab.cpp" break; case 290: /* type_specifier_nonarray: U16VEC3 */ -#line 2180 "MachineIndependent/glslang.y" +#line 2129 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(3); } -#line 8245 "MachineIndependent/glslang_tab.cpp" +#line 8244 "MachineIndependent/glslang_tab.cpp" break; case 291: /* type_specifier_nonarray: U16VEC4 */ -#line 2186 "MachineIndependent/glslang.y" +#line 2135 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; (yyval.interm.type).setVector(4); } -#line 8256 "MachineIndependent/glslang_tab.cpp" +#line 8255 "MachineIndependent/glslang_tab.cpp" break; case 292: /* type_specifier_nonarray: U32VEC2 */ -#line 2192 "MachineIndependent/glslang.y" +#line 2141 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 8267 "MachineIndependent/glslang_tab.cpp" +#line 8266 "MachineIndependent/glslang_tab.cpp" break; case 293: /* type_specifier_nonarray: U32VEC3 */ -#line 2198 "MachineIndependent/glslang.y" +#line 2147 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 8278 "MachineIndependent/glslang_tab.cpp" +#line 8277 "MachineIndependent/glslang_tab.cpp" break; case 294: /* type_specifier_nonarray: U32VEC4 */ -#line 2204 "MachineIndependent/glslang.y" +#line 2153 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 8289 "MachineIndependent/glslang_tab.cpp" +#line 8288 "MachineIndependent/glslang_tab.cpp" break; case 295: /* type_specifier_nonarray: U64VEC2 */ -#line 2210 "MachineIndependent/glslang.y" +#line 2159 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(2); } -#line 8300 "MachineIndependent/glslang_tab.cpp" +#line 8299 "MachineIndependent/glslang_tab.cpp" break; case 296: /* type_specifier_nonarray: U64VEC3 */ -#line 2216 "MachineIndependent/glslang.y" +#line 2165 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(3); } -#line 8311 "MachineIndependent/glslang_tab.cpp" +#line 8310 "MachineIndependent/glslang_tab.cpp" break; case 297: /* type_specifier_nonarray: U64VEC4 */ -#line 2222 "MachineIndependent/glslang.y" +#line 2171 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(4); } -#line 8322 "MachineIndependent/glslang_tab.cpp" +#line 8321 "MachineIndependent/glslang_tab.cpp" break; case 298: /* type_specifier_nonarray: DMAT2 */ -#line 2228 "MachineIndependent/glslang.y" +#line 2177 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8331,11 +8330,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8335 "MachineIndependent/glslang_tab.cpp" +#line 8334 "MachineIndependent/glslang_tab.cpp" break; case 299: /* type_specifier_nonarray: DMAT3 */ -#line 2236 "MachineIndependent/glslang.y" +#line 2185 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8344,11 +8343,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8348 "MachineIndependent/glslang_tab.cpp" +#line 8347 "MachineIndependent/glslang_tab.cpp" break; case 300: /* type_specifier_nonarray: DMAT4 */ -#line 2244 "MachineIndependent/glslang.y" +#line 2193 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8357,11 +8356,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8361 "MachineIndependent/glslang_tab.cpp" +#line 8360 "MachineIndependent/glslang_tab.cpp" break; case 301: /* type_specifier_nonarray: DMAT2X2 */ -#line 2252 "MachineIndependent/glslang.y" +#line 2201 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8370,11 +8369,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8374 "MachineIndependent/glslang_tab.cpp" +#line 8373 "MachineIndependent/glslang_tab.cpp" break; case 302: /* type_specifier_nonarray: DMAT2X3 */ -#line 2260 "MachineIndependent/glslang.y" +#line 2209 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8383,11 +8382,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 8387 "MachineIndependent/glslang_tab.cpp" +#line 8386 "MachineIndependent/glslang_tab.cpp" break; case 303: /* type_specifier_nonarray: DMAT2X4 */ -#line 2268 "MachineIndependent/glslang.y" +#line 2217 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8396,11 +8395,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 8400 "MachineIndependent/glslang_tab.cpp" +#line 8399 "MachineIndependent/glslang_tab.cpp" break; case 304: /* type_specifier_nonarray: DMAT3X2 */ -#line 2276 "MachineIndependent/glslang.y" +#line 2225 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8409,11 +8408,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 8413 "MachineIndependent/glslang_tab.cpp" +#line 8412 "MachineIndependent/glslang_tab.cpp" break; case 305: /* type_specifier_nonarray: DMAT3X3 */ -#line 2284 "MachineIndependent/glslang.y" +#line 2233 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8422,11 +8421,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8426 "MachineIndependent/glslang_tab.cpp" +#line 8425 "MachineIndependent/glslang_tab.cpp" break; case 306: /* type_specifier_nonarray: DMAT3X4 */ -#line 2292 "MachineIndependent/glslang.y" +#line 2241 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8435,11 +8434,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 8439 "MachineIndependent/glslang_tab.cpp" +#line 8438 "MachineIndependent/glslang_tab.cpp" break; case 307: /* type_specifier_nonarray: DMAT4X2 */ -#line 2300 "MachineIndependent/glslang.y" +#line 2249 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8448,11 +8447,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 8452 "MachineIndependent/glslang_tab.cpp" +#line 8451 "MachineIndependent/glslang_tab.cpp" break; case 308: /* type_specifier_nonarray: DMAT4X3 */ -#line 2308 "MachineIndependent/glslang.y" +#line 2257 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8461,11 +8460,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 8465 "MachineIndependent/glslang_tab.cpp" +#line 8464 "MachineIndependent/glslang_tab.cpp" break; case 309: /* type_specifier_nonarray: DMAT4X4 */ -#line 2316 "MachineIndependent/glslang.y" +#line 2265 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8474,2261 +8473,2261 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8478 "MachineIndependent/glslang_tab.cpp" +#line 8477 "MachineIndependent/glslang_tab.cpp" break; case 310: /* type_specifier_nonarray: F16MAT2 */ -#line 2324 "MachineIndependent/glslang.y" +#line 2273 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 8489 "MachineIndependent/glslang_tab.cpp" +#line 8488 "MachineIndependent/glslang_tab.cpp" break; case 311: /* type_specifier_nonarray: F16MAT3 */ -#line 2330 "MachineIndependent/glslang.y" +#line 2279 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 8500 "MachineIndependent/glslang_tab.cpp" +#line 8499 "MachineIndependent/glslang_tab.cpp" break; case 312: /* type_specifier_nonarray: F16MAT4 */ -#line 2336 "MachineIndependent/glslang.y" +#line 2285 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 8511 "MachineIndependent/glslang_tab.cpp" +#line 8510 "MachineIndependent/glslang_tab.cpp" break; case 313: /* type_specifier_nonarray: F16MAT2X2 */ -#line 2342 "MachineIndependent/glslang.y" +#line 2291 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 8522 "MachineIndependent/glslang_tab.cpp" +#line 8521 "MachineIndependent/glslang_tab.cpp" break; case 314: /* type_specifier_nonarray: F16MAT2X3 */ -#line 2348 "MachineIndependent/glslang.y" +#line 2297 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 3); } -#line 8533 "MachineIndependent/glslang_tab.cpp" +#line 8532 "MachineIndependent/glslang_tab.cpp" break; case 315: /* type_specifier_nonarray: F16MAT2X4 */ -#line 2354 "MachineIndependent/glslang.y" +#line 2303 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 4); } -#line 8544 "MachineIndependent/glslang_tab.cpp" +#line 8543 "MachineIndependent/glslang_tab.cpp" break; case 316: /* type_specifier_nonarray: F16MAT3X2 */ -#line 2360 "MachineIndependent/glslang.y" +#line 2309 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 2); } -#line 8555 "MachineIndependent/glslang_tab.cpp" +#line 8554 "MachineIndependent/glslang_tab.cpp" break; case 317: /* type_specifier_nonarray: F16MAT3X3 */ -#line 2366 "MachineIndependent/glslang.y" +#line 2315 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 8566 "MachineIndependent/glslang_tab.cpp" +#line 8565 "MachineIndependent/glslang_tab.cpp" break; case 318: /* type_specifier_nonarray: F16MAT3X4 */ -#line 2372 "MachineIndependent/glslang.y" +#line 2321 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 4); } -#line 8577 "MachineIndependent/glslang_tab.cpp" +#line 8576 "MachineIndependent/glslang_tab.cpp" break; case 319: /* type_specifier_nonarray: F16MAT4X2 */ -#line 2378 "MachineIndependent/glslang.y" +#line 2327 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 2); } -#line 8588 "MachineIndependent/glslang_tab.cpp" +#line 8587 "MachineIndependent/glslang_tab.cpp" break; case 320: /* type_specifier_nonarray: F16MAT4X3 */ -#line 2384 "MachineIndependent/glslang.y" +#line 2333 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 3); } -#line 8599 "MachineIndependent/glslang_tab.cpp" +#line 8598 "MachineIndependent/glslang_tab.cpp" break; case 321: /* type_specifier_nonarray: F16MAT4X4 */ -#line 2390 "MachineIndependent/glslang.y" +#line 2339 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 8610 "MachineIndependent/glslang_tab.cpp" +#line 8609 "MachineIndependent/glslang_tab.cpp" break; case 322: /* type_specifier_nonarray: F32MAT2 */ -#line 2396 "MachineIndependent/glslang.y" +#line 2345 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 8621 "MachineIndependent/glslang_tab.cpp" +#line 8620 "MachineIndependent/glslang_tab.cpp" break; case 323: /* type_specifier_nonarray: F32MAT3 */ -#line 2402 "MachineIndependent/glslang.y" +#line 2351 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 8632 "MachineIndependent/glslang_tab.cpp" +#line 8631 "MachineIndependent/glslang_tab.cpp" break; case 324: /* type_specifier_nonarray: F32MAT4 */ -#line 2408 "MachineIndependent/glslang.y" +#line 2357 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 8643 "MachineIndependent/glslang_tab.cpp" +#line 8642 "MachineIndependent/glslang_tab.cpp" break; case 325: /* type_specifier_nonarray: F32MAT2X2 */ -#line 2414 "MachineIndependent/glslang.y" +#line 2363 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 8654 "MachineIndependent/glslang_tab.cpp" +#line 8653 "MachineIndependent/glslang_tab.cpp" break; case 326: /* type_specifier_nonarray: F32MAT2X3 */ -#line 2420 "MachineIndependent/glslang.y" +#line 2369 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 8665 "MachineIndependent/glslang_tab.cpp" +#line 8664 "MachineIndependent/glslang_tab.cpp" break; case 327: /* type_specifier_nonarray: F32MAT2X4 */ -#line 2426 "MachineIndependent/glslang.y" +#line 2375 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 8676 "MachineIndependent/glslang_tab.cpp" +#line 8675 "MachineIndependent/glslang_tab.cpp" break; case 328: /* type_specifier_nonarray: F32MAT3X2 */ -#line 2432 "MachineIndependent/glslang.y" +#line 2381 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 8687 "MachineIndependent/glslang_tab.cpp" +#line 8686 "MachineIndependent/glslang_tab.cpp" break; case 329: /* type_specifier_nonarray: F32MAT3X3 */ -#line 2438 "MachineIndependent/glslang.y" +#line 2387 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 8698 "MachineIndependent/glslang_tab.cpp" +#line 8697 "MachineIndependent/glslang_tab.cpp" break; case 330: /* type_specifier_nonarray: F32MAT3X4 */ -#line 2444 "MachineIndependent/glslang.y" +#line 2393 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 8709 "MachineIndependent/glslang_tab.cpp" +#line 8708 "MachineIndependent/glslang_tab.cpp" break; case 331: /* type_specifier_nonarray: F32MAT4X2 */ -#line 2450 "MachineIndependent/glslang.y" +#line 2399 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 8720 "MachineIndependent/glslang_tab.cpp" +#line 8719 "MachineIndependent/glslang_tab.cpp" break; case 332: /* type_specifier_nonarray: F32MAT4X3 */ -#line 2456 "MachineIndependent/glslang.y" +#line 2405 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 8731 "MachineIndependent/glslang_tab.cpp" +#line 8730 "MachineIndependent/glslang_tab.cpp" break; case 333: /* type_specifier_nonarray: F32MAT4X4 */ -#line 2462 "MachineIndependent/glslang.y" +#line 2411 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 8742 "MachineIndependent/glslang_tab.cpp" +#line 8741 "MachineIndependent/glslang_tab.cpp" break; case 334: /* type_specifier_nonarray: F64MAT2 */ -#line 2468 "MachineIndependent/glslang.y" +#line 2417 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8753 "MachineIndependent/glslang_tab.cpp" +#line 8752 "MachineIndependent/glslang_tab.cpp" break; case 335: /* type_specifier_nonarray: F64MAT3 */ -#line 2474 "MachineIndependent/glslang.y" +#line 2423 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8764 "MachineIndependent/glslang_tab.cpp" +#line 8763 "MachineIndependent/glslang_tab.cpp" break; case 336: /* type_specifier_nonarray: F64MAT4 */ -#line 2480 "MachineIndependent/glslang.y" +#line 2429 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8775 "MachineIndependent/glslang_tab.cpp" +#line 8774 "MachineIndependent/glslang_tab.cpp" break; case 337: /* type_specifier_nonarray: F64MAT2X2 */ -#line 2486 "MachineIndependent/glslang.y" +#line 2435 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8786 "MachineIndependent/glslang_tab.cpp" +#line 8785 "MachineIndependent/glslang_tab.cpp" break; case 338: /* type_specifier_nonarray: F64MAT2X3 */ -#line 2492 "MachineIndependent/glslang.y" +#line 2441 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 8797 "MachineIndependent/glslang_tab.cpp" +#line 8796 "MachineIndependent/glslang_tab.cpp" break; case 339: /* type_specifier_nonarray: F64MAT2X4 */ -#line 2498 "MachineIndependent/glslang.y" +#line 2447 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 8808 "MachineIndependent/glslang_tab.cpp" +#line 8807 "MachineIndependent/glslang_tab.cpp" break; case 340: /* type_specifier_nonarray: F64MAT3X2 */ -#line 2504 "MachineIndependent/glslang.y" +#line 2453 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 8819 "MachineIndependent/glslang_tab.cpp" +#line 8818 "MachineIndependent/glslang_tab.cpp" break; case 341: /* type_specifier_nonarray: F64MAT3X3 */ -#line 2510 "MachineIndependent/glslang.y" +#line 2459 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8830 "MachineIndependent/glslang_tab.cpp" +#line 8829 "MachineIndependent/glslang_tab.cpp" break; case 342: /* type_specifier_nonarray: F64MAT3X4 */ -#line 2516 "MachineIndependent/glslang.y" +#line 2465 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 8841 "MachineIndependent/glslang_tab.cpp" +#line 8840 "MachineIndependent/glslang_tab.cpp" break; case 343: /* type_specifier_nonarray: F64MAT4X2 */ -#line 2522 "MachineIndependent/glslang.y" +#line 2471 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 8852 "MachineIndependent/glslang_tab.cpp" +#line 8851 "MachineIndependent/glslang_tab.cpp" break; case 344: /* type_specifier_nonarray: F64MAT4X3 */ -#line 2528 "MachineIndependent/glslang.y" +#line 2477 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 8863 "MachineIndependent/glslang_tab.cpp" +#line 8862 "MachineIndependent/glslang_tab.cpp" break; case 345: /* type_specifier_nonarray: F64MAT4X4 */ -#line 2534 "MachineIndependent/glslang.y" +#line 2483 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8874 "MachineIndependent/glslang_tab.cpp" +#line 8873 "MachineIndependent/glslang_tab.cpp" break; case 346: /* type_specifier_nonarray: ACCSTRUCTNV */ -#line 2540 "MachineIndependent/glslang.y" +#line 2489 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 8883 "MachineIndependent/glslang_tab.cpp" +#line 8882 "MachineIndependent/glslang_tab.cpp" break; case 347: /* type_specifier_nonarray: ACCSTRUCTEXT */ -#line 2544 "MachineIndependent/glslang.y" +#line 2493 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 8892 "MachineIndependent/glslang_tab.cpp" +#line 8891 "MachineIndependent/glslang_tab.cpp" break; case 348: /* type_specifier_nonarray: RAYQUERYEXT */ -#line 2548 "MachineIndependent/glslang.y" +#line 2497 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtRayQuery; } -#line 8901 "MachineIndependent/glslang_tab.cpp" +#line 8900 "MachineIndependent/glslang_tab.cpp" break; case 349: /* type_specifier_nonarray: ATOMIC_UINT */ -#line 2552 "MachineIndependent/glslang.y" +#line 2501 "MachineIndependent/glslang.y" { parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAtomicUint; } -#line 8911 "MachineIndependent/glslang_tab.cpp" +#line 8910 "MachineIndependent/glslang_tab.cpp" break; case 350: /* type_specifier_nonarray: SAMPLER1D */ -#line 2557 "MachineIndependent/glslang.y" +#line 2506 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D); } -#line 8921 "MachineIndependent/glslang_tab.cpp" +#line 8920 "MachineIndependent/glslang_tab.cpp" break; case 351: /* type_specifier_nonarray: SAMPLER2D */ -#line 2563 "MachineIndependent/glslang.y" +#line 2511 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); } -#line 8931 "MachineIndependent/glslang_tab.cpp" +#line 8930 "MachineIndependent/glslang_tab.cpp" break; case 352: /* type_specifier_nonarray: SAMPLER3D */ -#line 2568 "MachineIndependent/glslang.y" +#line 2516 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd3D); } -#line 8941 "MachineIndependent/glslang_tab.cpp" +#line 8940 "MachineIndependent/glslang_tab.cpp" break; case 353: /* type_specifier_nonarray: SAMPLERCUBE */ -#line 2573 "MachineIndependent/glslang.y" +#line 2521 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube); } -#line 8951 "MachineIndependent/glslang_tab.cpp" +#line 8950 "MachineIndependent/glslang_tab.cpp" break; case 354: /* type_specifier_nonarray: SAMPLER2DSHADOW */ -#line 2578 "MachineIndependent/glslang.y" +#line 2526 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); } -#line 8961 "MachineIndependent/glslang_tab.cpp" +#line 8960 "MachineIndependent/glslang_tab.cpp" break; case 355: /* type_specifier_nonarray: SAMPLERCUBESHADOW */ -#line 2583 "MachineIndependent/glslang.y" +#line 2531 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); } -#line 8971 "MachineIndependent/glslang_tab.cpp" +#line 8970 "MachineIndependent/glslang_tab.cpp" break; case 356: /* type_specifier_nonarray: SAMPLER2DARRAY */ -#line 2588 "MachineIndependent/glslang.y" +#line 2536 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); } -#line 8981 "MachineIndependent/glslang_tab.cpp" +#line 8980 "MachineIndependent/glslang_tab.cpp" break; case 357: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */ -#line 2593 "MachineIndependent/glslang.y" +#line 2541 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); } -#line 8991 "MachineIndependent/glslang_tab.cpp" +#line 8990 "MachineIndependent/glslang_tab.cpp" break; case 358: /* type_specifier_nonarray: SAMPLER1DSHADOW */ -#line 2599 "MachineIndependent/glslang.y" +#line 2546 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); } -#line 9001 "MachineIndependent/glslang_tab.cpp" +#line 9000 "MachineIndependent/glslang_tab.cpp" break; case 359: /* type_specifier_nonarray: SAMPLER1DARRAY */ -#line 2604 "MachineIndependent/glslang.y" +#line 2551 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); } -#line 9011 "MachineIndependent/glslang_tab.cpp" +#line 9010 "MachineIndependent/glslang_tab.cpp" break; case 360: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */ -#line 2609 "MachineIndependent/glslang.y" +#line 2556 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); } -#line 9021 "MachineIndependent/glslang_tab.cpp" +#line 9020 "MachineIndependent/glslang_tab.cpp" break; case 361: /* type_specifier_nonarray: SAMPLERCUBEARRAY */ -#line 2614 "MachineIndependent/glslang.y" +#line 2561 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); } -#line 9031 "MachineIndependent/glslang_tab.cpp" +#line 9030 "MachineIndependent/glslang_tab.cpp" break; case 362: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */ -#line 2619 "MachineIndependent/glslang.y" +#line 2566 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); } -#line 9041 "MachineIndependent/glslang_tab.cpp" +#line 9040 "MachineIndependent/glslang_tab.cpp" break; case 363: /* type_specifier_nonarray: F16SAMPLER1D */ -#line 2624 "MachineIndependent/glslang.y" +#line 2571 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D); } -#line 9052 "MachineIndependent/glslang_tab.cpp" +#line 9051 "MachineIndependent/glslang_tab.cpp" break; case 364: /* type_specifier_nonarray: F16SAMPLER2D */ -#line 2630 "MachineIndependent/glslang.y" +#line 2577 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D); } -#line 9063 "MachineIndependent/glslang_tab.cpp" +#line 9062 "MachineIndependent/glslang_tab.cpp" break; case 365: /* type_specifier_nonarray: F16SAMPLER3D */ -#line 2636 "MachineIndependent/glslang.y" +#line 2583 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd3D); } -#line 9074 "MachineIndependent/glslang_tab.cpp" +#line 9073 "MachineIndependent/glslang_tab.cpp" break; case 366: /* type_specifier_nonarray: F16SAMPLERCUBE */ -#line 2642 "MachineIndependent/glslang.y" +#line 2589 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube); } -#line 9085 "MachineIndependent/glslang_tab.cpp" +#line 9084 "MachineIndependent/glslang_tab.cpp" break; case 367: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */ -#line 2648 "MachineIndependent/glslang.y" +#line 2595 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, false, true); } -#line 9096 "MachineIndependent/glslang_tab.cpp" +#line 9095 "MachineIndependent/glslang_tab.cpp" break; case 368: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */ -#line 2654 "MachineIndependent/glslang.y" +#line 2601 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, true); } -#line 9107 "MachineIndependent/glslang_tab.cpp" +#line 9106 "MachineIndependent/glslang_tab.cpp" break; case 369: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */ -#line 2660 "MachineIndependent/glslang.y" +#line 2607 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, false, true); } -#line 9118 "MachineIndependent/glslang_tab.cpp" +#line 9117 "MachineIndependent/glslang_tab.cpp" break; case 370: /* type_specifier_nonarray: F16SAMPLER1DARRAY */ -#line 2666 "MachineIndependent/glslang.y" +#line 2613 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true); } -#line 9129 "MachineIndependent/glslang_tab.cpp" +#line 9128 "MachineIndependent/glslang_tab.cpp" break; case 371: /* type_specifier_nonarray: F16SAMPLER2DARRAY */ -#line 2672 "MachineIndependent/glslang.y" +#line 2619 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true); } -#line 9140 "MachineIndependent/glslang_tab.cpp" +#line 9139 "MachineIndependent/glslang_tab.cpp" break; case 372: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */ -#line 2678 "MachineIndependent/glslang.y" +#line 2625 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true, true); } -#line 9151 "MachineIndependent/glslang_tab.cpp" +#line 9150 "MachineIndependent/glslang_tab.cpp" break; case 373: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */ -#line 2684 "MachineIndependent/glslang.y" +#line 2631 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, true); } -#line 9162 "MachineIndependent/glslang_tab.cpp" +#line 9161 "MachineIndependent/glslang_tab.cpp" break; case 374: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */ -#line 2690 "MachineIndependent/glslang.y" +#line 2637 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true); } -#line 9173 "MachineIndependent/glslang_tab.cpp" +#line 9172 "MachineIndependent/glslang_tab.cpp" break; case 375: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */ -#line 2696 "MachineIndependent/glslang.y" +#line 2643 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true, true); } -#line 9184 "MachineIndependent/glslang_tab.cpp" +#line 9183 "MachineIndependent/glslang_tab.cpp" break; case 376: /* type_specifier_nonarray: ISAMPLER1D */ -#line 2702 "MachineIndependent/glslang.y" +#line 2649 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D); } -#line 9194 "MachineIndependent/glslang_tab.cpp" +#line 9193 "MachineIndependent/glslang_tab.cpp" break; case 377: /* type_specifier_nonarray: ISAMPLER2D */ -#line 2708 "MachineIndependent/glslang.y" +#line 2654 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D); } -#line 9204 "MachineIndependent/glslang_tab.cpp" +#line 9203 "MachineIndependent/glslang_tab.cpp" break; case 378: /* type_specifier_nonarray: ISAMPLER3D */ -#line 2713 "MachineIndependent/glslang.y" +#line 2659 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd3D); } -#line 9214 "MachineIndependent/glslang_tab.cpp" +#line 9213 "MachineIndependent/glslang_tab.cpp" break; case 379: /* type_specifier_nonarray: ISAMPLERCUBE */ -#line 2718 "MachineIndependent/glslang.y" +#line 2664 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube); } -#line 9224 "MachineIndependent/glslang_tab.cpp" +#line 9223 "MachineIndependent/glslang_tab.cpp" break; case 380: /* type_specifier_nonarray: ISAMPLER2DARRAY */ -#line 2723 "MachineIndependent/glslang.y" +#line 2669 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } -#line 9234 "MachineIndependent/glslang_tab.cpp" +#line 9233 "MachineIndependent/glslang_tab.cpp" break; case 381: /* type_specifier_nonarray: USAMPLER2D */ -#line 2728 "MachineIndependent/glslang.y" +#line 2674 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D); } -#line 9244 "MachineIndependent/glslang_tab.cpp" +#line 9243 "MachineIndependent/glslang_tab.cpp" break; case 382: /* type_specifier_nonarray: USAMPLER3D */ -#line 2733 "MachineIndependent/glslang.y" +#line 2679 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd3D); } -#line 9254 "MachineIndependent/glslang_tab.cpp" +#line 9253 "MachineIndependent/glslang_tab.cpp" break; case 383: /* type_specifier_nonarray: USAMPLERCUBE */ -#line 2738 "MachineIndependent/glslang.y" +#line 2684 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube); } -#line 9264 "MachineIndependent/glslang_tab.cpp" +#line 9263 "MachineIndependent/glslang_tab.cpp" break; case 384: /* type_specifier_nonarray: ISAMPLER1DARRAY */ -#line 2744 "MachineIndependent/glslang.y" +#line 2689 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } -#line 9274 "MachineIndependent/glslang_tab.cpp" +#line 9273 "MachineIndependent/glslang_tab.cpp" break; case 385: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */ -#line 2749 "MachineIndependent/glslang.y" +#line 2694 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } -#line 9284 "MachineIndependent/glslang_tab.cpp" +#line 9283 "MachineIndependent/glslang_tab.cpp" break; case 386: /* type_specifier_nonarray: USAMPLER1D */ -#line 2754 "MachineIndependent/glslang.y" +#line 2699 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D); } -#line 9294 "MachineIndependent/glslang_tab.cpp" +#line 9293 "MachineIndependent/glslang_tab.cpp" break; case 387: /* type_specifier_nonarray: USAMPLER1DARRAY */ -#line 2759 "MachineIndependent/glslang.y" +#line 2704 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } -#line 9304 "MachineIndependent/glslang_tab.cpp" +#line 9303 "MachineIndependent/glslang_tab.cpp" break; case 388: /* type_specifier_nonarray: USAMPLERCUBEARRAY */ -#line 2764 "MachineIndependent/glslang.y" +#line 2709 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } -#line 9314 "MachineIndependent/glslang_tab.cpp" +#line 9313 "MachineIndependent/glslang_tab.cpp" break; case 389: /* type_specifier_nonarray: TEXTURECUBEARRAY */ -#line 2769 "MachineIndependent/glslang.y" +#line 2714 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } -#line 9324 "MachineIndependent/glslang_tab.cpp" +#line 9323 "MachineIndependent/glslang_tab.cpp" break; case 390: /* type_specifier_nonarray: ITEXTURECUBEARRAY */ -#line 2774 "MachineIndependent/glslang.y" +#line 2719 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } -#line 9334 "MachineIndependent/glslang_tab.cpp" +#line 9333 "MachineIndependent/glslang_tab.cpp" break; case 391: /* type_specifier_nonarray: UTEXTURECUBEARRAY */ -#line 2779 "MachineIndependent/glslang.y" +#line 2724 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } -#line 9344 "MachineIndependent/glslang_tab.cpp" +#line 9343 "MachineIndependent/glslang_tab.cpp" break; case 392: /* type_specifier_nonarray: USAMPLER2DARRAY */ -#line 2785 "MachineIndependent/glslang.y" +#line 2729 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } -#line 9354 "MachineIndependent/glslang_tab.cpp" +#line 9353 "MachineIndependent/glslang_tab.cpp" break; case 393: /* type_specifier_nonarray: TEXTURE2D */ -#line 2790 "MachineIndependent/glslang.y" +#line 2734 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } -#line 9364 "MachineIndependent/glslang_tab.cpp" +#line 9363 "MachineIndependent/glslang_tab.cpp" break; case 394: /* type_specifier_nonarray: TEXTURE3D */ -#line 2795 "MachineIndependent/glslang.y" +#line 2739 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } -#line 9374 "MachineIndependent/glslang_tab.cpp" +#line 9373 "MachineIndependent/glslang_tab.cpp" break; case 395: /* type_specifier_nonarray: TEXTURE2DARRAY */ -#line 2800 "MachineIndependent/glslang.y" +#line 2744 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } -#line 9384 "MachineIndependent/glslang_tab.cpp" +#line 9383 "MachineIndependent/glslang_tab.cpp" break; case 396: /* type_specifier_nonarray: TEXTURECUBE */ -#line 2805 "MachineIndependent/glslang.y" +#line 2749 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } -#line 9394 "MachineIndependent/glslang_tab.cpp" +#line 9393 "MachineIndependent/glslang_tab.cpp" break; case 397: /* type_specifier_nonarray: ITEXTURE2D */ -#line 2810 "MachineIndependent/glslang.y" +#line 2754 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } -#line 9404 "MachineIndependent/glslang_tab.cpp" +#line 9403 "MachineIndependent/glslang_tab.cpp" break; case 398: /* type_specifier_nonarray: ITEXTURE3D */ -#line 2815 "MachineIndependent/glslang.y" +#line 2759 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } -#line 9414 "MachineIndependent/glslang_tab.cpp" +#line 9413 "MachineIndependent/glslang_tab.cpp" break; case 399: /* type_specifier_nonarray: ITEXTURECUBE */ -#line 2820 "MachineIndependent/glslang.y" +#line 2764 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } -#line 9424 "MachineIndependent/glslang_tab.cpp" +#line 9423 "MachineIndependent/glslang_tab.cpp" break; case 400: /* type_specifier_nonarray: ITEXTURE2DARRAY */ -#line 2825 "MachineIndependent/glslang.y" +#line 2769 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } -#line 9434 "MachineIndependent/glslang_tab.cpp" +#line 9433 "MachineIndependent/glslang_tab.cpp" break; case 401: /* type_specifier_nonarray: UTEXTURE2D */ -#line 2830 "MachineIndependent/glslang.y" +#line 2774 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } -#line 9444 "MachineIndependent/glslang_tab.cpp" +#line 9443 "MachineIndependent/glslang_tab.cpp" break; case 402: /* type_specifier_nonarray: UTEXTURE3D */ -#line 2835 "MachineIndependent/glslang.y" +#line 2779 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } -#line 9454 "MachineIndependent/glslang_tab.cpp" +#line 9453 "MachineIndependent/glslang_tab.cpp" break; case 403: /* type_specifier_nonarray: UTEXTURECUBE */ -#line 2840 "MachineIndependent/glslang.y" +#line 2784 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } -#line 9464 "MachineIndependent/glslang_tab.cpp" +#line 9463 "MachineIndependent/glslang_tab.cpp" break; case 404: /* type_specifier_nonarray: UTEXTURE2DARRAY */ -#line 2845 "MachineIndependent/glslang.y" +#line 2789 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } -#line 9474 "MachineIndependent/glslang_tab.cpp" +#line 9473 "MachineIndependent/glslang_tab.cpp" break; case 405: /* type_specifier_nonarray: SAMPLER */ -#line 2850 "MachineIndependent/glslang.y" +#line 2794 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(false); } -#line 9484 "MachineIndependent/glslang_tab.cpp" +#line 9483 "MachineIndependent/glslang_tab.cpp" break; case 406: /* type_specifier_nonarray: SAMPLERSHADOW */ -#line 2855 "MachineIndependent/glslang.y" +#line 2799 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(true); } -#line 9494 "MachineIndependent/glslang_tab.cpp" +#line 9493 "MachineIndependent/glslang_tab.cpp" break; case 407: /* type_specifier_nonarray: SAMPLER2DRECT */ -#line 2861 "MachineIndependent/glslang.y" +#line 2804 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } -#line 9504 "MachineIndependent/glslang_tab.cpp" +#line 9503 "MachineIndependent/glslang_tab.cpp" break; case 408: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */ -#line 2866 "MachineIndependent/glslang.y" +#line 2809 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } -#line 9514 "MachineIndependent/glslang_tab.cpp" +#line 9513 "MachineIndependent/glslang_tab.cpp" break; case 409: /* type_specifier_nonarray: F16SAMPLER2DRECT */ -#line 2871 "MachineIndependent/glslang.y" +#line 2814 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect); } -#line 9525 "MachineIndependent/glslang_tab.cpp" +#line 9524 "MachineIndependent/glslang_tab.cpp" break; case 410: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */ -#line 2877 "MachineIndependent/glslang.y" +#line 2820 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true); } -#line 9536 "MachineIndependent/glslang_tab.cpp" +#line 9535 "MachineIndependent/glslang_tab.cpp" break; case 411: /* type_specifier_nonarray: ISAMPLER2DRECT */ -#line 2883 "MachineIndependent/glslang.y" +#line 2826 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdRect); } -#line 9546 "MachineIndependent/glslang_tab.cpp" +#line 9545 "MachineIndependent/glslang_tab.cpp" break; case 412: /* type_specifier_nonarray: USAMPLER2DRECT */ -#line 2888 "MachineIndependent/glslang.y" +#line 2831 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdRect); } -#line 9556 "MachineIndependent/glslang_tab.cpp" +#line 9555 "MachineIndependent/glslang_tab.cpp" break; case 413: /* type_specifier_nonarray: SAMPLERBUFFER */ -#line 2893 "MachineIndependent/glslang.y" +#line 2836 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } -#line 9566 "MachineIndependent/glslang_tab.cpp" +#line 9565 "MachineIndependent/glslang_tab.cpp" break; case 414: /* type_specifier_nonarray: F16SAMPLERBUFFER */ -#line 2898 "MachineIndependent/glslang.y" +#line 2841 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer); } -#line 9577 "MachineIndependent/glslang_tab.cpp" +#line 9576 "MachineIndependent/glslang_tab.cpp" break; case 415: /* type_specifier_nonarray: ISAMPLERBUFFER */ -#line 2904 "MachineIndependent/glslang.y" +#line 2847 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } -#line 9587 "MachineIndependent/glslang_tab.cpp" +#line 9586 "MachineIndependent/glslang_tab.cpp" break; case 416: /* type_specifier_nonarray: USAMPLERBUFFER */ -#line 2909 "MachineIndependent/glslang.y" +#line 2852 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } -#line 9597 "MachineIndependent/glslang_tab.cpp" +#line 9596 "MachineIndependent/glslang_tab.cpp" break; case 417: /* type_specifier_nonarray: SAMPLER2DMS */ -#line 2914 "MachineIndependent/glslang.y" +#line 2857 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } -#line 9607 "MachineIndependent/glslang_tab.cpp" +#line 9606 "MachineIndependent/glslang_tab.cpp" break; case 418: /* type_specifier_nonarray: F16SAMPLER2DMS */ -#line 2919 "MachineIndependent/glslang.y" +#line 2862 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true); } -#line 9618 "MachineIndependent/glslang_tab.cpp" +#line 9617 "MachineIndependent/glslang_tab.cpp" break; case 419: /* type_specifier_nonarray: ISAMPLER2DMS */ -#line 2925 "MachineIndependent/glslang.y" +#line 2868 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } -#line 9628 "MachineIndependent/glslang_tab.cpp" +#line 9627 "MachineIndependent/glslang_tab.cpp" break; case 420: /* type_specifier_nonarray: USAMPLER2DMS */ -#line 2930 "MachineIndependent/glslang.y" +#line 2873 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } -#line 9638 "MachineIndependent/glslang_tab.cpp" +#line 9637 "MachineIndependent/glslang_tab.cpp" break; case 421: /* type_specifier_nonarray: SAMPLER2DMSARRAY */ -#line 2935 "MachineIndependent/glslang.y" +#line 2878 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } -#line 9648 "MachineIndependent/glslang_tab.cpp" +#line 9647 "MachineIndependent/glslang_tab.cpp" break; case 422: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */ -#line 2940 "MachineIndependent/glslang.y" +#line 2883 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true); } -#line 9659 "MachineIndependent/glslang_tab.cpp" +#line 9658 "MachineIndependent/glslang_tab.cpp" break; case 423: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */ -#line 2946 "MachineIndependent/glslang.y" +#line 2889 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } -#line 9669 "MachineIndependent/glslang_tab.cpp" +#line 9668 "MachineIndependent/glslang_tab.cpp" break; case 424: /* type_specifier_nonarray: USAMPLER2DMSARRAY */ -#line 2951 "MachineIndependent/glslang.y" +#line 2894 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } -#line 9679 "MachineIndependent/glslang_tab.cpp" +#line 9678 "MachineIndependent/glslang_tab.cpp" break; case 425: /* type_specifier_nonarray: TEXTURE1D */ -#line 2956 "MachineIndependent/glslang.y" +#line 2899 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } -#line 9689 "MachineIndependent/glslang_tab.cpp" +#line 9688 "MachineIndependent/glslang_tab.cpp" break; case 426: /* type_specifier_nonarray: F16TEXTURE1D */ -#line 2961 "MachineIndependent/glslang.y" +#line 2904 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D); } -#line 9700 "MachineIndependent/glslang_tab.cpp" +#line 9699 "MachineIndependent/glslang_tab.cpp" break; case 427: /* type_specifier_nonarray: F16TEXTURE2D */ -#line 2967 "MachineIndependent/glslang.y" +#line 2910 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D); } -#line 9711 "MachineIndependent/glslang_tab.cpp" +#line 9710 "MachineIndependent/glslang_tab.cpp" break; case 428: /* type_specifier_nonarray: F16TEXTURE3D */ -#line 2973 "MachineIndependent/glslang.y" +#line 2916 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D); } -#line 9722 "MachineIndependent/glslang_tab.cpp" +#line 9721 "MachineIndependent/glslang_tab.cpp" break; case 429: /* type_specifier_nonarray: F16TEXTURECUBE */ -#line 2979 "MachineIndependent/glslang.y" +#line 2922 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube); } -#line 9733 "MachineIndependent/glslang_tab.cpp" +#line 9732 "MachineIndependent/glslang_tab.cpp" break; case 430: /* type_specifier_nonarray: TEXTURE1DARRAY */ -#line 2985 "MachineIndependent/glslang.y" +#line 2928 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } -#line 9743 "MachineIndependent/glslang_tab.cpp" +#line 9742 "MachineIndependent/glslang_tab.cpp" break; case 431: /* type_specifier_nonarray: F16TEXTURE1DARRAY */ -#line 2990 "MachineIndependent/glslang.y" +#line 2933 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true); } -#line 9754 "MachineIndependent/glslang_tab.cpp" +#line 9753 "MachineIndependent/glslang_tab.cpp" break; case 432: /* type_specifier_nonarray: F16TEXTURE2DARRAY */ -#line 2996 "MachineIndependent/glslang.y" +#line 2939 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true); } -#line 9765 "MachineIndependent/glslang_tab.cpp" +#line 9764 "MachineIndependent/glslang_tab.cpp" break; case 433: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */ -#line 3002 "MachineIndependent/glslang.y" +#line 2945 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true); } -#line 9776 "MachineIndependent/glslang_tab.cpp" +#line 9775 "MachineIndependent/glslang_tab.cpp" break; case 434: /* type_specifier_nonarray: ITEXTURE1D */ -#line 3008 "MachineIndependent/glslang.y" +#line 2951 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } -#line 9786 "MachineIndependent/glslang_tab.cpp" +#line 9785 "MachineIndependent/glslang_tab.cpp" break; case 435: /* type_specifier_nonarray: ITEXTURE1DARRAY */ -#line 3013 "MachineIndependent/glslang.y" +#line 2956 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } -#line 9796 "MachineIndependent/glslang_tab.cpp" +#line 9795 "MachineIndependent/glslang_tab.cpp" break; case 436: /* type_specifier_nonarray: UTEXTURE1D */ -#line 3018 "MachineIndependent/glslang.y" +#line 2961 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } -#line 9806 "MachineIndependent/glslang_tab.cpp" +#line 9805 "MachineIndependent/glslang_tab.cpp" break; case 437: /* type_specifier_nonarray: UTEXTURE1DARRAY */ -#line 3023 "MachineIndependent/glslang.y" +#line 2966 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } -#line 9816 "MachineIndependent/glslang_tab.cpp" +#line 9815 "MachineIndependent/glslang_tab.cpp" break; case 438: /* type_specifier_nonarray: TEXTURE2DRECT */ -#line 3028 "MachineIndependent/glslang.y" +#line 2971 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } -#line 9826 "MachineIndependent/glslang_tab.cpp" +#line 9825 "MachineIndependent/glslang_tab.cpp" break; case 439: /* type_specifier_nonarray: F16TEXTURE2DRECT */ -#line 3033 "MachineIndependent/glslang.y" +#line 2976 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdRect); } -#line 9837 "MachineIndependent/glslang_tab.cpp" +#line 9836 "MachineIndependent/glslang_tab.cpp" break; case 440: /* type_specifier_nonarray: ITEXTURE2DRECT */ -#line 3039 "MachineIndependent/glslang.y" +#line 2982 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } -#line 9847 "MachineIndependent/glslang_tab.cpp" +#line 9846 "MachineIndependent/glslang_tab.cpp" break; case 441: /* type_specifier_nonarray: UTEXTURE2DRECT */ -#line 3044 "MachineIndependent/glslang.y" +#line 2987 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } -#line 9857 "MachineIndependent/glslang_tab.cpp" +#line 9856 "MachineIndependent/glslang_tab.cpp" break; case 442: /* type_specifier_nonarray: TEXTUREBUFFER */ -#line 3049 "MachineIndependent/glslang.y" +#line 2992 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } -#line 9867 "MachineIndependent/glslang_tab.cpp" +#line 9866 "MachineIndependent/glslang_tab.cpp" break; case 443: /* type_specifier_nonarray: F16TEXTUREBUFFER */ -#line 3054 "MachineIndependent/glslang.y" +#line 2997 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdBuffer); } -#line 9878 "MachineIndependent/glslang_tab.cpp" +#line 9877 "MachineIndependent/glslang_tab.cpp" break; case 444: /* type_specifier_nonarray: ITEXTUREBUFFER */ -#line 3060 "MachineIndependent/glslang.y" +#line 3003 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } -#line 9888 "MachineIndependent/glslang_tab.cpp" +#line 9887 "MachineIndependent/glslang_tab.cpp" break; case 445: /* type_specifier_nonarray: UTEXTUREBUFFER */ -#line 3065 "MachineIndependent/glslang.y" +#line 3008 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } -#line 9898 "MachineIndependent/glslang_tab.cpp" +#line 9897 "MachineIndependent/glslang_tab.cpp" break; case 446: /* type_specifier_nonarray: TEXTURE2DMS */ -#line 3070 "MachineIndependent/glslang.y" +#line 3013 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } -#line 9908 "MachineIndependent/glslang_tab.cpp" +#line 9907 "MachineIndependent/glslang_tab.cpp" break; case 447: /* type_specifier_nonarray: F16TEXTURE2DMS */ -#line 3075 "MachineIndependent/glslang.y" +#line 3018 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, false, false, true); } -#line 9919 "MachineIndependent/glslang_tab.cpp" +#line 9918 "MachineIndependent/glslang_tab.cpp" break; case 448: /* type_specifier_nonarray: ITEXTURE2DMS */ -#line 3081 "MachineIndependent/glslang.y" +#line 3024 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } -#line 9929 "MachineIndependent/glslang_tab.cpp" +#line 9928 "MachineIndependent/glslang_tab.cpp" break; case 449: /* type_specifier_nonarray: UTEXTURE2DMS */ -#line 3086 "MachineIndependent/glslang.y" +#line 3029 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } -#line 9939 "MachineIndependent/glslang_tab.cpp" +#line 9938 "MachineIndependent/glslang_tab.cpp" break; case 450: /* type_specifier_nonarray: TEXTURE2DMSARRAY */ -#line 3091 "MachineIndependent/glslang.y" +#line 3034 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } -#line 9949 "MachineIndependent/glslang_tab.cpp" +#line 9948 "MachineIndependent/glslang_tab.cpp" break; case 451: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */ -#line 3096 "MachineIndependent/glslang.y" +#line 3039 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true, false, true); } -#line 9960 "MachineIndependent/glslang_tab.cpp" +#line 9959 "MachineIndependent/glslang_tab.cpp" break; case 452: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */ -#line 3102 "MachineIndependent/glslang.y" +#line 3045 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } -#line 9970 "MachineIndependent/glslang_tab.cpp" +#line 9969 "MachineIndependent/glslang_tab.cpp" break; case 453: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */ -#line 3107 "MachineIndependent/glslang.y" +#line 3050 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } -#line 9980 "MachineIndependent/glslang_tab.cpp" +#line 9979 "MachineIndependent/glslang_tab.cpp" break; case 454: /* type_specifier_nonarray: IMAGE1D */ -#line 3112 "MachineIndependent/glslang.y" +#line 3055 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } -#line 9990 "MachineIndependent/glslang_tab.cpp" +#line 9989 "MachineIndependent/glslang_tab.cpp" break; case 455: /* type_specifier_nonarray: F16IMAGE1D */ -#line 3117 "MachineIndependent/glslang.y" +#line 3060 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); } -#line 10001 "MachineIndependent/glslang_tab.cpp" +#line 10000 "MachineIndependent/glslang_tab.cpp" break; case 456: /* type_specifier_nonarray: IIMAGE1D */ -#line 3123 "MachineIndependent/glslang.y" +#line 3066 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } -#line 10011 "MachineIndependent/glslang_tab.cpp" +#line 10010 "MachineIndependent/glslang_tab.cpp" break; case 457: /* type_specifier_nonarray: UIMAGE1D */ -#line 3128 "MachineIndependent/glslang.y" +#line 3071 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } -#line 10021 "MachineIndependent/glslang_tab.cpp" +#line 10020 "MachineIndependent/glslang_tab.cpp" break; case 458: /* type_specifier_nonarray: IMAGE2D */ -#line 3133 "MachineIndependent/glslang.y" +#line 3076 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } -#line 10031 "MachineIndependent/glslang_tab.cpp" +#line 10030 "MachineIndependent/glslang_tab.cpp" break; case 459: /* type_specifier_nonarray: F16IMAGE2D */ -#line 3138 "MachineIndependent/glslang.y" +#line 3081 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); } -#line 10042 "MachineIndependent/glslang_tab.cpp" +#line 10041 "MachineIndependent/glslang_tab.cpp" break; case 460: /* type_specifier_nonarray: IIMAGE2D */ -#line 3144 "MachineIndependent/glslang.y" +#line 3087 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } -#line 10052 "MachineIndependent/glslang_tab.cpp" +#line 10051 "MachineIndependent/glslang_tab.cpp" break; case 461: /* type_specifier_nonarray: UIMAGE2D */ -#line 3149 "MachineIndependent/glslang.y" +#line 3092 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } -#line 10062 "MachineIndependent/glslang_tab.cpp" +#line 10061 "MachineIndependent/glslang_tab.cpp" break; case 462: /* type_specifier_nonarray: IMAGE3D */ -#line 3154 "MachineIndependent/glslang.y" +#line 3097 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } -#line 10072 "MachineIndependent/glslang_tab.cpp" +#line 10071 "MachineIndependent/glslang_tab.cpp" break; case 463: /* type_specifier_nonarray: F16IMAGE3D */ -#line 3159 "MachineIndependent/glslang.y" +#line 3102 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); } -#line 10083 "MachineIndependent/glslang_tab.cpp" +#line 10082 "MachineIndependent/glslang_tab.cpp" break; case 464: /* type_specifier_nonarray: IIMAGE3D */ -#line 3165 "MachineIndependent/glslang.y" +#line 3108 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } -#line 10093 "MachineIndependent/glslang_tab.cpp" +#line 10092 "MachineIndependent/glslang_tab.cpp" break; case 465: /* type_specifier_nonarray: UIMAGE3D */ -#line 3170 "MachineIndependent/glslang.y" +#line 3113 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } -#line 10103 "MachineIndependent/glslang_tab.cpp" +#line 10102 "MachineIndependent/glslang_tab.cpp" break; case 466: /* type_specifier_nonarray: IMAGE2DRECT */ -#line 3175 "MachineIndependent/glslang.y" +#line 3118 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } -#line 10113 "MachineIndependent/glslang_tab.cpp" +#line 10112 "MachineIndependent/glslang_tab.cpp" break; case 467: /* type_specifier_nonarray: F16IMAGE2DRECT */ -#line 3180 "MachineIndependent/glslang.y" +#line 3123 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); } -#line 10124 "MachineIndependent/glslang_tab.cpp" +#line 10123 "MachineIndependent/glslang_tab.cpp" break; case 468: /* type_specifier_nonarray: IIMAGE2DRECT */ -#line 3186 "MachineIndependent/glslang.y" +#line 3129 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } -#line 10134 "MachineIndependent/glslang_tab.cpp" +#line 10133 "MachineIndependent/glslang_tab.cpp" break; case 469: /* type_specifier_nonarray: UIMAGE2DRECT */ -#line 3191 "MachineIndependent/glslang.y" +#line 3134 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } -#line 10144 "MachineIndependent/glslang_tab.cpp" +#line 10143 "MachineIndependent/glslang_tab.cpp" break; case 470: /* type_specifier_nonarray: IMAGECUBE */ -#line 3196 "MachineIndependent/glslang.y" +#line 3139 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } -#line 10154 "MachineIndependent/glslang_tab.cpp" +#line 10153 "MachineIndependent/glslang_tab.cpp" break; case 471: /* type_specifier_nonarray: F16IMAGECUBE */ -#line 3201 "MachineIndependent/glslang.y" +#line 3144 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); } -#line 10165 "MachineIndependent/glslang_tab.cpp" +#line 10164 "MachineIndependent/glslang_tab.cpp" break; case 472: /* type_specifier_nonarray: IIMAGECUBE */ -#line 3207 "MachineIndependent/glslang.y" +#line 3150 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } -#line 10175 "MachineIndependent/glslang_tab.cpp" +#line 10174 "MachineIndependent/glslang_tab.cpp" break; case 473: /* type_specifier_nonarray: UIMAGECUBE */ -#line 3212 "MachineIndependent/glslang.y" +#line 3155 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } -#line 10185 "MachineIndependent/glslang_tab.cpp" +#line 10184 "MachineIndependent/glslang_tab.cpp" break; case 474: /* type_specifier_nonarray: IMAGEBUFFER */ -#line 3217 "MachineIndependent/glslang.y" +#line 3160 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } -#line 10195 "MachineIndependent/glslang_tab.cpp" +#line 10194 "MachineIndependent/glslang_tab.cpp" break; case 475: /* type_specifier_nonarray: F16IMAGEBUFFER */ -#line 3222 "MachineIndependent/glslang.y" +#line 3165 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); } -#line 10206 "MachineIndependent/glslang_tab.cpp" +#line 10205 "MachineIndependent/glslang_tab.cpp" break; case 476: /* type_specifier_nonarray: IIMAGEBUFFER */ -#line 3228 "MachineIndependent/glslang.y" +#line 3171 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } -#line 10216 "MachineIndependent/glslang_tab.cpp" +#line 10215 "MachineIndependent/glslang_tab.cpp" break; case 477: /* type_specifier_nonarray: UIMAGEBUFFER */ -#line 3233 "MachineIndependent/glslang.y" +#line 3176 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); } -#line 10226 "MachineIndependent/glslang_tab.cpp" +#line 10225 "MachineIndependent/glslang_tab.cpp" break; case 478: /* type_specifier_nonarray: IMAGE1DARRAY */ -#line 3238 "MachineIndependent/glslang.y" +#line 3181 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } -#line 10236 "MachineIndependent/glslang_tab.cpp" +#line 10235 "MachineIndependent/glslang_tab.cpp" break; case 479: /* type_specifier_nonarray: F16IMAGE1DARRAY */ -#line 3243 "MachineIndependent/glslang.y" +#line 3186 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); } -#line 10247 "MachineIndependent/glslang_tab.cpp" +#line 10246 "MachineIndependent/glslang_tab.cpp" break; case 480: /* type_specifier_nonarray: IIMAGE1DARRAY */ -#line 3249 "MachineIndependent/glslang.y" +#line 3192 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } -#line 10257 "MachineIndependent/glslang_tab.cpp" +#line 10256 "MachineIndependent/glslang_tab.cpp" break; case 481: /* type_specifier_nonarray: UIMAGE1DARRAY */ -#line 3254 "MachineIndependent/glslang.y" +#line 3197 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } -#line 10267 "MachineIndependent/glslang_tab.cpp" +#line 10266 "MachineIndependent/glslang_tab.cpp" break; case 482: /* type_specifier_nonarray: IMAGE2DARRAY */ -#line 3259 "MachineIndependent/glslang.y" +#line 3202 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } -#line 10277 "MachineIndependent/glslang_tab.cpp" +#line 10276 "MachineIndependent/glslang_tab.cpp" break; case 483: /* type_specifier_nonarray: F16IMAGE2DARRAY */ -#line 3264 "MachineIndependent/glslang.y" +#line 3207 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); } -#line 10288 "MachineIndependent/glslang_tab.cpp" +#line 10287 "MachineIndependent/glslang_tab.cpp" break; case 484: /* type_specifier_nonarray: IIMAGE2DARRAY */ -#line 3270 "MachineIndependent/glslang.y" +#line 3213 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } -#line 10298 "MachineIndependent/glslang_tab.cpp" +#line 10297 "MachineIndependent/glslang_tab.cpp" break; case 485: /* type_specifier_nonarray: UIMAGE2DARRAY */ -#line 3275 "MachineIndependent/glslang.y" +#line 3218 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); } -#line 10308 "MachineIndependent/glslang_tab.cpp" +#line 10307 "MachineIndependent/glslang_tab.cpp" break; case 486: /* type_specifier_nonarray: IMAGECUBEARRAY */ -#line 3280 "MachineIndependent/glslang.y" +#line 3223 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); } -#line 10318 "MachineIndependent/glslang_tab.cpp" +#line 10317 "MachineIndependent/glslang_tab.cpp" break; case 487: /* type_specifier_nonarray: F16IMAGECUBEARRAY */ -#line 3285 "MachineIndependent/glslang.y" +#line 3228 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); } -#line 10329 "MachineIndependent/glslang_tab.cpp" +#line 10328 "MachineIndependent/glslang_tab.cpp" break; case 488: /* type_specifier_nonarray: IIMAGECUBEARRAY */ -#line 3291 "MachineIndependent/glslang.y" +#line 3234 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); } -#line 10339 "MachineIndependent/glslang_tab.cpp" +#line 10338 "MachineIndependent/glslang_tab.cpp" break; case 489: /* type_specifier_nonarray: UIMAGECUBEARRAY */ -#line 3296 "MachineIndependent/glslang.y" +#line 3239 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); } -#line 10349 "MachineIndependent/glslang_tab.cpp" +#line 10348 "MachineIndependent/glslang_tab.cpp" break; case 490: /* type_specifier_nonarray: IMAGE2DMS */ -#line 3301 "MachineIndependent/glslang.y" +#line 3244 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); } -#line 10359 "MachineIndependent/glslang_tab.cpp" +#line 10358 "MachineIndependent/glslang_tab.cpp" break; case 491: /* type_specifier_nonarray: F16IMAGE2DMS */ -#line 3306 "MachineIndependent/glslang.y" +#line 3249 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); } -#line 10370 "MachineIndependent/glslang_tab.cpp" +#line 10369 "MachineIndependent/glslang_tab.cpp" break; case 492: /* type_specifier_nonarray: IIMAGE2DMS */ -#line 3312 "MachineIndependent/glslang.y" +#line 3255 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); } -#line 10380 "MachineIndependent/glslang_tab.cpp" +#line 10379 "MachineIndependent/glslang_tab.cpp" break; case 493: /* type_specifier_nonarray: UIMAGE2DMS */ -#line 3317 "MachineIndependent/glslang.y" +#line 3260 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); } -#line 10390 "MachineIndependent/glslang_tab.cpp" +#line 10389 "MachineIndependent/glslang_tab.cpp" break; case 494: /* type_specifier_nonarray: IMAGE2DMSARRAY */ -#line 3322 "MachineIndependent/glslang.y" +#line 3265 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); } -#line 10400 "MachineIndependent/glslang_tab.cpp" +#line 10399 "MachineIndependent/glslang_tab.cpp" break; case 495: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */ -#line 3327 "MachineIndependent/glslang.y" +#line 3270 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); } -#line 10411 "MachineIndependent/glslang_tab.cpp" +#line 10410 "MachineIndependent/glslang_tab.cpp" break; case 496: /* type_specifier_nonarray: IIMAGE2DMSARRAY */ -#line 3333 "MachineIndependent/glslang.y" +#line 3276 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); } -#line 10421 "MachineIndependent/glslang_tab.cpp" +#line 10420 "MachineIndependent/glslang_tab.cpp" break; case 497: /* type_specifier_nonarray: UIMAGE2DMSARRAY */ -#line 3338 "MachineIndependent/glslang.y" +#line 3281 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); } -#line 10431 "MachineIndependent/glslang_tab.cpp" +#line 10430 "MachineIndependent/glslang_tab.cpp" break; case 498: /* type_specifier_nonarray: I64IMAGE1D */ -#line 3343 "MachineIndependent/glslang.y" +#line 3286 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D); } -#line 10441 "MachineIndependent/glslang_tab.cpp" +#line 10440 "MachineIndependent/glslang_tab.cpp" break; case 499: /* type_specifier_nonarray: U64IMAGE1D */ -#line 3348 "MachineIndependent/glslang.y" +#line 3291 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D); } -#line 10451 "MachineIndependent/glslang_tab.cpp" +#line 10450 "MachineIndependent/glslang_tab.cpp" break; case 500: /* type_specifier_nonarray: I64IMAGE2D */ -#line 3353 "MachineIndependent/glslang.y" +#line 3296 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D); } -#line 10461 "MachineIndependent/glslang_tab.cpp" +#line 10460 "MachineIndependent/glslang_tab.cpp" break; case 501: /* type_specifier_nonarray: U64IMAGE2D */ -#line 3358 "MachineIndependent/glslang.y" +#line 3301 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D); } -#line 10471 "MachineIndependent/glslang_tab.cpp" +#line 10470 "MachineIndependent/glslang_tab.cpp" break; case 502: /* type_specifier_nonarray: I64IMAGE3D */ -#line 3363 "MachineIndependent/glslang.y" +#line 3306 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd3D); } -#line 10481 "MachineIndependent/glslang_tab.cpp" +#line 10480 "MachineIndependent/glslang_tab.cpp" break; case 503: /* type_specifier_nonarray: U64IMAGE3D */ -#line 3368 "MachineIndependent/glslang.y" +#line 3311 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd3D); } -#line 10491 "MachineIndependent/glslang_tab.cpp" +#line 10490 "MachineIndependent/glslang_tab.cpp" break; case 504: /* type_specifier_nonarray: I64IMAGE2DRECT */ -#line 3373 "MachineIndependent/glslang.y" +#line 3316 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdRect); } -#line 10501 "MachineIndependent/glslang_tab.cpp" +#line 10500 "MachineIndependent/glslang_tab.cpp" break; case 505: /* type_specifier_nonarray: U64IMAGE2DRECT */ -#line 3378 "MachineIndependent/glslang.y" +#line 3321 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdRect); } -#line 10511 "MachineIndependent/glslang_tab.cpp" +#line 10510 "MachineIndependent/glslang_tab.cpp" break; case 506: /* type_specifier_nonarray: I64IMAGECUBE */ -#line 3383 "MachineIndependent/glslang.y" +#line 3326 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube); } -#line 10521 "MachineIndependent/glslang_tab.cpp" +#line 10520 "MachineIndependent/glslang_tab.cpp" break; case 507: /* type_specifier_nonarray: U64IMAGECUBE */ -#line 3388 "MachineIndependent/glslang.y" +#line 3331 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube); } -#line 10531 "MachineIndependent/glslang_tab.cpp" +#line 10530 "MachineIndependent/glslang_tab.cpp" break; case 508: /* type_specifier_nonarray: I64IMAGEBUFFER */ -#line 3393 "MachineIndependent/glslang.y" +#line 3336 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdBuffer); } -#line 10541 "MachineIndependent/glslang_tab.cpp" +#line 10540 "MachineIndependent/glslang_tab.cpp" break; case 509: /* type_specifier_nonarray: U64IMAGEBUFFER */ -#line 3398 "MachineIndependent/glslang.y" +#line 3341 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdBuffer); } -#line 10551 "MachineIndependent/glslang_tab.cpp" +#line 10550 "MachineIndependent/glslang_tab.cpp" break; case 510: /* type_specifier_nonarray: I64IMAGE1DARRAY */ -#line 3403 "MachineIndependent/glslang.y" +#line 3346 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D, true); } -#line 10561 "MachineIndependent/glslang_tab.cpp" +#line 10560 "MachineIndependent/glslang_tab.cpp" break; case 511: /* type_specifier_nonarray: U64IMAGE1DARRAY */ -#line 3408 "MachineIndependent/glslang.y" +#line 3351 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D, true); } -#line 10571 "MachineIndependent/glslang_tab.cpp" +#line 10570 "MachineIndependent/glslang_tab.cpp" break; case 512: /* type_specifier_nonarray: I64IMAGE2DARRAY */ -#line 3413 "MachineIndependent/glslang.y" +#line 3356 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true); } -#line 10581 "MachineIndependent/glslang_tab.cpp" +#line 10580 "MachineIndependent/glslang_tab.cpp" break; case 513: /* type_specifier_nonarray: U64IMAGE2DARRAY */ -#line 3418 "MachineIndependent/glslang.y" +#line 3361 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true); } -#line 10591 "MachineIndependent/glslang_tab.cpp" +#line 10590 "MachineIndependent/glslang_tab.cpp" break; case 514: /* type_specifier_nonarray: I64IMAGECUBEARRAY */ -#line 3423 "MachineIndependent/glslang.y" +#line 3366 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube, true); } -#line 10601 "MachineIndependent/glslang_tab.cpp" +#line 10600 "MachineIndependent/glslang_tab.cpp" break; case 515: /* type_specifier_nonarray: U64IMAGECUBEARRAY */ -#line 3428 "MachineIndependent/glslang.y" +#line 3371 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube, true); } -#line 10611 "MachineIndependent/glslang_tab.cpp" +#line 10610 "MachineIndependent/glslang_tab.cpp" break; case 516: /* type_specifier_nonarray: I64IMAGE2DMS */ -#line 3433 "MachineIndependent/glslang.y" +#line 3376 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, false, false, true); } -#line 10621 "MachineIndependent/glslang_tab.cpp" +#line 10620 "MachineIndependent/glslang_tab.cpp" break; case 517: /* type_specifier_nonarray: U64IMAGE2DMS */ -#line 3438 "MachineIndependent/glslang.y" +#line 3381 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, false, false, true); } -#line 10631 "MachineIndependent/glslang_tab.cpp" +#line 10630 "MachineIndependent/glslang_tab.cpp" break; case 518: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */ -#line 3443 "MachineIndependent/glslang.y" +#line 3386 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true, false, true); } -#line 10641 "MachineIndependent/glslang_tab.cpp" +#line 10640 "MachineIndependent/glslang_tab.cpp" break; case 519: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */ -#line 3448 "MachineIndependent/glslang.y" +#line 3391 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true, false, true); } -#line 10651 "MachineIndependent/glslang_tab.cpp" +#line 10650 "MachineIndependent/glslang_tab.cpp" break; case 520: /* type_specifier_nonarray: SAMPLEREXTERNALOES */ -#line 3453 "MachineIndependent/glslang.y" +#line 3396 "MachineIndependent/glslang.y" { // GL_OES_EGL_image_external (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } -#line 10662 "MachineIndependent/glslang_tab.cpp" +#line 10661 "MachineIndependent/glslang_tab.cpp" break; case 521: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */ -#line 3459 "MachineIndependent/glslang.y" +#line 3402 "MachineIndependent/glslang.y" { // GL_EXT_YUV_target (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.yuv = true; } -#line 10673 "MachineIndependent/glslang_tab.cpp" +#line 10672 "MachineIndependent/glslang_tab.cpp" break; case 522: /* type_specifier_nonarray: ATTACHMENTEXT */ -#line 3465 "MachineIndependent/glslang.y" +#line 3408 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setAttachmentEXT(EbtFloat); } -#line 10684 "MachineIndependent/glslang_tab.cpp" +#line 10683 "MachineIndependent/glslang_tab.cpp" break; case 523: /* type_specifier_nonarray: IATTACHMENTEXT */ -#line 3471 "MachineIndependent/glslang.y" +#line 3414 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setAttachmentEXT(EbtInt); } -#line 10695 "MachineIndependent/glslang_tab.cpp" +#line 10694 "MachineIndependent/glslang_tab.cpp" break; case 524: /* type_specifier_nonarray: UATTACHMENTEXT */ -#line 3477 "MachineIndependent/glslang.y" +#line 3420 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setAttachmentEXT(EbtUint); } -#line 10706 "MachineIndependent/glslang_tab.cpp" +#line 10705 "MachineIndependent/glslang_tab.cpp" break; case 525: /* type_specifier_nonarray: SUBPASSINPUT */ -#line 3483 "MachineIndependent/glslang.y" +#line 3426 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } -#line 10717 "MachineIndependent/glslang_tab.cpp" +#line 10716 "MachineIndependent/glslang_tab.cpp" break; case 526: /* type_specifier_nonarray: SUBPASSINPUTMS */ -#line 3489 "MachineIndependent/glslang.y" +#line 3432 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } -#line 10728 "MachineIndependent/glslang_tab.cpp" +#line 10727 "MachineIndependent/glslang_tab.cpp" break; case 527: /* type_specifier_nonarray: F16SUBPASSINPUT */ -#line 3495 "MachineIndependent/glslang.y" +#line 3438 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); @@ -10736,11 +10735,11 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16); } -#line 10740 "MachineIndependent/glslang_tab.cpp" +#line 10739 "MachineIndependent/glslang_tab.cpp" break; case 528: /* type_specifier_nonarray: F16SUBPASSINPUTMS */ -#line 3502 "MachineIndependent/glslang.y" +#line 3445 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); @@ -10748,55 +10747,55 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); } -#line 10752 "MachineIndependent/glslang_tab.cpp" +#line 10751 "MachineIndependent/glslang_tab.cpp" break; case 529: /* type_specifier_nonarray: ISUBPASSINPUT */ -#line 3509 "MachineIndependent/glslang.y" +#line 3452 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } -#line 10763 "MachineIndependent/glslang_tab.cpp" +#line 10762 "MachineIndependent/glslang_tab.cpp" break; case 530: /* type_specifier_nonarray: ISUBPASSINPUTMS */ -#line 3515 "MachineIndependent/glslang.y" +#line 3458 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } -#line 10774 "MachineIndependent/glslang_tab.cpp" +#line 10773 "MachineIndependent/glslang_tab.cpp" break; case 531: /* type_specifier_nonarray: USUBPASSINPUT */ -#line 3521 "MachineIndependent/glslang.y" +#line 3464 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } -#line 10785 "MachineIndependent/glslang_tab.cpp" +#line 10784 "MachineIndependent/glslang_tab.cpp" break; case 532: /* type_specifier_nonarray: USUBPASSINPUTMS */ -#line 3527 "MachineIndependent/glslang.y" +#line 3470 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } -#line 10796 "MachineIndependent/glslang_tab.cpp" +#line 10795 "MachineIndependent/glslang_tab.cpp" break; case 533: /* type_specifier_nonarray: FCOOPMATNV */ -#line 3533 "MachineIndependent/glslang.y" +#line 3476 "MachineIndependent/glslang.y" { parseContext.fcoopmatCheckNV((yyvsp[0].lex).loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -10804,11 +10803,11 @@ yyreduce: (yyval.interm.type).coopmatNV = true; (yyval.interm.type).coopmatKHR = false; } -#line 10808 "MachineIndependent/glslang_tab.cpp" +#line 10807 "MachineIndependent/glslang_tab.cpp" break; case 534: /* type_specifier_nonarray: ICOOPMATNV */ -#line 3540 "MachineIndependent/glslang.y" +#line 3483 "MachineIndependent/glslang.y" { parseContext.intcoopmatCheckNV((yyvsp[0].lex).loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -10816,11 +10815,11 @@ yyreduce: (yyval.interm.type).coopmatNV = true; (yyval.interm.type).coopmatKHR = false; } -#line 10820 "MachineIndependent/glslang_tab.cpp" +#line 10819 "MachineIndependent/glslang_tab.cpp" break; case 535: /* type_specifier_nonarray: UCOOPMATNV */ -#line 3547 "MachineIndependent/glslang.y" +#line 3490 "MachineIndependent/glslang.y" { parseContext.intcoopmatCheckNV((yyvsp[0].lex).loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -10828,11 +10827,11 @@ yyreduce: (yyval.interm.type).coopmatNV = true; (yyval.interm.type).coopmatKHR = false; } -#line 10832 "MachineIndependent/glslang_tab.cpp" +#line 10831 "MachineIndependent/glslang_tab.cpp" break; case 536: /* type_specifier_nonarray: COOPMAT */ -#line 3554 "MachineIndependent/glslang.y" +#line 3497 "MachineIndependent/glslang.y" { parseContext.coopmatCheck((yyvsp[0].lex).loc, "coopmat", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -10840,39 +10839,39 @@ yyreduce: (yyval.interm.type).coopmatNV = false; (yyval.interm.type).coopmatKHR = true; } -#line 10844 "MachineIndependent/glslang_tab.cpp" +#line 10843 "MachineIndependent/glslang_tab.cpp" break; case 537: /* type_specifier_nonarray: spirv_type_specifier */ -#line 3561 "MachineIndependent/glslang.y" +#line 3504 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 10853 "MachineIndependent/glslang_tab.cpp" +#line 10852 "MachineIndependent/glslang_tab.cpp" break; case 538: /* type_specifier_nonarray: HITOBJECTNV */ -#line 3565 "MachineIndependent/glslang.y" +#line 3508 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtHitObjectNV; } -#line 10862 "MachineIndependent/glslang_tab.cpp" +#line 10861 "MachineIndependent/glslang_tab.cpp" break; case 539: /* type_specifier_nonarray: struct_specifier */ -#line 3570 "MachineIndependent/glslang.y" +#line 3512 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } -#line 10872 "MachineIndependent/glslang_tab.cpp" +#line 10871 "MachineIndependent/glslang_tab.cpp" break; case 540: /* type_specifier_nonarray: TYPE_NAME */ -#line 3575 "MachineIndependent/glslang.y" +#line 3517 "MachineIndependent/glslang.y" { // // This is for user defined type names. The lexical phase looked up the @@ -10886,47 +10885,47 @@ yyreduce: } else parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } -#line 10890 "MachineIndependent/glslang_tab.cpp" +#line 10889 "MachineIndependent/glslang_tab.cpp" break; case 541: /* precision_qualifier: HIGH_PRECISION */ -#line 3591 "MachineIndependent/glslang.y" +#line 3533 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } -#line 10900 "MachineIndependent/glslang_tab.cpp" +#line 10899 "MachineIndependent/glslang_tab.cpp" break; case 542: /* precision_qualifier: MEDIUM_PRECISION */ -#line 3596 "MachineIndependent/glslang.y" +#line 3538 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } -#line 10910 "MachineIndependent/glslang_tab.cpp" +#line 10909 "MachineIndependent/glslang_tab.cpp" break; case 543: /* precision_qualifier: LOW_PRECISION */ -#line 3601 "MachineIndependent/glslang.y" +#line 3543 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } -#line 10920 "MachineIndependent/glslang_tab.cpp" +#line 10919 "MachineIndependent/glslang_tab.cpp" break; case 544: /* $@3: %empty */ -#line 3609 "MachineIndependent/glslang.y" +#line 3551 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } -#line 10926 "MachineIndependent/glslang_tab.cpp" +#line 10925 "MachineIndependent/glslang_tab.cpp" break; case 545: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */ -#line 3609 "MachineIndependent/glslang.y" +#line 3551 "MachineIndependent/glslang.y" { TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); @@ -10938,17 +10937,17 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 10942 "MachineIndependent/glslang_tab.cpp" +#line 10941 "MachineIndependent/glslang_tab.cpp" break; case 546: /* $@4: %empty */ -#line 3620 "MachineIndependent/glslang.y" +#line 3562 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } -#line 10948 "MachineIndependent/glslang_tab.cpp" +#line 10947 "MachineIndependent/glslang_tab.cpp" break; case 547: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */ -#line 3620 "MachineIndependent/glslang.y" +#line 3562 "MachineIndependent/glslang.y" { TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); (yyval.interm.type).init((yyvsp[-4].lex).loc); @@ -10956,19 +10955,19 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 10960 "MachineIndependent/glslang_tab.cpp" +#line 10959 "MachineIndependent/glslang_tab.cpp" break; case 548: /* struct_declaration_list: struct_declaration */ -#line 3630 "MachineIndependent/glslang.y" +#line 3572 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } -#line 10968 "MachineIndependent/glslang_tab.cpp" +#line 10967 "MachineIndependent/glslang_tab.cpp" break; case 549: /* struct_declaration_list: struct_declaration_list struct_declaration */ -#line 3633 "MachineIndependent/glslang.y" +#line 3575 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { @@ -10979,11 +10978,11 @@ yyreduce: (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); } } -#line 10983 "MachineIndependent/glslang_tab.cpp" +#line 10982 "MachineIndependent/glslang_tab.cpp" break; case 550: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */ -#line 3646 "MachineIndependent/glslang.y" +#line 3588 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -11006,11 +11005,11 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 11010 "MachineIndependent/glslang_tab.cpp" +#line 11009 "MachineIndependent/glslang_tab.cpp" break; case 551: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */ -#line 3668 "MachineIndependent/glslang.y" +#line 3610 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -11035,38 +11034,38 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 11039 "MachineIndependent/glslang_tab.cpp" +#line 11038 "MachineIndependent/glslang_tab.cpp" break; case 552: /* struct_declarator_list: struct_declarator */ -#line 3695 "MachineIndependent/glslang.y" +#line 3637 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = new TTypeList; (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 11048 "MachineIndependent/glslang_tab.cpp" +#line 11047 "MachineIndependent/glslang_tab.cpp" break; case 553: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */ -#line 3699 "MachineIndependent/glslang.y" +#line 3641 "MachineIndependent/glslang.y" { (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 11056 "MachineIndependent/glslang_tab.cpp" +#line 11055 "MachineIndependent/glslang_tab.cpp" break; case 554: /* struct_declarator: IDENTIFIER */ -#line 3705 "MachineIndependent/glslang.y" +#line 3647 "MachineIndependent/glslang.y" { (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); } -#line 11066 "MachineIndependent/glslang_tab.cpp" +#line 11065 "MachineIndependent/glslang_tab.cpp" break; case 555: /* struct_declarator: IDENTIFIER array_specifier */ -#line 3710 "MachineIndependent/glslang.y" +#line 3652 "MachineIndependent/glslang.y" { parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes); @@ -11075,246 +11074,246 @@ yyreduce: (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); } -#line 11079 "MachineIndependent/glslang_tab.cpp" +#line 11078 "MachineIndependent/glslang_tab.cpp" break; case 556: /* initializer: assignment_expression */ -#line 3721 "MachineIndependent/glslang.y" +#line 3663 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 11087 "MachineIndependent/glslang_tab.cpp" +#line 11086 "MachineIndependent/glslang_tab.cpp" break; case 557: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */ -#line 3725 "MachineIndependent/glslang.y" +#line 3666 "MachineIndependent/glslang.y" { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); } -#line 11098 "MachineIndependent/glslang_tab.cpp" +#line 11097 "MachineIndependent/glslang_tab.cpp" break; case 558: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */ -#line 3731 "MachineIndependent/glslang.y" +#line 3672 "MachineIndependent/glslang.y" { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 11109 "MachineIndependent/glslang_tab.cpp" +#line 11108 "MachineIndependent/glslang_tab.cpp" break; case 559: /* initializer: LEFT_BRACE RIGHT_BRACE */ -#line 3737 "MachineIndependent/glslang.y" +#line 3678 "MachineIndependent/glslang.y" { const char* initFeature = "empty { } initializer"; parseContext.profileRequires((yyvsp[-1].lex).loc, EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); parseContext.profileRequires((yyvsp[-1].lex).loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); (yyval.interm.intermTypedNode) = parseContext.intermediate.makeAggregate((yyvsp[-1].lex).loc); } -#line 11120 "MachineIndependent/glslang_tab.cpp" +#line 11119 "MachineIndependent/glslang_tab.cpp" break; case 560: /* initializer_list: initializer */ -#line 3748 "MachineIndependent/glslang.y" +#line 3687 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); } -#line 11128 "MachineIndependent/glslang_tab.cpp" +#line 11127 "MachineIndependent/glslang_tab.cpp" break; case 561: /* initializer_list: initializer_list COMMA initializer */ -#line 3751 "MachineIndependent/glslang.y" +#line 3690 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); } -#line 11136 "MachineIndependent/glslang_tab.cpp" +#line 11135 "MachineIndependent/glslang_tab.cpp" break; case 562: /* declaration_statement: declaration */ -#line 3758 "MachineIndependent/glslang.y" +#line 3696 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11142 "MachineIndependent/glslang_tab.cpp" +#line 11141 "MachineIndependent/glslang_tab.cpp" break; case 563: /* statement: compound_statement */ -#line 3762 "MachineIndependent/glslang.y" +#line 3700 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11148 "MachineIndependent/glslang_tab.cpp" +#line 11147 "MachineIndependent/glslang_tab.cpp" break; case 564: /* statement: simple_statement */ -#line 3763 "MachineIndependent/glslang.y" +#line 3701 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11154 "MachineIndependent/glslang_tab.cpp" +#line 11153 "MachineIndependent/glslang_tab.cpp" break; case 565: /* simple_statement: declaration_statement */ -#line 3769 "MachineIndependent/glslang.y" +#line 3707 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11160 "MachineIndependent/glslang_tab.cpp" +#line 11159 "MachineIndependent/glslang_tab.cpp" break; case 566: /* simple_statement: expression_statement */ -#line 3770 "MachineIndependent/glslang.y" +#line 3708 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11166 "MachineIndependent/glslang_tab.cpp" +#line 11165 "MachineIndependent/glslang_tab.cpp" break; case 567: /* simple_statement: selection_statement */ -#line 3771 "MachineIndependent/glslang.y" +#line 3709 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11172 "MachineIndependent/glslang_tab.cpp" +#line 11171 "MachineIndependent/glslang_tab.cpp" break; case 568: /* simple_statement: switch_statement */ -#line 3772 "MachineIndependent/glslang.y" +#line 3710 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11178 "MachineIndependent/glslang_tab.cpp" +#line 11177 "MachineIndependent/glslang_tab.cpp" break; case 569: /* simple_statement: case_label */ -#line 3773 "MachineIndependent/glslang.y" +#line 3711 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11184 "MachineIndependent/glslang_tab.cpp" +#line 11183 "MachineIndependent/glslang_tab.cpp" break; case 570: /* simple_statement: iteration_statement */ -#line 3774 "MachineIndependent/glslang.y" +#line 3712 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11190 "MachineIndependent/glslang_tab.cpp" +#line 11189 "MachineIndependent/glslang_tab.cpp" break; case 571: /* simple_statement: jump_statement */ -#line 3775 "MachineIndependent/glslang.y" +#line 3713 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11196 "MachineIndependent/glslang_tab.cpp" +#line 11195 "MachineIndependent/glslang_tab.cpp" break; case 572: /* simple_statement: demote_statement */ -#line 3777 "MachineIndependent/glslang.y" +#line 3714 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11202 "MachineIndependent/glslang_tab.cpp" +#line 11201 "MachineIndependent/glslang_tab.cpp" break; case 573: /* demote_statement: DEMOTE SEMICOLON */ -#line 3783 "MachineIndependent/glslang.y" +#line 3718 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "demote"); parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDemote, (yyvsp[-1].lex).loc); } -#line 11212 "MachineIndependent/glslang_tab.cpp" +#line 11211 "MachineIndependent/glslang_tab.cpp" break; case 574: /* compound_statement: LEFT_BRACE RIGHT_BRACE */ -#line 3792 "MachineIndependent/glslang.y" +#line 3726 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11218 "MachineIndependent/glslang_tab.cpp" +#line 11217 "MachineIndependent/glslang_tab.cpp" break; case 575: /* $@5: %empty */ -#line 3793 "MachineIndependent/glslang.y" +#line 3727 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; } -#line 11227 "MachineIndependent/glslang_tab.cpp" +#line 11226 "MachineIndependent/glslang_tab.cpp" break; case 576: /* $@6: %empty */ -#line 3797 "MachineIndependent/glslang.y" +#line 3731 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } -#line 11236 "MachineIndependent/glslang_tab.cpp" +#line 11235 "MachineIndependent/glslang_tab.cpp" break; case 577: /* compound_statement: LEFT_BRACE $@5 statement_list $@6 RIGHT_BRACE */ -#line 3801 "MachineIndependent/glslang.y" +#line 3735 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } -#line 11246 "MachineIndependent/glslang_tab.cpp" +#line 11245 "MachineIndependent/glslang_tab.cpp" break; case 578: /* statement_no_new_scope: compound_statement_no_new_scope */ -#line 3809 "MachineIndependent/glslang.y" +#line 3743 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11252 "MachineIndependent/glslang_tab.cpp" +#line 11251 "MachineIndependent/glslang_tab.cpp" break; case 579: /* statement_no_new_scope: simple_statement */ -#line 3810 "MachineIndependent/glslang.y" +#line 3744 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11258 "MachineIndependent/glslang_tab.cpp" +#line 11257 "MachineIndependent/glslang_tab.cpp" break; case 580: /* $@7: %empty */ -#line 3814 "MachineIndependent/glslang.y" +#line 3748 "MachineIndependent/glslang.y" { ++parseContext.controlFlowNestingLevel; } -#line 11266 "MachineIndependent/glslang_tab.cpp" +#line 11265 "MachineIndependent/glslang_tab.cpp" break; case 581: /* statement_scoped: $@7 compound_statement */ -#line 3817 "MachineIndependent/glslang.y" +#line 3751 "MachineIndependent/glslang.y" { --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11275 "MachineIndependent/glslang_tab.cpp" +#line 11274 "MachineIndependent/glslang_tab.cpp" break; case 582: /* $@8: %empty */ -#line 3821 "MachineIndependent/glslang.y" +#line 3755 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11285 "MachineIndependent/glslang_tab.cpp" +#line 11284 "MachineIndependent/glslang_tab.cpp" break; case 583: /* statement_scoped: $@8 simple_statement */ -#line 3826 "MachineIndependent/glslang.y" +#line 3760 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11296 "MachineIndependent/glslang_tab.cpp" +#line 11295 "MachineIndependent/glslang_tab.cpp" break; case 584: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */ -#line 3835 "MachineIndependent/glslang.y" +#line 3769 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11304 "MachineIndependent/glslang_tab.cpp" +#line 11303 "MachineIndependent/glslang_tab.cpp" break; case 585: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */ -#line 3838 "MachineIndependent/glslang.y" +#line 3772 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); } -#line 11314 "MachineIndependent/glslang_tab.cpp" +#line 11313 "MachineIndependent/glslang_tab.cpp" break; case 586: /* statement_list: statement */ -#line 3846 "MachineIndependent/glslang.y" +#line 3780 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || @@ -11323,11 +11322,11 @@ yyreduce: (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case } } -#line 11327 "MachineIndependent/glslang_tab.cpp" +#line 11326 "MachineIndependent/glslang_tab.cpp" break; case 587: /* statement_list: statement_list statement */ -#line 3854 "MachineIndependent/glslang.y" +#line 3788 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { @@ -11336,77 +11335,77 @@ yyreduce: } else (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 11340 "MachineIndependent/glslang_tab.cpp" +#line 11339 "MachineIndependent/glslang_tab.cpp" break; case 588: /* expression_statement: SEMICOLON */ -#line 3865 "MachineIndependent/glslang.y" +#line 3799 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11346 "MachineIndependent/glslang_tab.cpp" +#line 11345 "MachineIndependent/glslang_tab.cpp" break; case 589: /* expression_statement: expression SEMICOLON */ -#line 3866 "MachineIndependent/glslang.y" +#line 3800 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[-1].interm.intermTypedNode)); } -#line 11352 "MachineIndependent/glslang_tab.cpp" +#line 11351 "MachineIndependent/glslang_tab.cpp" break; case 590: /* selection_statement: selection_statement_nonattributed */ -#line 3870 "MachineIndependent/glslang.y" +#line 3804 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11360 "MachineIndependent/glslang_tab.cpp" +#line 11359 "MachineIndependent/glslang_tab.cpp" break; case 591: /* selection_statement: attribute selection_statement_nonattributed */ -#line 3874 "MachineIndependent/glslang.y" +#line 3807 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11370 "MachineIndependent/glslang_tab.cpp" +#line 11369 "MachineIndependent/glslang_tab.cpp" break; case 592: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */ -#line 3882 "MachineIndependent/glslang.y" +#line 3814 "MachineIndependent/glslang.y" { parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); } -#line 11379 "MachineIndependent/glslang_tab.cpp" +#line 11378 "MachineIndependent/glslang_tab.cpp" break; case 593: /* selection_rest_statement: statement_scoped ELSE statement_scoped */ -#line 3889 "MachineIndependent/glslang.y" +#line 3821 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); } -#line 11388 "MachineIndependent/glslang_tab.cpp" +#line 11387 "MachineIndependent/glslang_tab.cpp" break; case 594: /* selection_rest_statement: statement_scoped */ -#line 3893 "MachineIndependent/glslang.y" +#line 3825 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 11397 "MachineIndependent/glslang_tab.cpp" +#line 11396 "MachineIndependent/glslang_tab.cpp" break; case 595: /* condition: expression */ -#line 3901 "MachineIndependent/glslang.y" +#line 3833 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); } -#line 11406 "MachineIndependent/glslang_tab.cpp" +#line 11405 "MachineIndependent/glslang_tab.cpp" break; case 596: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */ -#line 3905 "MachineIndependent/glslang.y" +#line 3837 "MachineIndependent/glslang.y" { parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); @@ -11417,29 +11416,29 @@ yyreduce: else (yyval.interm.intermTypedNode) = 0; } -#line 11421 "MachineIndependent/glslang_tab.cpp" +#line 11420 "MachineIndependent/glslang_tab.cpp" break; case 597: /* switch_statement: switch_statement_nonattributed */ -#line 3918 "MachineIndependent/glslang.y" +#line 3850 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11429 "MachineIndependent/glslang_tab.cpp" +#line 11428 "MachineIndependent/glslang_tab.cpp" break; case 598: /* switch_statement: attribute switch_statement_nonattributed */ -#line 3922 "MachineIndependent/glslang.y" +#line 3853 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11439 "MachineIndependent/glslang_tab.cpp" +#line 11438 "MachineIndependent/glslang_tab.cpp" break; case 599: /* $@9: %empty */ -#line 3930 "MachineIndependent/glslang.y" +#line 3860 "MachineIndependent/glslang.y" { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -11448,11 +11447,11 @@ yyreduce: parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } -#line 11452 "MachineIndependent/glslang_tab.cpp" +#line 11451 "MachineIndependent/glslang_tab.cpp" break; case 600: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */ -#line 3938 "MachineIndependent/glslang.y" +#line 3868 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); delete parseContext.switchSequenceStack.back(); @@ -11462,27 +11461,27 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11466 "MachineIndependent/glslang_tab.cpp" +#line 11465 "MachineIndependent/glslang_tab.cpp" break; case 601: /* switch_statement_list: %empty */ -#line 3950 "MachineIndependent/glslang.y" +#line 3880 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11474 "MachineIndependent/glslang_tab.cpp" +#line 11473 "MachineIndependent/glslang_tab.cpp" break; case 602: /* switch_statement_list: statement_list */ -#line 3953 "MachineIndependent/glslang.y" +#line 3883 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11482 "MachineIndependent/glslang_tab.cpp" +#line 11481 "MachineIndependent/glslang_tab.cpp" break; case 603: /* case_label: CASE expression COLON */ -#line 3959 "MachineIndependent/glslang.y" +#line 3889 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -11495,11 +11494,11 @@ yyreduce: (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } -#line 11499 "MachineIndependent/glslang_tab.cpp" +#line 11498 "MachineIndependent/glslang_tab.cpp" break; case 604: /* case_label: DEFAULT COLON */ -#line 3971 "MachineIndependent/glslang.y" +#line 3901 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -11509,29 +11508,29 @@ yyreduce: else (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } -#line 11513 "MachineIndependent/glslang_tab.cpp" +#line 11512 "MachineIndependent/glslang_tab.cpp" break; case 605: /* iteration_statement: iteration_statement_nonattributed */ -#line 3983 "MachineIndependent/glslang.y" +#line 3913 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11521 "MachineIndependent/glslang_tab.cpp" +#line 11520 "MachineIndependent/glslang_tab.cpp" break; case 606: /* iteration_statement: attribute iteration_statement_nonattributed */ -#line 3987 "MachineIndependent/glslang.y" +#line 3916 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11531 "MachineIndependent/glslang_tab.cpp" +#line 11530 "MachineIndependent/glslang_tab.cpp" break; case 607: /* $@10: %empty */ -#line 3995 "MachineIndependent/glslang.y" +#line 3923 "MachineIndependent/glslang.y" { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); @@ -11540,11 +11539,11 @@ yyreduce: ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11544 "MachineIndependent/glslang_tab.cpp" +#line 11543 "MachineIndependent/glslang_tab.cpp" break; case 608: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@10 condition RIGHT_PAREN statement_no_new_scope */ -#line 4003 "MachineIndependent/glslang.y" +#line 3931 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc); @@ -11552,22 +11551,22 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11556 "MachineIndependent/glslang_tab.cpp" +#line 11555 "MachineIndependent/glslang_tab.cpp" break; case 609: /* $@11: %empty */ -#line 4010 "MachineIndependent/glslang.y" +#line 3938 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11567 "MachineIndependent/glslang_tab.cpp" +#line 11566 "MachineIndependent/glslang_tab.cpp" break; case 610: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */ -#line 4016 "MachineIndependent/glslang.y" +#line 3944 "MachineIndependent/glslang.y" { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); @@ -11580,22 +11579,22 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11584 "MachineIndependent/glslang_tab.cpp" +#line 11583 "MachineIndependent/glslang_tab.cpp" break; case 611: /* $@12: %empty */ -#line 4028 "MachineIndependent/glslang.y" +#line 3956 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11595 "MachineIndependent/glslang_tab.cpp" +#line 11594 "MachineIndependent/glslang_tab.cpp" break; case 612: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@12 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */ -#line 4034 "MachineIndependent/glslang.y" +#line 3962 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); @@ -11608,81 +11607,81 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11612 "MachineIndependent/glslang_tab.cpp" +#line 11611 "MachineIndependent/glslang_tab.cpp" break; case 613: /* for_init_statement: expression_statement */ -#line 4049 "MachineIndependent/glslang.y" +#line 3977 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11620 "MachineIndependent/glslang_tab.cpp" +#line 11619 "MachineIndependent/glslang_tab.cpp" break; case 614: /* for_init_statement: declaration_statement */ -#line 4052 "MachineIndependent/glslang.y" +#line 3980 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11628 "MachineIndependent/glslang_tab.cpp" +#line 11627 "MachineIndependent/glslang_tab.cpp" break; case 615: /* conditionopt: condition */ -#line 4058 "MachineIndependent/glslang.y" +#line 3986 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 11636 "MachineIndependent/glslang_tab.cpp" +#line 11635 "MachineIndependent/glslang_tab.cpp" break; case 616: /* conditionopt: %empty */ -#line 4061 "MachineIndependent/glslang.y" +#line 3989 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = 0; } -#line 11644 "MachineIndependent/glslang_tab.cpp" +#line 11643 "MachineIndependent/glslang_tab.cpp" break; case 617: /* for_rest_statement: conditionopt SEMICOLON */ -#line 4067 "MachineIndependent/glslang.y" +#line 3995 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); (yyval.interm.nodePair).node2 = 0; } -#line 11653 "MachineIndependent/glslang_tab.cpp" +#line 11652 "MachineIndependent/glslang_tab.cpp" break; case 618: /* for_rest_statement: conditionopt SEMICOLON expression */ -#line 4071 "MachineIndependent/glslang.y" +#line 3999 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } -#line 11662 "MachineIndependent/glslang_tab.cpp" +#line 11661 "MachineIndependent/glslang_tab.cpp" break; case 619: /* jump_statement: CONTINUE SEMICOLON */ -#line 4078 "MachineIndependent/glslang.y" +#line 4006 "MachineIndependent/glslang.y" { if (parseContext.loopNestingLevel <= 0) parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); } -#line 11672 "MachineIndependent/glslang_tab.cpp" +#line 11671 "MachineIndependent/glslang_tab.cpp" break; case 620: /* jump_statement: BREAK SEMICOLON */ -#line 4083 "MachineIndependent/glslang.y" +#line 4011 "MachineIndependent/glslang.y" { if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); } -#line 11682 "MachineIndependent/glslang_tab.cpp" +#line 11681 "MachineIndependent/glslang_tab.cpp" break; case 621: /* jump_statement: RETURN SEMICOLON */ -#line 4088 "MachineIndependent/glslang.y" +#line 4016 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); if (parseContext.currentFunctionType->getBasicType() != EbtVoid) @@ -11690,101 +11689,101 @@ yyreduce: if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 11694 "MachineIndependent/glslang_tab.cpp" +#line 11693 "MachineIndependent/glslang_tab.cpp" break; case 622: /* jump_statement: RETURN expression SEMICOLON */ -#line 4095 "MachineIndependent/glslang.y" +#line 4023 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 11702 "MachineIndependent/glslang_tab.cpp" +#line 11701 "MachineIndependent/glslang_tab.cpp" break; case 623: /* jump_statement: DISCARD SEMICOLON */ -#line 4098 "MachineIndependent/glslang.y" +#line 4026 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 11711 "MachineIndependent/glslang_tab.cpp" +#line 11710 "MachineIndependent/glslang_tab.cpp" break; case 624: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */ -#line 4102 "MachineIndependent/glslang.y" +#line 4030 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "terminateInvocation"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateInvocation, (yyvsp[-1].lex).loc); } -#line 11720 "MachineIndependent/glslang_tab.cpp" +#line 11719 "MachineIndependent/glslang_tab.cpp" break; case 625: /* jump_statement: TERMINATE_RAY SEMICOLON */ -#line 4107 "MachineIndependent/glslang.y" +#line 4034 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "terminateRayEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateRayKHR, (yyvsp[-1].lex).loc); } -#line 11729 "MachineIndependent/glslang_tab.cpp" +#line 11728 "MachineIndependent/glslang_tab.cpp" break; case 626: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */ -#line 4111 "MachineIndependent/glslang.y" +#line 4038 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "ignoreIntersectionEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, (yyvsp[-1].lex).loc); } -#line 11738 "MachineIndependent/glslang_tab.cpp" +#line 11737 "MachineIndependent/glslang_tab.cpp" break; case 627: /* translation_unit: external_declaration */ -#line 4121 "MachineIndependent/glslang.y" +#line 4047 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 11747 "MachineIndependent/glslang_tab.cpp" +#line 11746 "MachineIndependent/glslang_tab.cpp" break; case 628: /* translation_unit: translation_unit external_declaration */ -#line 4125 "MachineIndependent/glslang.y" +#line 4051 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermNode) != nullptr) { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } } -#line 11758 "MachineIndependent/glslang_tab.cpp" +#line 11757 "MachineIndependent/glslang_tab.cpp" break; case 629: /* external_declaration: function_definition */ -#line 4134 "MachineIndependent/glslang.y" +#line 4060 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11766 "MachineIndependent/glslang_tab.cpp" +#line 11765 "MachineIndependent/glslang_tab.cpp" break; case 630: /* external_declaration: declaration */ -#line 4137 "MachineIndependent/glslang.y" +#line 4063 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11774 "MachineIndependent/glslang_tab.cpp" +#line 11773 "MachineIndependent/glslang_tab.cpp" break; case 631: /* external_declaration: SEMICOLON */ -#line 4141 "MachineIndependent/glslang.y" +#line 4066 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon"); parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); (yyval.interm.intermNode) = nullptr; } -#line 11784 "MachineIndependent/glslang_tab.cpp" +#line 11783 "MachineIndependent/glslang_tab.cpp" break; case 632: /* $@13: %empty */ -#line 4150 "MachineIndependent/glslang.y" +#line 4074 "MachineIndependent/glslang.y" { (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); @@ -11797,17 +11796,18 @@ yyreduce: ++parseContext.statementNestingLevel; } } -#line 11801 "MachineIndependent/glslang_tab.cpp" +#line 11800 "MachineIndependent/glslang_tab.cpp" break; case 633: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */ -#line 4162 "MachineIndependent/glslang.y" +#line 4086 "MachineIndependent/glslang.y" { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) parseContext.error((yyvsp[-2].interm).loc, "function does not return a value:", "", (yyvsp[-2].interm).function->getName().c_str()); parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode)->getAsAggregate()->setLinkType((yyvsp[-2].interm).function->getLinkType()); parseContext.intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[-2].interm).function->getType(), (yyvsp[-2].interm).loc); (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[-2].interm).function->getMangledName().c_str()); @@ -11832,7 +11832,7 @@ yyreduce: break; case 634: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */ -#line 4192 "MachineIndependent/glslang.y" +#line 4116 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); } @@ -11840,7 +11840,7 @@ yyreduce: break; case 635: /* attribute_list: single_attribute */ -#line 4197 "MachineIndependent/glslang.y" +#line 4121 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = (yyvsp[0].interm.attributes); } @@ -11848,7 +11848,7 @@ yyreduce: break; case 636: /* attribute_list: attribute_list COMMA single_attribute */ -#line 4200 "MachineIndependent/glslang.y" +#line 4124 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); } @@ -11856,7 +11856,7 @@ yyreduce: break; case 637: /* single_attribute: IDENTIFIER */ -#line 4205 "MachineIndependent/glslang.y" +#line 4129 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); } @@ -11864,7 +11864,7 @@ yyreduce: break; case 638: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */ -#line 4208 "MachineIndependent/glslang.y" +#line 4132 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); } @@ -11872,7 +11872,7 @@ yyreduce: break; case 639: /* spirv_requirements_list: spirv_requirements_parameter */ -#line 4215 "MachineIndependent/glslang.y" +#line 4137 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = (yyvsp[0].interm.spirvReq); } @@ -11880,7 +11880,7 @@ yyreduce: break; case 640: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */ -#line 4218 "MachineIndependent/glslang.y" +#line 4140 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.mergeSpirvRequirements((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvReq), (yyvsp[0].interm.spirvReq)); } @@ -11888,7 +11888,7 @@ yyreduce: break; case 641: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */ -#line 4223 "MachineIndependent/glslang.y" +#line 4145 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, (yyvsp[-1].interm.intermNode)->getAsAggregate(), nullptr); } @@ -11896,7 +11896,7 @@ yyreduce: break; case 642: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */ -#line 4226 "MachineIndependent/glslang.y" +#line 4148 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, nullptr, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } @@ -11904,7 +11904,7 @@ yyreduce: break; case 643: /* spirv_extension_list: STRING_LITERAL */ -#line 4231 "MachineIndependent/glslang.y" +#line 4153 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } @@ -11912,7 +11912,7 @@ yyreduce: break; case 644: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */ -#line 4234 "MachineIndependent/glslang.y" +#line 4156 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } @@ -11920,7 +11920,7 @@ yyreduce: break; case 645: /* spirv_capability_list: INTCONSTANT */ -#line 4239 "MachineIndependent/glslang.y" +#line 4161 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); } @@ -11928,7 +11928,7 @@ yyreduce: break; case 646: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */ -#line 4242 "MachineIndependent/glslang.y" +#line 4164 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); } @@ -11936,7 +11936,7 @@ yyreduce: break; case 647: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4247 "MachineIndependent/glslang.y" +#line 4169 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; @@ -11945,7 +11945,7 @@ yyreduce: break; case 648: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4251 "MachineIndependent/glslang.y" +#line 4173 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); @@ -11955,7 +11955,7 @@ yyreduce: break; case 649: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4256 "MachineIndependent/glslang.y" +#line 4178 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; @@ -11964,7 +11964,7 @@ yyreduce: break; case 650: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4260 "MachineIndependent/glslang.y" +#line 4182 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); @@ -11974,7 +11974,7 @@ yyreduce: break; case 651: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ -#line 4265 "MachineIndependent/glslang.y" +#line 4187 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; @@ -11983,7 +11983,7 @@ yyreduce: break; case 652: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ -#line 4269 "MachineIndependent/glslang.y" +#line 4191 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); @@ -11993,7 +11993,7 @@ yyreduce: break; case 653: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */ -#line 4276 "MachineIndependent/glslang.y" +#line 4198 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } @@ -12001,7 +12001,7 @@ yyreduce: break; case 654: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */ -#line 4279 "MachineIndependent/glslang.y" +#line 4201 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } @@ -12009,7 +12009,7 @@ yyreduce: break; case 655: /* spirv_execution_mode_parameter: FLOATCONSTANT */ -#line 4284 "MachineIndependent/glslang.y" +#line 4206 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } @@ -12017,7 +12017,7 @@ yyreduce: break; case 656: /* spirv_execution_mode_parameter: INTCONSTANT */ -#line 4287 "MachineIndependent/glslang.y" +#line 4209 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } @@ -12025,7 +12025,7 @@ yyreduce: break; case 657: /* spirv_execution_mode_parameter: UINTCONSTANT */ -#line 4290 "MachineIndependent/glslang.y" +#line 4212 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } @@ -12033,7 +12033,7 @@ yyreduce: break; case 658: /* spirv_execution_mode_parameter: BOOLCONSTANT */ -#line 4293 "MachineIndependent/glslang.y" +#line 4215 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } @@ -12041,7 +12041,7 @@ yyreduce: break; case 659: /* spirv_execution_mode_parameter: STRING_LITERAL */ -#line 4296 "MachineIndependent/glslang.y" +#line 4218 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } @@ -12049,7 +12049,7 @@ yyreduce: break; case 660: /* spirv_execution_mode_id_parameter_list: constant_expression */ -#line 4301 "MachineIndependent/glslang.y" +#line 4223 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -12063,7 +12063,7 @@ yyreduce: break; case 661: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */ -#line 4310 "MachineIndependent/glslang.y" +#line 4232 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -12077,7 +12077,7 @@ yyreduce: break; case 662: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4321 "MachineIndependent/glslang.y" +#line 4243 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; @@ -12087,7 +12087,7 @@ yyreduce: break; case 663: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4326 "MachineIndependent/glslang.y" +#line 4248 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); @@ -12098,7 +12098,7 @@ yyreduce: break; case 664: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4334 "MachineIndependent/glslang.y" +#line 4256 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); @@ -12107,7 +12107,7 @@ yyreduce: break; case 665: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4338 "MachineIndependent/glslang.y" +#line 4260 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); @@ -12117,7 +12117,7 @@ yyreduce: break; case 666: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4343 "MachineIndependent/glslang.y" +#line 4265 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); @@ -12126,7 +12126,7 @@ yyreduce: break; case 667: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4347 "MachineIndependent/glslang.y" +#line 4269 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); @@ -12136,7 +12136,7 @@ yyreduce: break; case 668: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4352 "MachineIndependent/glslang.y" +#line 4274 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); @@ -12145,7 +12145,7 @@ yyreduce: break; case 669: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4356 "MachineIndependent/glslang.y" +#line 4278 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); @@ -12155,7 +12155,7 @@ yyreduce: break; case 670: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4361 "MachineIndependent/glslang.y" +#line 4283 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); @@ -12164,7 +12164,7 @@ yyreduce: break; case 671: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4365 "MachineIndependent/glslang.y" +#line 4287 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); @@ -12174,7 +12174,7 @@ yyreduce: break; case 672: /* spirv_decorate_parameter_list: spirv_decorate_parameter */ -#line 4372 "MachineIndependent/glslang.y" +#line 4294 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } @@ -12182,7 +12182,7 @@ yyreduce: break; case 673: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */ -#line 4375 "MachineIndependent/glslang.y" +#line 4297 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } @@ -12190,7 +12190,7 @@ yyreduce: break; case 674: /* spirv_decorate_parameter: FLOATCONSTANT */ -#line 4380 "MachineIndependent/glslang.y" +#line 4302 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } @@ -12198,7 +12198,7 @@ yyreduce: break; case 675: /* spirv_decorate_parameter: INTCONSTANT */ -#line 4383 "MachineIndependent/glslang.y" +#line 4305 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } @@ -12206,7 +12206,7 @@ yyreduce: break; case 676: /* spirv_decorate_parameter: UINTCONSTANT */ -#line 4386 "MachineIndependent/glslang.y" +#line 4308 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } @@ -12214,7 +12214,7 @@ yyreduce: break; case 677: /* spirv_decorate_parameter: BOOLCONSTANT */ -#line 4389 "MachineIndependent/glslang.y" +#line 4311 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } @@ -12222,7 +12222,7 @@ yyreduce: break; case 678: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter */ -#line 4394 "MachineIndependent/glslang.y" +#line 4316 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } @@ -12230,7 +12230,7 @@ yyreduce: break; case 679: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter */ -#line 4397 "MachineIndependent/glslang.y" +#line 4319 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } @@ -12238,7 +12238,7 @@ yyreduce: break; case 680: /* spirv_decorate_id_parameter: variable_identifier */ -#line 4402 "MachineIndependent/glslang.y" +#line 4324 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getAsConstantUnion() || (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode()) (yyval.interm.intermNode) = (yyvsp[0].interm.intermTypedNode); @@ -12249,7 +12249,7 @@ yyreduce: break; case 681: /* spirv_decorate_id_parameter: FLOATCONSTANT */ -#line 4408 "MachineIndependent/glslang.y" +#line 4330 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } @@ -12257,7 +12257,7 @@ yyreduce: break; case 682: /* spirv_decorate_id_parameter: INTCONSTANT */ -#line 4411 "MachineIndependent/glslang.y" +#line 4333 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } @@ -12265,7 +12265,7 @@ yyreduce: break; case 683: /* spirv_decorate_id_parameter: UINTCONSTANT */ -#line 4414 "MachineIndependent/glslang.y" +#line 4336 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } @@ -12273,7 +12273,7 @@ yyreduce: break; case 684: /* spirv_decorate_id_parameter: BOOLCONSTANT */ -#line 4417 "MachineIndependent/glslang.y" +#line 4339 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } @@ -12281,7 +12281,7 @@ yyreduce: break; case 685: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ -#line 4422 "MachineIndependent/glslang.y" +#line 4344 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate( parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); @@ -12290,7 +12290,7 @@ yyreduce: break; case 686: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ -#line 4426 "MachineIndependent/glslang.y" +#line 4348 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } @@ -12298,7 +12298,7 @@ yyreduce: break; case 687: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4431 "MachineIndependent/glslang.y" +#line 4353 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); @@ -12307,7 +12307,7 @@ yyreduce: break; case 688: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4435 "MachineIndependent/glslang.y" +#line 4357 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); @@ -12317,7 +12317,7 @@ yyreduce: break; case 689: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4440 "MachineIndependent/glslang.y" +#line 4362 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); @@ -12326,7 +12326,7 @@ yyreduce: break; case 690: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4444 "MachineIndependent/glslang.y" +#line 4366 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); @@ -12336,7 +12336,7 @@ yyreduce: break; case 691: /* spirv_type_parameter_list: spirv_type_parameter */ -#line 4451 "MachineIndependent/glslang.y" +#line 4373 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = (yyvsp[0].interm.spirvTypeParams); } @@ -12344,7 +12344,7 @@ yyreduce: break; case 692: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ -#line 4454 "MachineIndependent/glslang.y" +#line 4376 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.mergeSpirvTypeParameters((yyvsp[-2].interm.spirvTypeParams), (yyvsp[0].interm.spirvTypeParams)); } @@ -12352,7 +12352,7 @@ yyreduce: break; case 693: /* spirv_type_parameter: constant_expression */ -#line 4459 "MachineIndependent/glslang.y" +#line 4381 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)->getAsConstantUnion()); } @@ -12360,7 +12360,7 @@ yyreduce: break; case 694: /* spirv_type_parameter: type_specifier_nonarray */ -#line 4462 "MachineIndependent/glslang.y" +#line 4384 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } @@ -12368,7 +12368,7 @@ yyreduce: break; case 695: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4467 "MachineIndependent/glslang.y" +#line 4389 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } @@ -12376,7 +12376,7 @@ yyreduce: break; case 696: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4470 "MachineIndependent/glslang.y" +#line 4392 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); @@ -12385,7 +12385,7 @@ yyreduce: break; case 697: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ -#line 4476 "MachineIndependent/glslang.y" +#line 4398 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[0].interm.spirvInst); } @@ -12393,7 +12393,7 @@ yyreduce: break; case 698: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ -#line 4479 "MachineIndependent/glslang.y" +#line 4401 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.mergeSpirvInstruction((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvInst), (yyvsp[0].interm.spirvInst)); } @@ -12401,7 +12401,7 @@ yyreduce: break; case 699: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ -#line 4484 "MachineIndependent/glslang.y" +#line 4406 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, *(yyvsp[0].lex).string); } @@ -12409,7 +12409,7 @@ yyreduce: break; case 700: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ -#line 4487 "MachineIndependent/glslang.y" +#line 4409 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[0].lex).i); } @@ -12641,5 +12641,5 @@ yyreturnlab: return yyresult; } -#line 4492 "MachineIndependent/glslang.y" +#line 4413 "MachineIndependent/glslang.y" diff --git a/thirdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/thirdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h index 39455f276d..d6484924d6 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +++ b/thirdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h @@ -524,7 +524,7 @@ extern int yydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { -#line 97 "MachineIndependent/glslang.y" +#line 72 "MachineIndependent/glslang.y" struct { glslang::TSourceLoc loc; diff --git a/thirdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/thirdparty/glslang/glslang/MachineIndependent/intermOut.cpp index d5fc26bbf2..32c3c573f9 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/intermOut.cpp @@ -1141,6 +1141,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpHitObjectGetShaderBindingTableRecordIndexNV: out.debug << "HitObjectGetShaderBindingTableRecordIndexNV"; break; case EOpHitObjectGetShaderRecordBufferHandleNV: out.debug << "HitObjectReadShaderRecordBufferHandleNV"; break; case EOpReorderThreadNV: out.debug << "ReorderThreadNV"; break; + case EOpFetchMicroTriangleVertexPositionNV: out.debug << "MicroTriangleVertexPositionNV"; break; + case EOpFetchMicroTriangleVertexBarycentricNV: out.debug << "MicroTriangleVertexBarycentricNV"; break; case EOpSpirvInst: out.debug << "spirv_instruction"; break; case EOpStencilAttachmentReadEXT: out.debug << "stencilAttachmentReadEXT"; break; diff --git a/thirdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/thirdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp index 8d2e85f0be..16b9d24376 100644 --- a/thirdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/thirdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -378,8 +378,6 @@ namespace { int op_cmpl(int a) { return ~a; } int op_not(int a) { return !a; } -}; - struct TBinop { int token, precedence, (*op)(int, int); } binop[] = { @@ -412,6 +410,8 @@ struct TUnop { { '!', op_not }, }; +} // anonymous namespace + #define NUM_ELEMENTS(A) (sizeof(A) / sizeof(A[0])) int TPpContext::eval(int token, int precedence, bool shortCircuit, int& res, bool& err, TPpToken* ppToken) diff --git a/thirdparty/glslang/glslang/Public/ShaderLang.h b/thirdparty/glslang/glslang/Public/ShaderLang.h index e037e63f0b..c22cb2b43e 100644 --- a/thirdparty/glslang/glslang/Public/ShaderLang.h +++ b/thirdparty/glslang/glslang/Public/ShaderLang.h @@ -573,6 +573,9 @@ public: void setEnvInputVulkanRulesRelaxed() { environment.input.vulkanRulesRelaxed = true; } bool getEnvInputVulkanRulesRelaxed() const { return environment.input.vulkanRulesRelaxed; } + void setCompileOnly() { compileOnly = true; } + bool getCompileOnly() const { return compileOnly; } + // Interface to #include handlers. // // To support #include, a client of Glslang does the following: @@ -722,6 +725,9 @@ protected: TEnvironment environment; + // Indicates this shader is meant to be used without linking + bool compileOnly = false; + friend class TProgram; private: diff --git a/thirdparty/glslang/glslang/build_info.h b/thirdparty/glslang/glslang/build_info.h index 8bffae570a..c25117eefe 100644 --- a/thirdparty/glslang/glslang/build_info.h +++ b/thirdparty/glslang/glslang/build_info.h @@ -34,8 +34,8 @@ #ifndef GLSLANG_BUILD_INFO #define GLSLANG_BUILD_INFO -#define GLSLANG_VERSION_MAJOR 12 -#define GLSLANG_VERSION_MINOR 3 +#define GLSLANG_VERSION_MAJOR 13 +#define GLSLANG_VERSION_MINOR 1 #define GLSLANG_VERSION_PATCH 1 #define GLSLANG_VERSION_FLAVOR "" diff --git a/thirdparty/spirv-reflect/spirv_reflect.c b/thirdparty/spirv-reflect/spirv_reflect.c index a830ca9ebf..05b6d666a9 100644 --- a/thirdparty/spirv-reflect/spirv_reflect.c +++ b/thirdparty/spirv-reflect/spirv_reflect.c @@ -129,6 +129,9 @@ typedef struct SpvReflectPrvDecorations { bool is_flat; bool is_non_writable; bool is_non_readable; + bool is_patch; + bool is_per_vertex; + bool is_per_task; SpvReflectPrvNumberDecoration set; SpvReflectPrvNumberDecoration binding; SpvReflectPrvNumberDecoration input_attachment_index; @@ -515,6 +518,15 @@ static SpvReflectDecorationFlags ApplyDecorations(const SpvReflectPrvDecorations if (p_decoration_fields->is_non_readable) { decorations |= SPV_REFLECT_DECORATION_NON_READABLE; } + if (p_decoration_fields->is_patch) { + decorations |= SPV_REFLECT_DECORATION_PATCH; + } + if (p_decoration_fields->is_per_vertex) { + decorations |= SPV_REFLECT_DECORATION_PER_VERTEX; + } + if (p_decoration_fields->is_per_task) { + decorations |= SPV_REFLECT_DECORATION_PER_TASK; + } return decorations; } @@ -528,6 +540,10 @@ static void ApplyArrayTraits(const SpvReflectTypeDescription* p_type, SpvReflect memcpy(p_array_traits, &p_type->traits.array, sizeof(p_type->traits.array)); } +static bool IsSpecConstant(const SpvReflectPrvNode* p_node) { + return (p_node->op == SpvOpSpecConstant || p_node->op == SpvOpSpecConstantOp); +} + static SpvReflectPrvNode* FindNode( SpvReflectPrvParser* p_parser, uint32_t result_id) @@ -599,6 +615,9 @@ static uint32_t FindBaseId(SpvReflectPrvParser* p_parser, } base_id = base_ac->base_id; base_node = FindNode(p_parser, base_id); + if (IsNull(base_node)) { + return 0; + } } return base_id; } @@ -618,12 +637,15 @@ static SpvReflectBlockVariable* GetRefBlkVar(SpvReflectPrvParser* p_parser, bool IsPointerToPointer(SpvReflectPrvParser* p_parser, uint32_t type_id) { SpvReflectPrvNode* ptr_node = FindNode(p_parser, type_id); - if (ptr_node->op != SpvOpTypePointer) { + if (IsNull(ptr_node) || (ptr_node->op != SpvOpTypePointer)) { return false; } uint32_t pte_id = 0; UNCHECKED_READU32(p_parser, ptr_node->word_offset + 3, pte_id); SpvReflectPrvNode* pte_node = FindNode(p_parser, pte_id); + if (IsNull(pte_node)) { + return false; + } return pte_node->op == SpvOpTypePointer; } @@ -1493,6 +1515,9 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser) case SpvDecorationFlat: case SpvDecorationNonWritable: case SpvDecorationNonReadable: + case SpvDecorationPatch: + case SpvDecorationPerVertexKHR: + case SpvDecorationPerTaskNV: case SpvDecorationLocation: case SpvDecorationComponent: case SpvDecorationBinding: @@ -1597,6 +1622,18 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser) } break; + case SpvDecorationPatch: { + p_target_decorations->is_patch = true; + } break; + + case SpvDecorationPerVertexKHR: { + p_target_decorations->is_per_vertex = true; + } break; + + case SpvDecorationPerTaskNV: { + p_target_decorations->is_per_task = true; + } break; + case SpvDecorationLocation: { uint32_t word_offset = p_node->word_offset + member_offset + 3; CHECKED_READU32(p_parser, word_offset, p_target_decorations->location.value); @@ -1846,8 +1883,7 @@ static SpvReflectResult ParseType( SpvReflectPrvNode* p_length_node = FindNode(p_parser, length_id); if (IsNotNull(p_length_node)) { uint32_t dim_index = p_type->traits.array.dims_count; - if (p_length_node->op == SpvOpSpecConstant || - p_length_node->op == SpvOpSpecConstantOp) { + if (IsSpecConstant(p_length_node)) { p_type->traits.array.dims[dim_index] = (uint32_t)SPV_REFLECT_ARRAY_DIM_SPEC_CONSTANT; p_type->traits.array.spec_constant_op_ids[dim_index] = length_id; @@ -3131,7 +3167,7 @@ static SpvReflectResult ParseInterfaceVariables( } SpvReflectTypeDescription* p_type = FindType(p_module, p_node->type_id); - if (IsNull(p_node)) { + if (IsNull(p_node) || IsNull(p_type)) { return SPV_REFLECT_RESULT_ERROR_SPIRV_INVALID_ID_REFERENCE; } // If the type is a pointer, resolve it @@ -3533,7 +3569,8 @@ static SpvReflectResult ParseExecutionModes( if (IsNotNull(p_parser) && IsNotNull(p_parser->spirv_code) && IsNotNull(p_parser->nodes)) { for (size_t node_idx = 0; node_idx < p_parser->node_count; ++node_idx) { SpvReflectPrvNode* p_node = &(p_parser->nodes[node_idx]); - if (p_node->op != SpvOpExecutionMode) { + if (p_node->op != SpvOpExecutionMode && + p_node->op != SpvOpExecutionModeId) { continue; } @@ -3560,41 +3597,55 @@ static SpvReflectResult ParseExecutionModes( // Parse execution mode switch (execution_mode) { - default: { - return SPV_REFLECT_RESULT_ERROR_SPIRV_INVALID_EXECUTION_MODE; - } - break; - case SpvExecutionModeInvocations: { CHECKED_READU32(p_parser, p_node->word_offset + 3, p_entry_point->invocations); } break; - case SpvExecutionModeSpacingEqual: - case SpvExecutionModeSpacingFractionalEven: - case SpvExecutionModeSpacingFractionalOdd: - case SpvExecutionModeVertexOrderCw: - case SpvExecutionModeVertexOrderCcw: - case SpvExecutionModePixelCenterInteger: - case SpvExecutionModeOriginUpperLeft: - case SpvExecutionModeOriginLowerLeft: - case SpvExecutionModeEarlyFragmentTests: - case SpvExecutionModePointMode: - case SpvExecutionModeXfb: - case SpvExecutionModeDepthReplacing: - case SpvExecutionModeDepthGreater: - case SpvExecutionModeDepthLess: - case SpvExecutionModeDepthUnchanged: - break; - case SpvExecutionModeLocalSize: { CHECKED_READU32(p_parser, p_node->word_offset + 3, p_entry_point->local_size.x); CHECKED_READU32(p_parser, p_node->word_offset + 4, p_entry_point->local_size.y); CHECKED_READU32(p_parser, p_node->word_offset + 5, p_entry_point->local_size.z); } break; + case SpvExecutionModeLocalSizeId: { + uint32_t local_size_x_id = 0; + uint32_t local_size_y_id = 0; + uint32_t local_size_z_id = 0; + CHECKED_READU32(p_parser, p_node->word_offset + 3, local_size_x_id); + CHECKED_READU32(p_parser, p_node->word_offset + 4, local_size_y_id); + CHECKED_READU32(p_parser, p_node->word_offset + 5, local_size_z_id); + + SpvReflectPrvNode* x_node = FindNode(p_parser, local_size_x_id); + SpvReflectPrvNode* y_node = FindNode(p_parser, local_size_y_id); + SpvReflectPrvNode* z_node = FindNode(p_parser, local_size_z_id); + if (IsNotNull(x_node) && IsNotNull(y_node) && IsNotNull(z_node)) { + if (IsSpecConstant(x_node)) { + p_entry_point->local_size.x = + (uint32_t)SPV_REFLECT_EXECUTION_MODE_SPEC_CONSTANT; + } else { + CHECKED_READU32(p_parser, x_node->word_offset + 3, + p_entry_point->local_size.x); + } + + if (IsSpecConstant(y_node)) { + p_entry_point->local_size.y = + (uint32_t)SPV_REFLECT_EXECUTION_MODE_SPEC_CONSTANT; + } else { + CHECKED_READU32(p_parser, y_node->word_offset + 3, + p_entry_point->local_size.y); + } + + if (IsSpecConstant(z_node)) { + p_entry_point->local_size.z = + (uint32_t)SPV_REFLECT_EXECUTION_MODE_SPEC_CONSTANT; + } else { + CHECKED_READU32(p_parser, z_node->word_offset + 3, + p_entry_point->local_size.z); + } + } + } break; - case SpvExecutionModeLocalSizeHint: case SpvExecutionModeInputPoints: case SpvExecutionModeInputLines: case SpvExecutionModeInputLinesAdjacency: @@ -3607,32 +3658,7 @@ static SpvReflectResult ParseExecutionModes( } break; - case SpvExecutionModeOutputPoints: - case SpvExecutionModeOutputLineStrip: - case SpvExecutionModeOutputTriangleStrip: - case SpvExecutionModeVecTypeHint: - case SpvExecutionModeContractionOff: - case SpvExecutionModeInitializer: - case SpvExecutionModeFinalizer: - case SpvExecutionModeSubgroupSize: - case SpvExecutionModeSubgroupsPerWorkgroup: - case SpvExecutionModeSubgroupsPerWorkgroupId: - case SpvExecutionModeLocalSizeId: - case SpvExecutionModeLocalSizeHintId: - case SpvExecutionModePostDepthCoverage: - case SpvExecutionModeDenormPreserve: - case SpvExecutionModeDenormFlushToZero: - case SpvExecutionModeSignedZeroInfNanPreserve: - case SpvExecutionModeRoundingModeRTE: - case SpvExecutionModeRoundingModeRTZ: - case SpvExecutionModeStencilRefReplacingEXT: - case SpvExecutionModeOutputLinesNV: - case SpvExecutionModeOutputPrimitivesNV: - case SpvExecutionModeOutputTrianglesNV: - case SpvExecutionModePixelInterlockOrderedEXT: - case SpvExecutionModePixelInterlockUnorderedEXT: - case SpvExecutionModeSampleInterlockOrderedEXT: - case SpvExecutionModeSampleInterlockUnorderedEXT: + default: break; } p_entry_point->execution_mode_count++; @@ -3777,7 +3803,7 @@ static SpvReflectResult ParsePushConstantBlocks( } SpvReflectTypeDescription* p_type = FindType(p_module, p_node->type_id); - if (IsNull(p_node)) { + if (IsNull(p_node) || IsNull(p_type)) { return SPV_REFLECT_RESULT_ERROR_SPIRV_INVALID_ID_REFERENCE; } // If the type is a pointer, resolve it diff --git a/thirdparty/spirv-reflect/spirv_reflect.h b/thirdparty/spirv-reflect/spirv_reflect.h index 759db682f4..3395f6ce62 100644 --- a/thirdparty/spirv-reflect/spirv_reflect.h +++ b/thirdparty/spirv-reflect/spirv_reflect.h @@ -134,6 +134,9 @@ NOTE: HLSL row_major and column_major decorations are reversed SPIRV-Reflect reads the data as is and does not make any attempt to correct it to match what's in the source. + The Patch, PerVertex, and PerTask are used for Interface + variables that can have array + */ typedef enum SpvReflectDecorationFlagBits { SPV_REFLECT_DECORATION_NONE = 0x00000000, @@ -147,6 +150,9 @@ typedef enum SpvReflectDecorationFlagBits { SPV_REFLECT_DECORATION_NON_WRITABLE = 0x00000080, SPV_REFLECT_DECORATION_RELAXED_PRECISION = 0x00000100, SPV_REFLECT_DECORATION_NON_READABLE = 0x00000200, + SPV_REFLECT_DECORATION_PATCH = 0x00000400, + SPV_REFLECT_DECORATION_PER_VERTEX = 0x00000800, + SPV_REFLECT_DECORATION_PER_TASK = 0x00001000, } SpvReflectDecorationFlagBits; typedef uint32_t SpvReflectDecorationFlags; @@ -478,6 +484,10 @@ typedef struct SpvReflectDescriptorSet { SpvReflectDescriptorBinding** bindings; } SpvReflectDescriptorSet; +typedef enum SpvReflectExecutionModeValue { + SPV_REFLECT_EXECUTION_MODE_SPEC_CONSTANT = 0xFFFFFFFF // specialization constant +} SpvReflectExecutionModeValue; + /*! @struct SpvReflectEntryPoint */ diff --git a/thirdparty/thorvg/inc/config.h b/thirdparty/thorvg/inc/config.h index d1abc5a290..73e72c74a7 100644 --- a/thirdparty/thorvg/inc/config.h +++ b/thirdparty/thorvg/inc/config.h @@ -9,5 +9,5 @@ // For internal debugging: //#define THORVG_LOG_ENABLED -#define THORVG_VERSION_STRING "0.12.0" +#define THORVG_VERSION_STRING "0.12.1" #endif diff --git a/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp b/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp index 6e52476625..74f9871a08 100644 --- a/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp +++ b/thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp @@ -3732,10 +3732,8 @@ bool SvgLoader::read() { if (!content || size == 0) return false; - if (!LoadModule::read()) return true; - //the loading has been already completed in header() - if (root) return true; + if (root || !LoadModule::read()) return true; TaskScheduler::request(this); diff --git a/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp b/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp index aec30d2384..6530d52259 100644 --- a/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp +++ b/thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp @@ -171,10 +171,11 @@ static const char* _simpleXmlFindStartTag(const char* itr, const char* itrEnd) static const char* _simpleXmlFindEndTag(const char* itr, const char* itrEnd) { - bool insideQuote = false; + bool insideQuote[2] = {false, false}; // 0: ", 1: ' for (; itr < itrEnd; itr++) { - if (*itr == '"') insideQuote = !insideQuote; - if (!insideQuote) { + if (*itr == '"' && !insideQuote[1]) insideQuote[0] = !insideQuote[0]; + if (*itr == '\'' && !insideQuote[0]) insideQuote[1] = !insideQuote[1]; + if (!insideQuote[0] && !insideQuote[1]) { if ((*itr == '>') || (*itr == '<')) return itr; } diff --git a/thirdparty/thorvg/src/renderer/sw_engine/tvgSwMemPool.cpp b/thirdparty/thorvg/src/renderer/sw_engine/tvgSwMemPool.cpp index 68eb7a5a6f..b85d943873 100644 --- a/thirdparty/thorvg/src/renderer/sw_engine/tvgSwMemPool.cpp +++ b/thirdparty/thorvg/src/renderer/sw_engine/tvgSwMemPool.cpp @@ -77,7 +77,7 @@ void mpoolRetDashOutline(SwMpool* mpool, unsigned idx) } -SwMpool* mpoolInit(unsigned threads) +SwMpool* mpoolInit(uint32_t threads) { auto allocSize = threads + 1; diff --git a/thirdparty/thorvg/src/renderer/sw_engine/tvgSwRasterTexmap.h b/thirdparty/thorvg/src/renderer/sw_engine/tvgSwRasterTexmap.h index 04e382b842..8d604a3c9d 100644 --- a/thirdparty/thorvg/src/renderer/sw_engine/tvgSwRasterTexmap.h +++ b/thirdparty/thorvg/src/renderer/sw_engine/tvgSwRasterTexmap.h @@ -821,8 +821,8 @@ static void _rasterPolygonImage(SwSurface* surface, const SwImage* image, const static AASpans* _AASpans(float ymin, float ymax, const SwImage* image, const SwBBox* region) { - auto yStart = static_cast<int32_t>(ymin); - auto yEnd = static_cast<int32_t>(ymax); + auto yStart = static_cast<int>(ymin); + auto yEnd = static_cast<int>(ymax); if (!_arrange(image, region, yStart, yEnd)) return nullptr; @@ -1108,8 +1108,7 @@ static bool _rasterTexmapPolygon(SwSurface* surface, const SwImage* image, const float ys = FLT_MAX, ye = -1.0f; for (int i = 0; i < 4; i++) { - mathMultiply(&vertices[i].pt, transform); - + if (transform) mathMultiply(&vertices[i].pt, transform); if (vertices[i].pt.y < ys) ys = vertices[i].pt.y; if (vertices[i].pt.y > ye) ye = vertices[i].pt.y; } diff --git a/thirdparty/thorvg/src/renderer/tvgShape.cpp b/thirdparty/thorvg/src/renderer/tvgShape.cpp index 23b8006dd9..d083c8aa2c 100644 --- a/thirdparty/thorvg/src/renderer/tvgShape.cpp +++ b/thirdparty/thorvg/src/renderer/tvgShape.cpp @@ -130,11 +130,11 @@ Result Shape::appendCircle(float cx, float cy, float rx, float ry) noexcept auto ryKappa = ry * PATH_KAPPA; pImpl->grow(6, 13); - pImpl->moveTo(cx, cy - ry); - pImpl->cubicTo(cx + rxKappa, cy - ry, cx + rx, cy - ryKappa, cx + rx, cy); + pImpl->moveTo(cx + rx, cy); pImpl->cubicTo(cx + rx, cy + ryKappa, cx + rxKappa, cy + ry, cx, cy + ry); pImpl->cubicTo(cx - rxKappa, cy + ry, cx - rx, cy + ryKappa, cx - rx, cy); pImpl->cubicTo(cx - rx, cy - ryKappa, cx - rxKappa, cy - ry, cx, cy - ry); + pImpl->cubicTo(cx + rxKappa, cy - ry, cx + rx, cy - ryKappa, cx + rx, cy); pImpl->close(); return Result::Success; diff --git a/thirdparty/thorvg/update-thorvg.sh b/thirdparty/thorvg/update-thorvg.sh index a1732d5157..7e7fd0591c 100755 --- a/thirdparty/thorvg/update-thorvg.sh +++ b/thirdparty/thorvg/update-thorvg.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -VERSION=0.12.0 +VERSION=0.12.1 cd thirdparty/thorvg/ || true rm -rf AUTHORS LICENSE inc/ src/ *.zip *.tar.gz tmp/ diff --git a/thirdparty/volk/volk.c b/thirdparty/volk/volk.c index b390e73643..3da1667699 100644 --- a/thirdparty/volk/volk.c +++ b/thirdparty/volk/volk.c @@ -6,7 +6,9 @@ typedef const char* LPCSTR; typedef struct HINSTANCE__* HINSTANCE; typedef HINSTANCE HMODULE; - #ifdef _WIN64 + #if defined(_MINWINDEF_) + /* minwindef.h defines FARPROC, and attempting to redefine it may conflict with -Wstrict-prototypes */ + #elif defined(_WIN64) typedef __int64 (__stdcall* FARPROC)(void); #else typedef int (__stdcall* FARPROC)(void); @@ -1017,6 +1019,13 @@ static void volkGenLoadDevice(void* context, PFN_vkVoidFunction (*load)(void*, c #if defined(VK_NV_fragment_shading_rate_enums) vkCmdSetFragmentShadingRateEnumNV = (PFN_vkCmdSetFragmentShadingRateEnumNV)load(context, "vkCmdSetFragmentShadingRateEnumNV"); #endif /* defined(VK_NV_fragment_shading_rate_enums) */ +#if defined(VK_NV_low_latency2) + vkGetLatencyTimingsNV = (PFN_vkGetLatencyTimingsNV)load(context, "vkGetLatencyTimingsNV"); + vkLatencySleepNV = (PFN_vkLatencySleepNV)load(context, "vkLatencySleepNV"); + vkQueueNotifyOutOfBandNV = (PFN_vkQueueNotifyOutOfBandNV)load(context, "vkQueueNotifyOutOfBandNV"); + vkSetLatencyMarkerNV = (PFN_vkSetLatencyMarkerNV)load(context, "vkSetLatencyMarkerNV"); + vkSetLatencySleepModeNV = (PFN_vkSetLatencySleepModeNV)load(context, "vkSetLatencySleepModeNV"); +#endif /* defined(VK_NV_low_latency2) */ #if defined(VK_NV_memory_decompression) vkCmdDecompressMemoryIndirectCountNV = (PFN_vkCmdDecompressMemoryIndirectCountNV)load(context, "vkCmdDecompressMemoryIndirectCountNV"); vkCmdDecompressMemoryNV = (PFN_vkCmdDecompressMemoryNV)load(context, "vkCmdDecompressMemoryNV"); @@ -1818,6 +1827,13 @@ static void volkGenLoadDeviceTable(struct VolkDeviceTable* table, void* context, #if defined(VK_NV_fragment_shading_rate_enums) table->vkCmdSetFragmentShadingRateEnumNV = (PFN_vkCmdSetFragmentShadingRateEnumNV)load(context, "vkCmdSetFragmentShadingRateEnumNV"); #endif /* defined(VK_NV_fragment_shading_rate_enums) */ +#if defined(VK_NV_low_latency2) + table->vkGetLatencyTimingsNV = (PFN_vkGetLatencyTimingsNV)load(context, "vkGetLatencyTimingsNV"); + table->vkLatencySleepNV = (PFN_vkLatencySleepNV)load(context, "vkLatencySleepNV"); + table->vkQueueNotifyOutOfBandNV = (PFN_vkQueueNotifyOutOfBandNV)load(context, "vkQueueNotifyOutOfBandNV"); + table->vkSetLatencyMarkerNV = (PFN_vkSetLatencyMarkerNV)load(context, "vkSetLatencyMarkerNV"); + table->vkSetLatencySleepModeNV = (PFN_vkSetLatencySleepModeNV)load(context, "vkSetLatencySleepModeNV"); +#endif /* defined(VK_NV_low_latency2) */ #if defined(VK_NV_memory_decompression) table->vkCmdDecompressMemoryIndirectCountNV = (PFN_vkCmdDecompressMemoryIndirectCountNV)load(context, "vkCmdDecompressMemoryIndirectCountNV"); table->vkCmdDecompressMemoryNV = (PFN_vkCmdDecompressMemoryNV)load(context, "vkCmdDecompressMemoryNV"); @@ -2806,6 +2822,13 @@ PFN_vkGetMemoryWin32HandleNV vkGetMemoryWin32HandleNV; #if defined(VK_NV_fragment_shading_rate_enums) PFN_vkCmdSetFragmentShadingRateEnumNV vkCmdSetFragmentShadingRateEnumNV; #endif /* defined(VK_NV_fragment_shading_rate_enums) */ +#if defined(VK_NV_low_latency2) +PFN_vkGetLatencyTimingsNV vkGetLatencyTimingsNV; +PFN_vkLatencySleepNV vkLatencySleepNV; +PFN_vkQueueNotifyOutOfBandNV vkQueueNotifyOutOfBandNV; +PFN_vkSetLatencyMarkerNV vkSetLatencyMarkerNV; +PFN_vkSetLatencySleepModeNV vkSetLatencySleepModeNV; +#endif /* defined(VK_NV_low_latency2) */ #if defined(VK_NV_memory_decompression) PFN_vkCmdDecompressMemoryIndirectCountNV vkCmdDecompressMemoryIndirectCountNV; PFN_vkCmdDecompressMemoryNV vkCmdDecompressMemoryNV; diff --git a/thirdparty/volk/volk.h b/thirdparty/volk/volk.h index f70c51fcda..2d66b22621 100644 --- a/thirdparty/volk/volk.h +++ b/thirdparty/volk/volk.h @@ -15,7 +15,7 @@ #endif /* VOLK_GENERATE_VERSION_DEFINE */ -#define VOLK_HEADER_VERSION 261 +#define VOLK_HEADER_VERSION 268 /* VOLK_GENERATE_VERSION_DEFINE */ #ifndef VK_NO_PROTOTYPES @@ -787,6 +787,13 @@ struct VolkDeviceTable #if defined(VK_NV_fragment_shading_rate_enums) PFN_vkCmdSetFragmentShadingRateEnumNV vkCmdSetFragmentShadingRateEnumNV; #endif /* defined(VK_NV_fragment_shading_rate_enums) */ +#if defined(VK_NV_low_latency2) + PFN_vkGetLatencyTimingsNV vkGetLatencyTimingsNV; + PFN_vkLatencySleepNV vkLatencySleepNV; + PFN_vkQueueNotifyOutOfBandNV vkQueueNotifyOutOfBandNV; + PFN_vkSetLatencyMarkerNV vkSetLatencyMarkerNV; + PFN_vkSetLatencySleepModeNV vkSetLatencySleepModeNV; +#endif /* defined(VK_NV_low_latency2) */ #if defined(VK_NV_memory_decompression) PFN_vkCmdDecompressMemoryIndirectCountNV vkCmdDecompressMemoryIndirectCountNV; PFN_vkCmdDecompressMemoryNV vkCmdDecompressMemoryNV; @@ -1767,6 +1774,13 @@ extern PFN_vkGetMemoryWin32HandleNV vkGetMemoryWin32HandleNV; #if defined(VK_NV_fragment_shading_rate_enums) extern PFN_vkCmdSetFragmentShadingRateEnumNV vkCmdSetFragmentShadingRateEnumNV; #endif /* defined(VK_NV_fragment_shading_rate_enums) */ +#if defined(VK_NV_low_latency2) +extern PFN_vkGetLatencyTimingsNV vkGetLatencyTimingsNV; +extern PFN_vkLatencySleepNV vkLatencySleepNV; +extern PFN_vkQueueNotifyOutOfBandNV vkQueueNotifyOutOfBandNV; +extern PFN_vkSetLatencyMarkerNV vkSetLatencyMarkerNV; +extern PFN_vkSetLatencySleepModeNV vkSetLatencySleepModeNV; +#endif /* defined(VK_NV_low_latency2) */ #if defined(VK_NV_memory_decompression) extern PFN_vkCmdDecompressMemoryIndirectCountNV vkCmdDecompressMemoryIndirectCountNV; extern PFN_vkCmdDecompressMemoryNV vkCmdDecompressMemoryNV; diff --git a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h index a23789c68a..ef7eaf745e 100644 --- a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h +++ b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h @@ -29,6 +29,7 @@ extern "C" { #define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS 64 #define STD_VIDEO_H264_MAX_NUM_LIST_REF 32 #define STD_VIDEO_H264_MAX_CHROMA_PLANES 2 +#define STD_VIDEO_H264_NO_REFERENCE_PICTURE 0xFF typedef enum StdVideoH264ChromaFormatIdc { STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME = 0, diff --git a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std_encode.h b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std_encode.h index 2e0d706f6c..58b8bdb2f6 100644 --- a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std_encode.h +++ b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std_encode.h @@ -23,9 +23,9 @@ extern "C" { #define vulkan_video_codec_h264std_encode 1 #include "vulkan_video_codec_h264std.h" // Vulkan 0.9 provisional Vulkan video H.264 encode std specification version number -#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_10 VK_MAKE_VIDEO_STD_VERSION(0, 9, 10) +#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_11 VK_MAKE_VIDEO_STD_VERSION(0, 9, 11) -#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_10 +#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_11 #define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_encode" typedef struct StdVideoEncodeH264WeightTableFlags { uint32_t luma_weight_l0_flag; @@ -81,7 +81,7 @@ typedef struct StdVideoEncodeH264RefListModEntry { } StdVideoEncodeH264RefListModEntry; typedef struct StdVideoEncodeH264RefPicMarkingEntry { - StdVideoH264MemMgmtControlOp operation; + StdVideoH264MemMgmtControlOp memory_management_control_operation; uint16_t difference_of_pic_nums_minus1; uint16_t long_term_pic_num; uint16_t long_term_frame_idx; @@ -132,7 +132,8 @@ typedef struct StdVideoEncodeH264SliceHeader { StdVideoH264SliceType slice_type; int8_t slice_alpha_c0_offset_div2; int8_t slice_beta_offset_div2; - uint16_t reserved1; + int8_t slice_qp_delta; + uint8_t reserved1; StdVideoH264CabacInitIdc cabac_init_idc; StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc; const StdVideoEncodeH264WeightTable* pWeightTable; diff --git a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h265std.h b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h265std.h index 793bdbcff9..ff5d0dacbf 100644 --- a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h265std.h +++ b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h265std.h @@ -44,6 +44,7 @@ extern "C" { #define STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS 32 #define STD_VIDEO_H265_MAX_LONG_TERM_PICS 16 #define STD_VIDEO_H265_MAX_DELTA_POC 48 +#define STD_VIDEO_H265_NO_REFERENCE_PICTURE 0xFF typedef enum StdVideoH265ChromaFormatIdc { STD_VIDEO_H265_CHROMA_FORMAT_IDC_MONOCHROME = 0, diff --git a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h265std_encode.h b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h265std_encode.h index 25740398a4..2a7024caba 100644 --- a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h265std_encode.h +++ b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h265std_encode.h @@ -23,9 +23,9 @@ extern "C" { #define vulkan_video_codec_h265std_encode 1 #include "vulkan_video_codec_h265std.h" // Vulkan 0.9 provisional Vulkan video H.265 encode std specification version number -#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_11 VK_MAKE_VIDEO_STD_VERSION(0, 9, 11) +#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_12 VK_MAKE_VIDEO_STD_VERSION(0, 9, 12) -#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_11 +#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_12 #define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_encode" typedef struct StdVideoEncodeH265WeightTableFlags { uint16_t luma_weight_l0_flag; @@ -77,7 +77,8 @@ typedef struct StdVideoEncodeH265SliceSegmentHeader { int8_t slice_act_y_qp_offset; int8_t slice_act_cb_qp_offset; int8_t slice_act_cr_qp_offset; - uint8_t reserved1[3]; + int8_t slice_qp_delta; + uint16_t reserved1; const StdVideoEncodeH265WeightTable* pWeightTable; } StdVideoEncodeH265SliceSegmentHeader; @@ -110,7 +111,7 @@ typedef struct StdVideoEncodeH265PictureInfoFlags { uint32_t reserved : 23; } StdVideoEncodeH265PictureInfoFlags; -typedef struct StdVideoEncodeH265SliceSegmentLongTermRefPics { +typedef struct StdVideoEncodeH265LongTermRefPics { uint8_t num_long_term_sps; uint8_t num_long_term_pics; uint8_t lt_idx_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS]; @@ -118,21 +119,21 @@ typedef struct StdVideoEncodeH265SliceSegmentLongTermRefPics { uint16_t used_by_curr_pic_lt_flag; uint8_t delta_poc_msb_present_flag[STD_VIDEO_H265_MAX_DELTA_POC]; uint8_t delta_poc_msb_cycle_lt[STD_VIDEO_H265_MAX_DELTA_POC]; -} StdVideoEncodeH265SliceSegmentLongTermRefPics; +} StdVideoEncodeH265LongTermRefPics; typedef struct StdVideoEncodeH265PictureInfo { - StdVideoEncodeH265PictureInfoFlags flags; - StdVideoH265PictureType pic_type; - uint8_t sps_video_parameter_set_id; - uint8_t pps_seq_parameter_set_id; - uint8_t pps_pic_parameter_set_id; - uint8_t short_term_ref_pic_set_idx; - int32_t PicOrderCntVal; - uint8_t TemporalId; - uint8_t reserved1[7]; - const StdVideoEncodeH265ReferenceListsInfo* pRefLists; - const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSet; - const StdVideoEncodeH265SliceSegmentLongTermRefPics* pLongTermRefPics; + StdVideoEncodeH265PictureInfoFlags flags; + StdVideoH265PictureType pic_type; + uint8_t sps_video_parameter_set_id; + uint8_t pps_seq_parameter_set_id; + uint8_t pps_pic_parameter_set_id; + uint8_t short_term_ref_pic_set_idx; + int32_t PicOrderCntVal; + uint8_t TemporalId; + uint8_t reserved1[7]; + const StdVideoEncodeH265ReferenceListsInfo* pRefLists; + const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSet; + const StdVideoEncodeH265LongTermRefPics* pLongTermRefPics; } StdVideoEncodeH265PictureInfo; typedef struct StdVideoEncodeH265ReferenceInfoFlags { diff --git a/thirdparty/vulkan/include/vulkan/vulkan.cppm b/thirdparty/vulkan/include/vulkan/vulkan.cppm index cc693b8d43..9a2cad55c2 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan.cppm +++ b/thirdparty/vulkan/include/vulkan/vulkan.cppm @@ -5,6 +5,9 @@ // This header is generated from the Khronos Vulkan XML API Registry. +// Note: This module is still in an experimental state. +// Any feedback is welcome on https://github.com/KhronosGroup/Vulkan-Hpp/issues. + module; #include <vulkan/vulkan.hpp> @@ -12,10 +15,9 @@ module; #include <vulkan/vulkan_format_traits.hpp> #include <vulkan/vulkan_hash.hpp> #include <vulkan/vulkan_raii.hpp> +#include <vulkan/vulkan_shared.hpp> -export module vulkan; - -VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE +export module vulkan_hpp; export namespace VULKAN_HPP_NAMESPACE { @@ -25,6 +27,7 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::ArrayWrapper1D; using VULKAN_HPP_NAMESPACE::ArrayWrapper2D; using VULKAN_HPP_NAMESPACE::DispatchLoaderBase; + using VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic; using VULKAN_HPP_NAMESPACE::Flags; using VULKAN_HPP_NAMESPACE::FlagTraits; @@ -44,14 +47,19 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::Optional; using VULKAN_HPP_NAMESPACE::StridedArrayProxy; using VULKAN_HPP_NAMESPACE::StructureChain; - using VULKAN_HPP_NAMESPACE::UniqueHandle; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #if !defined( VULKAN_HPP_NO_SMART_HANDLE ) using VULKAN_HPP_NAMESPACE::ObjectDestroy; + using VULKAN_HPP_NAMESPACE::ObjectDestroyShared; using VULKAN_HPP_NAMESPACE::ObjectFree; + using VULKAN_HPP_NAMESPACE::ObjectFreeShared; using VULKAN_HPP_NAMESPACE::ObjectRelease; + using VULKAN_HPP_NAMESPACE::ObjectReleaseShared; using VULKAN_HPP_NAMESPACE::PoolFree; + using VULKAN_HPP_NAMESPACE::PoolFreeShared; + using VULKAN_HPP_NAMESPACE::SharedHandle; + using VULKAN_HPP_NAMESPACE::UniqueHandle; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ //================== @@ -110,6 +118,8 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::DescriptorType; using VULKAN_HPP_NAMESPACE::DeviceCreateFlagBits; using VULKAN_HPP_NAMESPACE::DeviceCreateFlags; + using VULKAN_HPP_NAMESPACE::DeviceQueueCreateFlagBits; + using VULKAN_HPP_NAMESPACE::DeviceQueueCreateFlags; using VULKAN_HPP_NAMESPACE::DynamicState; using VULKAN_HPP_NAMESPACE::EventCreateFlagBits; using VULKAN_HPP_NAMESPACE::EventCreateFlags; @@ -148,13 +158,21 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::ObjectType; using VULKAN_HPP_NAMESPACE::PhysicalDeviceType; using VULKAN_HPP_NAMESPACE::PipelineBindPoint; + using VULKAN_HPP_NAMESPACE::PipelineCacheCreateFlagBits; + using VULKAN_HPP_NAMESPACE::PipelineCacheCreateFlags; using VULKAN_HPP_NAMESPACE::PipelineCacheHeaderVersion; + using VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateFlagBits; + using VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateFlags; using VULKAN_HPP_NAMESPACE::PipelineCreateFlagBits; using VULKAN_HPP_NAMESPACE::PipelineCreateFlags; + using VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateFlagBits; + using VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateFlags; using VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateFlagBits; using VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateFlags; using VULKAN_HPP_NAMESPACE::PipelineInputAssemblyStateCreateFlagBits; using VULKAN_HPP_NAMESPACE::PipelineInputAssemblyStateCreateFlags; + using VULKAN_HPP_NAMESPACE::PipelineLayoutCreateFlagBits; + using VULKAN_HPP_NAMESPACE::PipelineLayoutCreateFlags; using VULKAN_HPP_NAMESPACE::PipelineMultisampleStateCreateFlagBits; using VULKAN_HPP_NAMESPACE::PipelineMultisampleStateCreateFlags; using VULKAN_HPP_NAMESPACE::PipelineRasterizationStateCreateFlagBits; @@ -222,8 +240,6 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateFlags; using VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateType; using VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateTypeKHR; - using VULKAN_HPP_NAMESPACE::DeviceQueueCreateFlagBits; - using VULKAN_HPP_NAMESPACE::DeviceQueueCreateFlags; using VULKAN_HPP_NAMESPACE::ExternalFenceFeatureFlagBits; using VULKAN_HPP_NAMESPACE::ExternalFenceFeatureFlagBitsKHR; using VULKAN_HPP_NAMESPACE::ExternalFenceFeatureFlags; @@ -669,10 +685,6 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::DeviceMemoryReportFlagBitsEXT; using VULKAN_HPP_NAMESPACE::DeviceMemoryReportFlagsEXT; - //=== VK_EXT_pipeline_creation_cache_control === - using VULKAN_HPP_NAMESPACE::PipelineCacheCreateFlagBits; - using VULKAN_HPP_NAMESPACE::PipelineCacheCreateFlags; - #if defined( VK_ENABLE_BETA_EXTENSIONS ) //=== VK_KHR_video_encode_queue === using VULKAN_HPP_NAMESPACE::VideoEncodeCapabilityFlagBitsKHR; @@ -705,8 +717,6 @@ export namespace VULKAN_HPP_NAMESPACE //=== VK_EXT_graphics_pipeline_library === using VULKAN_HPP_NAMESPACE::GraphicsPipelineLibraryFlagBitsEXT; using VULKAN_HPP_NAMESPACE::GraphicsPipelineLibraryFlagsEXT; - using VULKAN_HPP_NAMESPACE::PipelineLayoutCreateFlagBits; - using VULKAN_HPP_NAMESPACE::PipelineLayoutCreateFlags; //=== VK_NV_fragment_shading_rate_enums === using VULKAN_HPP_NAMESPACE::FragmentShadingRateNV; @@ -748,6 +758,10 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::ImageFormatConstraintsFlagsFUCHSIA; #endif /*VK_USE_PLATFORM_FUCHSIA*/ + //=== VK_EXT_frame_boundary === + using VULKAN_HPP_NAMESPACE::FrameBoundaryFlagBitsEXT; + using VULKAN_HPP_NAMESPACE::FrameBoundaryFlagsEXT; + #if defined( VK_USE_PLATFORM_SCREEN_QNX ) //=== VK_QNX_screen_surface === using VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateFlagBitsQNX; @@ -782,12 +796,6 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::DirectDriverLoadingFlagsLUNARG; using VULKAN_HPP_NAMESPACE::DirectDriverLoadingModeLUNARG; - //=== VK_EXT_rasterization_order_attachment_access === - using VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateFlagBits; - using VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateFlags; - using VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateFlagBits; - using VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateFlags; - //=== VK_NV_optical_flow === using VULKAN_HPP_NAMESPACE::OpticalFlowExecuteFlagBitsNV; using VULKAN_HPP_NAMESPACE::OpticalFlowExecuteFlagsNV; @@ -814,12 +822,25 @@ export namespace VULKAN_HPP_NAMESPACE //=== VK_NV_ray_tracing_invocation_reorder === using VULKAN_HPP_NAMESPACE::RayTracingInvocationReorderModeNV; + //=== VK_NV_low_latency2 === + using VULKAN_HPP_NAMESPACE::LatencyMarkerNV; + using VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeNV; + //=== VK_KHR_cooperative_matrix === using VULKAN_HPP_NAMESPACE::ComponentTypeKHR; using VULKAN_HPP_NAMESPACE::ComponentTypeNV; using VULKAN_HPP_NAMESPACE::ScopeKHR; using VULKAN_HPP_NAMESPACE::ScopeNV; + //=== VK_QCOM_image_processing2 === + using VULKAN_HPP_NAMESPACE::BlockMatchWindowCompareModeQCOM; + + //=== VK_QCOM_filter_cubic_weights === + using VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM; + + //=== VK_MSFT_layered_driver === + using VULKAN_HPP_NAMESPACE::LayeredDriverUnderlyingApiMSFT; + //========================= //=== Index Type Traits === //========================= @@ -925,40 +946,40 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::MaxDriverNameSize; //=== VK_KHR_device_group_creation === - using VULKAN_HPP_NAMESPACE::MaxDeviceGroupSizeKhr; + using VULKAN_HPP_NAMESPACE::MaxDeviceGroupSizeKHR; //=== VK_KHR_external_memory_capabilities === - using VULKAN_HPP_NAMESPACE::LuidSizeKhr; + using VULKAN_HPP_NAMESPACE::LuidSizeKHR; //=== VK_KHR_external_memory === - using VULKAN_HPP_NAMESPACE::QueueFamilyExternalKhr; + using VULKAN_HPP_NAMESPACE::QueueFamilyExternalKHR; #if defined( VK_ENABLE_BETA_EXTENSIONS ) //=== VK_AMDX_shader_enqueue === - using VULKAN_HPP_NAMESPACE::ShaderIndexUnusedAmdx; + using VULKAN_HPP_NAMESPACE::ShaderIndexUnusedAMDX; #endif /*VK_ENABLE_BETA_EXTENSIONS*/ //=== VK_KHR_ray_tracing_pipeline === - using VULKAN_HPP_NAMESPACE::ShaderUnusedKhr; + using VULKAN_HPP_NAMESPACE::ShaderUnusedKHR; //=== VK_NV_ray_tracing === - using VULKAN_HPP_NAMESPACE::ShaderUnusedNv; + using VULKAN_HPP_NAMESPACE::ShaderUnusedNV; //=== VK_KHR_global_priority === - using VULKAN_HPP_NAMESPACE::MaxGlobalPrioritySizeKhr; + using VULKAN_HPP_NAMESPACE::MaxGlobalPrioritySizeKHR; //=== VK_KHR_driver_properties === - using VULKAN_HPP_NAMESPACE::MaxDriverInfoSizeKhr; - using VULKAN_HPP_NAMESPACE::MaxDriverNameSizeKhr; + using VULKAN_HPP_NAMESPACE::MaxDriverInfoSizeKHR; + using VULKAN_HPP_NAMESPACE::MaxDriverNameSizeKHR; //=== VK_EXT_global_priority_query === - using VULKAN_HPP_NAMESPACE::MaxGlobalPrioritySizeExt; + using VULKAN_HPP_NAMESPACE::MaxGlobalPrioritySizeEXT; //=== VK_EXT_image_sliced_view_of_3d === - using VULKAN_HPP_NAMESPACE::Remaining3DSlicesExt; + using VULKAN_HPP_NAMESPACE::Remaining3DSlicesEXT; //=== VK_EXT_shader_module_identifier === - using VULKAN_HPP_NAMESPACE::MaxShaderModuleIdentifierSizeExt; + using VULKAN_HPP_NAMESPACE::MaxShaderModuleIdentifierSizeEXT; //======================== //=== CONSTEXPR VALUEs === @@ -2416,6 +2437,10 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::PhysicalDevicePipelinePropertiesFeaturesEXT; using VULKAN_HPP_NAMESPACE::PipelinePropertiesIdentifierEXT; + //=== VK_EXT_frame_boundary === + using VULKAN_HPP_NAMESPACE::FrameBoundaryEXT; + using VULKAN_HPP_NAMESPACE::PhysicalDeviceFrameBoundaryFeaturesEXT; + //=== VK_EXT_multisampled_render_to_single_sampled === using VULKAN_HPP_NAMESPACE::MultisampledRenderToSingleSampledInfoEXT; using VULKAN_HPP_NAMESPACE::PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT; @@ -2540,6 +2565,10 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessingFeaturesQCOM; using VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessingPropertiesQCOM; + //=== VK_EXT_nested_command_buffer === + using VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferFeaturesEXT; + using VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferPropertiesEXT; + //=== VK_EXT_external_memory_acquire_unmodified === using VULKAN_HPP_NAMESPACE::ExternalMemoryAcquireUnmodifiedEXT; @@ -2586,6 +2615,13 @@ export namespace VULKAN_HPP_NAMESPACE //=== VK_EXT_pipeline_protected_access === using VULKAN_HPP_NAMESPACE::PhysicalDevicePipelineProtectedAccessFeaturesEXT; +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) + //=== VK_ANDROID_external_format_resolve === + using VULKAN_HPP_NAMESPACE::AndroidHardwareBufferFormatResolvePropertiesANDROID; + using VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolveFeaturesANDROID; + using VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolvePropertiesANDROID; +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + //=== VK_KHR_maintenance5 === using VULKAN_HPP_NAMESPACE::BufferUsageFlags2CreateInfoKHR; using VULKAN_HPP_NAMESPACE::DeviceImageSubresourceInfoKHR; @@ -2621,6 +2657,10 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingInvocationReorderFeaturesNV; using VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingInvocationReorderPropertiesNV; + //=== VK_NV_extended_sparse_address_space === + using VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV; + using VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpacePropertiesNV; + //=== VK_EXT_mutable_descriptor_type === using VULKAN_HPP_NAMESPACE::MutableDescriptorTypeCreateInfoEXT; using VULKAN_HPP_NAMESPACE::MutableDescriptorTypeCreateInfoVALVE; @@ -2639,6 +2679,17 @@ export namespace VULKAN_HPP_NAMESPACE //=== VK_EXT_dynamic_rendering_unused_attachments === using VULKAN_HPP_NAMESPACE::PhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT; + //=== VK_NV_low_latency2 === + using VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV; + using VULKAN_HPP_NAMESPACE::LatencySleepInfoNV; + using VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV; + using VULKAN_HPP_NAMESPACE::LatencySubmissionPresentIdNV; + using VULKAN_HPP_NAMESPACE::LatencySurfaceCapabilitiesNV; + using VULKAN_HPP_NAMESPACE::LatencyTimingsFrameReportNV; + using VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV; + using VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV; + using VULKAN_HPP_NAMESPACE::SwapchainLatencyCreateInfoNV; + //=== VK_KHR_cooperative_matrix === using VULKAN_HPP_NAMESPACE::CooperativeMatrixPropertiesKHR; using VULKAN_HPP_NAMESPACE::PhysicalDeviceCooperativeMatrixFeaturesKHR; @@ -2648,6 +2699,23 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM; using VULKAN_HPP_NAMESPACE::PhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM; + //=== VK_QCOM_image_processing2 === + using VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2FeaturesQCOM; + using VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2PropertiesQCOM; + using VULKAN_HPP_NAMESPACE::SamplerBlockMatchWindowCreateInfoQCOM; + + //=== VK_QCOM_filter_cubic_weights === + using VULKAN_HPP_NAMESPACE::BlitImageCubicWeightsInfoQCOM; + using VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicWeightsFeaturesQCOM; + using VULKAN_HPP_NAMESPACE::SamplerCubicWeightsCreateInfoQCOM; + + //=== VK_QCOM_ycbcr_degamma === + using VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcrDegammaFeaturesQCOM; + using VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM; + + //=== VK_QCOM_filter_cubic_clamp === + using VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicClampFeaturesQCOM; + //=== VK_EXT_attachment_feedback_loop_dynamic_state === using VULKAN_HPP_NAMESPACE::PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT; @@ -2660,6 +2728,12 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::ScreenBufferPropertiesQNX; #endif /*VK_USE_PLATFORM_SCREEN_QNX*/ + //=== VK_MSFT_layered_driver === + using VULKAN_HPP_NAMESPACE::PhysicalDeviceLayeredDriverPropertiesMSFT; + + //=== VK_NV_descriptor_pool_overallocation === + using VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorPoolOverallocationFeaturesNV; + //=============== //=== HANDLEs === //=============== @@ -2845,6 +2919,104 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::UniqueShaderEXT; #endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + //====================== + //=== SHARED HANDLEs === + //====================== + +#if !defined( VULKAN_HPP_NO_SMART_HANDLE ) + + //=== VK_VERSION_1_0 === + using VULKAN_HPP_NAMESPACE::SharedBuffer; + using VULKAN_HPP_NAMESPACE::SharedBufferView; + using VULKAN_HPP_NAMESPACE::SharedCommandBuffer; + using VULKAN_HPP_NAMESPACE::SharedCommandPool; + using VULKAN_HPP_NAMESPACE::SharedDescriptorPool; + using VULKAN_HPP_NAMESPACE::SharedDescriptorSet; + using VULKAN_HPP_NAMESPACE::SharedDescriptorSetLayout; + using VULKAN_HPP_NAMESPACE::SharedDevice; + using VULKAN_HPP_NAMESPACE::SharedDeviceMemory; + using VULKAN_HPP_NAMESPACE::SharedEvent; + using VULKAN_HPP_NAMESPACE::SharedFence; + using VULKAN_HPP_NAMESPACE::SharedFramebuffer; + using VULKAN_HPP_NAMESPACE::SharedImage; + using VULKAN_HPP_NAMESPACE::SharedImageView; + using VULKAN_HPP_NAMESPACE::SharedInstance; + using VULKAN_HPP_NAMESPACE::SharedPhysicalDevice; + using VULKAN_HPP_NAMESPACE::SharedPipeline; + using VULKAN_HPP_NAMESPACE::SharedPipelineCache; + using VULKAN_HPP_NAMESPACE::SharedPipelineLayout; + using VULKAN_HPP_NAMESPACE::SharedQueryPool; + using VULKAN_HPP_NAMESPACE::SharedQueue; + using VULKAN_HPP_NAMESPACE::SharedRenderPass; + using VULKAN_HPP_NAMESPACE::SharedSampler; + using VULKAN_HPP_NAMESPACE::SharedSemaphore; + using VULKAN_HPP_NAMESPACE::SharedShaderModule; + + //=== VK_VERSION_1_1 === + using VULKAN_HPP_NAMESPACE::SharedDescriptorUpdateTemplate; + using VULKAN_HPP_NAMESPACE::SharedSamplerYcbcrConversion; + + //=== VK_VERSION_1_3 === + using VULKAN_HPP_NAMESPACE::SharedPrivateDataSlot; + + //=== VK_KHR_surface === + using VULKAN_HPP_NAMESPACE::SharedSurfaceKHR; + + //=== VK_KHR_swapchain === + using VULKAN_HPP_NAMESPACE::SharedSwapchainKHR; + + //=== VK_KHR_display === + using VULKAN_HPP_NAMESPACE::SharedDisplayKHR; + using VULKAN_HPP_NAMESPACE::SharedDisplayModeKHR; + + //=== VK_EXT_debug_report === + using VULKAN_HPP_NAMESPACE::SharedDebugReportCallbackEXT; + + //=== VK_KHR_video_queue === + using VULKAN_HPP_NAMESPACE::SharedVideoSessionKHR; + using VULKAN_HPP_NAMESPACE::SharedVideoSessionParametersKHR; + + //=== VK_NVX_binary_import === + using VULKAN_HPP_NAMESPACE::SharedCuFunctionNVX; + using VULKAN_HPP_NAMESPACE::SharedCuModuleNVX; + + //=== VK_EXT_debug_utils === + using VULKAN_HPP_NAMESPACE::SharedDebugUtilsMessengerEXT; + + //=== VK_KHR_acceleration_structure === + using VULKAN_HPP_NAMESPACE::SharedAccelerationStructureKHR; + + //=== VK_EXT_validation_cache === + using VULKAN_HPP_NAMESPACE::SharedValidationCacheEXT; + + //=== VK_NV_ray_tracing === + using VULKAN_HPP_NAMESPACE::SharedAccelerationStructureNV; + + //=== VK_INTEL_performance_query === + using VULKAN_HPP_NAMESPACE::SharedPerformanceConfigurationINTEL; + + //=== VK_KHR_deferred_host_operations === + using VULKAN_HPP_NAMESPACE::SharedDeferredOperationKHR; + + //=== VK_NV_device_generated_commands === + using VULKAN_HPP_NAMESPACE::SharedIndirectCommandsLayoutNV; + +# if defined( VK_USE_PLATFORM_FUCHSIA ) + //=== VK_FUCHSIA_buffer_collection === + using VULKAN_HPP_NAMESPACE::SharedBufferCollectionFUCHSIA; +# endif /*VK_USE_PLATFORM_FUCHSIA*/ + + //=== VK_EXT_opacity_micromap === + using VULKAN_HPP_NAMESPACE::SharedMicromapEXT; + + //=== VK_NV_optical_flow === + using VULKAN_HPP_NAMESPACE::SharedOpticalFlowSessionNV; + + //=== VK_EXT_shader_object === + using VULKAN_HPP_NAMESPACE::SharedHandleTraits; + using VULKAN_HPP_NAMESPACE::SharedShaderEXT; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + //=========================== //=== COMMAND Definitions === //=========================== @@ -2865,8 +3037,6 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::DynamicLoader; #endif /*VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL*/ - using VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic; - //===================== //=== Format Traits === //===================== @@ -2906,6 +3076,7 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::isObsoletedExtension; using VULKAN_HPP_NAMESPACE::isPromotedExtension; +#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) && !defined( VULKAN_HPP_NO_EXCEPTIONS ) namespace VULKAN_HPP_RAII_NAMESPACE { //====================== @@ -3004,10 +3175,10 @@ export namespace VULKAN_HPP_NAMESPACE //=== VK_NV_device_generated_commands === using VULKAN_HPP_RAII_NAMESPACE::IndirectCommandsLayoutNV; -#if defined( VK_USE_PLATFORM_FUCHSIA ) +# if defined( VK_USE_PLATFORM_FUCHSIA ) //=== VK_FUCHSIA_buffer_collection === using VULKAN_HPP_RAII_NAMESPACE::BufferCollectionFUCHSIA; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ +# endif /*VK_USE_PLATFORM_FUCHSIA*/ //=== VK_EXT_opacity_micromap === using VULKAN_HPP_RAII_NAMESPACE::MicromapEXT; @@ -3020,4 +3191,5 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_RAII_NAMESPACE::ShaderEXTs; } // namespace VULKAN_HPP_RAII_NAMESPACE +#endif } // namespace VULKAN_HPP_NAMESPACE diff --git a/thirdparty/vulkan/include/vulkan/vulkan.hpp b/thirdparty/vulkan/include/vulkan/vulkan.hpp index 03789305bf..37f72277cf 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan.hpp +++ b/thirdparty/vulkan/include/vulkan/vulkan.hpp @@ -8,37 +8,17 @@ #ifndef VULKAN_HPP #define VULKAN_HPP -#if defined( _MSVC_LANG ) -# define VULKAN_HPP_CPLUSPLUS _MSVC_LANG -#else -# define VULKAN_HPP_CPLUSPLUS __cplusplus -#endif - -#if 201703L < VULKAN_HPP_CPLUSPLUS -# define VULKAN_HPP_CPP_VERSION 20 -#elif 201402L < VULKAN_HPP_CPLUSPLUS -# define VULKAN_HPP_CPP_VERSION 17 -#elif 201103L < VULKAN_HPP_CPLUSPLUS -# define VULKAN_HPP_CPP_VERSION 14 -#elif 199711L < VULKAN_HPP_CPLUSPLUS -# define VULKAN_HPP_CPP_VERSION 11 -#else -# error "vulkan.hpp needs at least c++ standard version 11" -#endif - #include <algorithm> #include <array> // ArrayWrapperND #include <string> // std::string #include <vulkan/vulkan.h> +#include <vulkan/vulkan_hpp_macros.hpp> + #if 17 <= VULKAN_HPP_CPP_VERSION # include <string_view> // std::string_view #endif -#if defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) -# if !defined( VULKAN_HPP_NO_SMART_HANDLE ) -# define VULKAN_HPP_NO_SMART_HANDLE -# endif -#else +#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) # include <tuple> // std::tie # include <vector> // std::vector #endif @@ -47,43 +27,12 @@ # include <system_error> // std::is_error_code_enum #endif -#if defined( VULKAN_HPP_NO_CONSTRUCTORS ) -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) -# define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS -# endif -# if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) -# define VULKAN_HPP_NO_UNION_CONSTRUCTORS -# endif -#endif - -#if defined( VULKAN_HPP_NO_SETTERS ) -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) -# define VULKAN_HPP_NO_STRUCT_SETTERS -# endif -# if !defined( VULKAN_HPP_NO_UNION_SETTERS ) -# define VULKAN_HPP_NO_UNION_SETTERS -# endif -#endif - -#if !defined( VULKAN_HPP_ASSERT ) +#if ( VULKAN_HPP_ASSERT == assert ) # include <cassert> -# define VULKAN_HPP_ASSERT assert -#endif - -#if !defined( VULKAN_HPP_ASSERT_ON_RESULT ) -# define VULKAN_HPP_ASSERT_ON_RESULT VULKAN_HPP_ASSERT -#endif - -#if !defined( VULKAN_HPP_STATIC_ASSERT ) -# define VULKAN_HPP_STATIC_ASSERT static_assert -#endif - -#if !defined( VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL ) -# define VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL 1 #endif #if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1 -# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ ) # include <dlfcn.h> # elif defined( _WIN32 ) typedef struct HINSTANCE__ * HINSTANCE; @@ -98,31 +47,15 @@ extern "C" __declspec( dllimport ) FARPROC __stdcall GetProcAddress( HINSTANCE h # endif #endif -#if !defined( __has_include ) -# define __has_include( x ) false -#endif - -#if ( 201907 <= __cpp_lib_three_way_comparison ) && __has_include( <compare> ) && !defined( VULKAN_HPP_NO_SPACESHIP_OPERATOR ) -# define VULKAN_HPP_HAS_SPACESHIP_OPERATOR -#endif #if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) # include <compare> #endif -#if ( 201803 <= __cpp_lib_span ) -# define VULKAN_HPP_SUPPORT_SPAN +#if defined( VULKAN_HPP_SUPPORT_SPAN ) # include <span> #endif -static_assert( VK_HEADER_VERSION == 261, "Wrong VK_HEADER_VERSION!" ); - -// 32-bit vulkan is not typesafe for non-dispatchable handles, so don't allow copy constructors on this platform by default. -// To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION -#if ( VK_USE_64_BIT_PTR_DEFINES == 1 ) -# if !defined( VULKAN_HPP_TYPESAFE_CONVERSION ) -# define VULKAN_HPP_TYPESAFE_CONVERSION -# endif -#endif +static_assert( VK_HEADER_VERSION == 268, "Wrong VK_HEADER_VERSION!" ); // <tuple> includes <sys/sysmacros.h> through some other header // this results in major(x) being resolved to gnu_dev_major(x) @@ -151,115 +84,6 @@ constexpr int True = 1; constexpr int False = 0; #endif -#if defined( __GNUC__ ) -# define GCC_VERSION ( __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ ) -#endif - -#if !defined( VULKAN_HPP_HAS_UNRESTRICTED_UNIONS ) -# if defined( __clang__ ) -# if __has_feature( cxx_unrestricted_unions ) -# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS -# endif -# elif defined( __GNUC__ ) -# if 40600 <= GCC_VERSION -# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS -# endif -# elif defined( _MSC_VER ) -# if 1900 <= _MSC_VER -# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS -# endif -# endif -#endif - -#if !defined( VULKAN_HPP_INLINE ) -# if defined( __clang__ ) -# if __has_attribute( always_inline ) -# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__ -# else -# define VULKAN_HPP_INLINE inline -# endif -# elif defined( __GNUC__ ) -# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__ -# elif defined( _MSC_VER ) -# define VULKAN_HPP_INLINE inline -# else -# define VULKAN_HPP_INLINE inline -# endif -#endif - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) -# define VULKAN_HPP_TYPESAFE_EXPLICIT -#else -# define VULKAN_HPP_TYPESAFE_EXPLICIT explicit -#endif - -#if defined( __cpp_constexpr ) -# define VULKAN_HPP_CONSTEXPR constexpr -# if 201304 <= __cpp_constexpr -# define VULKAN_HPP_CONSTEXPR_14 constexpr -# else -# define VULKAN_HPP_CONSTEXPR_14 -# endif -# if ( 201907 <= __cpp_constexpr ) && ( !defined( __GNUC__ ) || ( 110400 < GCC_VERSION ) ) -# define VULKAN_HPP_CONSTEXPR_20 constexpr -# else -# define VULKAN_HPP_CONSTEXPR_20 -# endif -# define VULKAN_HPP_CONST_OR_CONSTEXPR constexpr -#else -# define VULKAN_HPP_CONSTEXPR -# define VULKAN_HPP_CONSTEXPR_14 -# define VULKAN_HPP_CONST_OR_CONSTEXPR const -#endif - -#if !defined( VULKAN_HPP_CONSTEXPR_INLINE ) -# if 201606L <= __cpp_inline_variables -# define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR inline -# else -# define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR -# endif -#endif - -#if !defined( VULKAN_HPP_NOEXCEPT ) -# if defined( _MSC_VER ) && ( _MSC_VER <= 1800 ) -# define VULKAN_HPP_NOEXCEPT -# else -# define VULKAN_HPP_NOEXCEPT noexcept -# define VULKAN_HPP_HAS_NOEXCEPT 1 -# if defined( VULKAN_HPP_NO_EXCEPTIONS ) -# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS noexcept -# else -# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS -# endif -# endif -#endif - -#if 14 <= VULKAN_HPP_CPP_VERSION -# define VULKAN_HPP_DEPRECATED( msg ) [[deprecated( msg )]] -#else -# define VULKAN_HPP_DEPRECATED( msg ) -#endif - -#if ( 17 <= VULKAN_HPP_CPP_VERSION ) && !defined( VULKAN_HPP_NO_NODISCARD_WARNINGS ) -# define VULKAN_HPP_NODISCARD [[nodiscard]] -# if defined( VULKAN_HPP_NO_EXCEPTIONS ) -# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS [[nodiscard]] -# else -# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS -# endif -#else -# define VULKAN_HPP_NODISCARD -# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS -#endif - -#if !defined( VULKAN_HPP_NAMESPACE ) -# define VULKAN_HPP_NAMESPACE vk -#endif - -#define VULKAN_HPP_STRINGIFY2( text ) #text -#define VULKAN_HPP_STRINGIFY( text ) VULKAN_HPP_STRINGIFY2( text ) -#define VULKAN_HPP_NAMESPACE_STRING VULKAN_HPP_STRINGIFY( VULKAN_HPP_NAMESPACE ) - namespace VULKAN_HPP_NAMESPACE { template <typename T, size_t N> @@ -401,212 +225,6 @@ namespace VULKAN_HPP_NAMESPACE } }; - template <typename FlagBitsType> - struct FlagTraits - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = false; - }; - - template <typename BitType> - class Flags - { - public: - using MaskType = typename std::underlying_type<BitType>::type; - - // constructors - VULKAN_HPP_CONSTEXPR Flags() VULKAN_HPP_NOEXCEPT : m_mask( 0 ) {} - - VULKAN_HPP_CONSTEXPR Flags( BitType bit ) VULKAN_HPP_NOEXCEPT : m_mask( static_cast<MaskType>( bit ) ) {} - - VULKAN_HPP_CONSTEXPR Flags( Flags<BitType> const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VULKAN_HPP_CONSTEXPR explicit Flags( MaskType flags ) VULKAN_HPP_NOEXCEPT : m_mask( flags ) {} - - // relational operators -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Flags<BitType> const & ) const = default; -#else - VULKAN_HPP_CONSTEXPR bool operator<( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask < rhs.m_mask; - } - - VULKAN_HPP_CONSTEXPR bool operator<=( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask <= rhs.m_mask; - } - - VULKAN_HPP_CONSTEXPR bool operator>( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask > rhs.m_mask; - } - - VULKAN_HPP_CONSTEXPR bool operator>=( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask >= rhs.m_mask; - } - - VULKAN_HPP_CONSTEXPR bool operator==( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask == rhs.m_mask; - } - - VULKAN_HPP_CONSTEXPR bool operator!=( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask != rhs.m_mask; - } -#endif - - // logical operator - VULKAN_HPP_CONSTEXPR bool operator!() const VULKAN_HPP_NOEXCEPT - { - return !m_mask; - } - - // bitwise operators - VULKAN_HPP_CONSTEXPR Flags<BitType> operator&( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return Flags<BitType>( m_mask & rhs.m_mask ); - } - - VULKAN_HPP_CONSTEXPR Flags<BitType> operator|( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return Flags<BitType>( m_mask | rhs.m_mask ); - } - - VULKAN_HPP_CONSTEXPR Flags<BitType> operator^( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return Flags<BitType>( m_mask ^ rhs.m_mask ); - } - - VULKAN_HPP_CONSTEXPR Flags<BitType> operator~() const VULKAN_HPP_NOEXCEPT - { - return Flags<BitType>( m_mask ^ FlagTraits<BitType>::allFlags.m_mask ); - } - - // assignment operators - VULKAN_HPP_CONSTEXPR_14 Flags<BitType> & operator=( Flags<BitType> const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VULKAN_HPP_CONSTEXPR_14 Flags<BitType> & operator|=( Flags<BitType> const & rhs ) VULKAN_HPP_NOEXCEPT - { - m_mask |= rhs.m_mask; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Flags<BitType> & operator&=( Flags<BitType> const & rhs ) VULKAN_HPP_NOEXCEPT - { - m_mask &= rhs.m_mask; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Flags<BitType> & operator^=( Flags<BitType> const & rhs ) VULKAN_HPP_NOEXCEPT - { - m_mask ^= rhs.m_mask; - return *this; - } - - // cast operators - explicit VULKAN_HPP_CONSTEXPR operator bool() const VULKAN_HPP_NOEXCEPT - { - return !!m_mask; - } - - explicit VULKAN_HPP_CONSTEXPR operator MaskType() const VULKAN_HPP_NOEXCEPT - { - return m_mask; - } - -#if defined( VULKAN_HPP_FLAGS_MASK_TYPE_AS_PUBLIC ) - public: -#else - private: -#endif - MaskType m_mask; - }; - -#if !defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - // relational operators only needed for pre C++20 - template <typename BitType> - VULKAN_HPP_CONSTEXPR bool operator<( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator>( bit ); - } - - template <typename BitType> - VULKAN_HPP_CONSTEXPR bool operator<=( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator>=( bit ); - } - - template <typename BitType> - VULKAN_HPP_CONSTEXPR bool operator>( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator<( bit ); - } - - template <typename BitType> - VULKAN_HPP_CONSTEXPR bool operator>=( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator<=( bit ); - } - - template <typename BitType> - VULKAN_HPP_CONSTEXPR bool operator==( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator==( bit ); - } - - template <typename BitType> - VULKAN_HPP_CONSTEXPR bool operator!=( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator!=( bit ); - } -#endif - - // bitwise operators - template <typename BitType> - VULKAN_HPP_CONSTEXPR Flags<BitType> operator&( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator&( bit ); - } - - template <typename BitType> - VULKAN_HPP_CONSTEXPR Flags<BitType> operator|( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator|( bit ); - } - - template <typename BitType> - VULKAN_HPP_CONSTEXPR Flags<BitType> operator^( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator^( bit ); - } - - // bitwise operators on BitType - template <typename BitType, typename std::enable_if<FlagTraits<BitType>::isBitmask, bool>::type = true> - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR Flags<BitType> operator&( BitType lhs, BitType rhs ) VULKAN_HPP_NOEXCEPT - { - return Flags<BitType>( lhs ) & rhs; - } - - template <typename BitType, typename std::enable_if<FlagTraits<BitType>::isBitmask, bool>::type = true> - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR Flags<BitType> operator|( BitType lhs, BitType rhs ) VULKAN_HPP_NOEXCEPT - { - return Flags<BitType>( lhs ) | rhs; - } - - template <typename BitType, typename std::enable_if<FlagTraits<BitType>::isBitmask, bool>::type = true> - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR Flags<BitType> operator^( BitType lhs, BitType rhs ) VULKAN_HPP_NOEXCEPT - { - return Flags<BitType>( lhs ) ^ rhs; - } - - template <typename BitType, typename std::enable_if<FlagTraits<BitType>::isBitmask, bool>::type = true> - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR Flags<BitType> operator~( BitType bit ) VULKAN_HPP_NOEXCEPT - { - return ~( Flags<BitType>( bit ) ); - } - #if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) template <typename T> class ArrayProxy @@ -6093,6 +5711,36 @@ namespace VULKAN_HPP_NAMESPACE return ::vkGetDynamicRenderingTilePropertiesQCOM( device, pRenderingInfo, pProperties ); } + //=== VK_NV_low_latency2 === + + VkResult vkSetLatencySleepModeNV( VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepModeInfoNV * pSleepModeInfo ) const VULKAN_HPP_NOEXCEPT + { + return ::vkSetLatencySleepModeNV( device, swapchain, pSleepModeInfo ); + } + + VkResult vkLatencySleepNV( VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepInfoNV * pSleepInfo ) const VULKAN_HPP_NOEXCEPT + { + return ::vkLatencySleepNV( device, swapchain, pSleepInfo ); + } + + void vkSetLatencyMarkerNV( VkDevice device, VkSwapchainKHR swapchain, const VkSetLatencyMarkerInfoNV * pLatencyMarkerInfo ) const VULKAN_HPP_NOEXCEPT + { + return ::vkSetLatencyMarkerNV( device, swapchain, pLatencyMarkerInfo ); + } + + void vkGetLatencyTimingsNV( VkDevice device, + VkSwapchainKHR swapchain, + uint32_t * pTimingCount, + VkGetLatencyMarkerInfoNV * pLatencyMarkerInfo ) const VULKAN_HPP_NOEXCEPT + { + return ::vkGetLatencyTimingsNV( device, swapchain, pTimingCount, pLatencyMarkerInfo ); + } + + void vkQueueNotifyOutOfBandNV( VkQueue queue, const VkOutOfBandQueueTypeInfoNV * pQueueTypeInfo ) const VULKAN_HPP_NOEXCEPT + { + return ::vkQueueNotifyOutOfBandNV( queue, pQueueTypeInfo ); + } + //=== VK_KHR_cooperative_matrix === VkResult vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR( VkPhysicalDevice physicalDevice, @@ -6120,76 +5768,12 @@ namespace VULKAN_HPP_NAMESPACE } # endif /*VK_USE_PLATFORM_SCREEN_QNX*/ }; -#endif - - class DispatchLoaderDynamic; -#if !defined( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC ) -# if defined( VK_NO_PROTOTYPES ) -# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1 -# else -# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 0 -# endif -#endif - -#if !defined( VULKAN_HPP_STORAGE_API ) -# if defined( VULKAN_HPP_STORAGE_SHARED ) -# if defined( _MSC_VER ) -# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT ) -# define VULKAN_HPP_STORAGE_API __declspec( dllexport ) -# else -# define VULKAN_HPP_STORAGE_API __declspec( dllimport ) -# endif -# elif defined( __clang__ ) || defined( __GNUC__ ) -# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT ) -# define VULKAN_HPP_STORAGE_API __attribute__( ( visibility( "default" ) ) ) -# else -# define VULKAN_HPP_STORAGE_API -# endif -# else -# define VULKAN_HPP_STORAGE_API -# pragma warning Unknown import / export semantics -# endif -# else -# define VULKAN_HPP_STORAGE_API -# endif -#endif -#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER ) -# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 -# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::defaultDispatchLoaderDynamic -# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \ - namespace VULKAN_HPP_NAMESPACE \ - { \ - VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; \ - } - extern VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; -# else inline ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic & getDispatchLoaderStatic() { static ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic dls; return dls; } -# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::getDispatchLoaderStatic() -# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE -# endif -#endif - -#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ) -# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 -# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic -# else -# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic -# endif -#endif - -#if defined( VULKAN_HPP_NO_DEFAULT_DISPATCHER ) -# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT -# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT -# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT -#else -# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT = {} -# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT = nullptr -# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT = VULKAN_HPP_DEFAULT_DISPATCHER #endif #if !defined( VULKAN_HPP_NO_SMART_HANDLE ) @@ -7034,40 +6618,40 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDriverInfoSize = VK_MAX_DRIVER_INFO_SIZE; //=== VK_KHR_device_group_creation === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDeviceGroupSizeKhr = VK_MAX_DEVICE_GROUP_SIZE_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDeviceGroupSizeKHR = VK_MAX_DEVICE_GROUP_SIZE_KHR; //=== VK_KHR_external_memory_capabilities === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t LuidSizeKhr = VK_LUID_SIZE_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t LuidSizeKHR = VK_LUID_SIZE_KHR; //=== VK_KHR_external_memory === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t QueueFamilyExternalKhr = VK_QUEUE_FAMILY_EXTERNAL_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t QueueFamilyExternalKHR = VK_QUEUE_FAMILY_EXTERNAL_KHR; #if defined( VK_ENABLE_BETA_EXTENSIONS ) //=== VK_AMDX_shader_enqueue === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderIndexUnusedAmdx = VK_SHADER_INDEX_UNUSED_AMDX; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderIndexUnusedAMDX = VK_SHADER_INDEX_UNUSED_AMDX; #endif /*VK_ENABLE_BETA_EXTENSIONS*/ //=== VK_KHR_ray_tracing_pipeline === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderUnusedKhr = VK_SHADER_UNUSED_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderUnusedKHR = VK_SHADER_UNUSED_KHR; //=== VK_NV_ray_tracing === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderUnusedNv = VK_SHADER_UNUSED_NV; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderUnusedNV = VK_SHADER_UNUSED_NV; //=== VK_KHR_global_priority === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxGlobalPrioritySizeKhr = VK_MAX_GLOBAL_PRIORITY_SIZE_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxGlobalPrioritySizeKHR = VK_MAX_GLOBAL_PRIORITY_SIZE_KHR; //=== VK_KHR_driver_properties === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDriverNameSizeKhr = VK_MAX_DRIVER_NAME_SIZE_KHR; - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDriverInfoSizeKhr = VK_MAX_DRIVER_INFO_SIZE_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDriverNameSizeKHR = VK_MAX_DRIVER_NAME_SIZE_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDriverInfoSizeKHR = VK_MAX_DRIVER_INFO_SIZE_KHR; //=== VK_EXT_global_priority_query === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxGlobalPrioritySizeExt = VK_MAX_GLOBAL_PRIORITY_SIZE_EXT; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxGlobalPrioritySizeEXT = VK_MAX_GLOBAL_PRIORITY_SIZE_EXT; //=== VK_EXT_image_sliced_view_of_3d === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t Remaining3DSlicesExt = VK_REMAINING_3D_SLICES_EXT; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t Remaining3DSlicesEXT = VK_REMAINING_3D_SLICES_EXT; //=== VK_EXT_shader_module_identifier === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxShaderModuleIdentifierSizeExt = VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxShaderModuleIdentifierSizeEXT = VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT; //======================== //=== CONSTEXPR VALUEs === @@ -9508,6 +9092,30 @@ namespace VULKAN_HPP_NAMESPACE }; }; template <> + struct StructExtends<ExternalFormatANDROID, AttachmentDescription2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<ExternalFormatANDROID, GraphicsPipelineCreateInfo> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<ExternalFormatANDROID, CommandBufferInheritanceInfo> + { + enum + { + value = true + }; + }; + template <> struct StructExtends<AndroidHardwareBufferFormatProperties2ANDROID, AndroidHardwareBufferPropertiesANDROID> { enum @@ -12249,6 +11857,56 @@ namespace VULKAN_HPP_NAMESPACE }; }; + //=== VK_EXT_frame_boundary === + template <> + struct StructExtends<PhysicalDeviceFrameBoundaryFeaturesEXT, PhysicalDeviceFeatures2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceFrameBoundaryFeaturesEXT, DeviceCreateInfo> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<FrameBoundaryEXT, SubmitInfo> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<FrameBoundaryEXT, SubmitInfo2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<FrameBoundaryEXT, PresentInfoKHR> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<FrameBoundaryEXT, BindSparseInfo> + { + enum + { + value = true + }; + }; + //=== VK_EXT_multisampled_render_to_single_sampled === template <> struct StructExtends<PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT, PhysicalDeviceFeatures2> @@ -12871,6 +12529,32 @@ namespace VULKAN_HPP_NAMESPACE }; }; + //=== VK_EXT_nested_command_buffer === + template <> + struct StructExtends<PhysicalDeviceNestedCommandBufferFeaturesEXT, PhysicalDeviceFeatures2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceNestedCommandBufferFeaturesEXT, DeviceCreateInfo> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceNestedCommandBufferPropertiesEXT, PhysicalDeviceProperties2> + { + enum + { + value = true + }; + }; + //=== VK_EXT_external_memory_acquire_unmodified === template <> struct StructExtends<ExternalMemoryAcquireUnmodifiedEXT, BufferMemoryBarrier> @@ -13129,6 +12813,42 @@ namespace VULKAN_HPP_NAMESPACE }; }; +# if defined( VK_USE_PLATFORM_ANDROID_KHR ) + //=== VK_ANDROID_external_format_resolve === + template <> + struct StructExtends<PhysicalDeviceExternalFormatResolveFeaturesANDROID, PhysicalDeviceFeatures2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceExternalFormatResolveFeaturesANDROID, DeviceCreateInfo> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceExternalFormatResolvePropertiesANDROID, PhysicalDeviceProperties2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<AndroidHardwareBufferFormatResolvePropertiesANDROID, AndroidHardwareBufferPropertiesANDROID> + { + enum + { + value = true + }; + }; +# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + //=== VK_KHR_maintenance5 === template <> struct StructExtends<PhysicalDeviceMaintenance5FeaturesKHR, PhysicalDeviceFeatures2> @@ -13351,6 +13071,32 @@ namespace VULKAN_HPP_NAMESPACE }; }; + //=== VK_NV_extended_sparse_address_space === + template <> + struct StructExtends<PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV, PhysicalDeviceFeatures2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV, DeviceCreateInfo> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceExtendedSparseAddressSpacePropertiesNV, PhysicalDeviceProperties2> + { + enum + { + value = true + }; + }; + //=== VK_EXT_mutable_descriptor_type === template <> struct StructExtends<PhysicalDeviceMutableDescriptorTypeFeaturesEXT, PhysicalDeviceFeatures2> @@ -13447,6 +13193,40 @@ namespace VULKAN_HPP_NAMESPACE }; }; + //=== VK_NV_low_latency2 === + template <> + struct StructExtends<LatencySubmissionPresentIdNV, SubmitInfo> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<LatencySubmissionPresentIdNV, SubmitInfo2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<SwapchainLatencyCreateInfoNV, SwapchainCreateInfoKHR> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<LatencySurfaceCapabilitiesNV, SurfaceCapabilities2KHR> + { + enum + { + value = true + }; + }; + //=== VK_KHR_cooperative_matrix === template <> struct StructExtends<PhysicalDeviceCooperativeMatrixFeaturesKHR, PhysicalDeviceFeatures2> @@ -13507,6 +13287,118 @@ namespace VULKAN_HPP_NAMESPACE }; }; + //=== VK_QCOM_image_processing2 === + template <> + struct StructExtends<PhysicalDeviceImageProcessing2FeaturesQCOM, PhysicalDeviceFeatures2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceImageProcessing2FeaturesQCOM, DeviceCreateInfo> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceImageProcessing2PropertiesQCOM, PhysicalDeviceProperties2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<SamplerBlockMatchWindowCreateInfoQCOM, SamplerCreateInfo> + { + enum + { + value = true + }; + }; + + //=== VK_QCOM_filter_cubic_weights === + template <> + struct StructExtends<PhysicalDeviceCubicWeightsFeaturesQCOM, PhysicalDeviceFeatures2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceCubicWeightsFeaturesQCOM, DeviceCreateInfo> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<SamplerCubicWeightsCreateInfoQCOM, SamplerCreateInfo> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<BlitImageCubicWeightsInfoQCOM, BlitImageInfo2> + { + enum + { + value = true + }; + }; + + //=== VK_QCOM_ycbcr_degamma === + template <> + struct StructExtends<PhysicalDeviceYcbcrDegammaFeaturesQCOM, PhysicalDeviceFeatures2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceYcbcrDegammaFeaturesQCOM, DeviceCreateInfo> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM, SamplerYcbcrConversionCreateInfo> + { + enum + { + value = true + }; + }; + + //=== VK_QCOM_filter_cubic_clamp === + template <> + struct StructExtends<PhysicalDeviceCubicClampFeaturesQCOM, PhysicalDeviceFeatures2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceCubicClampFeaturesQCOM, DeviceCreateInfo> + { + enum + { + value = true + }; + }; + //=== VK_EXT_attachment_feedback_loop_dynamic_state === template <> struct StructExtends<PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT, PhysicalDeviceFeatures2> @@ -13577,6 +13469,34 @@ namespace VULKAN_HPP_NAMESPACE }; # endif /*VK_USE_PLATFORM_SCREEN_QNX*/ + //=== VK_MSFT_layered_driver === + template <> + struct StructExtends<PhysicalDeviceLayeredDriverPropertiesMSFT, PhysicalDeviceProperties2> + { + enum + { + value = true + }; + }; + + //=== VK_NV_descriptor_pool_overallocation === + template <> + struct StructExtends<PhysicalDeviceDescriptorPoolOverallocationFeaturesNV, PhysicalDeviceFeatures2> + { + enum + { + value = true + }; + }; + template <> + struct StructExtends<PhysicalDeviceDescriptorPoolOverallocationFeaturesNV, DeviceCreateInfo> + { + enum + { + value = true + }; + }; + #endif // VULKAN_HPP_DISABLE_ENHANCED_MODE #if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL @@ -13591,7 +13511,7 @@ namespace VULKAN_HPP_NAMESPACE { if ( !vulkanLibraryName.empty() ) { -# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ ) m_library = dlopen( vulkanLibraryName.c_str(), RTLD_NOW | RTLD_LOCAL ); # elif defined( _WIN32 ) m_library = ::LoadLibraryA( vulkanLibraryName.c_str() ); @@ -13601,7 +13521,7 @@ namespace VULKAN_HPP_NAMESPACE } else { -# if defined( __unix__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || defined( __QNX__ ) || defined( __Fuchsia__ ) m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL ); if ( m_library == nullptr ) { @@ -13644,7 +13564,7 @@ namespace VULKAN_HPP_NAMESPACE { if ( m_library ) { -# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ ) dlclose( m_library ); # elif defined( _WIN32 ) ::FreeLibrary( m_library ); @@ -13657,7 +13577,7 @@ namespace VULKAN_HPP_NAMESPACE template <typename T> T getProcAddress( const char * function ) const VULKAN_HPP_NOEXCEPT { -# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ ) return (T)dlsym( m_library, function ); # elif defined( _WIN32 ) return ( T )::GetProcAddress( m_library, function ); @@ -13672,7 +13592,7 @@ namespace VULKAN_HPP_NAMESPACE } private: -# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ ) void * m_library; # elif defined( _WIN32 ) ::HINSTANCE m_library; @@ -14763,6 +14683,13 @@ namespace VULKAN_HPP_NAMESPACE PFN_vkGetFramebufferTilePropertiesQCOM vkGetFramebufferTilePropertiesQCOM = 0; PFN_vkGetDynamicRenderingTilePropertiesQCOM vkGetDynamicRenderingTilePropertiesQCOM = 0; + //=== VK_NV_low_latency2 === + PFN_vkSetLatencySleepModeNV vkSetLatencySleepModeNV = 0; + PFN_vkLatencySleepNV vkLatencySleepNV = 0; + PFN_vkSetLatencyMarkerNV vkSetLatencyMarkerNV = 0; + PFN_vkGetLatencyTimingsNV vkGetLatencyTimingsNV = 0; + PFN_vkQueueNotifyOutOfBandNV vkQueueNotifyOutOfBandNV = 0; + //=== VK_KHR_cooperative_matrix === PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR = 0; @@ -14785,6 +14712,33 @@ namespace VULKAN_HPP_NAMESPACE init( getInstanceProcAddr ); } + // This interface does not require a linked vulkan library. + DispatchLoaderDynamic( VkInstance instance, + PFN_vkGetInstanceProcAddr getInstanceProcAddr, + VkDevice device = {}, + PFN_vkGetDeviceProcAddr getDeviceProcAddr = nullptr ) VULKAN_HPP_NOEXCEPT + { + init( instance, getInstanceProcAddr, device, getDeviceProcAddr ); + } + + template <typename DynamicLoader +#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL + = VULKAN_HPP_NAMESPACE::DynamicLoader +#endif + > + void init() + { + static DynamicLoader dl; + init( dl ); + } + + template <typename DynamicLoader> + void init( DynamicLoader const & dl ) VULKAN_HPP_NOEXCEPT + { + PFN_vkGetInstanceProcAddr getInstanceProcAddr = dl.template getProcAddress<PFN_vkGetInstanceProcAddr>( "vkGetInstanceProcAddr" ); + init( getInstanceProcAddr ); + } + void init( PFN_vkGetInstanceProcAddr getInstanceProcAddr ) VULKAN_HPP_NOEXCEPT { VULKAN_HPP_ASSERT( getInstanceProcAddr ); @@ -14802,15 +14756,6 @@ namespace VULKAN_HPP_NAMESPACE } // This interface does not require a linked vulkan library. - DispatchLoaderDynamic( VkInstance instance, - PFN_vkGetInstanceProcAddr getInstanceProcAddr, - VkDevice device = {}, - PFN_vkGetDeviceProcAddr getDeviceProcAddr = nullptr ) VULKAN_HPP_NOEXCEPT - { - init( instance, getInstanceProcAddr, device, getDeviceProcAddr ); - } - - // This interface does not require a linked vulkan library. void init( VkInstance instance, PFN_vkGetInstanceProcAddr getInstanceProcAddr, VkDevice device = {}, @@ -16106,6 +16051,13 @@ namespace VULKAN_HPP_NAMESPACE vkGetDynamicRenderingTilePropertiesQCOM = PFN_vkGetDynamicRenderingTilePropertiesQCOM( vkGetInstanceProcAddr( instance, "vkGetDynamicRenderingTilePropertiesQCOM" ) ); + //=== VK_NV_low_latency2 === + vkSetLatencySleepModeNV = PFN_vkSetLatencySleepModeNV( vkGetInstanceProcAddr( instance, "vkSetLatencySleepModeNV" ) ); + vkLatencySleepNV = PFN_vkLatencySleepNV( vkGetInstanceProcAddr( instance, "vkLatencySleepNV" ) ); + vkSetLatencyMarkerNV = PFN_vkSetLatencyMarkerNV( vkGetInstanceProcAddr( instance, "vkSetLatencyMarkerNV" ) ); + vkGetLatencyTimingsNV = PFN_vkGetLatencyTimingsNV( vkGetInstanceProcAddr( instance, "vkGetLatencyTimingsNV" ) ); + vkQueueNotifyOutOfBandNV = PFN_vkQueueNotifyOutOfBandNV( vkGetInstanceProcAddr( instance, "vkQueueNotifyOutOfBandNV" ) ); + //=== VK_KHR_cooperative_matrix === vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR = PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR" ) ); @@ -17113,6 +17065,13 @@ namespace VULKAN_HPP_NAMESPACE vkGetDynamicRenderingTilePropertiesQCOM = PFN_vkGetDynamicRenderingTilePropertiesQCOM( vkGetDeviceProcAddr( device, "vkGetDynamicRenderingTilePropertiesQCOM" ) ); + //=== VK_NV_low_latency2 === + vkSetLatencySleepModeNV = PFN_vkSetLatencySleepModeNV( vkGetDeviceProcAddr( device, "vkSetLatencySleepModeNV" ) ); + vkLatencySleepNV = PFN_vkLatencySleepNV( vkGetDeviceProcAddr( device, "vkLatencySleepNV" ) ); + vkSetLatencyMarkerNV = PFN_vkSetLatencyMarkerNV( vkGetDeviceProcAddr( device, "vkSetLatencyMarkerNV" ) ); + vkGetLatencyTimingsNV = PFN_vkGetLatencyTimingsNV( vkGetDeviceProcAddr( device, "vkGetLatencyTimingsNV" ) ); + vkQueueNotifyOutOfBandNV = PFN_vkQueueNotifyOutOfBandNV( vkGetDeviceProcAddr( device, "vkQueueNotifyOutOfBandNV" ) ); + //=== VK_EXT_attachment_feedback_loop_dynamic_state === vkCmdSetAttachmentFeedbackLoopEnableEXT = PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetAttachmentFeedbackLoopEnableEXT" ) ); diff --git a/thirdparty/vulkan/include/vulkan/vulkan_android.h b/thirdparty/vulkan/include/vulkan/vulkan_android.h index d86f43f2d2..40b3c67ba6 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_android.h +++ b/thirdparty/vulkan/include/vulkan/vulkan_android.h @@ -120,6 +120,32 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID( struct AHardwareBuffer** pBuffer); #endif + +// VK_ANDROID_external_format_resolve is a preprocessor guard. Do not pass it to API calls. +#define VK_ANDROID_external_format_resolve 1 +#define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_SPEC_VERSION 1 +#define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_EXTENSION_NAME "VK_ANDROID_external_format_resolve" +typedef struct VkPhysicalDeviceExternalFormatResolveFeaturesANDROID { + VkStructureType sType; + void* pNext; + VkBool32 externalFormatResolve; +} VkPhysicalDeviceExternalFormatResolveFeaturesANDROID; + +typedef struct VkPhysicalDeviceExternalFormatResolvePropertiesANDROID { + VkStructureType sType; + void* pNext; + VkBool32 nullColorAttachmentWithExternalFormatResolve; + VkChromaLocation externalFormatResolveChromaOffsetX; + VkChromaLocation externalFormatResolveChromaOffsetY; +} VkPhysicalDeviceExternalFormatResolvePropertiesANDROID; + +typedef struct VkAndroidHardwareBufferFormatResolvePropertiesANDROID { + VkStructureType sType; + void* pNext; + VkFormat colorAttachmentFormat; +} VkAndroidHardwareBufferFormatResolvePropertiesANDROID; + + #ifdef __cplusplus } #endif diff --git a/thirdparty/vulkan/include/vulkan/vulkan_beta.h b/thirdparty/vulkan/include/vulkan/vulkan_beta.h index f00ed3ff1f..1871651d26 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_beta.h +++ b/thirdparty/vulkan/include/vulkan/vulkan_beta.h @@ -53,7 +53,7 @@ typedef struct VkPhysicalDevicePortabilitySubsetPropertiesKHR { // VK_KHR_video_encode_queue is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_video_encode_queue 1 -#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 9 +#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 10 #define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue" typedef enum VkVideoEncodeTuningModeKHR { @@ -68,6 +68,7 @@ typedef VkFlags VkVideoEncodeFlagsKHR; typedef enum VkVideoEncodeCapabilityFlagBitsKHR { VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_CAPABILITY_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_DETECTION_BIT_KHR = 0x00000002, VK_VIDEO_ENCODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkVideoEncodeCapabilityFlagBitsKHR; typedef VkFlags VkVideoEncodeCapabilityFlagsKHR; @@ -227,7 +228,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdEncodeVideoKHR( #define VK_EXT_video_encode_h264 1 #include "vk_video/vulkan_video_codec_h264std.h" #include "vk_video/vulkan_video_codec_h264std_encode.h" -#define VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION 11 +#define VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION 12 #define VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_EXT_video_encode_h264" typedef enum VkVideoEncodeH264CapabilityFlagBitsEXT { @@ -263,6 +264,8 @@ typedef enum VkVideoEncodeH264StdFlagBitsEXT { VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_DISABLED_BIT_EXT = 0x00008000, VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_ENABLED_BIT_EXT = 0x00010000, VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_PARTIAL_BIT_EXT = 0x00020000, + VK_VIDEO_ENCODE_H264_STD_SLICE_QP_DELTA_BIT_EXT = 0x00080000, + VK_VIDEO_ENCODE_H264_STD_DIFFERENT_SLICE_QP_DELTA_BIT_EXT = 0x00100000, VK_VIDEO_ENCODE_H264_STD_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF } VkVideoEncodeH264StdFlagBitsEXT; typedef VkFlags VkVideoEncodeH264StdFlagsEXT; @@ -424,7 +427,7 @@ typedef struct VkVideoEncodeH264GopRemainingFrameInfoEXT { #define VK_EXT_video_encode_h265 1 #include "vk_video/vulkan_video_codec_h265std.h" #include "vk_video/vulkan_video_codec_h265std_encode.h" -#define VK_EXT_VIDEO_ENCODE_H265_SPEC_VERSION 11 +#define VK_EXT_VIDEO_ENCODE_H265_SPEC_VERSION 12 #define VK_EXT_VIDEO_ENCODE_H265_EXTENSION_NAME "VK_EXT_video_encode_h265" typedef enum VkVideoEncodeH265CapabilityFlagBitsEXT { @@ -462,6 +465,8 @@ typedef enum VkVideoEncodeH265StdFlagBitsEXT { VK_VIDEO_ENCODE_H265_STD_DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG_SET_BIT_EXT = 0x00010000, VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENTS_ENABLED_FLAG_SET_BIT_EXT = 0x00020000, VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_EXT = 0x00040000, + VK_VIDEO_ENCODE_H265_STD_SLICE_QP_DELTA_BIT_EXT = 0x00080000, + VK_VIDEO_ENCODE_H265_STD_DIFFERENT_SLICE_QP_DELTA_BIT_EXT = 0x00100000, VK_VIDEO_ENCODE_H265_STD_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF } VkVideoEncodeH265StdFlagBitsEXT; typedef VkFlags VkVideoEncodeH265StdFlagsEXT; diff --git a/thirdparty/vulkan/include/vulkan/vulkan_core.h b/thirdparty/vulkan/include/vulkan/vulkan_core.h index c574858134..77bdf09412 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_core.h +++ b/thirdparty/vulkan/include/vulkan/vulkan_core.h @@ -27,7 +27,7 @@ extern "C" { #ifndef VK_USE_64_BIT_PTR_DEFINES - #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) + #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) || (defined(__riscv) && __riscv_xlen == 64) #define VK_USE_64_BIT_PTR_DEFINES 1 #else #define VK_USE_64_BIT_PTR_DEFINES 0 @@ -69,7 +69,7 @@ extern "C" { #define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 261 +#define VK_HEADER_VERSION 268 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) @@ -992,6 +992,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV = 1000371001, VK_STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT = 1000372000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT = 1000372001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT = 1000375000, + VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT = 1000375001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT = 1000376000, VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT = 1000376001, VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT = 1000376002, @@ -1055,6 +1057,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM = 1000440000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM = 1000440001, VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM = 1000440002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT = 1000451000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT = 1000451001, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT = 1000453000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT = 1000455000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT = 1000455001, @@ -1078,6 +1082,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV = 1000464010, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT = 1000465000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT = 1000466000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID = 1000468000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_PROPERTIES_ANDROID = 1000468001, + VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_RESOLVE_PROPERTIES_ANDROID = 1000468002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR = 1000470000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR = 1000470001, VK_STRUCTURE_TYPE_RENDERING_AREA_INFO_KHR = 1000470003, @@ -1097,23 +1104,45 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM = 1000488000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV = 1000490000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV = 1000490001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV = 1000492000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV = 1000492001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT = 1000351000, VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT = 1000351002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM = 1000497000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM = 1000497001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT = 1000498000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT = 1000499000, + VK_STRUCTURE_TYPE_LATENCY_SLEEP_MODE_INFO_NV = 1000505000, + VK_STRUCTURE_TYPE_LATENCY_SLEEP_INFO_NV = 1000505001, + VK_STRUCTURE_TYPE_SET_LATENCY_MARKER_INFO_NV = 1000505002, + VK_STRUCTURE_TYPE_GET_LATENCY_MARKER_INFO_NV = 1000505003, + VK_STRUCTURE_TYPE_LATENCY_TIMINGS_FRAME_REPORT_NV = 1000505004, + VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV = 1000505005, + VK_STRUCTURE_TYPE_OUT_OF_BAND_QUEUE_TYPE_INFO_NV = 1000505006, + VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV = 1000505007, + VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV = 1000505008, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR = 1000506000, VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR = 1000506001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR = 1000506002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM = 1000510000, VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM = 1000510001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM = 1000518000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM = 1000518001, + VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM = 1000518002, + VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM = 1000519000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM = 1000519001, + VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM = 1000519002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM = 1000520000, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM = 1000520001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM = 1000521000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT = 1000524000, VK_STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX = 1000529000, VK_STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX = 1000529001, VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX = 1000529002, VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX = 1000529003, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX = 1000529004, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT = 1000530000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV = 1000546000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, @@ -2163,6 +2192,7 @@ typedef enum VkIndexType { typedef enum VkSubpassContents { VK_SUBPASS_CONTENTS_INLINE = 0, VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1, + VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT = 1000451000, VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7FFFFFFF } VkSubpassContents; @@ -2714,6 +2744,8 @@ typedef enum VkDescriptorPoolCreateFlagBits { VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT = 0x00000002, VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT = 0x00000004, + VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV = 0x00000008, + VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_POOLS_BIT_NV = 0x00000010, VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT, VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE = VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT, VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF @@ -5784,6 +5816,7 @@ typedef enum VkDriverId { VK_DRIVER_ID_MESA_DOZEN = 23, VK_DRIVER_ID_MESA_NVK = 24, VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA = 25, + VK_DRIVER_ID_MESA_AGXV = 26, VK_DRIVER_ID_AMD_PROPRIETARY_KHR = VK_DRIVER_ID_AMD_PROPRIETARY, VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR = VK_DRIVER_ID_AMD_OPEN_SOURCE, VK_DRIVER_ID_MESA_RADV_KHR = VK_DRIVER_ID_MESA_RADV, @@ -5813,6 +5846,7 @@ typedef enum VkSamplerReductionMode { VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE = 0, VK_SAMPLER_REDUCTION_MODE_MIN = 1, VK_SAMPLER_REDUCTION_MODE_MAX = 2, + VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM = 1000521000, VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, VK_SAMPLER_REDUCTION_MODE_MIN_EXT = VK_SAMPLER_REDUCTION_MODE_MIN, VK_SAMPLER_REDUCTION_MODE_MAX_EXT = VK_SAMPLER_REDUCTION_MODE_MAX, @@ -5833,6 +5867,7 @@ typedef enum VkResolveModeFlagBits { VK_RESOLVE_MODE_AVERAGE_BIT = 0x00000002, VK_RESOLVE_MODE_MIN_BIT = 0x00000004, VK_RESOLVE_MODE_MAX_BIT = 0x00000008, + VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID = 0x00000010, VK_RESOLVE_MODE_NONE_KHR = VK_RESOLVE_MODE_NONE, VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT, VK_RESOLVE_MODE_AVERAGE_BIT_KHR = VK_RESOLVE_MODE_AVERAGE_BIT, @@ -6711,6 +6746,7 @@ typedef enum VkRenderingFlagBits { VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT = 0x00000001, VK_RENDERING_SUSPENDING_BIT = 0x00000002, VK_RENDERING_RESUMING_BIT = 0x00000004, + VK_RENDERING_CONTENTS_INLINE_BIT_EXT = 0x00000010, VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT = 0x00000008, VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR = VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT, VK_RENDERING_SUSPENDING_BIT_KHR = VK_RENDERING_SUSPENDING_BIT, @@ -7992,6 +8028,7 @@ typedef enum VkQueryResultStatusKHR { VK_QUERY_RESULT_STATUS_ERROR_KHR = -1, VK_QUERY_RESULT_STATUS_NOT_READY_KHR = 0, VK_QUERY_RESULT_STATUS_COMPLETE_KHR = 1, + VK_QUERY_RESULT_STATUS_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_KHR = -1000299000, VK_QUERY_RESULT_STATUS_MAX_ENUM_KHR = 0x7FFFFFFF } VkQueryResultStatusKHR; @@ -15816,6 +15853,38 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelinePropertiesEXT( #endif +// VK_EXT_frame_boundary is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_frame_boundary 1 +#define VK_EXT_FRAME_BOUNDARY_SPEC_VERSION 1 +#define VK_EXT_FRAME_BOUNDARY_EXTENSION_NAME "VK_EXT_frame_boundary" + +typedef enum VkFrameBoundaryFlagBitsEXT { + VK_FRAME_BOUNDARY_FRAME_END_BIT_EXT = 0x00000001, + VK_FRAME_BOUNDARY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkFrameBoundaryFlagBitsEXT; +typedef VkFlags VkFrameBoundaryFlagsEXT; +typedef struct VkPhysicalDeviceFrameBoundaryFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 frameBoundary; +} VkPhysicalDeviceFrameBoundaryFeaturesEXT; + +typedef struct VkFrameBoundaryEXT { + VkStructureType sType; + const void* pNext; + VkFrameBoundaryFlagsEXT flags; + uint64_t frameID; + uint32_t imageCount; + const VkImage* pImages; + uint32_t bufferCount; + const VkBuffer* pBuffers; + uint64_t tagName; + size_t tagSize; + const void* pTag; +} VkFrameBoundaryEXT; + + + // VK_EXT_multisampled_render_to_single_sampled is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_multisampled_render_to_single_sampled 1 #define VK_EXT_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_SPEC_VERSION 1 @@ -16728,6 +16797,26 @@ typedef struct VkPhysicalDeviceImageProcessingPropertiesQCOM { +// VK_EXT_nested_command_buffer is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_nested_command_buffer 1 +#define VK_EXT_NESTED_COMMAND_BUFFER_SPEC_VERSION 1 +#define VK_EXT_NESTED_COMMAND_BUFFER_EXTENSION_NAME "VK_EXT_nested_command_buffer" +typedef struct VkPhysicalDeviceNestedCommandBufferFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 nestedCommandBuffer; + VkBool32 nestedCommandBufferRendering; + VkBool32 nestedCommandBufferSimultaneousUse; +} VkPhysicalDeviceNestedCommandBufferFeaturesEXT; + +typedef struct VkPhysicalDeviceNestedCommandBufferPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxCommandBufferNestingLevel; +} VkPhysicalDeviceNestedCommandBufferPropertiesEXT; + + + // VK_EXT_external_memory_acquire_unmodified is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_external_memory_acquire_unmodified 1 #define VK_EXT_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_SPEC_VERSION 1 @@ -17482,6 +17571,26 @@ typedef struct VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV { +// VK_NV_extended_sparse_address_space is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_extended_sparse_address_space 1 +#define VK_NV_EXTENDED_SPARSE_ADDRESS_SPACE_SPEC_VERSION 1 +#define VK_NV_EXTENDED_SPARSE_ADDRESS_SPACE_EXTENSION_NAME "VK_NV_extended_sparse_address_space" +typedef struct VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 extendedSparseAddressSpace; +} VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV; + +typedef struct VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV { + VkStructureType sType; + void* pNext; + VkDeviceSize extendedSparseAddressSpaceSize; + VkImageUsageFlags extendedSparseImageUsageFlags; + VkBufferUsageFlags extendedSparseBufferUsageFlags; +} VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV; + + + // VK_EXT_mutable_descriptor_type is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_mutable_descriptor_type 1 #define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION 1 @@ -17532,6 +17641,138 @@ typedef struct VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT { +// VK_NV_low_latency2 is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_low_latency2 1 +#define VK_NV_LOW_LATENCY_2_SPEC_VERSION 1 +#define VK_NV_LOW_LATENCY_2_EXTENSION_NAME "VK_NV_low_latency2" + +typedef enum VkLatencyMarkerNV { + VK_LATENCY_MARKER_SIMULATION_START_NV = 0, + VK_LATENCY_MARKER_SIMULATION_END_NV = 1, + VK_LATENCY_MARKER_RENDERSUBMIT_START_NV = 2, + VK_LATENCY_MARKER_RENDERSUBMIT_END_NV = 3, + VK_LATENCY_MARKER_PRESENT_START_NV = 4, + VK_LATENCY_MARKER_PRESENT_END_NV = 5, + VK_LATENCY_MARKER_INPUT_SAMPLE_NV = 6, + VK_LATENCY_MARKER_TRIGGER_FLASH_NV = 7, + VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_START_NV = 8, + VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_END_NV = 9, + VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_START_NV = 10, + VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_END_NV = 11, + VK_LATENCY_MARKER_MAX_ENUM_NV = 0x7FFFFFFF +} VkLatencyMarkerNV; + +typedef enum VkOutOfBandQueueTypeNV { + VK_OUT_OF_BAND_QUEUE_TYPE_RENDER_NV = 0, + VK_OUT_OF_BAND_QUEUE_TYPE_PRESENT_NV = 1, + VK_OUT_OF_BAND_QUEUE_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkOutOfBandQueueTypeNV; +typedef struct VkLatencySleepModeInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 lowLatencyMode; + VkBool32 lowLatencyBoost; + uint32_t minimumIntervalUs; +} VkLatencySleepModeInfoNV; + +typedef struct VkLatencySleepInfoNV { + VkStructureType sType; + const void* pNext; + VkSemaphore signalSemaphore; + uint64_t value; +} VkLatencySleepInfoNV; + +typedef struct VkSetLatencyMarkerInfoNV { + VkStructureType sType; + const void* pNext; + uint64_t presentID; + VkLatencyMarkerNV marker; +} VkSetLatencyMarkerInfoNV; + +typedef struct VkLatencyTimingsFrameReportNV { + VkStructureType sType; + const void* pNext; + uint64_t presentID; + uint64_t inputSampleTimeUs; + uint64_t simStartTimeUs; + uint64_t simEndTimeUs; + uint64_t renderSubmitStartTimeUs; + uint64_t renderSubmitEndTimeUs; + uint64_t presentStartTimeUs; + uint64_t presentEndTimeUs; + uint64_t driverStartTimeUs; + uint64_t driverEndTimeUs; + uint64_t osRenderQueueStartTimeUs; + uint64_t osRenderQueueEndTimeUs; + uint64_t gpuRenderStartTimeUs; + uint64_t gpuRenderEndTimeUs; +} VkLatencyTimingsFrameReportNV; + +typedef struct VkGetLatencyMarkerInfoNV { + VkStructureType sType; + const void* pNext; + VkLatencyTimingsFrameReportNV* pTimings; +} VkGetLatencyMarkerInfoNV; + +typedef struct VkLatencySubmissionPresentIdNV { + VkStructureType sType; + const void* pNext; + uint64_t presentID; +} VkLatencySubmissionPresentIdNV; + +typedef struct VkSwapchainLatencyCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 latencyModeEnable; +} VkSwapchainLatencyCreateInfoNV; + +typedef struct VkOutOfBandQueueTypeInfoNV { + VkStructureType sType; + const void* pNext; + VkOutOfBandQueueTypeNV queueType; +} VkOutOfBandQueueTypeInfoNV; + +typedef struct VkLatencySurfaceCapabilitiesNV { + VkStructureType sType; + const void* pNext; + uint32_t presentModeCount; + VkPresentModeKHR* pPresentModes; +} VkLatencySurfaceCapabilitiesNV; + +typedef VkResult (VKAPI_PTR *PFN_vkSetLatencySleepModeNV)(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepModeInfoNV* pSleepModeInfo); +typedef VkResult (VKAPI_PTR *PFN_vkLatencySleepNV)(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepInfoNV* pSleepInfo); +typedef void (VKAPI_PTR *PFN_vkSetLatencyMarkerNV)(VkDevice device, VkSwapchainKHR swapchain, const VkSetLatencyMarkerInfoNV* pLatencyMarkerInfo); +typedef void (VKAPI_PTR *PFN_vkGetLatencyTimingsNV)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pTimingCount, VkGetLatencyMarkerInfoNV* pLatencyMarkerInfo); +typedef void (VKAPI_PTR *PFN_vkQueueNotifyOutOfBandNV)(VkQueue queue, const VkOutOfBandQueueTypeInfoNV* pQueueTypeInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkSetLatencySleepModeNV( + VkDevice device, + VkSwapchainKHR swapchain, + const VkLatencySleepModeInfoNV* pSleepModeInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkLatencySleepNV( + VkDevice device, + VkSwapchainKHR swapchain, + const VkLatencySleepInfoNV* pSleepInfo); + +VKAPI_ATTR void VKAPI_CALL vkSetLatencyMarkerNV( + VkDevice device, + VkSwapchainKHR swapchain, + const VkSetLatencyMarkerInfoNV* pLatencyMarkerInfo); + +VKAPI_ATTR void VKAPI_CALL vkGetLatencyTimingsNV( + VkDevice device, + VkSwapchainKHR swapchain, + uint32_t* pTimingCount, + VkGetLatencyMarkerInfoNV* pLatencyMarkerInfo); + +VKAPI_ATTR void VKAPI_CALL vkQueueNotifyOutOfBandNV( + VkQueue queue, + const VkOutOfBandQueueTypeInfoNV* pQueueTypeInfo); +#endif + + // VK_QCOM_multiview_per_view_render_areas is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_multiview_per_view_render_areas 1 #define VK_QCOM_MULTIVIEW_PER_VIEW_RENDER_AREAS_SPEC_VERSION 1 @@ -17551,6 +17792,100 @@ typedef struct VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM { +// VK_QCOM_image_processing2 is a preprocessor guard. Do not pass it to API calls. +#define VK_QCOM_image_processing2 1 +#define VK_QCOM_IMAGE_PROCESSING_2_SPEC_VERSION 1 +#define VK_QCOM_IMAGE_PROCESSING_2_EXTENSION_NAME "VK_QCOM_image_processing2" + +typedef enum VkBlockMatchWindowCompareModeQCOM { + VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MIN_QCOM = 0, + VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_QCOM = 1, + VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_ENUM_QCOM = 0x7FFFFFFF +} VkBlockMatchWindowCompareModeQCOM; +typedef struct VkPhysicalDeviceImageProcessing2FeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 textureBlockMatch2; +} VkPhysicalDeviceImageProcessing2FeaturesQCOM; + +typedef struct VkPhysicalDeviceImageProcessing2PropertiesQCOM { + VkStructureType sType; + void* pNext; + VkExtent2D maxBlockMatchWindow; +} VkPhysicalDeviceImageProcessing2PropertiesQCOM; + +typedef struct VkSamplerBlockMatchWindowCreateInfoQCOM { + VkStructureType sType; + const void* pNext; + VkExtent2D windowExtent; + VkBlockMatchWindowCompareModeQCOM windowCompareMode; +} VkSamplerBlockMatchWindowCreateInfoQCOM; + + + +// VK_QCOM_filter_cubic_weights is a preprocessor guard. Do not pass it to API calls. +#define VK_QCOM_filter_cubic_weights 1 +#define VK_QCOM_FILTER_CUBIC_WEIGHTS_SPEC_VERSION 1 +#define VK_QCOM_FILTER_CUBIC_WEIGHTS_EXTENSION_NAME "VK_QCOM_filter_cubic_weights" + +typedef enum VkCubicFilterWeightsQCOM { + VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM = 0, + VK_CUBIC_FILTER_WEIGHTS_ZERO_TANGENT_CARDINAL_QCOM = 1, + VK_CUBIC_FILTER_WEIGHTS_B_SPLINE_QCOM = 2, + VK_CUBIC_FILTER_WEIGHTS_MITCHELL_NETRAVALI_QCOM = 3, + VK_CUBIC_FILTER_WEIGHTS_MAX_ENUM_QCOM = 0x7FFFFFFF +} VkCubicFilterWeightsQCOM; +typedef struct VkPhysicalDeviceCubicWeightsFeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 selectableCubicWeights; +} VkPhysicalDeviceCubicWeightsFeaturesQCOM; + +typedef struct VkSamplerCubicWeightsCreateInfoQCOM { + VkStructureType sType; + const void* pNext; + VkCubicFilterWeightsQCOM cubicWeights; +} VkSamplerCubicWeightsCreateInfoQCOM; + +typedef struct VkBlitImageCubicWeightsInfoQCOM { + VkStructureType sType; + const void* pNext; + VkCubicFilterWeightsQCOM cubicWeights; +} VkBlitImageCubicWeightsInfoQCOM; + + + +// VK_QCOM_ycbcr_degamma is a preprocessor guard. Do not pass it to API calls. +#define VK_QCOM_ycbcr_degamma 1 +#define VK_QCOM_YCBCR_DEGAMMA_SPEC_VERSION 1 +#define VK_QCOM_YCBCR_DEGAMMA_EXTENSION_NAME "VK_QCOM_ycbcr_degamma" +typedef struct VkPhysicalDeviceYcbcrDegammaFeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 ycbcrDegamma; +} VkPhysicalDeviceYcbcrDegammaFeaturesQCOM; + +typedef struct VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM { + VkStructureType sType; + void* pNext; + VkBool32 enableYDegamma; + VkBool32 enableCbCrDegamma; +} VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM; + + + +// VK_QCOM_filter_cubic_clamp is a preprocessor guard. Do not pass it to API calls. +#define VK_QCOM_filter_cubic_clamp 1 +#define VK_QCOM_FILTER_CUBIC_CLAMP_SPEC_VERSION 1 +#define VK_QCOM_FILTER_CUBIC_CLAMP_EXTENSION_NAME "VK_QCOM_filter_cubic_clamp" +typedef struct VkPhysicalDeviceCubicClampFeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 cubicRangeClamp; +} VkPhysicalDeviceCubicClampFeaturesQCOM; + + + // VK_EXT_attachment_feedback_loop_dynamic_state is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_attachment_feedback_loop_dynamic_state 1 #define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION 1 @@ -17570,6 +17905,36 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetAttachmentFeedbackLoopEnableEXT( #endif +// VK_MSFT_layered_driver is a preprocessor guard. Do not pass it to API calls. +#define VK_MSFT_layered_driver 1 +#define VK_MSFT_LAYERED_DRIVER_SPEC_VERSION 1 +#define VK_MSFT_LAYERED_DRIVER_EXTENSION_NAME "VK_MSFT_layered_driver" + +typedef enum VkLayeredDriverUnderlyingApiMSFT { + VK_LAYERED_DRIVER_UNDERLYING_API_NONE_MSFT = 0, + VK_LAYERED_DRIVER_UNDERLYING_API_D3D12_MSFT = 1, + VK_LAYERED_DRIVER_UNDERLYING_API_MAX_ENUM_MSFT = 0x7FFFFFFF +} VkLayeredDriverUnderlyingApiMSFT; +typedef struct VkPhysicalDeviceLayeredDriverPropertiesMSFT { + VkStructureType sType; + void* pNext; + VkLayeredDriverUnderlyingApiMSFT underlyingAPI; +} VkPhysicalDeviceLayeredDriverPropertiesMSFT; + + + +// VK_NV_descriptor_pool_overallocation is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_descriptor_pool_overallocation 1 +#define VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_SPEC_VERSION 1 +#define VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_EXTENSION_NAME "VK_NV_descriptor_pool_overallocation" +typedef struct VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 descriptorPoolOverallocation; +} VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV; + + + // VK_KHR_acceleration_structure is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_acceleration_structure 1 #define VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION 13 diff --git a/thirdparty/vulkan/include/vulkan/vulkan_enums.hpp b/thirdparty/vulkan/include/vulkan/vulkan_enums.hpp index bac993339b..d243cd4014 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_enums.hpp +++ b/thirdparty/vulkan/include/vulkan/vulkan_enums.hpp @@ -10,6 +10,212 @@ namespace VULKAN_HPP_NAMESPACE { + template <typename FlagBitsType> + struct FlagTraits + { + static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = false; + }; + + template <typename BitType> + class Flags + { + public: + using MaskType = typename std::underlying_type<BitType>::type; + + // constructors + VULKAN_HPP_CONSTEXPR Flags() VULKAN_HPP_NOEXCEPT : m_mask( 0 ) {} + + VULKAN_HPP_CONSTEXPR Flags( BitType bit ) VULKAN_HPP_NOEXCEPT : m_mask( static_cast<MaskType>( bit ) ) {} + + VULKAN_HPP_CONSTEXPR Flags( Flags<BitType> const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + VULKAN_HPP_CONSTEXPR explicit Flags( MaskType flags ) VULKAN_HPP_NOEXCEPT : m_mask( flags ) {} + + // relational operators +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( Flags<BitType> const & ) const = default; +#else + VULKAN_HPP_CONSTEXPR bool operator<( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return m_mask < rhs.m_mask; + } + + VULKAN_HPP_CONSTEXPR bool operator<=( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return m_mask <= rhs.m_mask; + } + + VULKAN_HPP_CONSTEXPR bool operator>( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return m_mask > rhs.m_mask; + } + + VULKAN_HPP_CONSTEXPR bool operator>=( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return m_mask >= rhs.m_mask; + } + + VULKAN_HPP_CONSTEXPR bool operator==( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return m_mask == rhs.m_mask; + } + + VULKAN_HPP_CONSTEXPR bool operator!=( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return m_mask != rhs.m_mask; + } +#endif + + // logical operator + VULKAN_HPP_CONSTEXPR bool operator!() const VULKAN_HPP_NOEXCEPT + { + return !m_mask; + } + + // bitwise operators + VULKAN_HPP_CONSTEXPR Flags<BitType> operator&( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return Flags<BitType>( m_mask & rhs.m_mask ); + } + + VULKAN_HPP_CONSTEXPR Flags<BitType> operator|( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return Flags<BitType>( m_mask | rhs.m_mask ); + } + + VULKAN_HPP_CONSTEXPR Flags<BitType> operator^( Flags<BitType> const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return Flags<BitType>( m_mask ^ rhs.m_mask ); + } + + VULKAN_HPP_CONSTEXPR Flags<BitType> operator~() const VULKAN_HPP_NOEXCEPT + { + return Flags<BitType>( m_mask ^ FlagTraits<BitType>::allFlags.m_mask ); + } + + // assignment operators + VULKAN_HPP_CONSTEXPR_14 Flags<BitType> & operator=( Flags<BitType> const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + VULKAN_HPP_CONSTEXPR_14 Flags<BitType> & operator|=( Flags<BitType> const & rhs ) VULKAN_HPP_NOEXCEPT + { + m_mask |= rhs.m_mask; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 Flags<BitType> & operator&=( Flags<BitType> const & rhs ) VULKAN_HPP_NOEXCEPT + { + m_mask &= rhs.m_mask; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 Flags<BitType> & operator^=( Flags<BitType> const & rhs ) VULKAN_HPP_NOEXCEPT + { + m_mask ^= rhs.m_mask; + return *this; + } + + // cast operators + explicit VULKAN_HPP_CONSTEXPR operator bool() const VULKAN_HPP_NOEXCEPT + { + return !!m_mask; + } + + explicit VULKAN_HPP_CONSTEXPR operator MaskType() const VULKAN_HPP_NOEXCEPT + { + return m_mask; + } + +#if defined( VULKAN_HPP_FLAGS_MASK_TYPE_AS_PUBLIC ) + public: +#else + private: +#endif + MaskType m_mask; + }; + +#if !defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + // relational operators only needed for pre C++20 + template <typename BitType> + VULKAN_HPP_CONSTEXPR bool operator<( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT + { + return flags.operator>( bit ); + } + + template <typename BitType> + VULKAN_HPP_CONSTEXPR bool operator<=( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT + { + return flags.operator>=( bit ); + } + + template <typename BitType> + VULKAN_HPP_CONSTEXPR bool operator>( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT + { + return flags.operator<( bit ); + } + + template <typename BitType> + VULKAN_HPP_CONSTEXPR bool operator>=( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT + { + return flags.operator<=( bit ); + } + + template <typename BitType> + VULKAN_HPP_CONSTEXPR bool operator==( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT + { + return flags.operator==( bit ); + } + + template <typename BitType> + VULKAN_HPP_CONSTEXPR bool operator!=( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT + { + return flags.operator!=( bit ); + } +#endif + + // bitwise operators + template <typename BitType> + VULKAN_HPP_CONSTEXPR Flags<BitType> operator&( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT + { + return flags.operator&( bit ); + } + + template <typename BitType> + VULKAN_HPP_CONSTEXPR Flags<BitType> operator|( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT + { + return flags.operator|( bit ); + } + + template <typename BitType> + VULKAN_HPP_CONSTEXPR Flags<BitType> operator^( BitType bit, Flags<BitType> const & flags ) VULKAN_HPP_NOEXCEPT + { + return flags.operator^( bit ); + } + + // bitwise operators on BitType + template <typename BitType, typename std::enable_if<FlagTraits<BitType>::isBitmask, bool>::type = true> + VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR Flags<BitType> operator&( BitType lhs, BitType rhs ) VULKAN_HPP_NOEXCEPT + { + return Flags<BitType>( lhs ) & rhs; + } + + template <typename BitType, typename std::enable_if<FlagTraits<BitType>::isBitmask, bool>::type = true> + VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR Flags<BitType> operator|( BitType lhs, BitType rhs ) VULKAN_HPP_NOEXCEPT + { + return Flags<BitType>( lhs ) | rhs; + } + + template <typename BitType, typename std::enable_if<FlagTraits<BitType>::isBitmask, bool>::type = true> + VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR Flags<BitType> operator^( BitType lhs, BitType rhs ) VULKAN_HPP_NOEXCEPT + { + return Flags<BitType>( lhs ) ^ rhs; + } + + template <typename BitType, typename std::enable_if<FlagTraits<BitType>::isBitmask, bool>::type = true> + VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR Flags<BitType> operator~( BitType bit ) VULKAN_HPP_NOEXCEPT + { + return ~( Flags<BitType>( bit ) ); + } + template <typename EnumType, EnumType value> struct CppType { @@ -1007,6 +1213,8 @@ namespace VULKAN_HPP_NAMESPACE ePipelinePropertiesIdentifierEXT = VK_STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT, ePhysicalDevicePipelinePropertiesFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT, ePipelineInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_INFO_EXT, + ePhysicalDeviceFrameBoundaryFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT, + eFrameBoundaryEXT = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT, ePhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT, eSubpassResolvePerformanceQueryEXT = VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT, eMultisampledRenderToSingleSampledInfoEXT = VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT, @@ -1074,6 +1282,8 @@ namespace VULKAN_HPP_NAMESPACE ePhysicalDeviceImageProcessingFeaturesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM, ePhysicalDeviceImageProcessingPropertiesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM, eImageViewSampleWeightCreateInfoQCOM = VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM, + ePhysicalDeviceNestedCommandBufferFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT, + ePhysicalDeviceNestedCommandBufferPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT, eExternalMemoryAcquireUnmodifiedEXT = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, ePhysicalDeviceExtendedDynamicState3FeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT, ePhysicalDeviceExtendedDynamicState3PropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT, @@ -1097,6 +1307,11 @@ namespace VULKAN_HPP_NAMESPACE eOpticalFlowSessionCreatePrivateDataInfoNV = VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV, ePhysicalDeviceLegacyDitheringFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT, ePhysicalDevicePipelineProtectedAccessFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT, +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) + ePhysicalDeviceExternalFormatResolveFeaturesANDROID = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID, + ePhysicalDeviceExternalFormatResolvePropertiesANDROID = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_PROPERTIES_ANDROID, + eAndroidHardwareBufferFormatResolvePropertiesANDROID = VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_RESOLVE_PROPERTIES_ANDROID, +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ ePhysicalDeviceMaintenance5FeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR, ePhysicalDeviceMaintenance5PropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR, eRenderingAreaInfoKHR = VK_STRUCTURE_TYPE_RENDERING_AREA_INFO_KHR, @@ -1117,25 +1332,47 @@ namespace VULKAN_HPP_NAMESPACE ePhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM, ePhysicalDeviceRayTracingInvocationReorderFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV, ePhysicalDeviceRayTracingInvocationReorderPropertiesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV, + ePhysicalDeviceExtendedSparseAddressSpaceFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV, + ePhysicalDeviceExtendedSparseAddressSpacePropertiesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV, ePhysicalDeviceMutableDescriptorTypeFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT, eMutableDescriptorTypeCreateInfoEXT = VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT, ePhysicalDeviceShaderCoreBuiltinsFeaturesARM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM, ePhysicalDeviceShaderCoreBuiltinsPropertiesARM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM, ePhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT, ePhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT, + eLatencySleepModeInfoNV = VK_STRUCTURE_TYPE_LATENCY_SLEEP_MODE_INFO_NV, + eLatencySleepInfoNV = VK_STRUCTURE_TYPE_LATENCY_SLEEP_INFO_NV, + eSetLatencyMarkerInfoNV = VK_STRUCTURE_TYPE_SET_LATENCY_MARKER_INFO_NV, + eGetLatencyMarkerInfoNV = VK_STRUCTURE_TYPE_GET_LATENCY_MARKER_INFO_NV, + eLatencyTimingsFrameReportNV = VK_STRUCTURE_TYPE_LATENCY_TIMINGS_FRAME_REPORT_NV, + eLatencySubmissionPresentIdNV = VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV, + eOutOfBandQueueTypeInfoNV = VK_STRUCTURE_TYPE_OUT_OF_BAND_QUEUE_TYPE_INFO_NV, + eSwapchainLatencyCreateInfoNV = VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV, + eLatencySurfaceCapabilitiesNV = VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV, ePhysicalDeviceCooperativeMatrixFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR, eCooperativeMatrixPropertiesKHR = VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR, ePhysicalDeviceCooperativeMatrixPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR, ePhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM, eMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM, + ePhysicalDeviceImageProcessing2FeaturesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM, + ePhysicalDeviceImageProcessing2PropertiesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM, + eSamplerBlockMatchWindowCreateInfoQCOM = VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM, + eSamplerCubicWeightsCreateInfoQCOM = VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM, + ePhysicalDeviceCubicWeightsFeaturesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM, + eBlitImageCubicWeightsInfoQCOM = VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM, + ePhysicalDeviceYcbcrDegammaFeaturesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM, + eSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM, + ePhysicalDeviceCubicClampFeaturesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM, ePhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT, #if defined( VK_USE_PLATFORM_SCREEN_QNX ) eScreenBufferPropertiesQNX = VK_STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX, eScreenBufferFormatPropertiesQNX = VK_STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX, eImportScreenBufferInfoQNX = VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX, eExternalFormatQNX = VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX, - ePhysicalDeviceExternalMemoryScreenBufferFeaturesQNX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX + ePhysicalDeviceExternalMemoryScreenBufferFeaturesQNX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX, #endif /*VK_USE_PLATFORM_SCREEN_QNX*/ + ePhysicalDeviceLayeredDriverPropertiesMSFT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT, + ePhysicalDeviceDescriptorPoolOverallocationFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV }; enum class PipelineCacheHeaderVersion @@ -1843,6 +2080,20 @@ namespace VULKAN_HPP_NAMESPACE static VULKAN_HPP_CONST_OR_CONSTEXPR DeviceCreateFlags allFlags = {}; }; + enum class DeviceQueueCreateFlagBits : VkDeviceQueueCreateFlags + { + eProtected = VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT + }; + + using DeviceQueueCreateFlags = Flags<DeviceQueueCreateFlagBits>; + + template <> + struct FlagTraits<DeviceQueueCreateFlagBits> + { + static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; + static VULKAN_HPP_CONST_OR_CONSTEXPR DeviceQueueCreateFlags allFlags = DeviceQueueCreateFlagBits::eProtected; + }; + enum class PipelineStageFlagBits : VkPipelineStageFlags { eTopOfPipe = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, @@ -2306,6 +2557,21 @@ namespace VULKAN_HPP_NAMESPACE static VULKAN_HPP_CONST_OR_CONSTEXPR ShaderModuleCreateFlags allFlags = {}; }; + enum class PipelineCacheCreateFlagBits : VkPipelineCacheCreateFlags + { + eExternallySynchronized = VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, + eExternallySynchronizedEXT = VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT + }; + + using PipelineCacheCreateFlags = Flags<PipelineCacheCreateFlagBits>; + + template <> + struct FlagTraits<PipelineCacheCreateFlagBits> + { + static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; + static VULKAN_HPP_CONST_OR_CONSTEXPR PipelineCacheCreateFlags allFlags = PipelineCacheCreateFlagBits::eExternallySynchronized; + }; + enum class BlendFactor { eZero = VK_BLEND_FACTOR_ZERO, @@ -2720,6 +2986,41 @@ namespace VULKAN_HPP_NAMESPACE eInstance = VK_VERTEX_INPUT_RATE_INSTANCE }; + enum class PipelineColorBlendStateCreateFlagBits : VkPipelineColorBlendStateCreateFlags + { + eRasterizationOrderAttachmentAccessARM = VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_ARM, + eRasterizationOrderAttachmentAccessEXT = VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT + }; + + using PipelineColorBlendStateCreateFlags = Flags<PipelineColorBlendStateCreateFlagBits>; + + template <> + struct FlagTraits<PipelineColorBlendStateCreateFlagBits> + { + static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; + static VULKAN_HPP_CONST_OR_CONSTEXPR PipelineColorBlendStateCreateFlags allFlags = + PipelineColorBlendStateCreateFlagBits::eRasterizationOrderAttachmentAccessEXT; + }; + + enum class PipelineDepthStencilStateCreateFlagBits : VkPipelineDepthStencilStateCreateFlags + { + eRasterizationOrderAttachmentDepthAccessARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM, + eRasterizationOrderAttachmentStencilAccessARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM, + eRasterizationOrderAttachmentDepthAccessEXT = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT, + eRasterizationOrderAttachmentStencilAccessEXT = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT + }; + + using PipelineDepthStencilStateCreateFlags = Flags<PipelineDepthStencilStateCreateFlagBits>; + + template <> + struct FlagTraits<PipelineDepthStencilStateCreateFlagBits> + { + static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; + static VULKAN_HPP_CONST_OR_CONSTEXPR PipelineDepthStencilStateCreateFlags allFlags = + PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentDepthAccessEXT | + PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentStencilAccessEXT; + }; + enum class PipelineDynamicStateCreateFlagBits : VkPipelineDynamicStateCreateFlags { }; @@ -2746,6 +3047,20 @@ namespace VULKAN_HPP_NAMESPACE static VULKAN_HPP_CONST_OR_CONSTEXPR PipelineInputAssemblyStateCreateFlags allFlags = {}; }; + enum class PipelineLayoutCreateFlagBits : VkPipelineLayoutCreateFlags + { + eIndependentSetsEXT = VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT + }; + + using PipelineLayoutCreateFlags = Flags<PipelineLayoutCreateFlagBits>; + + template <> + struct FlagTraits<PipelineLayoutCreateFlagBits> + { + static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; + static VULKAN_HPP_CONST_OR_CONSTEXPR PipelineLayoutCreateFlags allFlags = PipelineLayoutCreateFlagBits::eIndependentSetsEXT; + }; + enum class PipelineMultisampleStateCreateFlagBits : VkPipelineMultisampleStateCreateFlags { }; @@ -2869,11 +3184,13 @@ namespace VULKAN_HPP_NAMESPACE enum class DescriptorPoolCreateFlagBits : VkDescriptorPoolCreateFlags { - eFreeDescriptorSet = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, - eUpdateAfterBind = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT, - eUpdateAfterBindEXT = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT, - eHostOnlyVALVE = VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE, - eHostOnlyEXT = VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT + eFreeDescriptorSet = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, + eUpdateAfterBind = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT, + eUpdateAfterBindEXT = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT, + eHostOnlyVALVE = VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE, + eHostOnlyEXT = VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT, + eAllowOverallocationSetsNV = VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV, + eAllowOverallocationPoolsNV = VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_POOLS_BIT_NV }; using DescriptorPoolCreateFlags = Flags<DescriptorPoolCreateFlagBits>; @@ -2883,7 +3200,8 @@ namespace VULKAN_HPP_NAMESPACE { static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; static VULKAN_HPP_CONST_OR_CONSTEXPR DescriptorPoolCreateFlags allFlags = - DescriptorPoolCreateFlagBits::eFreeDescriptorSet | DescriptorPoolCreateFlagBits::eUpdateAfterBind | DescriptorPoolCreateFlagBits::eHostOnlyEXT; + DescriptorPoolCreateFlagBits::eFreeDescriptorSet | DescriptorPoolCreateFlagBits::eUpdateAfterBind | DescriptorPoolCreateFlagBits::eHostOnlyEXT | + DescriptorPoolCreateFlagBits::eAllowOverallocationSetsNV | DescriptorPoolCreateFlagBits::eAllowOverallocationPoolsNV; }; enum class DescriptorSetLayoutCreateFlagBits : VkDescriptorSetLayoutCreateFlags @@ -3232,8 +3550,9 @@ namespace VULKAN_HPP_NAMESPACE enum class SubpassContents { - eInline = VK_SUBPASS_CONTENTS_INLINE, - eSecondaryCommandBuffers = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS + eInline = VK_SUBPASS_CONTENTS_INLINE, + eSecondaryCommandBuffers = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS, + eInlineAndSecondaryCommandBuffersEXT = VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT }; //=== VK_VERSION_1_1 === @@ -3330,20 +3649,6 @@ namespace VULKAN_HPP_NAMESPACE }; using TessellationDomainOriginKHR = TessellationDomainOrigin; - enum class DeviceQueueCreateFlagBits : VkDeviceQueueCreateFlags - { - eProtected = VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT - }; - - using DeviceQueueCreateFlags = Flags<DeviceQueueCreateFlagBits>; - - template <> - struct FlagTraits<DeviceQueueCreateFlagBits> - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR DeviceQueueCreateFlags allFlags = DeviceQueueCreateFlagBits::eProtected; - }; - enum class SamplerYcbcrModelConversion { eRgbIdentity = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, @@ -3605,7 +3910,8 @@ namespace VULKAN_HPP_NAMESPACE eMesaVenus = VK_DRIVER_ID_MESA_VENUS, eMesaDozen = VK_DRIVER_ID_MESA_DOZEN, eMesaNvk = VK_DRIVER_ID_MESA_NVK, - eImaginationOpenSourceMESA = VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA + eImaginationOpenSourceMESA = VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA, + eMesaAgxv = VK_DRIVER_ID_MESA_AGXV }; using DriverIdKHR = DriverId; @@ -3644,7 +3950,10 @@ namespace VULKAN_HPP_NAMESPACE eSampleZero = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT, eAverage = VK_RESOLVE_MODE_AVERAGE_BIT, eMin = VK_RESOLVE_MODE_MIN_BIT, - eMax = VK_RESOLVE_MODE_MAX_BIT + eMax = VK_RESOLVE_MODE_MAX_BIT, +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) + eExternalFormatDownsampleANDROID = VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ }; using ResolveModeFlagBitsKHR = ResolveModeFlagBits; @@ -3655,15 +3964,20 @@ namespace VULKAN_HPP_NAMESPACE struct FlagTraits<ResolveModeFlagBits> { static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR ResolveModeFlags allFlags = - ResolveModeFlagBits::eNone | ResolveModeFlagBits::eSampleZero | ResolveModeFlagBits::eAverage | ResolveModeFlagBits::eMin | ResolveModeFlagBits::eMax; + static VULKAN_HPP_CONST_OR_CONSTEXPR ResolveModeFlags allFlags = ResolveModeFlagBits::eNone | ResolveModeFlagBits::eSampleZero | + ResolveModeFlagBits::eAverage | ResolveModeFlagBits::eMin | ResolveModeFlagBits::eMax +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) + | ResolveModeFlagBits::eExternalFormatDownsampleANDROID +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + ; }; enum class SamplerReductionMode { - eWeightedAverage = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, - eMin = VK_SAMPLER_REDUCTION_MODE_MIN, - eMax = VK_SAMPLER_REDUCTION_MODE_MAX + eWeightedAverage = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, + eMin = VK_SAMPLER_REDUCTION_MODE_MIN, + eMax = VK_SAMPLER_REDUCTION_MODE_MAX, + eWeightedAverageRangeclampQCOM = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM }; using SamplerReductionModeEXT = SamplerReductionMode; @@ -3933,6 +4247,7 @@ namespace VULKAN_HPP_NAMESPACE eContentsSecondaryCommandBuffers = VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT, eSuspending = VK_RENDERING_SUSPENDING_BIT, eResuming = VK_RENDERING_RESUMING_BIT, + eContentsInlineEXT = VK_RENDERING_CONTENTS_INLINE_BIT_EXT, eEnableLegacyDitheringEXT = VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT }; using RenderingFlagBitsKHR = RenderingFlagBits; @@ -3945,7 +4260,8 @@ namespace VULKAN_HPP_NAMESPACE { static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; static VULKAN_HPP_CONST_OR_CONSTEXPR RenderingFlags allFlags = RenderingFlagBits::eContentsSecondaryCommandBuffers | RenderingFlagBits::eSuspending | - RenderingFlagBits::eResuming | RenderingFlagBits::eEnableLegacyDitheringEXT; + RenderingFlagBits::eResuming | RenderingFlagBits::eContentsInlineEXT | + RenderingFlagBits::eEnableLegacyDitheringEXT; }; enum class FormatFeatureFlagBits2 : VkFormatFeatureFlags2 @@ -4487,7 +4803,10 @@ namespace VULKAN_HPP_NAMESPACE { eError = VK_QUERY_RESULT_STATUS_ERROR_KHR, eNotReady = VK_QUERY_RESULT_STATUS_NOT_READY_KHR, - eComplete = VK_QUERY_RESULT_STATUS_COMPLETE_KHR + eComplete = VK_QUERY_RESULT_STATUS_COMPLETE_KHR, +#if defined( VK_ENABLE_BETA_EXTENSIONS ) + eInsufficientBitstreamBufferRange = VK_QUERY_RESULT_STATUS_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_KHR +#endif /*VK_ENABLE_BETA_EXTENSIONS*/ }; enum class VideoSessionParametersCreateFlagBitsKHR : VkVideoSessionParametersCreateFlagsKHR @@ -4642,7 +4961,9 @@ namespace VULKAN_HPP_NAMESPACE eConstrainedIntraPredFlagSet = VK_VIDEO_ENCODE_H264_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_EXT, eDeblockingFilterDisabled = VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_DISABLED_BIT_EXT, eDeblockingFilterEnabled = VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_ENABLED_BIT_EXT, - eDeblockingFilterPartial = VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_PARTIAL_BIT_EXT + eDeblockingFilterPartial = VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_PARTIAL_BIT_EXT, + eSliceQpDelta = VK_VIDEO_ENCODE_H264_STD_SLICE_QP_DELTA_BIT_EXT, + eDifferentSliceQpDelta = VK_VIDEO_ENCODE_H264_STD_DIFFERENT_SLICE_QP_DELTA_BIT_EXT }; using VideoEncodeH264StdFlagsEXT = Flags<VideoEncodeH264StdFlagBitsEXT>; @@ -4660,7 +4981,8 @@ namespace VULKAN_HPP_NAMESPACE VideoEncodeH264StdFlagBitsEXT::eDirectSpatialMvPredFlagUnset | VideoEncodeH264StdFlagBitsEXT::eEntropyCodingModeFlagUnset | VideoEncodeH264StdFlagBitsEXT::eEntropyCodingModeFlagSet | VideoEncodeH264StdFlagBitsEXT::eDirect8X8InferenceFlagUnset | VideoEncodeH264StdFlagBitsEXT::eConstrainedIntraPredFlagSet | VideoEncodeH264StdFlagBitsEXT::eDeblockingFilterDisabled | - VideoEncodeH264StdFlagBitsEXT::eDeblockingFilterEnabled | VideoEncodeH264StdFlagBitsEXT::eDeblockingFilterPartial; + VideoEncodeH264StdFlagBitsEXT::eDeblockingFilterEnabled | VideoEncodeH264StdFlagBitsEXT::eDeblockingFilterPartial | + VideoEncodeH264StdFlagBitsEXT::eSliceQpDelta | VideoEncodeH264StdFlagBitsEXT::eDifferentSliceQpDelta; }; enum class VideoEncodeH264RateControlFlagBitsEXT : VkVideoEncodeH264RateControlFlagsEXT @@ -4736,7 +5058,9 @@ namespace VULKAN_HPP_NAMESPACE eEntropyCodingSyncEnabledFlagSet = VK_VIDEO_ENCODE_H265_STD_ENTROPY_CODING_SYNC_ENABLED_FLAG_SET_BIT_EXT, eDeblockingFilterOverrideEnabledFlagSet = VK_VIDEO_ENCODE_H265_STD_DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG_SET_BIT_EXT, eDependentSliceSegmentsEnabledFlagSet = VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENTS_ENABLED_FLAG_SET_BIT_EXT, - eDependentSliceSegmentFlagSet = VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_EXT + eDependentSliceSegmentFlagSet = VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_EXT, + eSliceQpDelta = VK_VIDEO_ENCODE_H265_STD_SLICE_QP_DELTA_BIT_EXT, + eDifferentSliceQpDelta = VK_VIDEO_ENCODE_H265_STD_DIFFERENT_SLICE_QP_DELTA_BIT_EXT }; using VideoEncodeH265StdFlagsEXT = Flags<VideoEncodeH265StdFlagBitsEXT>; @@ -4755,7 +5079,8 @@ namespace VULKAN_HPP_NAMESPACE VideoEncodeH265StdFlagBitsEXT::ePpsSliceChromaQpOffsetsPresentFlagSet | VideoEncodeH265StdFlagBitsEXT::eTransquantBypassEnabledFlagSet | VideoEncodeH265StdFlagBitsEXT::eConstrainedIntraPredFlagSet | VideoEncodeH265StdFlagBitsEXT::eEntropyCodingSyncEnabledFlagSet | VideoEncodeH265StdFlagBitsEXT::eDeblockingFilterOverrideEnabledFlagSet | VideoEncodeH265StdFlagBitsEXT::eDependentSliceSegmentsEnabledFlagSet | - VideoEncodeH265StdFlagBitsEXT::eDependentSliceSegmentFlagSet; + VideoEncodeH265StdFlagBitsEXT::eDependentSliceSegmentFlagSet | VideoEncodeH265StdFlagBitsEXT::eSliceQpDelta | + VideoEncodeH265StdFlagBitsEXT::eDifferentSliceQpDelta; }; enum class VideoEncodeH265CtbSizeFlagBitsEXT : VkVideoEncodeH265CtbSizeFlagsEXT @@ -5896,29 +6221,13 @@ namespace VULKAN_HPP_NAMESPACE static VULKAN_HPP_CONST_OR_CONSTEXPR DeviceMemoryReportFlagsEXT allFlags = {}; }; - //=== VK_EXT_pipeline_creation_cache_control === - - enum class PipelineCacheCreateFlagBits : VkPipelineCacheCreateFlags - { - eExternallySynchronized = VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, - eExternallySynchronizedEXT = VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT - }; - - using PipelineCacheCreateFlags = Flags<PipelineCacheCreateFlagBits>; - - template <> - struct FlagTraits<PipelineCacheCreateFlagBits> - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR PipelineCacheCreateFlags allFlags = PipelineCacheCreateFlagBits::eExternallySynchronized; - }; - #if defined( VK_ENABLE_BETA_EXTENSIONS ) //=== VK_KHR_video_encode_queue === enum class VideoEncodeCapabilityFlagBitsKHR : VkVideoEncodeCapabilityFlagsKHR { - ePrecedingExternallyEncodedBytes = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR + ePrecedingExternallyEncodedBytes = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR, + eInsufficientstreamBufferRangeDetectionBit = VK_VIDEO_ENCODE_CAPABILITY_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_DETECTION_BIT_KHR }; using VideoEncodeCapabilityFlagsKHR = Flags<VideoEncodeCapabilityFlagBitsKHR>; @@ -5927,7 +6236,8 @@ namespace VULKAN_HPP_NAMESPACE struct FlagTraits<VideoEncodeCapabilityFlagBitsKHR> { static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR VideoEncodeCapabilityFlagsKHR allFlags = VideoEncodeCapabilityFlagBitsKHR::ePrecedingExternallyEncodedBytes; + static VULKAN_HPP_CONST_OR_CONSTEXPR VideoEncodeCapabilityFlagsKHR allFlags = + VideoEncodeCapabilityFlagBitsKHR::ePrecedingExternallyEncodedBytes | VideoEncodeCapabilityFlagBitsKHR::eInsufficientstreamBufferRangeDetectionBit; }; enum class VideoEncodeFeedbackFlagBitsKHR : VkVideoEncodeFeedbackFlagsKHR @@ -6109,20 +6419,6 @@ namespace VULKAN_HPP_NAMESPACE GraphicsPipelineLibraryFlagBitsEXT::eFragmentShader | GraphicsPipelineLibraryFlagBitsEXT::eFragmentOutputInterface; }; - enum class PipelineLayoutCreateFlagBits : VkPipelineLayoutCreateFlags - { - eIndependentSetsEXT = VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT - }; - - using PipelineLayoutCreateFlags = Flags<PipelineLayoutCreateFlagBits>; - - template <> - struct FlagTraits<PipelineLayoutCreateFlagBits> - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR PipelineLayoutCreateFlags allFlags = PipelineLayoutCreateFlagBits::eIndependentSetsEXT; - }; - //=== VK_NV_fragment_shading_rate_enums === enum class FragmentShadingRateNV @@ -6345,6 +6641,22 @@ namespace VULKAN_HPP_NAMESPACE }; #endif /*VK_USE_PLATFORM_FUCHSIA*/ + //=== VK_EXT_frame_boundary === + + enum class FrameBoundaryFlagBitsEXT : VkFrameBoundaryFlagsEXT + { + eFrameEnd = VK_FRAME_BOUNDARY_FRAME_END_BIT_EXT + }; + + using FrameBoundaryFlagsEXT = Flags<FrameBoundaryFlagBitsEXT>; + + template <> + struct FlagTraits<FrameBoundaryFlagBitsEXT> + { + static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; + static VULKAN_HPP_CONST_OR_CONSTEXPR FrameBoundaryFlagsEXT allFlags = FrameBoundaryFlagBitsEXT::eFrameEnd; + }; + #if defined( VK_USE_PLATFORM_SCREEN_QNX ) //=== VK_QNX_screen_surface === @@ -6498,43 +6810,6 @@ namespace VULKAN_HPP_NAMESPACE static VULKAN_HPP_CONST_OR_CONSTEXPR DirectDriverLoadingFlagsLUNARG allFlags = {}; }; - //=== VK_EXT_rasterization_order_attachment_access === - - enum class PipelineColorBlendStateCreateFlagBits : VkPipelineColorBlendStateCreateFlags - { - eRasterizationOrderAttachmentAccessARM = VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_ARM, - eRasterizationOrderAttachmentAccessEXT = VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT - }; - - using PipelineColorBlendStateCreateFlags = Flags<PipelineColorBlendStateCreateFlagBits>; - - template <> - struct FlagTraits<PipelineColorBlendStateCreateFlagBits> - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR PipelineColorBlendStateCreateFlags allFlags = - PipelineColorBlendStateCreateFlagBits::eRasterizationOrderAttachmentAccessEXT; - }; - - enum class PipelineDepthStencilStateCreateFlagBits : VkPipelineDepthStencilStateCreateFlags - { - eRasterizationOrderAttachmentDepthAccessARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM, - eRasterizationOrderAttachmentStencilAccessARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM, - eRasterizationOrderAttachmentDepthAccessEXT = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT, - eRasterizationOrderAttachmentStencilAccessEXT = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT - }; - - using PipelineDepthStencilStateCreateFlags = Flags<PipelineDepthStencilStateCreateFlagBits>; - - template <> - struct FlagTraits<PipelineDepthStencilStateCreateFlagBits> - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool isBitmask = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR PipelineDepthStencilStateCreateFlags allFlags = - PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentDepthAccessEXT | - PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentStencilAccessEXT; - }; - //=== VK_NV_optical_flow === enum class OpticalFlowUsageFlagBitsNV : VkOpticalFlowUsageFlagsNV @@ -6793,6 +7068,30 @@ namespace VULKAN_HPP_NAMESPACE eReorder = VK_RAY_TRACING_INVOCATION_REORDER_MODE_REORDER_NV }; + //=== VK_NV_low_latency2 === + + enum class LatencyMarkerNV + { + eSimulationStart = VK_LATENCY_MARKER_SIMULATION_START_NV, + eSimulationEnd = VK_LATENCY_MARKER_SIMULATION_END_NV, + eRendersubmitStart = VK_LATENCY_MARKER_RENDERSUBMIT_START_NV, + eRendersubmitEnd = VK_LATENCY_MARKER_RENDERSUBMIT_END_NV, + ePresentStart = VK_LATENCY_MARKER_PRESENT_START_NV, + ePresentEnd = VK_LATENCY_MARKER_PRESENT_END_NV, + eInputSample = VK_LATENCY_MARKER_INPUT_SAMPLE_NV, + eTriggerFlash = VK_LATENCY_MARKER_TRIGGER_FLASH_NV, + eOutOfBandRendersubmitStart = VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_START_NV, + eOutOfBandRendersubmitEnd = VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_END_NV, + eOutOfBandPresentStart = VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_START_NV, + eOutOfBandPresentEnd = VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_END_NV + }; + + enum class OutOfBandQueueTypeNV + { + eRender = VK_OUT_OF_BAND_QUEUE_TYPE_RENDER_NV, + ePresent = VK_OUT_OF_BAND_QUEUE_TYPE_PRESENT_NV + }; + //=== VK_KHR_cooperative_matrix === enum class ScopeKHR @@ -6820,6 +7119,32 @@ namespace VULKAN_HPP_NAMESPACE }; using ComponentTypeNV = ComponentTypeKHR; + //=== VK_QCOM_image_processing2 === + + enum class BlockMatchWindowCompareModeQCOM + { + eMin = VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MIN_QCOM, + eMax = VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_QCOM + }; + + //=== VK_QCOM_filter_cubic_weights === + + enum class CubicFilterWeightsQCOM + { + eCatmullRom = VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM, + eZeroTangentCardinal = VK_CUBIC_FILTER_WEIGHTS_ZERO_TANGENT_CARDINAL_QCOM, + eBSpline = VK_CUBIC_FILTER_WEIGHTS_B_SPLINE_QCOM, + eMitchellNetravali = VK_CUBIC_FILTER_WEIGHTS_MITCHELL_NETRAVALI_QCOM + }; + + //=== VK_MSFT_layered_driver === + + enum class LayeredDriverUnderlyingApiMSFT + { + eNone = VK_LAYERED_DRIVER_UNDERLYING_API_NONE_MSFT, + eD3D12 = VK_LAYERED_DRIVER_UNDERLYING_API_D3D12_MSFT + }; + //========================= //=== Index Type Traits === //========================= @@ -6865,5 +7190,124 @@ namespace VULKAN_HPP_NAMESPACE using Type = uint8_t; }; + //=========================================================== + //=== Mapping from ObjectType to DebugReportObjectTypeEXT === + //=========================================================== + + VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType( VULKAN_HPP_NAMESPACE::ObjectType objectType ) + { + switch ( objectType ) + { + //=== VK_VERSION_1_0 === + case VULKAN_HPP_NAMESPACE::ObjectType::eInstance: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eInstance; + case VULKAN_HPP_NAMESPACE::ObjectType::ePhysicalDevice: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePhysicalDevice; + case VULKAN_HPP_NAMESPACE::ObjectType::eDevice: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDevice; + case VULKAN_HPP_NAMESPACE::ObjectType::eQueue: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eQueue; + case VULKAN_HPP_NAMESPACE::ObjectType::eDeviceMemory: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDeviceMemory; + case VULKAN_HPP_NAMESPACE::ObjectType::eFence: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eFence; + case VULKAN_HPP_NAMESPACE::ObjectType::eSemaphore: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSemaphore; + case VULKAN_HPP_NAMESPACE::ObjectType::eEvent: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eEvent; + case VULKAN_HPP_NAMESPACE::ObjectType::eQueryPool: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eQueryPool; + case VULKAN_HPP_NAMESPACE::ObjectType::eBuffer: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eBuffer; + case VULKAN_HPP_NAMESPACE::ObjectType::eBufferView: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eBufferView; + case VULKAN_HPP_NAMESPACE::ObjectType::eImage: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eImage; + case VULKAN_HPP_NAMESPACE::ObjectType::eImageView: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eImageView; + case VULKAN_HPP_NAMESPACE::ObjectType::eShaderModule: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eShaderModule; + case VULKAN_HPP_NAMESPACE::ObjectType::ePipelineCache: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePipelineCache; + case VULKAN_HPP_NAMESPACE::ObjectType::ePipeline: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePipeline; + case VULKAN_HPP_NAMESPACE::ObjectType::ePipelineLayout: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePipelineLayout; + case VULKAN_HPP_NAMESPACE::ObjectType::eSampler: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSampler; + case VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorPool: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorPool; + case VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorSet: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorSet; + case VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorSetLayout: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorSetLayout; + case VULKAN_HPP_NAMESPACE::ObjectType::eFramebuffer: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eFramebuffer; + case VULKAN_HPP_NAMESPACE::ObjectType::eRenderPass: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eRenderPass; + case VULKAN_HPP_NAMESPACE::ObjectType::eCommandPool: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCommandPool; + case VULKAN_HPP_NAMESPACE::ObjectType::eCommandBuffer: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCommandBuffer; + + //=== VK_VERSION_1_1 === + case VULKAN_HPP_NAMESPACE::ObjectType::eSamplerYcbcrConversion: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSamplerYcbcrConversion; + case VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorUpdateTemplate: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorUpdateTemplate; + + //=== VK_VERSION_1_3 === + case VULKAN_HPP_NAMESPACE::ObjectType::ePrivateDataSlot: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; + + //=== VK_KHR_surface === + case VULKAN_HPP_NAMESPACE::ObjectType::eSurfaceKHR: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSurfaceKHR; + + //=== VK_KHR_swapchain === + case VULKAN_HPP_NAMESPACE::ObjectType::eSwapchainKHR: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSwapchainKHR; + + //=== VK_KHR_display === + case VULKAN_HPP_NAMESPACE::ObjectType::eDisplayKHR: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDisplayKHR; + case VULKAN_HPP_NAMESPACE::ObjectType::eDisplayModeKHR: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDisplayModeKHR; + + //=== VK_EXT_debug_report === + case VULKAN_HPP_NAMESPACE::ObjectType::eDebugReportCallbackEXT: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDebugReportCallbackEXT; + + //=== VK_KHR_video_queue === + case VULKAN_HPP_NAMESPACE::ObjectType::eVideoSessionKHR: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; + case VULKAN_HPP_NAMESPACE::ObjectType::eVideoSessionParametersKHR: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; + + //=== VK_NVX_binary_import === + case VULKAN_HPP_NAMESPACE::ObjectType::eCuModuleNVX: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCuModuleNVX; + case VULKAN_HPP_NAMESPACE::ObjectType::eCuFunctionNVX: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCuFunctionNVX; + + //=== VK_EXT_debug_utils === + case VULKAN_HPP_NAMESPACE::ObjectType::eDebugUtilsMessengerEXT: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; + + //=== VK_KHR_acceleration_structure === + case VULKAN_HPP_NAMESPACE::ObjectType::eAccelerationStructureKHR: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eAccelerationStructureKHR; + + //=== VK_EXT_validation_cache === + case VULKAN_HPP_NAMESPACE::ObjectType::eValidationCacheEXT: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eValidationCacheEXT; + + //=== VK_NV_ray_tracing === + case VULKAN_HPP_NAMESPACE::ObjectType::eAccelerationStructureNV: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eAccelerationStructureNV; + + //=== VK_INTEL_performance_query === + case VULKAN_HPP_NAMESPACE::ObjectType::ePerformanceConfigurationINTEL: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; + + //=== VK_KHR_deferred_host_operations === + case VULKAN_HPP_NAMESPACE::ObjectType::eDeferredOperationKHR: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; + + //=== VK_NV_device_generated_commands === + case VULKAN_HPP_NAMESPACE::ObjectType::eIndirectCommandsLayoutNV: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; + +#if defined( VK_USE_PLATFORM_FUCHSIA ) + //=== VK_FUCHSIA_buffer_collection === + case VULKAN_HPP_NAMESPACE::ObjectType::eBufferCollectionFUCHSIA: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eBufferCollectionFUCHSIA; +#endif /*VK_USE_PLATFORM_FUCHSIA*/ + + //=== VK_EXT_opacity_micromap === + case VULKAN_HPP_NAMESPACE::ObjectType::eMicromapEXT: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; + + //=== VK_NV_optical_flow === + case VULKAN_HPP_NAMESPACE::ObjectType::eOpticalFlowSessionNV: + return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; + + //=== VK_EXT_shader_object === + case VULKAN_HPP_NAMESPACE::ObjectType::eShaderEXT: return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; + + default: VULKAN_HPP_ASSERT( false && "unknown ObjectType" ); return VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; + } + } + } // namespace VULKAN_HPP_NAMESPACE #endif diff --git a/thirdparty/vulkan/include/vulkan/vulkan_extension_inspection.hpp b/thirdparty/vulkan/include/vulkan/vulkan_extension_inspection.hpp index 548a32fc27..d010468e08 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_extension_inspection.hpp +++ b/thirdparty/vulkan/include/vulkan/vulkan_extension_inspection.hpp @@ -343,6 +343,7 @@ namespace VULKAN_HPP_NAMESPACE "VK_HUAWEI_invocation_mask", "VK_NV_external_memory_rdma", "VK_EXT_pipeline_properties", +"VK_EXT_frame_boundary", "VK_EXT_multisampled_render_to_single_sampled", "VK_EXT_extended_dynamic_state2", "VK_EXT_color_write_enable", @@ -374,6 +375,7 @@ namespace VULKAN_HPP_NAMESPACE "VK_NV_linear_color_attachment", "VK_EXT_image_compression_control_swapchain", "VK_QCOM_image_processing", +"VK_EXT_nested_command_buffer", "VK_EXT_external_memory_acquire_unmodified", "VK_EXT_extended_dynamic_state3", "VK_EXT_subpass_merge_feedback", @@ -381,7 +383,10 @@ namespace VULKAN_HPP_NAMESPACE "VK_EXT_rasterization_order_attachment_access", "VK_NV_optical_flow", "VK_EXT_legacy_dithering", -"VK_EXT_pipeline_protected_access", +"VK_EXT_pipeline_protected_access", +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) +"VK_ANDROID_external_format_resolve", +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ "VK_KHR_maintenance5", "VK_KHR_ray_tracing_position_fetch", "VK_EXT_shader_object", @@ -389,17 +394,24 @@ namespace VULKAN_HPP_NAMESPACE "VK_SEC_amigo_profiling", "VK_QCOM_multiview_per_view_viewports", "VK_NV_ray_tracing_invocation_reorder", +"VK_NV_extended_sparse_address_space", "VK_EXT_mutable_descriptor_type", "VK_ARM_shader_core_builtins", "VK_EXT_pipeline_library_group_handles", "VK_EXT_dynamic_rendering_unused_attachments", +"VK_NV_low_latency2", "VK_KHR_cooperative_matrix", "VK_QCOM_multiview_per_view_render_areas", +"VK_QCOM_image_processing2", +"VK_QCOM_filter_cubic_weights", +"VK_QCOM_ycbcr_degamma", +"VK_QCOM_filter_cubic_clamp", "VK_EXT_attachment_feedback_loop_dynamic_state", #if defined( VK_USE_PLATFORM_SCREEN_QNX ) -"VK_QNX_external_memory_screen_buffer" +"VK_QNX_external_memory_screen_buffer", #endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - }; +"VK_MSFT_layered_driver", +"VK_NV_descriptor_pool_overallocation" }; return deviceExtensions; } @@ -773,6 +785,7 @@ namespace VULKAN_HPP_NAMESPACE { "VK_GOOGLE_surfaceless_query", { { "VK_VERSION_1_0", { { "VK_KHR_surface", } } } } }, { "VK_EXT_image_compression_control_swapchain", { { "VK_VERSION_1_0", { { "VK_EXT_image_compression_control", } } } } }, { "VK_QCOM_image_processing", { { "VK_VERSION_1_0", { { "VK_KHR_format_feature_flags2", } } } } }, +{ "VK_EXT_nested_command_buffer", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", } } } } }, { "VK_EXT_external_memory_acquire_unmodified", { { "VK_VERSION_1_0", { { "VK_KHR_external_memory", } } } } }, { "VK_EXT_extended_dynamic_state3", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", } } } } }, { "VK_EXT_subpass_merge_feedback", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", } } } } }, @@ -780,7 +793,10 @@ namespace VULKAN_HPP_NAMESPACE { "VK_EXT_rasterization_order_attachment_access", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", } } } } }, { "VK_NV_optical_flow", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", "VK_KHR_format_feature_flags2", "VK_KHR_synchronization2", } } } } }, { "VK_EXT_legacy_dithering", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", } } } } }, -{ "VK_EXT_pipeline_protected_access", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", } } } } }, +{ "VK_EXT_pipeline_protected_access", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", } } } } }, +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) +{ "VK_ANDROID_external_format_resolve", { { "VK_VERSION_1_0", { { "VK_ANDROID_external_memory_android_hardware_buffer", } } } } }, +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ { "VK_KHR_maintenance5", { { "VK_VERSION_1_1", { { "VK_KHR_dynamic_rendering", } } } } }, { "VK_KHR_ray_tracing_position_fetch", { { "VK_VERSION_1_0", { { "VK_KHR_acceleration_structure", } } } } }, { "VK_EXT_shader_object", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", "VK_KHR_dynamic_rendering", } } }, { "VK_VERSION_1_1", { { "VK_KHR_dynamic_rendering", } } }, { "VK_VERSION_1_3", { { } } } } }, @@ -793,11 +809,15 @@ namespace VULKAN_HPP_NAMESPACE { "VK_EXT_pipeline_library_group_handles", { { "VK_VERSION_1_0", { { "VK_KHR_ray_tracing_pipeline", "VK_KHR_pipeline_library", } } } } }, { "VK_EXT_dynamic_rendering_unused_attachments", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", "VK_KHR_dynamic_rendering", } } }, { "VK_VERSION_1_1", { { "VK_KHR_dynamic_rendering", } } }, { "VK_VERSION_1_3", { { } } } } }, { "VK_KHR_cooperative_matrix", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", } } } } }, +{ "VK_QCOM_image_processing2", { { "VK_VERSION_1_0", { { "VK_QCOM_image_processing", } } } } }, +{ "VK_QCOM_filter_cubic_weights", { { "VK_VERSION_1_0", { { "VK_EXT_filter_cubic", } } } } }, +{ "VK_QCOM_filter_cubic_clamp", { { "VK_VERSION_1_0", { { "VK_EXT_filter_cubic", "VK_EXT_sampler_filter_minmax", } } }, { "VK_VERSION_1_2", { { "VK_EXT_filter_cubic", } } } } }, { "VK_EXT_attachment_feedback_loop_dynamic_state", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", "VK_EXT_attachment_feedback_loop_layout", } } } } }, #if defined( VK_USE_PLATFORM_SCREEN_QNX ) -{ "VK_QNX_external_memory_screen_buffer", { { "VK_VERSION_1_0", { { "VK_KHR_sampler_ycbcr_conversion", "VK_KHR_external_memory", "VK_KHR_dedicated_allocation", } } }, { "VK_VERSION_1_1", { { "VK_EXT_queue_family_foreign", } } } } } +{ "VK_QNX_external_memory_screen_buffer", { { "VK_VERSION_1_0", { { "VK_KHR_sampler_ycbcr_conversion", "VK_KHR_external_memory", "VK_KHR_dedicated_allocation", } } }, { "VK_VERSION_1_1", { { "VK_EXT_queue_family_foreign", } } } } }, #endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - }; +{ "VK_MSFT_layered_driver", { { "VK_VERSION_1_0", { { "VK_KHR_get_physical_device_properties2", } } } } }, +{ "VK_NV_descriptor_pool_overallocation", { { "VK_VERSION_1_1", { { } } } } } }; auto depIt = dependencies.find( extension ); return ( depIt != dependencies.end() ) ? depIt->second : noDependencies; } @@ -1486,11 +1506,12 @@ namespace VULKAN_HPP_NAMESPACE ( extension == "VK_FUCHSIA_buffer_collection" ) #endif /*VK_USE_PLATFORM_FUCHSIA*/ || ( extension == "VK_HUAWEI_subpass_shading" ) || ( extension == "VK_HUAWEI_invocation_mask" ) || ( extension == "VK_NV_external_memory_rdma" ) || - ( extension == "VK_EXT_pipeline_properties" ) || ( extension == "VK_EXT_multisampled_render_to_single_sampled" ) || - ( extension == "VK_EXT_extended_dynamic_state2" ) || ( extension == "VK_EXT_color_write_enable" ) || - ( extension == "VK_EXT_primitives_generated_query" ) || ( extension == "VK_KHR_ray_tracing_maintenance1" ) || - ( extension == "VK_EXT_global_priority_query" ) || ( extension == "VK_EXT_image_view_min_lod" ) || ( extension == "VK_EXT_multi_draw" ) || - ( extension == "VK_EXT_image_2d_view_of_3d" ) || ( extension == "VK_EXT_shader_tile_image" ) || ( extension == "VK_EXT_opacity_micromap" ) + ( extension == "VK_EXT_pipeline_properties" ) || ( extension == "VK_EXT_frame_boundary" ) || + ( extension == "VK_EXT_multisampled_render_to_single_sampled" ) || ( extension == "VK_EXT_extended_dynamic_state2" ) || + ( extension == "VK_EXT_color_write_enable" ) || ( extension == "VK_EXT_primitives_generated_query" ) || + ( extension == "VK_KHR_ray_tracing_maintenance1" ) || ( extension == "VK_EXT_global_priority_query" ) || + ( extension == "VK_EXT_image_view_min_lod" ) || ( extension == "VK_EXT_multi_draw" ) || ( extension == "VK_EXT_image_2d_view_of_3d" ) || + ( extension == "VK_EXT_shader_tile_image" ) || ( extension == "VK_EXT_opacity_micromap" ) #if defined( VK_ENABLE_BETA_EXTENSIONS ) || ( extension == "VK_NV_displacement_micromap" ) #endif /*VK_ENABLE_BETA_EXTENSIONS*/ @@ -1502,20 +1523,26 @@ namespace VULKAN_HPP_NAMESPACE ( extension == "VK_NV_copy_memory_indirect" ) || ( extension == "VK_NV_memory_decompression" ) || ( extension == "VK_NV_device_generated_commands_compute" ) || ( extension == "VK_NV_linear_color_attachment" ) || ( extension == "VK_EXT_image_compression_control_swapchain" ) || ( extension == "VK_QCOM_image_processing" ) || - ( extension == "VK_EXT_external_memory_acquire_unmodified" ) || ( extension == "VK_EXT_extended_dynamic_state3" ) || - ( extension == "VK_EXT_subpass_merge_feedback" ) || ( extension == "VK_EXT_shader_module_identifier" ) || - ( extension == "VK_EXT_rasterization_order_attachment_access" ) || ( extension == "VK_NV_optical_flow" ) || - ( extension == "VK_EXT_legacy_dithering" ) || ( extension == "VK_EXT_pipeline_protected_access" ) || ( extension == "VK_KHR_maintenance5" ) || - ( extension == "VK_KHR_ray_tracing_position_fetch" ) || ( extension == "VK_EXT_shader_object" ) || ( extension == "VK_QCOM_tile_properties" ) || - ( extension == "VK_SEC_amigo_profiling" ) || ( extension == "VK_QCOM_multiview_per_view_viewports" ) || - ( extension == "VK_NV_ray_tracing_invocation_reorder" ) || ( extension == "VK_EXT_mutable_descriptor_type" ) || - ( extension == "VK_ARM_shader_core_builtins" ) || ( extension == "VK_EXT_pipeline_library_group_handles" ) || - ( extension == "VK_EXT_dynamic_rendering_unused_attachments" ) || ( extension == "VK_KHR_cooperative_matrix" ) || - ( extension == "VK_QCOM_multiview_per_view_render_areas" ) || ( extension == "VK_EXT_attachment_feedback_loop_dynamic_state" ) + ( extension == "VK_EXT_nested_command_buffer" ) || ( extension == "VK_EXT_external_memory_acquire_unmodified" ) || + ( extension == "VK_EXT_extended_dynamic_state3" ) || ( extension == "VK_EXT_subpass_merge_feedback" ) || + ( extension == "VK_EXT_shader_module_identifier" ) || ( extension == "VK_EXT_rasterization_order_attachment_access" ) || + ( extension == "VK_NV_optical_flow" ) || ( extension == "VK_EXT_legacy_dithering" ) || ( extension == "VK_EXT_pipeline_protected_access" ) +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) + || ( extension == "VK_ANDROID_external_format_resolve" ) +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + || ( extension == "VK_KHR_maintenance5" ) || ( extension == "VK_KHR_ray_tracing_position_fetch" ) || ( extension == "VK_EXT_shader_object" ) || + ( extension == "VK_QCOM_tile_properties" ) || ( extension == "VK_SEC_amigo_profiling" ) || ( extension == "VK_QCOM_multiview_per_view_viewports" ) || + ( extension == "VK_NV_ray_tracing_invocation_reorder" ) || ( extension == "VK_NV_extended_sparse_address_space" ) || + ( extension == "VK_EXT_mutable_descriptor_type" ) || ( extension == "VK_ARM_shader_core_builtins" ) || + ( extension == "VK_EXT_pipeline_library_group_handles" ) || ( extension == "VK_EXT_dynamic_rendering_unused_attachments" ) || + ( extension == "VK_NV_low_latency2" ) || ( extension == "VK_KHR_cooperative_matrix" ) || + ( extension == "VK_QCOM_multiview_per_view_render_areas" ) || ( extension == "VK_QCOM_image_processing2" ) || + ( extension == "VK_QCOM_filter_cubic_weights" ) || ( extension == "VK_QCOM_ycbcr_degamma" ) || ( extension == "VK_QCOM_filter_cubic_clamp" ) || + ( extension == "VK_EXT_attachment_feedback_loop_dynamic_state" ) #if defined( VK_USE_PLATFORM_SCREEN_QNX ) || ( extension == "VK_QNX_external_memory_screen_buffer" ) #endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - ; + || ( extension == "VK_MSFT_layered_driver" ) || ( extension == "VK_NV_descriptor_pool_overallocation" ); } VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_20 bool isInstanceExtension( std::string const & extension ) diff --git a/thirdparty/vulkan/include/vulkan/vulkan_funcs.hpp b/thirdparty/vulkan/include/vulkan/vulkan_funcs.hpp index 1ab87369d8..32715f8ddc 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_funcs.hpp +++ b/thirdparty/vulkan/include/vulkan/vulkan_funcs.hpp @@ -19495,6 +19495,17 @@ namespace VULKAN_HPP_NAMESPACE } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch> + VULKAN_HPP_INLINE void Device::getDescriptorEXT( const VULKAN_HPP_NAMESPACE::DescriptorGetInfoEXT & descriptorInfo, + size_t dataSize, + void * pDescriptor, + Dispatch const & d ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); + + d.vkGetDescriptorEXT( m_device, reinterpret_cast<const VkDescriptorGetInfoEXT *>( &descriptorInfo ), dataSize, pDescriptor ); + } + template <typename DescriptorType, typename Dispatch> VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE DescriptorType Device::getDescriptorEXT( const VULKAN_HPP_NAMESPACE::DescriptorGetInfoEXT & descriptorInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT @@ -22786,6 +22797,126 @@ namespace VULKAN_HPP_NAMESPACE } #endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + //=== VK_NV_low_latency2 === + + template <typename Dispatch> + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::setLatencySleepModeNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + const VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV * pSleepModeInfo, + Dispatch const & d ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); + return static_cast<Result>( + d.vkSetLatencySleepModeNV( m_device, static_cast<VkSwapchainKHR>( swapchain ), reinterpret_cast<const VkLatencySleepModeInfoNV *>( pSleepModeInfo ) ) ); + } + +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch> + VULKAN_HPP_INLINE typename ResultValueType<void>::type Device::setLatencySleepModeNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + const VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV & sleepModeInfo, + Dispatch const & d ) const + { + VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); + + VkResult result = + d.vkSetLatencySleepModeNV( m_device, static_cast<VkSwapchainKHR>( swapchain ), reinterpret_cast<const VkLatencySleepModeInfoNV *>( &sleepModeInfo ) ); + resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setLatencySleepModeNV" ); + + return createResultValueType( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ) ); + } +#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + + template <typename Dispatch> + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::latencySleepNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + const VULKAN_HPP_NAMESPACE::LatencySleepInfoNV * pSleepInfo, + Dispatch const & d ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); + return static_cast<Result>( + d.vkLatencySleepNV( m_device, static_cast<VkSwapchainKHR>( swapchain ), reinterpret_cast<const VkLatencySleepInfoNV *>( pSleepInfo ) ) ); + } + +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch> + VULKAN_HPP_INLINE typename ResultValueType<void>::type + Device::latencySleepNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, const VULKAN_HPP_NAMESPACE::LatencySleepInfoNV & sleepInfo, Dispatch const & d ) const + { + VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); + + VkResult result = d.vkLatencySleepNV( m_device, static_cast<VkSwapchainKHR>( swapchain ), reinterpret_cast<const VkLatencySleepInfoNV *>( &sleepInfo ) ); + resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::latencySleepNV" ); + + return createResultValueType( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ) ); + } +#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + + template <typename Dispatch> + VULKAN_HPP_INLINE void Device::setLatencyMarkerNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + const VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV * pLatencyMarkerInfo, + Dispatch const & d ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); + d.vkSetLatencyMarkerNV( m_device, static_cast<VkSwapchainKHR>( swapchain ), reinterpret_cast<const VkSetLatencyMarkerInfoNV *>( pLatencyMarkerInfo ) ); + } + +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch> + VULKAN_HPP_INLINE void Device::setLatencyMarkerNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + const VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV & latencyMarkerInfo, + Dispatch const & d ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); + + d.vkSetLatencyMarkerNV( m_device, static_cast<VkSwapchainKHR>( swapchain ), reinterpret_cast<const VkSetLatencyMarkerInfoNV *>( &latencyMarkerInfo ) ); + } +#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + + template <typename Dispatch> + VULKAN_HPP_INLINE void Device::getLatencyTimingsNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + uint32_t * pTimingCount, + VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV * pLatencyMarkerInfo, + Dispatch const & d ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); + d.vkGetLatencyTimingsNV( + m_device, static_cast<VkSwapchainKHR>( swapchain ), pTimingCount, reinterpret_cast<VkGetLatencyMarkerInfoNV *>( pLatencyMarkerInfo ) ); + } + +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch> + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::pair<uint32_t, VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV> + Device::getLatencyTimingsNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); + + std::pair<uint32_t, VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV> data_; + uint32_t & timingCount = data_.first; + VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV & latencyMarkerInfo = data_.second; + d.vkGetLatencyTimingsNV( + m_device, static_cast<VkSwapchainKHR>( swapchain ), &timingCount, reinterpret_cast<VkGetLatencyMarkerInfoNV *>( &latencyMarkerInfo ) ); + + return data_; + } +#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + + template <typename Dispatch> + VULKAN_HPP_INLINE void Queue::notifyOutOfBandNV( const VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV * pQueueTypeInfo, + Dispatch const & d ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); + d.vkQueueNotifyOutOfBandNV( m_queue, reinterpret_cast<const VkOutOfBandQueueTypeInfoNV *>( pQueueTypeInfo ) ); + } + +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch> + VULKAN_HPP_INLINE void Queue::notifyOutOfBandNV( const VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV & queueTypeInfo, + Dispatch const & d ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); + + d.vkQueueNotifyOutOfBandNV( m_queue, reinterpret_cast<const VkOutOfBandQueueTypeInfoNV *>( &queueTypeInfo ) ); + } +#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + //=== VK_KHR_cooperative_matrix === template <typename Dispatch> diff --git a/thirdparty/vulkan/include/vulkan/vulkan_handles.hpp b/thirdparty/vulkan/include/vulkan/vulkan_handles.hpp index 9e7304f90a..332561680f 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_handles.hpp +++ b/thirdparty/vulkan/include/vulkan/vulkan_handles.hpp @@ -1438,6 +1438,10 @@ namespace VULKAN_HPP_NAMESPACE struct PipelinePropertiesIdentifierEXT; struct PhysicalDevicePipelinePropertiesFeaturesEXT; + //=== VK_EXT_frame_boundary === + struct PhysicalDeviceFrameBoundaryFeaturesEXT; + struct FrameBoundaryEXT; + //=== VK_EXT_multisampled_render_to_single_sampled === struct PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT; struct SubpassResolvePerformanceQueryEXT; @@ -1562,6 +1566,10 @@ namespace VULKAN_HPP_NAMESPACE struct PhysicalDeviceImageProcessingFeaturesQCOM; struct PhysicalDeviceImageProcessingPropertiesQCOM; + //=== VK_EXT_nested_command_buffer === + struct PhysicalDeviceNestedCommandBufferFeaturesEXT; + struct PhysicalDeviceNestedCommandBufferPropertiesEXT; + //=== VK_EXT_external_memory_acquire_unmodified === struct ExternalMemoryAcquireUnmodifiedEXT; @@ -1608,6 +1616,13 @@ namespace VULKAN_HPP_NAMESPACE //=== VK_EXT_pipeline_protected_access === struct PhysicalDevicePipelineProtectedAccessFeaturesEXT; +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) + //=== VK_ANDROID_external_format_resolve === + struct PhysicalDeviceExternalFormatResolveFeaturesANDROID; + struct PhysicalDeviceExternalFormatResolvePropertiesANDROID; + struct AndroidHardwareBufferFormatResolvePropertiesANDROID; +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + //=== VK_KHR_maintenance5 === struct PhysicalDeviceMaintenance5FeaturesKHR; struct PhysicalDeviceMaintenance5PropertiesKHR; @@ -1643,6 +1658,10 @@ namespace VULKAN_HPP_NAMESPACE struct PhysicalDeviceRayTracingInvocationReorderPropertiesNV; struct PhysicalDeviceRayTracingInvocationReorderFeaturesNV; + //=== VK_NV_extended_sparse_address_space === + struct PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV; + struct PhysicalDeviceExtendedSparseAddressSpacePropertiesNV; + //=== VK_EXT_mutable_descriptor_type === struct PhysicalDeviceMutableDescriptorTypeFeaturesEXT; using PhysicalDeviceMutableDescriptorTypeFeaturesVALVE = PhysicalDeviceMutableDescriptorTypeFeaturesEXT; @@ -1661,6 +1680,17 @@ namespace VULKAN_HPP_NAMESPACE //=== VK_EXT_dynamic_rendering_unused_attachments === struct PhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT; + //=== VK_NV_low_latency2 === + struct LatencySleepModeInfoNV; + struct LatencySleepInfoNV; + struct SetLatencyMarkerInfoNV; + struct GetLatencyMarkerInfoNV; + struct LatencyTimingsFrameReportNV; + struct LatencySubmissionPresentIdNV; + struct SwapchainLatencyCreateInfoNV; + struct OutOfBandQueueTypeInfoNV; + struct LatencySurfaceCapabilitiesNV; + //=== VK_KHR_cooperative_matrix === struct CooperativeMatrixPropertiesKHR; struct PhysicalDeviceCooperativeMatrixFeaturesKHR; @@ -1670,6 +1700,23 @@ namespace VULKAN_HPP_NAMESPACE struct PhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM; struct MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM; + //=== VK_QCOM_image_processing2 === + struct PhysicalDeviceImageProcessing2FeaturesQCOM; + struct PhysicalDeviceImageProcessing2PropertiesQCOM; + struct SamplerBlockMatchWindowCreateInfoQCOM; + + //=== VK_QCOM_filter_cubic_weights === + struct PhysicalDeviceCubicWeightsFeaturesQCOM; + struct SamplerCubicWeightsCreateInfoQCOM; + struct BlitImageCubicWeightsInfoQCOM; + + //=== VK_QCOM_ycbcr_degamma === + struct PhysicalDeviceYcbcrDegammaFeaturesQCOM; + struct SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM; + + //=== VK_QCOM_filter_cubic_clamp === + struct PhysicalDeviceCubicClampFeaturesQCOM; + //=== VK_EXT_attachment_feedback_loop_dynamic_state === struct PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT; @@ -1682,6 +1729,12 @@ namespace VULKAN_HPP_NAMESPACE struct PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX; #endif /*VK_USE_PLATFORM_SCREEN_QNX*/ + //=== VK_MSFT_layered_driver === + struct PhysicalDeviceLayeredDriverPropertiesMSFT; + + //=== VK_NV_descriptor_pool_overallocation === + struct PhysicalDeviceDescriptorPoolOverallocationFeaturesNV; + //=================================== //=== HANDLE forward declarations === //=================================== @@ -8173,6 +8226,17 @@ namespace VULKAN_HPP_NAMESPACE getCheckpointData2NV( CheckpointData2NVAllocator & checkpointData2NVAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; #endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + //=== VK_NV_low_latency2 === + + template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + void notifyOutOfBandNV( const VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV * pQueueTypeInfo, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + void notifyOutOfBandNV( const VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV & queueTypeInfo, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; +#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + operator VkQueue() const VULKAN_HPP_NOEXCEPT { return m_queue; @@ -12363,6 +12427,11 @@ namespace VULKAN_HPP_NAMESPACE void * pDescriptor, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + void getDescriptorEXT( const VULKAN_HPP_NAMESPACE::DescriptorGetInfoEXT & descriptorInfo, + size_t dataSize, + void * pDescriptor, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; template <typename DescriptorType, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> VULKAN_HPP_NODISCARD DescriptorType getDescriptorEXT( const VULKAN_HPP_NAMESPACE::DescriptorGetInfoEXT & descriptorInfo, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; @@ -13117,6 +13186,53 @@ namespace VULKAN_HPP_NAMESPACE Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; #endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + //=== VK_NV_low_latency2 === + + template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + VULKAN_HPP_NODISCARD Result setLatencySleepModeNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + const VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV * pSleepModeInfo, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + typename ResultValueType<void>::type setLatencySleepModeNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + const VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV & sleepModeInfo, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; +#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + + template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + VULKAN_HPP_NODISCARD Result latencySleepNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + const VULKAN_HPP_NAMESPACE::LatencySleepInfoNV * pSleepInfo, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + typename ResultValueType<void>::type latencySleepNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + const VULKAN_HPP_NAMESPACE::LatencySleepInfoNV & sleepInfo, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; +#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + + template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + void setLatencyMarkerNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + const VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV * pLatencyMarkerInfo, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + void setLatencyMarkerNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + const VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV & latencyMarkerInfo, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; +#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + + template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + void getLatencyTimingsNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + uint32_t * pTimingCount, + VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV * pLatencyMarkerInfo, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + VULKAN_HPP_NODISCARD std::pair<uint32_t, VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV> + getLatencyTimingsNV( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; +#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + #if defined( VK_USE_PLATFORM_SCREEN_QNX ) //=== VK_QNX_external_memory_screen_buffer === diff --git a/thirdparty/vulkan/include/vulkan/vulkan_hash.hpp b/thirdparty/vulkan/include/vulkan/vulkan_hash.hpp index d194824807..fa35d2edcf 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_hash.hpp +++ b/thirdparty/vulkan/include/vulkan/vulkan_hash.hpp @@ -977,6 +977,23 @@ namespace std # if defined( VK_USE_PLATFORM_ANDROID_KHR ) template <> + struct hash<VULKAN_HPP_NAMESPACE::AndroidHardwareBufferFormatResolvePropertiesANDROID> + { + std::size_t + operator()( VULKAN_HPP_NAMESPACE::AndroidHardwareBufferFormatResolvePropertiesANDROID const & androidHardwareBufferFormatResolvePropertiesANDROID ) const + VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatResolvePropertiesANDROID.sType ); + VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatResolvePropertiesANDROID.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatResolvePropertiesANDROID.colorAttachmentFormat ); + return seed; + } + }; +# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + +# if defined( VK_USE_PLATFORM_ANDROID_KHR ) + template <> struct hash<VULKAN_HPP_NAMESPACE::AndroidHardwareBufferPropertiesANDROID> { std::size_t @@ -1556,6 +1573,19 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::BlitImageCubicWeightsInfoQCOM> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::BlitImageCubicWeightsInfoQCOM const & blitImageCubicWeightsInfoQCOM ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, blitImageCubicWeightsInfoQCOM.sType ); + VULKAN_HPP_HASH_COMBINE( seed, blitImageCubicWeightsInfoQCOM.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, blitImageCubicWeightsInfoQCOM.cubicWeights ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::ImageSubresourceLayers> { std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & imageSubresourceLayers ) const VULKAN_HPP_NOEXCEPT @@ -4888,6 +4918,27 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::FrameBoundaryEXT> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::FrameBoundaryEXT const & frameBoundaryEXT ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, frameBoundaryEXT.sType ); + VULKAN_HPP_HASH_COMBINE( seed, frameBoundaryEXT.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, frameBoundaryEXT.flags ); + VULKAN_HPP_HASH_COMBINE( seed, frameBoundaryEXT.frameID ); + VULKAN_HPP_HASH_COMBINE( seed, frameBoundaryEXT.imageCount ); + VULKAN_HPP_HASH_COMBINE( seed, frameBoundaryEXT.pImages ); + VULKAN_HPP_HASH_COMBINE( seed, frameBoundaryEXT.bufferCount ); + VULKAN_HPP_HASH_COMBINE( seed, frameBoundaryEXT.pBuffers ); + VULKAN_HPP_HASH_COMBINE( seed, frameBoundaryEXT.tagName ); + VULKAN_HPP_HASH_COMBINE( seed, frameBoundaryEXT.tagSize ); + VULKAN_HPP_HASH_COMBINE( seed, frameBoundaryEXT.pTag ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::FramebufferAttachmentImageInfo> { std::size_t operator()( VULKAN_HPP_NAMESPACE::FramebufferAttachmentImageInfo const & framebufferAttachmentImageInfo ) const VULKAN_HPP_NOEXCEPT @@ -5010,6 +5061,45 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::LatencyTimingsFrameReportNV> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::LatencyTimingsFrameReportNV const & latencyTimingsFrameReportNV ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.presentID ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.inputSampleTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.simStartTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.simEndTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.renderSubmitStartTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.renderSubmitEndTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.presentStartTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.presentEndTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.driverStartTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.driverEndTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.osRenderQueueStartTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.osRenderQueueEndTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.gpuRenderStartTimeUs ); + VULKAN_HPP_HASH_COMBINE( seed, latencyTimingsFrameReportNV.gpuRenderEndTimeUs ); + return seed; + } + }; + + template <> + struct hash<VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV const & getLatencyMarkerInfoNV ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, getLatencyMarkerInfoNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, getLatencyMarkerInfoNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, getLatencyMarkerInfoNV.pTimings ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::VertexInputBindingDescription> { std::size_t operator()( VULKAN_HPP_NAMESPACE::VertexInputBindingDescription const & vertexInputBindingDescription ) const VULKAN_HPP_NOEXCEPT @@ -6238,6 +6328,62 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::LatencySleepInfoNV> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::LatencySleepInfoNV const & latencySleepInfoNV ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, latencySleepInfoNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, latencySleepInfoNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, latencySleepInfoNV.signalSemaphore ); + VULKAN_HPP_HASH_COMBINE( seed, latencySleepInfoNV.value ); + return seed; + } + }; + + template <> + struct hash<VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV const & latencySleepModeInfoNV ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, latencySleepModeInfoNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, latencySleepModeInfoNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, latencySleepModeInfoNV.lowLatencyMode ); + VULKAN_HPP_HASH_COMBINE( seed, latencySleepModeInfoNV.lowLatencyBoost ); + VULKAN_HPP_HASH_COMBINE( seed, latencySleepModeInfoNV.minimumIntervalUs ); + return seed; + } + }; + + template <> + struct hash<VULKAN_HPP_NAMESPACE::LatencySubmissionPresentIdNV> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::LatencySubmissionPresentIdNV const & latencySubmissionPresentIdNV ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, latencySubmissionPresentIdNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, latencySubmissionPresentIdNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, latencySubmissionPresentIdNV.presentID ); + return seed; + } + }; + + template <> + struct hash<VULKAN_HPP_NAMESPACE::LatencySurfaceCapabilitiesNV> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::LatencySurfaceCapabilitiesNV const & latencySurfaceCapabilitiesNV ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, latencySurfaceCapabilitiesNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, latencySurfaceCapabilitiesNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, latencySurfaceCapabilitiesNV.presentModeCount ); + VULKAN_HPP_HASH_COMBINE( seed, latencySurfaceCapabilitiesNV.pPresentModes ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::LayerProperties> { std::size_t operator()( VULKAN_HPP_NAMESPACE::LayerProperties const & layerProperties ) const VULKAN_HPP_NOEXCEPT @@ -6874,6 +7020,19 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV const & outOfBandQueueTypeInfoNV ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, outOfBandQueueTypeInfoNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, outOfBandQueueTypeInfoNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, outOfBandQueueTypeInfoNV.queueType ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::PastPresentationTimingGOOGLE> { std::size_t operator()( VULKAN_HPP_NAMESPACE::PastPresentationTimingGOOGLE const & pastPresentationTimingGOOGLE ) const VULKAN_HPP_NOEXCEPT @@ -7467,6 +7626,33 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicClampFeaturesQCOM> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicClampFeaturesQCOM const & physicalDeviceCubicClampFeaturesQCOM ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCubicClampFeaturesQCOM.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCubicClampFeaturesQCOM.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCubicClampFeaturesQCOM.cubicRangeClamp ); + return seed; + } + }; + + template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicWeightsFeaturesQCOM> + { + std::size_t + operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicWeightsFeaturesQCOM const & physicalDeviceCubicWeightsFeaturesQCOM ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCubicWeightsFeaturesQCOM.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCubicWeightsFeaturesQCOM.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCubicWeightsFeaturesQCOM.selectableCubicWeights ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceCustomBorderColorFeaturesEXT> { std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceCustomBorderColorFeaturesEXT const & physicalDeviceCustomBorderColorFeaturesEXT ) const @@ -7732,6 +7918,20 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorPoolOverallocationFeaturesNV> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorPoolOverallocationFeaturesNV const & + physicalDeviceDescriptorPoolOverallocationFeaturesNV ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorPoolOverallocationFeaturesNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorPoolOverallocationFeaturesNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorPoolOverallocationFeaturesNV.descriptorPoolOverallocation ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE> { std::size_t @@ -8043,6 +8243,37 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV> + { + std::size_t + operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV const & physicalDeviceExtendedSparseAddressSpaceFeaturesNV ) const + VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedSparseAddressSpaceFeaturesNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedSparseAddressSpaceFeaturesNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedSparseAddressSpaceFeaturesNV.extendedSparseAddressSpace ); + return seed; + } + }; + + template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpacePropertiesNV> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpacePropertiesNV const & + physicalDeviceExtendedSparseAddressSpacePropertiesNV ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedSparseAddressSpacePropertiesNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedSparseAddressSpacePropertiesNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedSparseAddressSpacePropertiesNV.extendedSparseAddressSpaceSize ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedSparseAddressSpacePropertiesNV.extendedSparseImageUsageFlags ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedSparseAddressSpacePropertiesNV.extendedSparseBufferUsageFlags ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo> { std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo const & physicalDeviceExternalBufferInfo ) const VULKAN_HPP_NOEXCEPT @@ -8070,6 +8301,41 @@ namespace std } }; +# if defined( VK_USE_PLATFORM_ANDROID_KHR ) + template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolveFeaturesANDROID> + { + std::size_t + operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolveFeaturesANDROID const & physicalDeviceExternalFormatResolveFeaturesANDROID ) const + VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalFormatResolveFeaturesANDROID.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalFormatResolveFeaturesANDROID.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalFormatResolveFeaturesANDROID.externalFormatResolve ); + return seed; + } + }; +# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + +# if defined( VK_USE_PLATFORM_ANDROID_KHR ) + template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolvePropertiesANDROID> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolvePropertiesANDROID const & + physicalDeviceExternalFormatResolvePropertiesANDROID ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalFormatResolvePropertiesANDROID.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalFormatResolvePropertiesANDROID.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalFormatResolvePropertiesANDROID.nullColorAttachmentWithExternalFormatResolve ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalFormatResolvePropertiesANDROID.externalFormatResolveChromaOffsetX ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalFormatResolvePropertiesANDROID.externalFormatResolveChromaOffsetY ); + return seed; + } + }; +# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + template <> struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalImageFormatInfo> { @@ -8428,6 +8694,20 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceFrameBoundaryFeaturesEXT> + { + std::size_t + operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFrameBoundaryFeaturesEXT const & physicalDeviceFrameBoundaryFeaturesEXT ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFrameBoundaryFeaturesEXT.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFrameBoundaryFeaturesEXT.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFrameBoundaryFeaturesEXT.frameBoundary ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceGlobalPriorityQueryFeaturesKHR> { std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceGlobalPriorityQueryFeaturesKHR const & physicalDeviceGlobalPriorityQueryFeaturesKHR ) const @@ -8642,6 +8922,34 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2FeaturesQCOM> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2FeaturesQCOM const & physicalDeviceImageProcessing2FeaturesQCOM ) const + VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessing2FeaturesQCOM.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessing2FeaturesQCOM.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessing2FeaturesQCOM.textureBlockMatch2 ); + return seed; + } + }; + + template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2PropertiesQCOM> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2PropertiesQCOM const & physicalDeviceImageProcessing2PropertiesQCOM ) const + VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessing2PropertiesQCOM.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessing2PropertiesQCOM.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessing2PropertiesQCOM.maxBlockMatchWindow ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessingFeaturesQCOM> { std::size_t @@ -8820,6 +9128,20 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceLayeredDriverPropertiesMSFT> + { + std::size_t + operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceLayeredDriverPropertiesMSFT const & physicalDeviceLayeredDriverPropertiesMSFT ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLayeredDriverPropertiesMSFT.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLayeredDriverPropertiesMSFT.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLayeredDriverPropertiesMSFT.underlyingAPI ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceLegacyDitheringFeaturesEXT> { std::size_t @@ -9426,6 +9748,36 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferFeaturesEXT> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferFeaturesEXT const & physicalDeviceNestedCommandBufferFeaturesEXT ) const + VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceNestedCommandBufferFeaturesEXT.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceNestedCommandBufferFeaturesEXT.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceNestedCommandBufferFeaturesEXT.nestedCommandBuffer ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceNestedCommandBufferFeaturesEXT.nestedCommandBufferRendering ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceNestedCommandBufferFeaturesEXT.nestedCommandBufferSimultaneousUse ); + return seed; + } + }; + + template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferPropertiesEXT> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferPropertiesEXT const & physicalDeviceNestedCommandBufferPropertiesEXT ) const + VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceNestedCommandBufferPropertiesEXT.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceNestedCommandBufferPropertiesEXT.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceNestedCommandBufferPropertiesEXT.maxCommandBufferNestingLevel ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceNonSeamlessCubeMapFeaturesEXT> { std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceNonSeamlessCubeMapFeaturesEXT const & physicalDeviceNonSeamlessCubeMapFeaturesEXT ) const @@ -11537,6 +11889,20 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcrDegammaFeaturesQCOM> + { + std::size_t + operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcrDegammaFeaturesQCOM const & physicalDeviceYcbcrDegammaFeaturesQCOM ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceYcbcrDegammaFeaturesQCOM.sType ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceYcbcrDegammaFeaturesQCOM.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceYcbcrDegammaFeaturesQCOM.ycbcrDegamma ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcrImageArraysFeaturesEXT> { std::size_t @@ -13121,6 +13487,21 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::SamplerBlockMatchWindowCreateInfoQCOM> + { + std::size_t + operator()( VULKAN_HPP_NAMESPACE::SamplerBlockMatchWindowCreateInfoQCOM const & samplerBlockMatchWindowCreateInfoQCOM ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, samplerBlockMatchWindowCreateInfoQCOM.sType ); + VULKAN_HPP_HASH_COMBINE( seed, samplerBlockMatchWindowCreateInfoQCOM.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, samplerBlockMatchWindowCreateInfoQCOM.windowExtent ); + VULKAN_HPP_HASH_COMBINE( seed, samplerBlockMatchWindowCreateInfoQCOM.windowCompareMode ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::SamplerBorderColorComponentMappingCreateInfoEXT> { std::size_t operator()( @@ -13177,6 +13558,19 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::SamplerCubicWeightsCreateInfoQCOM> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::SamplerCubicWeightsCreateInfoQCOM const & samplerCubicWeightsCreateInfoQCOM ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, samplerCubicWeightsCreateInfoQCOM.sType ); + VULKAN_HPP_HASH_COMBINE( seed, samplerCubicWeightsCreateInfoQCOM.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, samplerCubicWeightsCreateInfoQCOM.cubicWeights ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::SamplerReductionModeCreateInfo> { std::size_t operator()( VULKAN_HPP_NAMESPACE::SamplerReductionModeCreateInfo const & samplerReductionModeCreateInfo ) const VULKAN_HPP_NOEXCEPT @@ -13236,6 +13630,21 @@ namespace std } }; + template <> + struct hash<VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM const & samplerYcbcrConversionYcbcrDegammaCreateInfoQCOM ) + const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionYcbcrDegammaCreateInfoQCOM.sType ); + VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionYcbcrDegammaCreateInfoQCOM.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionYcbcrDegammaCreateInfoQCOM.enableYDegamma ); + VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionYcbcrDegammaCreateInfoQCOM.enableCbCrDegamma ); + return seed; + } + }; + # if defined( VK_USE_PLATFORM_SCREEN_QNX ) template <> struct hash<VULKAN_HPP_NAMESPACE::ScreenBufferFormatPropertiesQNX> @@ -13412,6 +13821,20 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV const & setLatencyMarkerInfoNV ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, setLatencyMarkerInfoNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, setLatencyMarkerInfoNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, setLatencyMarkerInfoNV.presentID ); + VULKAN_HPP_HASH_COMBINE( seed, setLatencyMarkerInfoNV.marker ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::SetStateFlagsIndirectCommandNV> { std::size_t operator()( VULKAN_HPP_NAMESPACE::SetStateFlagsIndirectCommandNV const & setStateFlagsIndirectCommandNV ) const VULKAN_HPP_NOEXCEPT @@ -14028,6 +14451,19 @@ namespace std }; template <> + struct hash<VULKAN_HPP_NAMESPACE::SwapchainLatencyCreateInfoNV> + { + std::size_t operator()( VULKAN_HPP_NAMESPACE::SwapchainLatencyCreateInfoNV const & swapchainLatencyCreateInfoNV ) const VULKAN_HPP_NOEXCEPT + { + std::size_t seed = 0; + VULKAN_HPP_HASH_COMBINE( seed, swapchainLatencyCreateInfoNV.sType ); + VULKAN_HPP_HASH_COMBINE( seed, swapchainLatencyCreateInfoNV.pNext ); + VULKAN_HPP_HASH_COMBINE( seed, swapchainLatencyCreateInfoNV.latencyModeEnable ); + return seed; + } + }; + + template <> struct hash<VULKAN_HPP_NAMESPACE::SwapchainPresentBarrierCreateInfoNV> { std::size_t operator()( VULKAN_HPP_NAMESPACE::SwapchainPresentBarrierCreateInfoNV const & swapchainPresentBarrierCreateInfoNV ) const VULKAN_HPP_NOEXCEPT diff --git a/thirdparty/vulkan/include/vulkan/vulkan_hpp_macros.hpp b/thirdparty/vulkan/include/vulkan/vulkan_hpp_macros.hpp new file mode 100644 index 0000000000..13fa815f65 --- /dev/null +++ b/thirdparty/vulkan/include/vulkan/vulkan_hpp_macros.hpp @@ -0,0 +1,270 @@ +// Copyright 2015-2023 The Khronos Group Inc. +// +// SPDX-License-Identifier: Apache-2.0 OR MIT +// + +// This header is generated from the Khronos Vulkan XML API Registry. + +#ifndef VULKAN_HPP_MACROS_HPP +#define VULKAN_HPP_MACROS_HPP + +#if defined( _MSVC_LANG ) +# define VULKAN_HPP_CPLUSPLUS _MSVC_LANG +#else +# define VULKAN_HPP_CPLUSPLUS __cplusplus +#endif + +#if 201703L < VULKAN_HPP_CPLUSPLUS +# define VULKAN_HPP_CPP_VERSION 20 +#elif 201402L < VULKAN_HPP_CPLUSPLUS +# define VULKAN_HPP_CPP_VERSION 17 +#elif 201103L < VULKAN_HPP_CPLUSPLUS +# define VULKAN_HPP_CPP_VERSION 14 +#elif 199711L < VULKAN_HPP_CPLUSPLUS +# define VULKAN_HPP_CPP_VERSION 11 +#else +# error "vulkan.hpp needs at least c++ standard version 11" +#endif + +#if defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) +# if !defined( VULKAN_HPP_NO_SMART_HANDLE ) +# define VULKAN_HPP_NO_SMART_HANDLE +# endif +#endif + +#if defined( VULKAN_HPP_NO_CONSTRUCTORS ) +# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) +# define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS +# endif +# if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) +# define VULKAN_HPP_NO_UNION_CONSTRUCTORS +# endif +#endif + +#if defined( VULKAN_HPP_NO_SETTERS ) +# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) +# define VULKAN_HPP_NO_STRUCT_SETTERS +# endif +# if !defined( VULKAN_HPP_NO_UNION_SETTERS ) +# define VULKAN_HPP_NO_UNION_SETTERS +# endif +#endif + +#if !defined( VULKAN_HPP_ASSERT ) +# define VULKAN_HPP_ASSERT assert +#endif + +#if !defined( VULKAN_HPP_ASSERT_ON_RESULT ) +# define VULKAN_HPP_ASSERT_ON_RESULT VULKAN_HPP_ASSERT +#endif + +#if !defined( VULKAN_HPP_STATIC_ASSERT ) +# define VULKAN_HPP_STATIC_ASSERT static_assert +#endif + +#if !defined( VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL ) +# define VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL 1 +#endif + +#if !defined( __has_include ) +# define __has_include( x ) false +#endif + +#if ( 201907 <= __cpp_lib_three_way_comparison ) && __has_include( <compare> ) && !defined( VULKAN_HPP_NO_SPACESHIP_OPERATOR ) +# define VULKAN_HPP_HAS_SPACESHIP_OPERATOR +#endif + +#if ( 201803 <= __cpp_lib_span ) +# define VULKAN_HPP_SUPPORT_SPAN +#endif + +// 32-bit vulkan is not typesafe for non-dispatchable handles, so don't allow copy constructors on this platform by default. +// To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION +#if ( VK_USE_64_BIT_PTR_DEFINES == 1 ) +# if !defined( VULKAN_HPP_TYPESAFE_CONVERSION ) +# define VULKAN_HPP_TYPESAFE_CONVERSION +# endif +#endif + +#if defined( __GNUC__ ) +# define GCC_VERSION ( __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ ) +#endif + +#if !defined( VULKAN_HPP_HAS_UNRESTRICTED_UNIONS ) +# if defined( __clang__ ) +# if __has_feature( cxx_unrestricted_unions ) +# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS +# endif +# elif defined( __GNUC__ ) +# if 40600 <= GCC_VERSION +# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS +# endif +# elif defined( _MSC_VER ) +# if 1900 <= _MSC_VER +# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS +# endif +# endif +#endif + +#if !defined( VULKAN_HPP_INLINE ) +# if defined( __clang__ ) +# if __has_attribute( always_inline ) +# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__ +# else +# define VULKAN_HPP_INLINE inline +# endif +# elif defined( __GNUC__ ) +# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__ +# elif defined( _MSC_VER ) +# define VULKAN_HPP_INLINE inline +# else +# define VULKAN_HPP_INLINE inline +# endif +#endif + +#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) +# define VULKAN_HPP_TYPESAFE_EXPLICIT +#else +# define VULKAN_HPP_TYPESAFE_EXPLICIT explicit +#endif + +#if defined( __cpp_constexpr ) +# define VULKAN_HPP_CONSTEXPR constexpr +# if 201304 <= __cpp_constexpr +# define VULKAN_HPP_CONSTEXPR_14 constexpr +# else +# define VULKAN_HPP_CONSTEXPR_14 +# endif +# if ( 201907 <= __cpp_constexpr ) && ( !defined( __GNUC__ ) || ( 110400 < GCC_VERSION ) ) +# define VULKAN_HPP_CONSTEXPR_20 constexpr +# else +# define VULKAN_HPP_CONSTEXPR_20 +# endif +# define VULKAN_HPP_CONST_OR_CONSTEXPR constexpr +#else +# define VULKAN_HPP_CONSTEXPR +# define VULKAN_HPP_CONSTEXPR_14 +# define VULKAN_HPP_CONST_OR_CONSTEXPR const +#endif + +#if !defined( VULKAN_HPP_CONSTEXPR_INLINE ) +# if 201606L <= __cpp_inline_variables +# define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR inline +# else +# define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR +# endif +#endif + +#if !defined( VULKAN_HPP_NOEXCEPT ) +# if defined( _MSC_VER ) && ( _MSC_VER <= 1800 ) +# define VULKAN_HPP_NOEXCEPT +# else +# define VULKAN_HPP_NOEXCEPT noexcept +# define VULKAN_HPP_HAS_NOEXCEPT 1 +# if defined( VULKAN_HPP_NO_EXCEPTIONS ) +# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS noexcept +# else +# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS +# endif +# endif +#endif + +#if 14 <= VULKAN_HPP_CPP_VERSION +# define VULKAN_HPP_DEPRECATED( msg ) [[deprecated( msg )]] +#else +# define VULKAN_HPP_DEPRECATED( msg ) +#endif + +#if ( 17 <= VULKAN_HPP_CPP_VERSION ) && !defined( VULKAN_HPP_NO_NODISCARD_WARNINGS ) +# define VULKAN_HPP_NODISCARD [[nodiscard]] +# if defined( VULKAN_HPP_NO_EXCEPTIONS ) +# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS [[nodiscard]] +# else +# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS +# endif +#else +# define VULKAN_HPP_NODISCARD +# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS +#endif + +#if !defined( VULKAN_HPP_NAMESPACE ) +# define VULKAN_HPP_NAMESPACE vk +#endif + +#define VULKAN_HPP_STRINGIFY2( text ) #text +#define VULKAN_HPP_STRINGIFY( text ) VULKAN_HPP_STRINGIFY2( text ) +#define VULKAN_HPP_NAMESPACE_STRING VULKAN_HPP_STRINGIFY( VULKAN_HPP_NAMESPACE ) + +#if !defined( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC ) +# if defined( VK_NO_PROTOTYPES ) +# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1 +# else +# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 0 +# endif +#endif + +#if !defined( VULKAN_HPP_STORAGE_API ) +# if defined( VULKAN_HPP_STORAGE_SHARED ) +# if defined( _MSC_VER ) +# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT ) +# define VULKAN_HPP_STORAGE_API __declspec( dllexport ) +# else +# define VULKAN_HPP_STORAGE_API __declspec( dllimport ) +# endif +# elif defined( __clang__ ) || defined( __GNUC__ ) +# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT ) +# define VULKAN_HPP_STORAGE_API __attribute__( ( visibility( "default" ) ) ) +# else +# define VULKAN_HPP_STORAGE_API +# endif +# else +# define VULKAN_HPP_STORAGE_API +# pragma warning Unknown import / export semantics +# endif +# else +# define VULKAN_HPP_STORAGE_API +# endif +#endif + +namespace VULKAN_HPP_NAMESPACE +{ + class DispatchLoaderDynamic; +} // namespace VULKAN_HPP_NAMESPACE + +#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER ) +# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 +# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::defaultDispatchLoaderDynamic +# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \ + namespace VULKAN_HPP_NAMESPACE \ + { \ + VULKAN_HPP_STORAGE_API ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic; \ + } +namespace VULKAN_HPP_NAMESPACE +{ + extern VULKAN_HPP_STORAGE_API VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic; +} // namespace VULKAN_HPP_NAMESPACE +# else +# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::getDispatchLoaderStatic() +# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE +# endif +#endif + +#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ) +# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 +# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic +# else +# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic +# endif +#endif + +#if defined( VULKAN_HPP_NO_DEFAULT_DISPATCHER ) +# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT +# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT +# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT +#else +# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT = {} +# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT = nullptr +# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT = VULKAN_HPP_DEFAULT_DISPATCHER +#endif + +#endif
\ No newline at end of file diff --git a/thirdparty/vulkan/include/vulkan/vulkan_raii.hpp b/thirdparty/vulkan/include/vulkan/vulkan_raii.hpp index f065519ebf..f217921c91 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_raii.hpp +++ b/thirdparty/vulkan/include/vulkan/vulkan_raii.hpp @@ -1663,6 +1663,13 @@ namespace VULKAN_HPP_NAMESPACE vkGetDynamicRenderingTilePropertiesQCOM = PFN_vkGetDynamicRenderingTilePropertiesQCOM( vkGetDeviceProcAddr( device, "vkGetDynamicRenderingTilePropertiesQCOM" ) ); + //=== VK_NV_low_latency2 === + vkSetLatencySleepModeNV = PFN_vkSetLatencySleepModeNV( vkGetDeviceProcAddr( device, "vkSetLatencySleepModeNV" ) ); + vkLatencySleepNV = PFN_vkLatencySleepNV( vkGetDeviceProcAddr( device, "vkLatencySleepNV" ) ); + vkSetLatencyMarkerNV = PFN_vkSetLatencyMarkerNV( vkGetDeviceProcAddr( device, "vkSetLatencyMarkerNV" ) ); + vkGetLatencyTimingsNV = PFN_vkGetLatencyTimingsNV( vkGetDeviceProcAddr( device, "vkGetLatencyTimingsNV" ) ); + vkQueueNotifyOutOfBandNV = PFN_vkQueueNotifyOutOfBandNV( vkGetDeviceProcAddr( device, "vkQueueNotifyOutOfBandNV" ) ); + //=== VK_EXT_attachment_feedback_loop_dynamic_state === vkCmdSetAttachmentFeedbackLoopEnableEXT = PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetAttachmentFeedbackLoopEnableEXT" ) ); @@ -2507,6 +2514,13 @@ namespace VULKAN_HPP_NAMESPACE PFN_vkGetFramebufferTilePropertiesQCOM vkGetFramebufferTilePropertiesQCOM = 0; PFN_vkGetDynamicRenderingTilePropertiesQCOM vkGetDynamicRenderingTilePropertiesQCOM = 0; + //=== VK_NV_low_latency2 === + PFN_vkSetLatencySleepModeNV vkSetLatencySleepModeNV = 0; + PFN_vkLatencySleepNV vkLatencySleepNV = 0; + PFN_vkSetLatencyMarkerNV vkSetLatencyMarkerNV = 0; + PFN_vkGetLatencyTimingsNV vkGetLatencyTimingsNV = 0; + PFN_vkQueueNotifyOutOfBandNV vkQueueNotifyOutOfBandNV = 0; + //=== VK_EXT_attachment_feedback_loop_dynamic_state === PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT vkCmdSetAttachmentFeedbackLoopEnableEXT = 0; @@ -2694,7 +2708,8 @@ namespace VULKAN_HPP_NAMESPACE class Instance { public: - using CType = VkInstance; + using CType = VkInstance; + using CppType = vk::Instance; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eInstance; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -2953,7 +2968,8 @@ namespace VULKAN_HPP_NAMESPACE class PhysicalDevice { public: - using CType = VkPhysicalDevice; + using CType = VkPhysicalDevice; + using CppType = vk::PhysicalDevice; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePhysicalDevice; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -3411,7 +3427,8 @@ namespace VULKAN_HPP_NAMESPACE class Device { public: - using CType = VkDevice; + using CType = VkDevice; + using CppType = vk::Device; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDevice; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -4178,6 +4195,8 @@ namespace VULKAN_HPP_NAMESPACE //=== VK_EXT_descriptor_buffer === + void getDescriptorEXT( const VULKAN_HPP_NAMESPACE::DescriptorGetInfoEXT & descriptorInfo, size_t dataSize, void * pDescriptor ) const VULKAN_HPP_NOEXCEPT; + template <typename DescriptorType> VULKAN_HPP_NODISCARD DescriptorType getDescriptorEXT( const VULKAN_HPP_NAMESPACE::DescriptorGetInfoEXT & descriptorInfo ) const VULKAN_HPP_NOEXCEPT; @@ -4369,7 +4388,8 @@ namespace VULKAN_HPP_NAMESPACE class AccelerationStructureKHR { public: - using CType = VkAccelerationStructureKHR; + using CType = VkAccelerationStructureKHR; + using CppType = vk::AccelerationStructureKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eAccelerationStructureKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -4489,7 +4509,8 @@ namespace VULKAN_HPP_NAMESPACE class AccelerationStructureNV { public: - using CType = VkAccelerationStructureNV; + using CType = VkAccelerationStructureNV; + using CppType = vk::AccelerationStructureNV; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eAccelerationStructureNV; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -4617,7 +4638,8 @@ namespace VULKAN_HPP_NAMESPACE class Buffer { public: - using CType = VkBuffer; + using CType = VkBuffer; + using CppType = vk::Buffer; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eBuffer; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -4743,7 +4765,8 @@ namespace VULKAN_HPP_NAMESPACE class BufferCollectionFUCHSIA { public: - using CType = VkBufferCollectionFUCHSIA; + using CType = VkBufferCollectionFUCHSIA; + using CppType = vk::BufferCollectionFUCHSIA; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eBufferCollectionFUCHSIA; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -4872,7 +4895,8 @@ namespace VULKAN_HPP_NAMESPACE class BufferView { public: - using CType = VkBufferView; + using CType = VkBufferView; + using CppType = vk::BufferView; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eBufferView; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -4991,7 +5015,8 @@ namespace VULKAN_HPP_NAMESPACE class CommandPool { public: - using CType = VkCommandPool; + using CType = VkCommandPool; + using CppType = vk::CommandPool; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCommandPool; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -5122,7 +5147,8 @@ namespace VULKAN_HPP_NAMESPACE class CommandBuffer { public: - using CType = VkCommandBuffer; + using CType = VkCommandBuffer; + using CppType = vk::CommandBuffer; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCommandBuffer; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -6159,7 +6185,8 @@ namespace VULKAN_HPP_NAMESPACE class CuFunctionNVX { public: - using CType = VkCuFunctionNVX; + using CType = VkCuFunctionNVX; + using CppType = vk::CuFunctionNVX; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCuFunctionNVX; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -6278,7 +6305,8 @@ namespace VULKAN_HPP_NAMESPACE class CuModuleNVX { public: - using CType = VkCuModuleNVX; + using CType = VkCuModuleNVX; + using CppType = vk::CuModuleNVX; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCuModuleNVX; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -6397,7 +6425,8 @@ namespace VULKAN_HPP_NAMESPACE class DebugReportCallbackEXT { public: - using CType = VkDebugReportCallbackEXT; + using CType = VkDebugReportCallbackEXT; + using CppType = vk::DebugReportCallbackEXT; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDebugReportCallbackEXT; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -6517,7 +6546,8 @@ namespace VULKAN_HPP_NAMESPACE class DebugUtilsMessengerEXT { public: - using CType = VkDebugUtilsMessengerEXT; + using CType = VkDebugUtilsMessengerEXT; + using CppType = vk::DebugUtilsMessengerEXT; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDebugUtilsMessengerEXT; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -6637,7 +6667,8 @@ namespace VULKAN_HPP_NAMESPACE class DeferredOperationKHR { public: - using CType = VkDeferredOperationKHR; + using CType = VkDeferredOperationKHR; + using CppType = vk::DeferredOperationKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDeferredOperationKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -6763,7 +6794,8 @@ namespace VULKAN_HPP_NAMESPACE class DescriptorPool { public: - using CType = VkDescriptorPool; + using CType = VkDescriptorPool; + using CppType = vk::DescriptorPool; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorPool; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -6887,7 +6919,8 @@ namespace VULKAN_HPP_NAMESPACE class DescriptorSet { public: - using CType = VkDescriptorSet; + using CType = VkDescriptorSet; + using CppType = vk::DescriptorSet; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorSet; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -7032,7 +7065,8 @@ namespace VULKAN_HPP_NAMESPACE class DescriptorSetLayout { public: - using CType = VkDescriptorSetLayout; + using CType = VkDescriptorSetLayout; + using CppType = vk::DescriptorSetLayout; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorSetLayout; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -7158,7 +7192,8 @@ namespace VULKAN_HPP_NAMESPACE class DescriptorUpdateTemplate { public: - using CType = VkDescriptorUpdateTemplate; + using CType = VkDescriptorUpdateTemplate; + using CppType = vk::DescriptorUpdateTemplate; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorUpdateTemplate; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -7278,7 +7313,8 @@ namespace VULKAN_HPP_NAMESPACE class DeviceMemory { public: - using CType = VkDeviceMemory; + using CType = VkDeviceMemory; + using CppType = vk::DeviceMemory; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDeviceMemory; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -7417,7 +7453,8 @@ namespace VULKAN_HPP_NAMESPACE class DisplayKHR { public: - using CType = VkDisplayKHR; + using CType = VkDisplayKHR; + using CppType = vk::DisplayKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDisplayKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -7605,7 +7642,8 @@ namespace VULKAN_HPP_NAMESPACE class DisplayModeKHR { public: - using CType = VkDisplayModeKHR; + using CType = VkDisplayModeKHR; + using CppType = vk::DisplayModeKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDisplayModeKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -7711,7 +7749,8 @@ namespace VULKAN_HPP_NAMESPACE class Event { public: - using CType = VkEvent; + using CType = VkEvent; + using CppType = vk::Event; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eEvent; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -7838,7 +7877,8 @@ namespace VULKAN_HPP_NAMESPACE class Fence { public: - using CType = VkFence; + using CType = VkFence; + using CppType = vk::Fence; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eFence; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -7999,7 +8039,8 @@ namespace VULKAN_HPP_NAMESPACE class Framebuffer { public: - using CType = VkFramebuffer; + using CType = VkFramebuffer; + using CppType = vk::Framebuffer; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eFramebuffer; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -8122,7 +8163,8 @@ namespace VULKAN_HPP_NAMESPACE class Image { public: - using CType = VkImage; + using CType = VkImage; + using CppType = vk::Image; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eImage; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -8274,7 +8316,8 @@ namespace VULKAN_HPP_NAMESPACE class ImageView { public: - using CType = VkImageView; + using CType = VkImageView; + using CppType = vk::ImageView; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eImageView; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -8397,7 +8440,8 @@ namespace VULKAN_HPP_NAMESPACE class IndirectCommandsLayoutNV { public: - using CType = VkIndirectCommandsLayoutNV; + using CType = VkIndirectCommandsLayoutNV; + using CppType = vk::IndirectCommandsLayoutNV; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eIndirectCommandsLayoutNV; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -8517,7 +8561,8 @@ namespace VULKAN_HPP_NAMESPACE class MicromapEXT { public: - using CType = VkMicromapEXT; + using CType = VkMicromapEXT; + using CppType = vk::MicromapEXT; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eMicromapEXT; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -8636,7 +8681,8 @@ namespace VULKAN_HPP_NAMESPACE class OpticalFlowSessionNV { public: - using CType = VkOpticalFlowSessionNV; + using CType = VkOpticalFlowSessionNV; + using CppType = vk::OpticalFlowSessionNV; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eOpticalFlowSessionNV; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -8762,7 +8808,8 @@ namespace VULKAN_HPP_NAMESPACE class PerformanceConfigurationINTEL { public: - using CType = VkPerformanceConfigurationINTEL; + using CType = VkPerformanceConfigurationINTEL; + using CppType = vk::PerformanceConfigurationINTEL; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePerformanceConfigurationINTEL; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -8866,7 +8913,8 @@ namespace VULKAN_HPP_NAMESPACE class PipelineCache { public: - using CType = VkPipelineCache; + using CType = VkPipelineCache; + using CppType = vk::PipelineCache; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePipelineCache; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -8992,7 +9040,8 @@ namespace VULKAN_HPP_NAMESPACE class Pipeline { public: - using CType = VkPipeline; + using CType = VkPipeline; + using CppType = vk::Pipeline; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePipeline; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -9420,7 +9469,8 @@ namespace VULKAN_HPP_NAMESPACE class PipelineLayout { public: - using CType = VkPipelineLayout; + using CType = VkPipelineLayout; + using CppType = vk::PipelineLayout; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePipelineLayout; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -9540,7 +9590,8 @@ namespace VULKAN_HPP_NAMESPACE class PrivateDataSlot { public: - using CType = VkPrivateDataSlot; + using CType = VkPrivateDataSlot; + using CppType = vk::PrivateDataSlot; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePrivateDataSlot; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -9660,7 +9711,8 @@ namespace VULKAN_HPP_NAMESPACE class QueryPool { public: - using CType = VkQueryPool; + using CType = VkQueryPool; + using CppType = vk::QueryPool; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eQueryPool; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -9804,7 +9856,8 @@ namespace VULKAN_HPP_NAMESPACE class Queue { public: - using CType = VkQueue; + using CType = VkQueue; + using CppType = vk::Queue; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eQueue; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -9929,6 +9982,10 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NODISCARD std::vector<VULKAN_HPP_NAMESPACE::CheckpointData2NV> getCheckpointData2NV() const; + //=== VK_NV_low_latency2 === + + void notifyOutOfBandNV( const VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV & queueTypeInfo ) const VULKAN_HPP_NOEXCEPT; + private: VULKAN_HPP_NAMESPACE::Queue m_queue = {}; VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; @@ -9937,7 +9994,8 @@ namespace VULKAN_HPP_NAMESPACE class RenderPass { public: - using CType = VkRenderPass; + using CType = VkRenderPass; + using CppType = vk::RenderPass; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eRenderPass; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -10082,7 +10140,8 @@ namespace VULKAN_HPP_NAMESPACE class Sampler { public: - using CType = VkSampler; + using CType = VkSampler; + using CppType = vk::Sampler; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSampler; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -10201,7 +10260,8 @@ namespace VULKAN_HPP_NAMESPACE class SamplerYcbcrConversion { public: - using CType = VkSamplerYcbcrConversion; + using CType = VkSamplerYcbcrConversion; + using CppType = vk::SamplerYcbcrConversion; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSamplerYcbcrConversion; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -10321,7 +10381,8 @@ namespace VULKAN_HPP_NAMESPACE class Semaphore { public: - using CType = VkSemaphore; + using CType = VkSemaphore; + using CppType = vk::Semaphore; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSemaphore; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -10448,7 +10509,8 @@ namespace VULKAN_HPP_NAMESPACE class ShaderEXT { public: - using CType = VkShaderEXT; + using CType = VkShaderEXT; + using CppType = vk::ShaderEXT; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eShaderEXT; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -10610,7 +10672,8 @@ namespace VULKAN_HPP_NAMESPACE class ShaderModule { public: - using CType = VkShaderModule; + using CType = VkShaderModule; + using CppType = vk::ShaderModule; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eShaderModule; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -10733,7 +10796,8 @@ namespace VULKAN_HPP_NAMESPACE class SurfaceKHR { public: - using CType = VkSurfaceKHR; + using CType = VkSurfaceKHR; + using CppType = vk::SurfaceKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSurfaceKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -11130,7 +11194,8 @@ namespace VULKAN_HPP_NAMESPACE class SwapchainKHR { public: - using CType = VkSwapchainKHR; + using CType = VkSwapchainKHR; + using CppType = vk::SwapchainKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSwapchainKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -11278,6 +11343,16 @@ namespace VULKAN_HPP_NAMESPACE void releaseFullScreenExclusiveModeEXT() const; # endif /*VK_USE_PLATFORM_WIN32_KHR*/ + //=== VK_NV_low_latency2 === + + void setLatencySleepModeNV( const VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV & sleepModeInfo ) const; + + void latencySleepNV( const VULKAN_HPP_NAMESPACE::LatencySleepInfoNV & sleepInfo ) const; + + void setLatencyMarkerNV( const VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV & latencyMarkerInfo ) const VULKAN_HPP_NOEXCEPT; + + VULKAN_HPP_NODISCARD std::pair<uint32_t, VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV> getLatencyTimingsNV() const VULKAN_HPP_NOEXCEPT; + private: VULKAN_HPP_NAMESPACE::Device m_device = {}; VULKAN_HPP_NAMESPACE::SwapchainKHR m_swapchain = {}; @@ -11326,7 +11401,8 @@ namespace VULKAN_HPP_NAMESPACE class ValidationCacheEXT { public: - using CType = VkValidationCacheEXT; + using CType = VkValidationCacheEXT; + using CppType = vk::ValidationCacheEXT; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eValidationCacheEXT; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -11452,7 +11528,8 @@ namespace VULKAN_HPP_NAMESPACE class VideoSessionKHR { public: - using CType = VkVideoSessionKHR; + using CType = VkVideoSessionKHR; + using CppType = vk::VideoSessionKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eVideoSessionKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -11578,7 +11655,8 @@ namespace VULKAN_HPP_NAMESPACE class VideoSessionParametersKHR { public: - using CType = VkVideoSessionParametersKHR; + using CType = VkVideoSessionParametersKHR; + using CppType = vk::VideoSessionParametersKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eVideoSessionParametersKHR; static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = @@ -18975,6 +19053,16 @@ namespace VULKAN_HPP_NAMESPACE return offset; } + VULKAN_HPP_INLINE void Device::getDescriptorEXT( const VULKAN_HPP_NAMESPACE::DescriptorGetInfoEXT & descriptorInfo, + size_t dataSize, + void * pDescriptor ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( getDispatcher()->vkGetDescriptorEXT && "Function <vkGetDescriptorEXT> requires <VK_EXT_descriptor_buffer>" ); + + getDispatcher()->vkGetDescriptorEXT( + static_cast<VkDevice>( m_device ), reinterpret_cast<const VkDescriptorGetInfoEXT *>( &descriptorInfo ), dataSize, pDescriptor ); + } + template <typename DescriptorType> VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE DescriptorType Device::getDescriptorEXT( const VULKAN_HPP_NAMESPACE::DescriptorGetInfoEXT & descriptorInfo ) const VULKAN_HPP_NOEXCEPT @@ -20639,6 +20727,58 @@ namespace VULKAN_HPP_NAMESPACE return properties; } + //=== VK_NV_low_latency2 === + + VULKAN_HPP_INLINE void SwapchainKHR::setLatencySleepModeNV( const VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV & sleepModeInfo ) const + { + VULKAN_HPP_ASSERT( getDispatcher()->vkSetLatencySleepModeNV && "Function <vkSetLatencySleepModeNV> requires <VK_NV_low_latency2>" ); + + VkResult result = getDispatcher()->vkSetLatencySleepModeNV( + static_cast<VkDevice>( m_device ), static_cast<VkSwapchainKHR>( m_swapchain ), reinterpret_cast<const VkLatencySleepModeInfoNV *>( &sleepModeInfo ) ); + resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::setLatencySleepModeNV" ); + } + + VULKAN_HPP_INLINE void SwapchainKHR::latencySleepNV( const VULKAN_HPP_NAMESPACE::LatencySleepInfoNV & sleepInfo ) const + { + VULKAN_HPP_ASSERT( getDispatcher()->vkLatencySleepNV && "Function <vkLatencySleepNV> requires <VK_NV_low_latency2>" ); + + VkResult result = getDispatcher()->vkLatencySleepNV( + static_cast<VkDevice>( m_device ), static_cast<VkSwapchainKHR>( m_swapchain ), reinterpret_cast<const VkLatencySleepInfoNV *>( &sleepInfo ) ); + resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::latencySleepNV" ); + } + + VULKAN_HPP_INLINE void SwapchainKHR::setLatencyMarkerNV( const VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV & latencyMarkerInfo ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( getDispatcher()->vkSetLatencyMarkerNV && "Function <vkSetLatencyMarkerNV> requires <VK_NV_low_latency2>" ); + + getDispatcher()->vkSetLatencyMarkerNV( static_cast<VkDevice>( m_device ), + static_cast<VkSwapchainKHR>( m_swapchain ), + reinterpret_cast<const VkSetLatencyMarkerInfoNV *>( &latencyMarkerInfo ) ); + } + + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::pair<uint32_t, VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV> + SwapchainKHR::getLatencyTimingsNV() const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( getDispatcher()->vkGetLatencyTimingsNV && "Function <vkGetLatencyTimingsNV> requires <VK_NV_low_latency2>" ); + + std::pair<uint32_t, VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV> data_; + uint32_t & timingCount = data_.first; + VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV & latencyMarkerInfo = data_.second; + getDispatcher()->vkGetLatencyTimingsNV( static_cast<VkDevice>( m_device ), + static_cast<VkSwapchainKHR>( m_swapchain ), + &timingCount, + reinterpret_cast<VkGetLatencyMarkerInfoNV *>( &latencyMarkerInfo ) ); + + return data_; + } + + VULKAN_HPP_INLINE void Queue::notifyOutOfBandNV( const VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV & queueTypeInfo ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( getDispatcher()->vkQueueNotifyOutOfBandNV && "Function <vkQueueNotifyOutOfBandNV> requires <VK_NV_low_latency2>" ); + + getDispatcher()->vkQueueNotifyOutOfBandNV( static_cast<VkQueue>( m_queue ), reinterpret_cast<const VkOutOfBandQueueTypeInfoNV *>( &queueTypeInfo ) ); + } + //=== VK_KHR_cooperative_matrix === VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector<VULKAN_HPP_NAMESPACE::CooperativeMatrixPropertiesKHR> @@ -20715,6 +20855,32 @@ namespace VULKAN_HPP_NAMESPACE } # endif /*VK_USE_PLATFORM_SCREEN_QNX*/ + //==================== + //=== RAII Helpers === + //==================== + + template <typename RAIIType> + std::vector<typename RAIIType::CppType> filterCppTypes( std::vector<RAIIType> const & raiiTypes ) + { + std::vector<typename RAIIType::CppType> cppTypes( raiiTypes.size() ); + std::transform( raiiTypes.begin(), raiiTypes.end(), cppTypes.begin(), []( RAIIType const & d ) { return *d; } ); + return cppTypes; + } + + template <typename RAIIType, class UnaryPredicate> + std::vector<typename RAIIType::CppType> filterCppTypes( std::vector<RAIIType> const & raiiTypes, UnaryPredicate p ) + { + std::vector<typename RAIIType::CppType> cppTypes; + for ( auto const & t : raiiTypes ) + { + if ( p( t ) ) + { + cppTypes.push_back( *t ); + } + } + return cppTypes; + } + } // namespace VULKAN_HPP_RAII_NAMESPACE } // namespace VULKAN_HPP_NAMESPACE #endif diff --git a/thirdparty/vulkan/include/vulkan/vulkan_shared.hpp b/thirdparty/vulkan/include/vulkan/vulkan_shared.hpp new file mode 100644 index 0000000000..7b1bb2338c --- /dev/null +++ b/thirdparty/vulkan/include/vulkan/vulkan_shared.hpp @@ -0,0 +1,988 @@ +// Copyright 2015-2023 The Khronos Group Inc. +// +// SPDX-License-Identifier: Apache-2.0 OR MIT +// + +// This header is generated from the Khronos Vulkan XML API Registry. + +#ifndef VULKAN_SHARED_HPP +#define VULKAN_SHARED_HPP + +#include <atomic> // std::atomic_size_t +#include <vulkan/vulkan.hpp> + +namespace VULKAN_HPP_NAMESPACE +{ +#if !defined( VULKAN_HPP_NO_SMART_HANDLE ) + + template <typename HandleType> + class SharedHandleTraits; + + class NoDestructor + { + }; + + template <typename HandleType, typename = void> + struct HasDestructorType : std::false_type + { + }; + + template <typename HandleType> + struct HasDestructorType<HandleType, decltype( (void)typename SharedHandleTraits<HandleType>::DestructorType() )> : std::true_type + { + }; + + template <typename HandleType, typename Enable = void> + struct GetDestructorType + { + using type = NoDestructor; + }; + + template <typename HandleType> + struct GetDestructorType<HandleType, typename std::enable_if<HasDestructorType<HandleType>::value>::type> + { + using type = typename SharedHandleTraits<HandleType>::DestructorType; + }; + + template <class HandleType> + using DestructorTypeOf = typename GetDestructorType<HandleType>::type; + + template <class HandleType> + struct HasDestructor : std::integral_constant<bool, !std::is_same<DestructorTypeOf<HandleType>, NoDestructor>::value> + { + }; + + //===================================================================================================================== + + template <typename HandleType> + class SharedHandle; + + template <typename DestructorType, typename Deleter> + struct SharedHeader + { + SharedHeader( SharedHandle<DestructorType> parent, Deleter deleter = Deleter() ) VULKAN_HPP_NOEXCEPT + : parent( std::move( parent ) ) + , deleter( std::move( deleter ) ) + { + } + + SharedHandle<DestructorType> parent; + Deleter deleter; + }; + + template <typename Deleter> + struct SharedHeader<NoDestructor, Deleter> + { + SharedHeader( Deleter deleter = Deleter() ) VULKAN_HPP_NOEXCEPT : deleter( std::move( deleter ) ) {} + + Deleter deleter; + }; + + //===================================================================================================================== + + template <typename HeaderType> + class ReferenceCounter + { + public: + template <typename... Args> + ReferenceCounter( Args &&... control_args ) : m_header( std::forward<Args>( control_args )... ) + { + } + ReferenceCounter( const ReferenceCounter & ) = delete; + ReferenceCounter & operator=( const ReferenceCounter & ) = delete; + + public: + size_t addRef() VULKAN_HPP_NOEXCEPT + { + // Relaxed memory order is sufficient since this does not impose any ordering on other operations + return m_ref_cnt.fetch_add( 1, std::memory_order_relaxed ); + } + + size_t release() VULKAN_HPP_NOEXCEPT + { + // A release memory order to ensure that all releases are ordered + return m_ref_cnt.fetch_sub( 1, std::memory_order_release ); + } + + public: + std::atomic_size_t m_ref_cnt{ 1 }; + HeaderType m_header{}; + }; + + //===================================================================================================================== + + template <typename HandleType, typename HeaderType, typename ForwardType = SharedHandle<HandleType>> + class SharedHandleBase + { + public: + SharedHandleBase() = default; + + template <typename... Args> + SharedHandleBase( HandleType handle, Args &&... control_args ) + : m_control( new ReferenceCounter<HeaderType>( std::forward<Args>( control_args )... ) ), m_handle( handle ) + { + } + + SharedHandleBase( const SharedHandleBase & o ) VULKAN_HPP_NOEXCEPT + { + o.addRef(); + m_handle = o.m_handle; + m_control = o.m_control; + } + + SharedHandleBase( SharedHandleBase && o ) VULKAN_HPP_NOEXCEPT + : m_control( o.m_control ) + , m_handle( o.m_handle ) + { + o.m_handle = nullptr; + o.m_control = nullptr; + } + + SharedHandleBase & operator=( const SharedHandleBase & o ) VULKAN_HPP_NOEXCEPT + { + SharedHandleBase( o ).swap( *this ); + return *this; + } + + SharedHandleBase & operator=( SharedHandleBase && o ) VULKAN_HPP_NOEXCEPT + { + SharedHandleBase( std::move( o ) ).swap( *this ); + return *this; + } + + ~SharedHandleBase() + { + // only this function owns the last reference to the control block + // the same principle is used in the default deleter of std::shared_ptr + if ( m_control && ( m_control->release() == 1 ) ) + { + // noop in x86, but does thread synchronization in ARM + // it is required to ensure that last thread is getting to destroy the control block + // by ordering all atomic operations before this fence + std::atomic_thread_fence( std::memory_order_acquire ); + ForwardType::internalDestroy( getHeader(), m_handle ); + delete m_control; + } + } + + public: + HandleType get() const VULKAN_HPP_NOEXCEPT + { + return m_handle; + } + + HandleType operator*() const VULKAN_HPP_NOEXCEPT + { + return m_handle; + } + + explicit operator bool() const VULKAN_HPP_NOEXCEPT + { + return bool( m_handle ); + } + + const HandleType * operator->() const VULKAN_HPP_NOEXCEPT + { + return &m_handle; + } + + HandleType * operator->() VULKAN_HPP_NOEXCEPT + { + return &m_handle; + } + + void reset() VULKAN_HPP_NOEXCEPT + { + SharedHandleBase().swap( *this ); + } + + void swap( SharedHandleBase & o ) VULKAN_HPP_NOEXCEPT + { + std::swap( m_handle, o.m_handle ); + std::swap( m_control, o.m_control ); + } + + template <typename T = HandleType> + typename std::enable_if<HasDestructor<T>::value, const SharedHandle<DestructorTypeOf<HandleType>> &>::type getDestructorType() const VULKAN_HPP_NOEXCEPT + { + return getHeader().parent; + } + + protected: + template <typename T = HandleType> + static typename std::enable_if<!HasDestructor<T>::value, void>::type internalDestroy( const HeaderType & control, HandleType handle ) VULKAN_HPP_NOEXCEPT + { + control.deleter.destroy( handle ); + } + + template <typename T = HandleType> + static typename std::enable_if<HasDestructor<T>::value, void>::type internalDestroy( const HeaderType & control, HandleType handle ) VULKAN_HPP_NOEXCEPT + { + control.deleter.destroy( control.parent.get(), handle ); + } + + const HeaderType & getHeader() const VULKAN_HPP_NOEXCEPT + { + return m_control->m_header; + } + + private: + void addRef() const VULKAN_HPP_NOEXCEPT + { + if ( m_control ) + m_control->addRef(); + } + + protected: + ReferenceCounter<HeaderType> * m_control = nullptr; + HandleType m_handle{}; + }; + + template <typename HandleType> + class SharedHandle : public SharedHandleBase<HandleType, SharedHeader<DestructorTypeOf<HandleType>, typename SharedHandleTraits<HandleType>::deleter>> + { + private: + using BaseType = SharedHandleBase<HandleType, SharedHeader<DestructorTypeOf<HandleType>, typename SharedHandleTraits<HandleType>::deleter>>; + using DeleterType = typename SharedHandleTraits<HandleType>::deleter; + friend BaseType; + + public: + SharedHandle() = default; + + template <typename T = HandleType, typename = typename std::enable_if<HasDestructor<T>::value>::type> + explicit SharedHandle( HandleType handle, SharedHandle<DestructorTypeOf<HandleType>> parent, DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT + : BaseType( handle, std::move( parent ), std::move( deleter ) ) + { + } + + template <typename T = HandleType, typename = typename std::enable_if<!HasDestructor<T>::value>::type> + explicit SharedHandle( HandleType handle, DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT : BaseType( handle, std::move( deleter ) ) + { + } + + protected: + using BaseType::internalDestroy; + }; + + template <typename HandleType> + class SharedHandleTraits; + +// Silence the function cast warnings. +# if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER ) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wcast-function-type" +# endif + + template <typename HandleType> + class ObjectDestroyShared + { + public: + using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType; + + template <class Dispatcher> + using DestroyFunctionPointerType = + typename std::conditional<HasDestructor<HandleType>::value, + void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const, + void ( HandleType::* )( const AllocationCallbacks *, const Dispatcher & ) const>::type; + + using SelectorType = typename std::conditional<HasDestructor<HandleType>::value, DestructorType, HandleType>::type; + + template <typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + ObjectDestroyShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, + const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) + : m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &SelectorType::destroy ) ) ) + , m_dispatch( &dispatch ) + , m_allocationCallbacks( allocationCallbacks ) + { + } + + public: + template <typename T = HandleType> + typename std::enable_if<HasDestructor<T>::value, void>::type destroy( DestructorType parent, HandleType handle ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( m_destroy && m_dispatch ); + ( parent.*m_destroy )( handle, m_allocationCallbacks, *m_dispatch ); + } + + template <typename T = HandleType> + typename std::enable_if<!HasDestructor<T>::value, void>::type destroy( HandleType handle ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( m_destroy && m_dispatch ); + ( handle.*m_destroy )( m_allocationCallbacks, *m_dispatch ); + } + + private: + DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr; + const DispatchLoaderBase * m_dispatch = nullptr; + Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr; + }; + + template <typename HandleType> + class ObjectFreeShared + { + public: + using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType; + + template <class Dispatcher> + using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const; + + template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + ObjectFreeShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, + const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) + : m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::free ) ) ) + , m_dispatch( &dispatch ) + , m_allocationCallbacks( allocationCallbacks ) + { + } + + public: + void destroy( DestructorType parent, HandleType handle ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( m_destroy && m_dispatch ); + ( parent.*m_destroy )( handle, m_allocationCallbacks, *m_dispatch ); + } + + private: + DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr; + const DispatchLoaderBase * m_dispatch = nullptr; + Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr; + }; + + template <typename HandleType> + class ObjectReleaseShared + { + public: + using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType; + + template <class Dispatcher> + using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const Dispatcher & ) const; + + template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + ObjectReleaseShared( const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) + : m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::release ) ) ) + , m_dispatch( &dispatch ) + { + } + + public: + void destroy( DestructorType parent, HandleType handle ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( m_destroy && m_dispatch ); + ( parent.*m_destroy )( handle, *m_dispatch ); + } + + private: + DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr; + const DispatchLoaderBase * m_dispatch = nullptr; + }; + + template <typename HandleType, typename PoolType> + class PoolFreeShared + { + public: + using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType; + + template <class Dispatcher> + using ReturnType = decltype( std::declval<DestructorType>().free( PoolType(), 0u, nullptr, Dispatcher() ) ); + + template <class Dispatcher> + using DestroyFunctionPointerType = ReturnType<Dispatcher> ( DestructorType::* )( PoolType, uint32_t, const HandleType *, const Dispatcher & ) const; + + PoolFreeShared() = default; + + template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + PoolFreeShared( SharedHandle<PoolType> pool, const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) + : m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::free ) ) ) + , m_dispatch( &dispatch ) + , m_pool( std::move( pool ) ) + { + } + + public: + void destroy( DestructorType parent, HandleType handle ) const VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( m_destroy && m_dispatch ); + ( parent.*m_destroy )( m_pool.get(), 1u, &handle, *m_dispatch ); + } + + private: + DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr; + const DispatchLoaderBase * m_dispatch = nullptr; + SharedHandle<PoolType> m_pool{}; + }; + +# if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER ) +# pragma GCC diagnostic pop +# endif + + //====================== + //=== SHARED HANDLEs === + //====================== + + //=== VK_VERSION_1_0 === + template <> + class SharedHandleTraits<Instance> + { + public: + using DestructorType = NoDestructor; + using deleter = ObjectDestroyShared<Instance>; + }; + using SharedInstance = SharedHandle<Instance>; + template <> + class SharedHandleTraits<Device> + { + public: + using DestructorType = NoDestructor; + using deleter = ObjectDestroyShared<Device>; + }; + using SharedDevice = SharedHandle<Device>; + template <> + class SharedHandleTraits<DeviceMemory> + { + public: + using DestructorType = Device; + using deleter = ObjectFreeShared<DeviceMemory>; + }; + using SharedDeviceMemory = SharedHandle<DeviceMemory>; + template <> + class SharedHandleTraits<Fence> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<Fence>; + }; + using SharedFence = SharedHandle<Fence>; + template <> + class SharedHandleTraits<Semaphore> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<Semaphore>; + }; + using SharedSemaphore = SharedHandle<Semaphore>; + template <> + class SharedHandleTraits<Event> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<Event>; + }; + using SharedEvent = SharedHandle<Event>; + template <> + class SharedHandleTraits<QueryPool> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<QueryPool>; + }; + using SharedQueryPool = SharedHandle<QueryPool>; + template <> + class SharedHandleTraits<Buffer> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<Buffer>; + }; + using SharedBuffer = SharedHandle<Buffer>; + template <> + class SharedHandleTraits<BufferView> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<BufferView>; + }; + using SharedBufferView = SharedHandle<BufferView>; + template <> + class SharedHandleTraits<Image> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<Image>; + }; + using SharedImage = SharedHandle<Image>; + template <> + class SharedHandleTraits<ImageView> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<ImageView>; + }; + using SharedImageView = SharedHandle<ImageView>; + template <> + class SharedHandleTraits<ShaderModule> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<ShaderModule>; + }; + using SharedShaderModule = SharedHandle<ShaderModule>; + template <> + class SharedHandleTraits<PipelineCache> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<PipelineCache>; + }; + using SharedPipelineCache = SharedHandle<PipelineCache>; + template <> + class SharedHandleTraits<Pipeline> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<Pipeline>; + }; + using SharedPipeline = SharedHandle<Pipeline>; + template <> + class SharedHandleTraits<PipelineLayout> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<PipelineLayout>; + }; + using SharedPipelineLayout = SharedHandle<PipelineLayout>; + template <> + class SharedHandleTraits<Sampler> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<Sampler>; + }; + using SharedSampler = SharedHandle<Sampler>; + template <> + class SharedHandleTraits<DescriptorPool> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<DescriptorPool>; + }; + using SharedDescriptorPool = SharedHandle<DescriptorPool>; + template <> + class SharedHandleTraits<DescriptorSet> + { + public: + using DestructorType = Device; + using deleter = PoolFreeShared<DescriptorSet, DescriptorPool>; + }; + using SharedDescriptorSet = SharedHandle<DescriptorSet>; + template <> + class SharedHandleTraits<DescriptorSetLayout> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<DescriptorSetLayout>; + }; + using SharedDescriptorSetLayout = SharedHandle<DescriptorSetLayout>; + template <> + class SharedHandleTraits<Framebuffer> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<Framebuffer>; + }; + using SharedFramebuffer = SharedHandle<Framebuffer>; + template <> + class SharedHandleTraits<RenderPass> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<RenderPass>; + }; + using SharedRenderPass = SharedHandle<RenderPass>; + template <> + class SharedHandleTraits<CommandPool> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<CommandPool>; + }; + using SharedCommandPool = SharedHandle<CommandPool>; + template <> + class SharedHandleTraits<CommandBuffer> + { + public: + using DestructorType = Device; + using deleter = PoolFreeShared<CommandBuffer, CommandPool>; + }; + using SharedCommandBuffer = SharedHandle<CommandBuffer>; + + //=== VK_VERSION_1_1 === + template <> + class SharedHandleTraits<SamplerYcbcrConversion> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<SamplerYcbcrConversion>; + }; + using SharedSamplerYcbcrConversion = SharedHandle<SamplerYcbcrConversion>; + using SharedSamplerYcbcrConversionKHR = SharedHandle<SamplerYcbcrConversion>; + template <> + class SharedHandleTraits<DescriptorUpdateTemplate> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<DescriptorUpdateTemplate>; + }; + using SharedDescriptorUpdateTemplate = SharedHandle<DescriptorUpdateTemplate>; + using SharedDescriptorUpdateTemplateKHR = SharedHandle<DescriptorUpdateTemplate>; + //=== VK_VERSION_1_3 === + template <> + class SharedHandleTraits<PrivateDataSlot> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<PrivateDataSlot>; + }; + using SharedPrivateDataSlot = SharedHandle<PrivateDataSlot>; + using SharedPrivateDataSlotEXT = SharedHandle<PrivateDataSlot>; + //=== VK_KHR_surface === + template <> + class SharedHandleTraits<SurfaceKHR> + { + public: + using DestructorType = Instance; + using deleter = ObjectDestroyShared<SurfaceKHR>; + }; + using SharedSurfaceKHR = SharedHandle<SurfaceKHR>; + + //=== VK_KHR_swapchain === + template <> + class SharedHandleTraits<SwapchainKHR> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<SwapchainKHR>; + }; + using SharedSwapchainKHR = SharedHandle<SwapchainKHR>; + + //=== VK_EXT_debug_report === + template <> + class SharedHandleTraits<DebugReportCallbackEXT> + { + public: + using DestructorType = Instance; + using deleter = ObjectDestroyShared<DebugReportCallbackEXT>; + }; + using SharedDebugReportCallbackEXT = SharedHandle<DebugReportCallbackEXT>; + + //=== VK_KHR_video_queue === + template <> + class SharedHandleTraits<VideoSessionKHR> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<VideoSessionKHR>; + }; + using SharedVideoSessionKHR = SharedHandle<VideoSessionKHR>; + template <> + class SharedHandleTraits<VideoSessionParametersKHR> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<VideoSessionParametersKHR>; + }; + using SharedVideoSessionParametersKHR = SharedHandle<VideoSessionParametersKHR>; + + //=== VK_NVX_binary_import === + template <> + class SharedHandleTraits<CuModuleNVX> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<CuModuleNVX>; + }; + using SharedCuModuleNVX = SharedHandle<CuModuleNVX>; + template <> + class SharedHandleTraits<CuFunctionNVX> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<CuFunctionNVX>; + }; + using SharedCuFunctionNVX = SharedHandle<CuFunctionNVX>; + + //=== VK_EXT_debug_utils === + template <> + class SharedHandleTraits<DebugUtilsMessengerEXT> + { + public: + using DestructorType = Instance; + using deleter = ObjectDestroyShared<DebugUtilsMessengerEXT>; + }; + using SharedDebugUtilsMessengerEXT = SharedHandle<DebugUtilsMessengerEXT>; + + //=== VK_KHR_acceleration_structure === + template <> + class SharedHandleTraits<AccelerationStructureKHR> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<AccelerationStructureKHR>; + }; + using SharedAccelerationStructureKHR = SharedHandle<AccelerationStructureKHR>; + + //=== VK_EXT_validation_cache === + template <> + class SharedHandleTraits<ValidationCacheEXT> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<ValidationCacheEXT>; + }; + using SharedValidationCacheEXT = SharedHandle<ValidationCacheEXT>; + + //=== VK_NV_ray_tracing === + template <> + class SharedHandleTraits<AccelerationStructureNV> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<AccelerationStructureNV>; + }; + using SharedAccelerationStructureNV = SharedHandle<AccelerationStructureNV>; + + //=== VK_KHR_deferred_host_operations === + template <> + class SharedHandleTraits<DeferredOperationKHR> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<DeferredOperationKHR>; + }; + using SharedDeferredOperationKHR = SharedHandle<DeferredOperationKHR>; + + //=== VK_NV_device_generated_commands === + template <> + class SharedHandleTraits<IndirectCommandsLayoutNV> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<IndirectCommandsLayoutNV>; + }; + using SharedIndirectCommandsLayoutNV = SharedHandle<IndirectCommandsLayoutNV>; + +# if defined( VK_USE_PLATFORM_FUCHSIA ) + //=== VK_FUCHSIA_buffer_collection === + template <> + class SharedHandleTraits<BufferCollectionFUCHSIA> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<BufferCollectionFUCHSIA>; + }; + using SharedBufferCollectionFUCHSIA = SharedHandle<BufferCollectionFUCHSIA>; +# endif /*VK_USE_PLATFORM_FUCHSIA*/ + + //=== VK_EXT_opacity_micromap === + template <> + class SharedHandleTraits<MicromapEXT> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<MicromapEXT>; + }; + using SharedMicromapEXT = SharedHandle<MicromapEXT>; + + //=== VK_NV_optical_flow === + template <> + class SharedHandleTraits<OpticalFlowSessionNV> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<OpticalFlowSessionNV>; + }; + using SharedOpticalFlowSessionNV = SharedHandle<OpticalFlowSessionNV>; + + //=== VK_EXT_shader_object === + template <> + class SharedHandleTraits<ShaderEXT> + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared<ShaderEXT>; + }; + using SharedShaderEXT = SharedHandle<ShaderEXT>; + + enum class SwapchainOwns + { + no, + yes, + }; + + struct ImageHeader : SharedHeader<DestructorTypeOf<VULKAN_HPP_NAMESPACE::Image>, typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::deleter> + { + ImageHeader( + SharedHandle<DestructorTypeOf<VULKAN_HPP_NAMESPACE::Image>> parent, + typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::deleter deleter = typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::deleter(), + SwapchainOwns swapchainOwned = SwapchainOwns::no ) VULKAN_HPP_NOEXCEPT + : SharedHeader<DestructorTypeOf<VULKAN_HPP_NAMESPACE::Image>, typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::deleter>( std::move( parent ), + std::move( deleter ) ) + , swapchainOwned( swapchainOwned ) + { + } + + SwapchainOwns swapchainOwned = SwapchainOwns::no; + }; + + template <> + class SharedHandle<VULKAN_HPP_NAMESPACE::Image> : public SharedHandleBase<VULKAN_HPP_NAMESPACE::Image, ImageHeader> + { + using BaseType = SharedHandleBase<VULKAN_HPP_NAMESPACE::Image, ImageHeader>; + using DeleterType = typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::deleter; + friend BaseType; + + public: + SharedHandle() = default; + + explicit SharedHandle( VULKAN_HPP_NAMESPACE::Image handle, + SharedHandle<DestructorTypeOf<VULKAN_HPP_NAMESPACE::Image>> parent, + SwapchainOwns swapchain_owned = SwapchainOwns::no, + DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT + : BaseType( handle, std::move( parent ), std::move( deleter ), swapchain_owned ) + { + } + + protected: + static void internalDestroy( const ImageHeader & control, VULKAN_HPP_NAMESPACE::Image handle ) VULKAN_HPP_NOEXCEPT + { + if ( control.swapchainOwned == SwapchainOwns::no ) + { + control.deleter.destroy( control.parent.get(), handle ); + } + } + }; + + struct SwapchainHeader + { + SwapchainHeader( SharedHandle<VULKAN_HPP_NAMESPACE::SurfaceKHR> surface, + SharedHandle<DestructorTypeOf<VULKAN_HPP_NAMESPACE::SwapchainKHR>> parent, + typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::SwapchainKHR>::deleter deleter = + typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::SwapchainKHR>::deleter() ) VULKAN_HPP_NOEXCEPT + : surface( std::move( surface ) ) + , parent( std::move( parent ) ) + , deleter( std::move( deleter ) ) + { + } + + SharedHandle<VULKAN_HPP_NAMESPACE::SurfaceKHR> surface{}; + SharedHandle<DestructorTypeOf<VULKAN_HPP_NAMESPACE::SwapchainKHR>> parent{}; + typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::SwapchainKHR>::deleter deleter{}; + }; + + template <> + class SharedHandle<VULKAN_HPP_NAMESPACE::SwapchainKHR> : public SharedHandleBase<VULKAN_HPP_NAMESPACE::SwapchainKHR, SwapchainHeader> + { + using BaseType = SharedHandleBase<VULKAN_HPP_NAMESPACE::SwapchainKHR, SwapchainHeader>; + using DeleterType = typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::SwapchainKHR>::deleter; + friend BaseType; + + public: + SharedHandle() = default; + + explicit SharedHandle( VULKAN_HPP_NAMESPACE::SwapchainKHR handle, + SharedHandle<DestructorTypeOf<VULKAN_HPP_NAMESPACE::SwapchainKHR>> parent, + SharedHandle<VULKAN_HPP_NAMESPACE::SurfaceKHR> surface, + DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT + : BaseType( handle, std::move( surface ), std::move( parent ), std::move( deleter ) ) + { + } + + public: + const SharedHandle<VULKAN_HPP_NAMESPACE::SurfaceKHR> & getSurface() const VULKAN_HPP_NOEXCEPT + { + return getHeader().surface; + } + + protected: + using BaseType::internalDestroy; + }; + + template <typename HandleType, typename DestructorType> + class SharedHandleBaseNoDestroy : public SharedHandleBase<HandleType, DestructorType> + { + public: + using SharedHandleBase<HandleType, DestructorType>::SharedHandleBase; + + const DestructorType & getDestructorType() const VULKAN_HPP_NOEXCEPT + { + return SharedHandleBase<HandleType, DestructorType>::getHeader(); + } + + protected: + static void internalDestroy( const DestructorType &, HandleType ) VULKAN_HPP_NOEXCEPT {} + }; + + //=== VK_VERSION_1_0 === + + template <> + class SharedHandle<PhysicalDevice> : public SharedHandleBaseNoDestroy<PhysicalDevice, SharedInstance> + { + friend SharedHandleBase<PhysicalDevice, SharedInstance>; + + public: + SharedHandle() = default; + explicit SharedHandle( PhysicalDevice handle, SharedInstance parent ) noexcept + : SharedHandleBaseNoDestroy<PhysicalDevice, SharedInstance>( handle, std::move( parent ) ) + { + } + }; + using SharedPhysicalDevice = SharedHandle<PhysicalDevice>; + + template <> + class SharedHandle<Queue> : public SharedHandleBaseNoDestroy<Queue, SharedDevice> + { + friend SharedHandleBase<Queue, SharedDevice>; + + public: + SharedHandle() = default; + explicit SharedHandle( Queue handle, SharedDevice parent ) noexcept : SharedHandleBaseNoDestroy<Queue, SharedDevice>( handle, std::move( parent ) ) {} + }; + using SharedQueue = SharedHandle<Queue>; + + //=== VK_KHR_display === + + template <> + class SharedHandle<DisplayKHR> : public SharedHandleBaseNoDestroy<DisplayKHR, SharedPhysicalDevice> + { + friend SharedHandleBase<DisplayKHR, SharedPhysicalDevice>; + + public: + SharedHandle() = default; + explicit SharedHandle( DisplayKHR handle, SharedPhysicalDevice parent ) noexcept + : SharedHandleBaseNoDestroy<DisplayKHR, SharedPhysicalDevice>( handle, std::move( parent ) ) + { + } + }; + using SharedDisplayKHR = SharedHandle<DisplayKHR>; + + template <> + class SharedHandle<DisplayModeKHR> : public SharedHandleBaseNoDestroy<DisplayModeKHR, SharedDisplayKHR> + { + friend SharedHandleBase<DisplayModeKHR, SharedDisplayKHR>; + + public: + SharedHandle() = default; + explicit SharedHandle( DisplayModeKHR handle, SharedDisplayKHR parent ) noexcept + : SharedHandleBaseNoDestroy<DisplayModeKHR, SharedDisplayKHR>( handle, std::move( parent ) ) + { + } + }; + using SharedDisplayModeKHR = SharedHandle<DisplayModeKHR>; + + //=== VK_INTEL_performance_query === + + template <> + class SharedHandle<PerformanceConfigurationINTEL> : public SharedHandleBaseNoDestroy<PerformanceConfigurationINTEL, SharedDevice> + { + friend SharedHandleBase<PerformanceConfigurationINTEL, SharedDevice>; + + public: + SharedHandle() = default; + explicit SharedHandle( PerformanceConfigurationINTEL handle, SharedDevice parent ) noexcept + : SharedHandleBaseNoDestroy<PerformanceConfigurationINTEL, SharedDevice>( handle, std::move( parent ) ) + { + } + }; + using SharedPerformanceConfigurationINTEL = SharedHandle<PerformanceConfigurationINTEL>; +#endif // !VULKAN_HPP_NO_SMART_HANDLE +} // namespace VULKAN_HPP_NAMESPACE +#endif // VULKAN_SHARED_HPP diff --git a/thirdparty/vulkan/include/vulkan/vulkan_static_assertions.hpp b/thirdparty/vulkan/include/vulkan/vulkan_static_assertions.hpp index 1fb34dbc25..a42e54d2cf 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_static_assertions.hpp +++ b/thirdparty/vulkan/include/vulkan/vulkan_static_assertions.hpp @@ -5882,6 +5882,20 @@ VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::Physical VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDevicePipelinePropertiesFeaturesEXT>::value, "PhysicalDevicePipelinePropertiesFeaturesEXT is not nothrow_move_constructible!" ); +//=== VK_EXT_frame_boundary === + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFrameBoundaryFeaturesEXT ) == sizeof( VkPhysicalDeviceFrameBoundaryFeaturesEXT ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceFrameBoundaryFeaturesEXT>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceFrameBoundaryFeaturesEXT>::value, + "PhysicalDeviceFrameBoundaryFeaturesEXT is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FrameBoundaryEXT ) == sizeof( VkFrameBoundaryEXT ), "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::FrameBoundaryEXT>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::FrameBoundaryEXT>::value, + "FrameBoundaryEXT is not nothrow_move_constructible!" ); + //=== VK_EXT_multisampled_render_to_single_sampled === VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT ) == @@ -6405,6 +6419,24 @@ VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::Physical VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessingPropertiesQCOM>::value, "PhysicalDeviceImageProcessingPropertiesQCOM is not nothrow_move_constructible!" ); +//=== VK_EXT_nested_command_buffer === + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferFeaturesEXT ) == + sizeof( VkPhysicalDeviceNestedCommandBufferFeaturesEXT ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferFeaturesEXT>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferFeaturesEXT>::value, + "PhysicalDeviceNestedCommandBufferFeaturesEXT is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferPropertiesEXT ) == + sizeof( VkPhysicalDeviceNestedCommandBufferPropertiesEXT ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferPropertiesEXT>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferPropertiesEXT>::value, + "PhysicalDeviceNestedCommandBufferPropertiesEXT is not nothrow_move_constructible!" ); + //=== VK_EXT_external_memory_acquire_unmodified === VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExternalMemoryAcquireUnmodifiedEXT ) == sizeof( VkExternalMemoryAcquireUnmodifiedEXT ), @@ -6613,6 +6645,34 @@ VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::Physical VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDevicePipelineProtectedAccessFeaturesEXT>::value, "PhysicalDevicePipelineProtectedAccessFeaturesEXT is not nothrow_move_constructible!" ); +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) +//=== VK_ANDROID_external_format_resolve === + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolveFeaturesANDROID ) == + sizeof( VkPhysicalDeviceExternalFormatResolveFeaturesANDROID ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolveFeaturesANDROID>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolveFeaturesANDROID>::value, + "PhysicalDeviceExternalFormatResolveFeaturesANDROID is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolvePropertiesANDROID ) == + sizeof( VkPhysicalDeviceExternalFormatResolvePropertiesANDROID ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolvePropertiesANDROID>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolvePropertiesANDROID>::value, + "PhysicalDeviceExternalFormatResolvePropertiesANDROID is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AndroidHardwareBufferFormatResolvePropertiesANDROID ) == + sizeof( VkAndroidHardwareBufferFormatResolvePropertiesANDROID ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::AndroidHardwareBufferFormatResolvePropertiesANDROID>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::AndroidHardwareBufferFormatResolvePropertiesANDROID>::value, + "AndroidHardwareBufferFormatResolvePropertiesANDROID is not nothrow_move_constructible!" ); +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + //=== VK_KHR_maintenance5 === VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMaintenance5FeaturesKHR ) == sizeof( VkPhysicalDeviceMaintenance5FeaturesKHR ), @@ -6754,6 +6814,24 @@ VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::Physical VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingInvocationReorderFeaturesNV>::value, "PhysicalDeviceRayTracingInvocationReorderFeaturesNV is not nothrow_move_constructible!" ); +//=== VK_NV_extended_sparse_address_space === + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV ) == + sizeof( VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV>::value, + "PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpacePropertiesNV ) == + sizeof( VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpacePropertiesNV>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpacePropertiesNV>::value, + "PhysicalDeviceExtendedSparseAddressSpacePropertiesNV is not nothrow_move_constructible!" ); + //=== VK_EXT_mutable_descriptor_type === VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMutableDescriptorTypeFeaturesEXT ) == @@ -6815,6 +6893,61 @@ VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::Physical VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT>::value, "PhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT is not nothrow_move_constructible!" ); +//=== VK_NV_low_latency2 === + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV ) == sizeof( VkLatencySleepModeInfoNV ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV>::value, + "LatencySleepModeInfoNV is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::LatencySleepInfoNV ) == sizeof( VkLatencySleepInfoNV ), "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::LatencySleepInfoNV>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::LatencySleepInfoNV>::value, + "LatencySleepInfoNV is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV ) == sizeof( VkSetLatencyMarkerInfoNV ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV>::value, + "SetLatencyMarkerInfoNV is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV ) == sizeof( VkGetLatencyMarkerInfoNV ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV>::value, + "GetLatencyMarkerInfoNV is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::LatencyTimingsFrameReportNV ) == sizeof( VkLatencyTimingsFrameReportNV ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::LatencyTimingsFrameReportNV>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::LatencyTimingsFrameReportNV>::value, + "LatencyTimingsFrameReportNV is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::LatencySubmissionPresentIdNV ) == sizeof( VkLatencySubmissionPresentIdNV ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::LatencySubmissionPresentIdNV>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::LatencySubmissionPresentIdNV>::value, + "LatencySubmissionPresentIdNV is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SwapchainLatencyCreateInfoNV ) == sizeof( VkSwapchainLatencyCreateInfoNV ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::SwapchainLatencyCreateInfoNV>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::SwapchainLatencyCreateInfoNV>::value, + "SwapchainLatencyCreateInfoNV is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV ) == sizeof( VkOutOfBandQueueTypeInfoNV ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV>::value, + "OutOfBandQueueTypeInfoNV is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::LatencySurfaceCapabilitiesNV ) == sizeof( VkLatencySurfaceCapabilitiesNV ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::LatencySurfaceCapabilitiesNV>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::LatencySurfaceCapabilitiesNV>::value, + "LatencySurfaceCapabilitiesNV is not nothrow_move_constructible!" ); + //=== VK_KHR_cooperative_matrix === VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CooperativeMatrixPropertiesKHR ) == sizeof( VkCooperativeMatrixPropertiesKHR ), @@ -6856,6 +6989,77 @@ VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::Multivie VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM>::value, "MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM is not nothrow_move_constructible!" ); +//=== VK_QCOM_image_processing2 === + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2FeaturesQCOM ) == sizeof( VkPhysicalDeviceImageProcessing2FeaturesQCOM ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2FeaturesQCOM>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2FeaturesQCOM>::value, + "PhysicalDeviceImageProcessing2FeaturesQCOM is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2PropertiesQCOM ) == + sizeof( VkPhysicalDeviceImageProcessing2PropertiesQCOM ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2PropertiesQCOM>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2PropertiesQCOM>::value, + "PhysicalDeviceImageProcessing2PropertiesQCOM is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SamplerBlockMatchWindowCreateInfoQCOM ) == sizeof( VkSamplerBlockMatchWindowCreateInfoQCOM ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::SamplerBlockMatchWindowCreateInfoQCOM>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::SamplerBlockMatchWindowCreateInfoQCOM>::value, + "SamplerBlockMatchWindowCreateInfoQCOM is not nothrow_move_constructible!" ); + +//=== VK_QCOM_filter_cubic_weights === + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicWeightsFeaturesQCOM ) == sizeof( VkPhysicalDeviceCubicWeightsFeaturesQCOM ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicWeightsFeaturesQCOM>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicWeightsFeaturesQCOM>::value, + "PhysicalDeviceCubicWeightsFeaturesQCOM is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SamplerCubicWeightsCreateInfoQCOM ) == sizeof( VkSamplerCubicWeightsCreateInfoQCOM ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::SamplerCubicWeightsCreateInfoQCOM>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::SamplerCubicWeightsCreateInfoQCOM>::value, + "SamplerCubicWeightsCreateInfoQCOM is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BlitImageCubicWeightsInfoQCOM ) == sizeof( VkBlitImageCubicWeightsInfoQCOM ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::BlitImageCubicWeightsInfoQCOM>::value, "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::BlitImageCubicWeightsInfoQCOM>::value, + "BlitImageCubicWeightsInfoQCOM is not nothrow_move_constructible!" ); + +//=== VK_QCOM_ycbcr_degamma === + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcrDegammaFeaturesQCOM ) == sizeof( VkPhysicalDeviceYcbcrDegammaFeaturesQCOM ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcrDegammaFeaturesQCOM>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcrDegammaFeaturesQCOM>::value, + "PhysicalDeviceYcbcrDegammaFeaturesQCOM is not nothrow_move_constructible!" ); + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM ) == + sizeof( VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM>::value, + "SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM is not nothrow_move_constructible!" ); + +//=== VK_QCOM_filter_cubic_clamp === + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicClampFeaturesQCOM ) == sizeof( VkPhysicalDeviceCubicClampFeaturesQCOM ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicClampFeaturesQCOM>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicClampFeaturesQCOM>::value, + "PhysicalDeviceCubicClampFeaturesQCOM is not nothrow_move_constructible!" ); + //=== VK_EXT_attachment_feedback_loop_dynamic_state === VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT ) == @@ -6901,4 +7105,23 @@ VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPAC "PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX is not nothrow_move_constructible!" ); #endif /*VK_USE_PLATFORM_SCREEN_QNX*/ +//=== VK_MSFT_layered_driver === + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceLayeredDriverPropertiesMSFT ) == sizeof( VkPhysicalDeviceLayeredDriverPropertiesMSFT ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceLayeredDriverPropertiesMSFT>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceLayeredDriverPropertiesMSFT>::value, + "PhysicalDeviceLayeredDriverPropertiesMSFT is not nothrow_move_constructible!" ); + +//=== VK_NV_descriptor_pool_overallocation === + +VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorPoolOverallocationFeaturesNV ) == + sizeof( VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV ), + "struct and wrapper have different size!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout<VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorPoolOverallocationFeaturesNV>::value, + "struct wrapper is not a standard layout!" ); +VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible<VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorPoolOverallocationFeaturesNV>::value, + "PhysicalDeviceDescriptorPoolOverallocationFeaturesNV is not nothrow_move_constructible!" ); + #endif diff --git a/thirdparty/vulkan/include/vulkan/vulkan_structs.hpp b/thirdparty/vulkan/include/vulkan/vulkan_structs.hpp index 8ffe8f2e68..b7bf6450eb 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_structs.hpp +++ b/thirdparty/vulkan/include/vulkan/vulkan_structs.hpp @@ -5098,6 +5098,94 @@ namespace VULKAN_HPP_NAMESPACE #endif /*VK_USE_PLATFORM_ANDROID_KHR*/ #if defined( VK_USE_PLATFORM_ANDROID_KHR ) + struct AndroidHardwareBufferFormatResolvePropertiesANDROID + { + using NativeType = VkAndroidHardwareBufferFormatResolvePropertiesANDROID; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAndroidHardwareBufferFormatResolvePropertiesANDROID; + +# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR + AndroidHardwareBufferFormatResolvePropertiesANDROID( VULKAN_HPP_NAMESPACE::Format colorAttachmentFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , colorAttachmentFormat( colorAttachmentFormat_ ) + { + } + + VULKAN_HPP_CONSTEXPR + AndroidHardwareBufferFormatResolvePropertiesANDROID( AndroidHardwareBufferFormatResolvePropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + AndroidHardwareBufferFormatResolvePropertiesANDROID( VkAndroidHardwareBufferFormatResolvePropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT + : AndroidHardwareBufferFormatResolvePropertiesANDROID( *reinterpret_cast<AndroidHardwareBufferFormatResolvePropertiesANDROID const *>( &rhs ) ) + { + } + + AndroidHardwareBufferFormatResolvePropertiesANDROID & + operator=( AndroidHardwareBufferFormatResolvePropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; +# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + AndroidHardwareBufferFormatResolvePropertiesANDROID & operator=( VkAndroidHardwareBufferFormatResolvePropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::AndroidHardwareBufferFormatResolvePropertiesANDROID const *>( &rhs ); + return *this; + } + + operator VkAndroidHardwareBufferFormatResolvePropertiesANDROID const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkAndroidHardwareBufferFormatResolvePropertiesANDROID *>( this ); + } + + operator VkAndroidHardwareBufferFormatResolvePropertiesANDROID &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkAndroidHardwareBufferFormatResolvePropertiesANDROID *>( this ); + } + +# if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::Format const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, colorAttachmentFormat ); + } +# endif + +# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( AndroidHardwareBufferFormatResolvePropertiesANDROID const & ) const = default; +# else + bool operator==( AndroidHardwareBufferFormatResolvePropertiesANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( colorAttachmentFormat == rhs.colorAttachmentFormat ); +# endif + } + + bool operator!=( AndroidHardwareBufferFormatResolvePropertiesANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +# endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAndroidHardwareBufferFormatResolvePropertiesANDROID; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Format colorAttachmentFormat = VULKAN_HPP_NAMESPACE::Format::eUndefined; + }; + + template <> + struct CppType<StructureType, StructureType::eAndroidHardwareBufferFormatResolvePropertiesANDROID> + { + using Type = AndroidHardwareBufferFormatResolvePropertiesANDROID; + }; +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) struct AndroidHardwareBufferPropertiesANDROID { using NativeType = VkAndroidHardwareBufferPropertiesANDROID; @@ -9691,6 +9779,104 @@ namespace VULKAN_HPP_NAMESPACE using Type = BindVideoSessionMemoryInfoKHR; }; + struct BlitImageCubicWeightsInfoQCOM + { + using NativeType = VkBlitImageCubicWeightsInfoQCOM; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBlitImageCubicWeightsInfoQCOM; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR + BlitImageCubicWeightsInfoQCOM( VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM cubicWeights_ = VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM::eCatmullRom, + const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , cubicWeights( cubicWeights_ ) + { + } + + VULKAN_HPP_CONSTEXPR BlitImageCubicWeightsInfoQCOM( BlitImageCubicWeightsInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + BlitImageCubicWeightsInfoQCOM( VkBlitImageCubicWeightsInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + : BlitImageCubicWeightsInfoQCOM( *reinterpret_cast<BlitImageCubicWeightsInfoQCOM const *>( &rhs ) ) + { + } + + BlitImageCubicWeightsInfoQCOM & operator=( BlitImageCubicWeightsInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + BlitImageCubicWeightsInfoQCOM & operator=( VkBlitImageCubicWeightsInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::BlitImageCubicWeightsInfoQCOM const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 BlitImageCubicWeightsInfoQCOM & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 BlitImageCubicWeightsInfoQCOM & setCubicWeights( VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM cubicWeights_ ) VULKAN_HPP_NOEXCEPT + { + cubicWeights = cubicWeights_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkBlitImageCubicWeightsInfoQCOM const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkBlitImageCubicWeightsInfoQCOM *>( this ); + } + + operator VkBlitImageCubicWeightsInfoQCOM &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkBlitImageCubicWeightsInfoQCOM *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, const void * const &, VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, cubicWeights ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( BlitImageCubicWeightsInfoQCOM const & ) const = default; +#else + bool operator==( BlitImageCubicWeightsInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( cubicWeights == rhs.cubicWeights ); +# endif + } + + bool operator!=( BlitImageCubicWeightsInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBlitImageCubicWeightsInfoQCOM; + const void * pNext = {}; + VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM cubicWeights = VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM::eCatmullRom; + }; + + template <> + struct CppType<StructureType, StructureType::eBlitImageCubicWeightsInfoQCOM> + { + using Type = BlitImageCubicWeightsInfoQCOM; + }; + struct ImageSubresourceLayers { using NativeType = VkImageSubresourceLayers; @@ -36596,6 +36782,235 @@ namespace VULKAN_HPP_NAMESPACE using Type = FragmentShadingRateAttachmentInfoKHR; }; + struct FrameBoundaryEXT + { + using NativeType = VkFrameBoundaryEXT; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFrameBoundaryEXT; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR FrameBoundaryEXT( VULKAN_HPP_NAMESPACE::FrameBoundaryFlagsEXT flags_ = {}, + uint64_t frameID_ = {}, + uint32_t imageCount_ = {}, + const VULKAN_HPP_NAMESPACE::Image * pImages_ = {}, + uint32_t bufferCount_ = {}, + const VULKAN_HPP_NAMESPACE::Buffer * pBuffers_ = {}, + uint64_t tagName_ = {}, + size_t tagSize_ = {}, + const void * pTag_ = {}, + const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , flags( flags_ ) + , frameID( frameID_ ) + , imageCount( imageCount_ ) + , pImages( pImages_ ) + , bufferCount( bufferCount_ ) + , pBuffers( pBuffers_ ) + , tagName( tagName_ ) + , tagSize( tagSize_ ) + , pTag( pTag_ ) + { + } + + VULKAN_HPP_CONSTEXPR FrameBoundaryEXT( FrameBoundaryEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + FrameBoundaryEXT( VkFrameBoundaryEXT const & rhs ) VULKAN_HPP_NOEXCEPT : FrameBoundaryEXT( *reinterpret_cast<FrameBoundaryEXT const *>( &rhs ) ) {} + +# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) + template <typename T> + FrameBoundaryEXT( VULKAN_HPP_NAMESPACE::FrameBoundaryFlagsEXT flags_, + uint64_t frameID_, + VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const VULKAN_HPP_NAMESPACE::Image> const & images_, + VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const VULKAN_HPP_NAMESPACE::Buffer> const & buffers_ = {}, + uint64_t tagName_ = {}, + VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const T> const & tag_ = {}, + const void * pNext_ = nullptr ) + : pNext( pNext_ ) + , flags( flags_ ) + , frameID( frameID_ ) + , imageCount( static_cast<uint32_t>( images_.size() ) ) + , pImages( images_.data() ) + , bufferCount( static_cast<uint32_t>( buffers_.size() ) ) + , pBuffers( buffers_.data() ) + , tagName( tagName_ ) + , tagSize( tag_.size() * sizeof( T ) ) + , pTag( tag_.data() ) + { + } +# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + FrameBoundaryEXT & operator=( FrameBoundaryEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + FrameBoundaryEXT & operator=( VkFrameBoundaryEXT const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::FrameBoundaryEXT const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 FrameBoundaryEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 FrameBoundaryEXT & setFlags( VULKAN_HPP_NAMESPACE::FrameBoundaryFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT + { + flags = flags_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 FrameBoundaryEXT & setFrameID( uint64_t frameID_ ) VULKAN_HPP_NOEXCEPT + { + frameID = frameID_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 FrameBoundaryEXT & setImageCount( uint32_t imageCount_ ) VULKAN_HPP_NOEXCEPT + { + imageCount = imageCount_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 FrameBoundaryEXT & setPImages( const VULKAN_HPP_NAMESPACE::Image * pImages_ ) VULKAN_HPP_NOEXCEPT + { + pImages = pImages_; + return *this; + } + +# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) + FrameBoundaryEXT & setImages( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const VULKAN_HPP_NAMESPACE::Image> const & images_ ) VULKAN_HPP_NOEXCEPT + { + imageCount = static_cast<uint32_t>( images_.size() ); + pImages = images_.data(); + return *this; + } +# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_CONSTEXPR_14 FrameBoundaryEXT & setBufferCount( uint32_t bufferCount_ ) VULKAN_HPP_NOEXCEPT + { + bufferCount = bufferCount_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 FrameBoundaryEXT & setPBuffers( const VULKAN_HPP_NAMESPACE::Buffer * pBuffers_ ) VULKAN_HPP_NOEXCEPT + { + pBuffers = pBuffers_; + return *this; + } + +# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) + FrameBoundaryEXT & setBuffers( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const VULKAN_HPP_NAMESPACE::Buffer> const & buffers_ ) VULKAN_HPP_NOEXCEPT + { + bufferCount = static_cast<uint32_t>( buffers_.size() ); + pBuffers = buffers_.data(); + return *this; + } +# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_CONSTEXPR_14 FrameBoundaryEXT & setTagName( uint64_t tagName_ ) VULKAN_HPP_NOEXCEPT + { + tagName = tagName_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 FrameBoundaryEXT & setTagSize( size_t tagSize_ ) VULKAN_HPP_NOEXCEPT + { + tagSize = tagSize_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 FrameBoundaryEXT & setPTag( const void * pTag_ ) VULKAN_HPP_NOEXCEPT + { + pTag = pTag_; + return *this; + } + +# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) + template <typename T> + FrameBoundaryEXT & setTag( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const T> const & tag_ ) VULKAN_HPP_NOEXCEPT + { + tagSize = tag_.size() * sizeof( T ); + pTag = tag_.data(); + return *this; + } +# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkFrameBoundaryEXT const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkFrameBoundaryEXT *>( this ); + } + + operator VkFrameBoundaryEXT &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkFrameBoundaryEXT *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, + const void * const &, + VULKAN_HPP_NAMESPACE::FrameBoundaryFlagsEXT const &, + uint64_t const &, + uint32_t const &, + const VULKAN_HPP_NAMESPACE::Image * const &, + uint32_t const &, + const VULKAN_HPP_NAMESPACE::Buffer * const &, + uint64_t const &, + size_t const &, + const void * const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, flags, frameID, imageCount, pImages, bufferCount, pBuffers, tagName, tagSize, pTag ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( FrameBoundaryEXT const & ) const = default; +#else + bool operator==( FrameBoundaryEXT const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( frameID == rhs.frameID ) && ( imageCount == rhs.imageCount ) && + ( pImages == rhs.pImages ) && ( bufferCount == rhs.bufferCount ) && ( pBuffers == rhs.pBuffers ) && ( tagName == rhs.tagName ) && + ( tagSize == rhs.tagSize ) && ( pTag == rhs.pTag ); +# endif + } + + bool operator!=( FrameBoundaryEXT const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFrameBoundaryEXT; + const void * pNext = {}; + VULKAN_HPP_NAMESPACE::FrameBoundaryFlagsEXT flags = {}; + uint64_t frameID = {}; + uint32_t imageCount = {}; + const VULKAN_HPP_NAMESPACE::Image * pImages = {}; + uint32_t bufferCount = {}; + const VULKAN_HPP_NAMESPACE::Buffer * pBuffers = {}; + uint64_t tagName = {}; + size_t tagSize = {}; + const void * pTag = {}; + }; + + template <> + struct CppType<StructureType, StructureType::eFrameBoundaryEXT> + { + using Type = FrameBoundaryEXT; + }; + struct FramebufferAttachmentImageInfo { using NativeType = VkFramebufferAttachmentImageInfo; @@ -37713,6 +38128,352 @@ namespace VULKAN_HPP_NAMESPACE using Type = GeneratedCommandsMemoryRequirementsInfoNV; }; + struct LatencyTimingsFrameReportNV + { + using NativeType = VkLatencyTimingsFrameReportNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eLatencyTimingsFrameReportNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR LatencyTimingsFrameReportNV( uint64_t presentID_ = {}, + uint64_t inputSampleTimeUs_ = {}, + uint64_t simStartTimeUs_ = {}, + uint64_t simEndTimeUs_ = {}, + uint64_t renderSubmitStartTimeUs_ = {}, + uint64_t renderSubmitEndTimeUs_ = {}, + uint64_t presentStartTimeUs_ = {}, + uint64_t presentEndTimeUs_ = {}, + uint64_t driverStartTimeUs_ = {}, + uint64_t driverEndTimeUs_ = {}, + uint64_t osRenderQueueStartTimeUs_ = {}, + uint64_t osRenderQueueEndTimeUs_ = {}, + uint64_t gpuRenderStartTimeUs_ = {}, + uint64_t gpuRenderEndTimeUs_ = {}, + const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , presentID( presentID_ ) + , inputSampleTimeUs( inputSampleTimeUs_ ) + , simStartTimeUs( simStartTimeUs_ ) + , simEndTimeUs( simEndTimeUs_ ) + , renderSubmitStartTimeUs( renderSubmitStartTimeUs_ ) + , renderSubmitEndTimeUs( renderSubmitEndTimeUs_ ) + , presentStartTimeUs( presentStartTimeUs_ ) + , presentEndTimeUs( presentEndTimeUs_ ) + , driverStartTimeUs( driverStartTimeUs_ ) + , driverEndTimeUs( driverEndTimeUs_ ) + , osRenderQueueStartTimeUs( osRenderQueueStartTimeUs_ ) + , osRenderQueueEndTimeUs( osRenderQueueEndTimeUs_ ) + , gpuRenderStartTimeUs( gpuRenderStartTimeUs_ ) + , gpuRenderEndTimeUs( gpuRenderEndTimeUs_ ) + { + } + + VULKAN_HPP_CONSTEXPR LatencyTimingsFrameReportNV( LatencyTimingsFrameReportNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + LatencyTimingsFrameReportNV( VkLatencyTimingsFrameReportNV const & rhs ) VULKAN_HPP_NOEXCEPT + : LatencyTimingsFrameReportNV( *reinterpret_cast<LatencyTimingsFrameReportNV const *>( &rhs ) ) + { + } + + LatencyTimingsFrameReportNV & operator=( LatencyTimingsFrameReportNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + LatencyTimingsFrameReportNV & operator=( VkLatencyTimingsFrameReportNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::LatencyTimingsFrameReportNV const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setPresentID( uint64_t presentID_ ) VULKAN_HPP_NOEXCEPT + { + presentID = presentID_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setInputSampleTimeUs( uint64_t inputSampleTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + inputSampleTimeUs = inputSampleTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setSimStartTimeUs( uint64_t simStartTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + simStartTimeUs = simStartTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setSimEndTimeUs( uint64_t simEndTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + simEndTimeUs = simEndTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setRenderSubmitStartTimeUs( uint64_t renderSubmitStartTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + renderSubmitStartTimeUs = renderSubmitStartTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setRenderSubmitEndTimeUs( uint64_t renderSubmitEndTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + renderSubmitEndTimeUs = renderSubmitEndTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setPresentStartTimeUs( uint64_t presentStartTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + presentStartTimeUs = presentStartTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setPresentEndTimeUs( uint64_t presentEndTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + presentEndTimeUs = presentEndTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setDriverStartTimeUs( uint64_t driverStartTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + driverStartTimeUs = driverStartTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setDriverEndTimeUs( uint64_t driverEndTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + driverEndTimeUs = driverEndTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setOsRenderQueueStartTimeUs( uint64_t osRenderQueueStartTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + osRenderQueueStartTimeUs = osRenderQueueStartTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setOsRenderQueueEndTimeUs( uint64_t osRenderQueueEndTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + osRenderQueueEndTimeUs = osRenderQueueEndTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setGpuRenderStartTimeUs( uint64_t gpuRenderStartTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + gpuRenderStartTimeUs = gpuRenderStartTimeUs_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencyTimingsFrameReportNV & setGpuRenderEndTimeUs( uint64_t gpuRenderEndTimeUs_ ) VULKAN_HPP_NOEXCEPT + { + gpuRenderEndTimeUs = gpuRenderEndTimeUs_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkLatencyTimingsFrameReportNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkLatencyTimingsFrameReportNV *>( this ); + } + + operator VkLatencyTimingsFrameReportNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkLatencyTimingsFrameReportNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, + const void * const &, + uint64_t const &, + uint64_t const &, + uint64_t const &, + uint64_t const &, + uint64_t const &, + uint64_t const &, + uint64_t const &, + uint64_t const &, + uint64_t const &, + uint64_t const &, + uint64_t const &, + uint64_t const &, + uint64_t const &, + uint64_t const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, + pNext, + presentID, + inputSampleTimeUs, + simStartTimeUs, + simEndTimeUs, + renderSubmitStartTimeUs, + renderSubmitEndTimeUs, + presentStartTimeUs, + presentEndTimeUs, + driverStartTimeUs, + driverEndTimeUs, + osRenderQueueStartTimeUs, + osRenderQueueEndTimeUs, + gpuRenderStartTimeUs, + gpuRenderEndTimeUs ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( LatencyTimingsFrameReportNV const & ) const = default; +#else + bool operator==( LatencyTimingsFrameReportNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( presentID == rhs.presentID ) && ( inputSampleTimeUs == rhs.inputSampleTimeUs ) && + ( simStartTimeUs == rhs.simStartTimeUs ) && ( simEndTimeUs == rhs.simEndTimeUs ) && ( renderSubmitStartTimeUs == rhs.renderSubmitStartTimeUs ) && + ( renderSubmitEndTimeUs == rhs.renderSubmitEndTimeUs ) && ( presentStartTimeUs == rhs.presentStartTimeUs ) && + ( presentEndTimeUs == rhs.presentEndTimeUs ) && ( driverStartTimeUs == rhs.driverStartTimeUs ) && ( driverEndTimeUs == rhs.driverEndTimeUs ) && + ( osRenderQueueStartTimeUs == rhs.osRenderQueueStartTimeUs ) && ( osRenderQueueEndTimeUs == rhs.osRenderQueueEndTimeUs ) && + ( gpuRenderStartTimeUs == rhs.gpuRenderStartTimeUs ) && ( gpuRenderEndTimeUs == rhs.gpuRenderEndTimeUs ); +# endif + } + + bool operator!=( LatencyTimingsFrameReportNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eLatencyTimingsFrameReportNV; + const void * pNext = {}; + uint64_t presentID = {}; + uint64_t inputSampleTimeUs = {}; + uint64_t simStartTimeUs = {}; + uint64_t simEndTimeUs = {}; + uint64_t renderSubmitStartTimeUs = {}; + uint64_t renderSubmitEndTimeUs = {}; + uint64_t presentStartTimeUs = {}; + uint64_t presentEndTimeUs = {}; + uint64_t driverStartTimeUs = {}; + uint64_t driverEndTimeUs = {}; + uint64_t osRenderQueueStartTimeUs = {}; + uint64_t osRenderQueueEndTimeUs = {}; + uint64_t gpuRenderStartTimeUs = {}; + uint64_t gpuRenderEndTimeUs = {}; + }; + + template <> + struct CppType<StructureType, StructureType::eLatencyTimingsFrameReportNV> + { + using Type = LatencyTimingsFrameReportNV; + }; + + struct GetLatencyMarkerInfoNV + { + using NativeType = VkGetLatencyMarkerInfoNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eGetLatencyMarkerInfoNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR GetLatencyMarkerInfoNV( VULKAN_HPP_NAMESPACE::LatencyTimingsFrameReportNV * pTimings_ = {}, + const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , pTimings( pTimings_ ) + { + } + + VULKAN_HPP_CONSTEXPR GetLatencyMarkerInfoNV( GetLatencyMarkerInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + GetLatencyMarkerInfoNV( VkGetLatencyMarkerInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT + : GetLatencyMarkerInfoNV( *reinterpret_cast<GetLatencyMarkerInfoNV const *>( &rhs ) ) + { + } + + GetLatencyMarkerInfoNV & operator=( GetLatencyMarkerInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + GetLatencyMarkerInfoNV & operator=( VkGetLatencyMarkerInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::GetLatencyMarkerInfoNV const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 GetLatencyMarkerInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 GetLatencyMarkerInfoNV & setPTimings( VULKAN_HPP_NAMESPACE::LatencyTimingsFrameReportNV * pTimings_ ) VULKAN_HPP_NOEXCEPT + { + pTimings = pTimings_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkGetLatencyMarkerInfoNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkGetLatencyMarkerInfoNV *>( this ); + } + + operator VkGetLatencyMarkerInfoNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkGetLatencyMarkerInfoNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, const void * const &, VULKAN_HPP_NAMESPACE::LatencyTimingsFrameReportNV * const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, pTimings ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( GetLatencyMarkerInfoNV const & ) const = default; +#else + bool operator==( GetLatencyMarkerInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pTimings == rhs.pTimings ); +# endif + } + + bool operator!=( GetLatencyMarkerInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eGetLatencyMarkerInfoNV; + const void * pNext = {}; + VULKAN_HPP_NAMESPACE::LatencyTimingsFrameReportNV * pTimings = {}; + }; + + template <> + struct CppType<StructureType, StructureType::eGetLatencyMarkerInfoNV> + { + using Type = GetLatencyMarkerInfoNV; + }; + struct VertexInputBindingDescription { using NativeType = VkVertexInputBindingDescription; @@ -47598,6 +48359,448 @@ namespace VULKAN_HPP_NAMESPACE using Type = InstanceCreateInfo; }; + struct LatencySleepInfoNV + { + using NativeType = VkLatencySleepInfoNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eLatencySleepInfoNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR + LatencySleepInfoNV( VULKAN_HPP_NAMESPACE::Semaphore signalSemaphore_ = {}, uint64_t value_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , signalSemaphore( signalSemaphore_ ) + , value( value_ ) + { + } + + VULKAN_HPP_CONSTEXPR LatencySleepInfoNV( LatencySleepInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + LatencySleepInfoNV( VkLatencySleepInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT : LatencySleepInfoNV( *reinterpret_cast<LatencySleepInfoNV const *>( &rhs ) ) {} + + LatencySleepInfoNV & operator=( LatencySleepInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + LatencySleepInfoNV & operator=( VkLatencySleepInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::LatencySleepInfoNV const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 LatencySleepInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencySleepInfoNV & setSignalSemaphore( VULKAN_HPP_NAMESPACE::Semaphore signalSemaphore_ ) VULKAN_HPP_NOEXCEPT + { + signalSemaphore = signalSemaphore_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencySleepInfoNV & setValue( uint64_t value_ ) VULKAN_HPP_NOEXCEPT + { + value = value_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkLatencySleepInfoNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkLatencySleepInfoNV *>( this ); + } + + operator VkLatencySleepInfoNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkLatencySleepInfoNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, const void * const &, VULKAN_HPP_NAMESPACE::Semaphore const &, uint64_t const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, signalSemaphore, value ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( LatencySleepInfoNV const & ) const = default; +#else + bool operator==( LatencySleepInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( signalSemaphore == rhs.signalSemaphore ) && ( value == rhs.value ); +# endif + } + + bool operator!=( LatencySleepInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eLatencySleepInfoNV; + const void * pNext = {}; + VULKAN_HPP_NAMESPACE::Semaphore signalSemaphore = {}; + uint64_t value = {}; + }; + + template <> + struct CppType<StructureType, StructureType::eLatencySleepInfoNV> + { + using Type = LatencySleepInfoNV; + }; + + struct LatencySleepModeInfoNV + { + using NativeType = VkLatencySleepModeInfoNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eLatencySleepModeInfoNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR LatencySleepModeInfoNV( VULKAN_HPP_NAMESPACE::Bool32 lowLatencyMode_ = {}, + VULKAN_HPP_NAMESPACE::Bool32 lowLatencyBoost_ = {}, + uint32_t minimumIntervalUs_ = {}, + const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , lowLatencyMode( lowLatencyMode_ ) + , lowLatencyBoost( lowLatencyBoost_ ) + , minimumIntervalUs( minimumIntervalUs_ ) + { + } + + VULKAN_HPP_CONSTEXPR LatencySleepModeInfoNV( LatencySleepModeInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + LatencySleepModeInfoNV( VkLatencySleepModeInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT + : LatencySleepModeInfoNV( *reinterpret_cast<LatencySleepModeInfoNV const *>( &rhs ) ) + { + } + + LatencySleepModeInfoNV & operator=( LatencySleepModeInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + LatencySleepModeInfoNV & operator=( VkLatencySleepModeInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::LatencySleepModeInfoNV const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 LatencySleepModeInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencySleepModeInfoNV & setLowLatencyMode( VULKAN_HPP_NAMESPACE::Bool32 lowLatencyMode_ ) VULKAN_HPP_NOEXCEPT + { + lowLatencyMode = lowLatencyMode_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencySleepModeInfoNV & setLowLatencyBoost( VULKAN_HPP_NAMESPACE::Bool32 lowLatencyBoost_ ) VULKAN_HPP_NOEXCEPT + { + lowLatencyBoost = lowLatencyBoost_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencySleepModeInfoNV & setMinimumIntervalUs( uint32_t minimumIntervalUs_ ) VULKAN_HPP_NOEXCEPT + { + minimumIntervalUs = minimumIntervalUs_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkLatencySleepModeInfoNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkLatencySleepModeInfoNV *>( this ); + } + + operator VkLatencySleepModeInfoNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkLatencySleepModeInfoNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, + const void * const &, + VULKAN_HPP_NAMESPACE::Bool32 const &, + VULKAN_HPP_NAMESPACE::Bool32 const &, + uint32_t const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, lowLatencyMode, lowLatencyBoost, minimumIntervalUs ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( LatencySleepModeInfoNV const & ) const = default; +#else + bool operator==( LatencySleepModeInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( lowLatencyMode == rhs.lowLatencyMode ) && ( lowLatencyBoost == rhs.lowLatencyBoost ) && + ( minimumIntervalUs == rhs.minimumIntervalUs ); +# endif + } + + bool operator!=( LatencySleepModeInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eLatencySleepModeInfoNV; + const void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 lowLatencyMode = {}; + VULKAN_HPP_NAMESPACE::Bool32 lowLatencyBoost = {}; + uint32_t minimumIntervalUs = {}; + }; + + template <> + struct CppType<StructureType, StructureType::eLatencySleepModeInfoNV> + { + using Type = LatencySleepModeInfoNV; + }; + + struct LatencySubmissionPresentIdNV + { + using NativeType = VkLatencySubmissionPresentIdNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eLatencySubmissionPresentIdNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR LatencySubmissionPresentIdNV( uint64_t presentID_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , presentID( presentID_ ) + { + } + + VULKAN_HPP_CONSTEXPR LatencySubmissionPresentIdNV( LatencySubmissionPresentIdNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + LatencySubmissionPresentIdNV( VkLatencySubmissionPresentIdNV const & rhs ) VULKAN_HPP_NOEXCEPT + : LatencySubmissionPresentIdNV( *reinterpret_cast<LatencySubmissionPresentIdNV const *>( &rhs ) ) + { + } + + LatencySubmissionPresentIdNV & operator=( LatencySubmissionPresentIdNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + LatencySubmissionPresentIdNV & operator=( VkLatencySubmissionPresentIdNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::LatencySubmissionPresentIdNV const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 LatencySubmissionPresentIdNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencySubmissionPresentIdNV & setPresentID( uint64_t presentID_ ) VULKAN_HPP_NOEXCEPT + { + presentID = presentID_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkLatencySubmissionPresentIdNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkLatencySubmissionPresentIdNV *>( this ); + } + + operator VkLatencySubmissionPresentIdNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkLatencySubmissionPresentIdNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, const void * const &, uint64_t const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, presentID ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( LatencySubmissionPresentIdNV const & ) const = default; +#else + bool operator==( LatencySubmissionPresentIdNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( presentID == rhs.presentID ); +# endif + } + + bool operator!=( LatencySubmissionPresentIdNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eLatencySubmissionPresentIdNV; + const void * pNext = {}; + uint64_t presentID = {}; + }; + + template <> + struct CppType<StructureType, StructureType::eLatencySubmissionPresentIdNV> + { + using Type = LatencySubmissionPresentIdNV; + }; + + struct LatencySurfaceCapabilitiesNV + { + using NativeType = VkLatencySurfaceCapabilitiesNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eLatencySurfaceCapabilitiesNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR LatencySurfaceCapabilitiesNV( uint32_t presentModeCount_ = {}, + VULKAN_HPP_NAMESPACE::PresentModeKHR * pPresentModes_ = {}, + const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , presentModeCount( presentModeCount_ ) + , pPresentModes( pPresentModes_ ) + { + } + + VULKAN_HPP_CONSTEXPR LatencySurfaceCapabilitiesNV( LatencySurfaceCapabilitiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + LatencySurfaceCapabilitiesNV( VkLatencySurfaceCapabilitiesNV const & rhs ) VULKAN_HPP_NOEXCEPT + : LatencySurfaceCapabilitiesNV( *reinterpret_cast<LatencySurfaceCapabilitiesNV const *>( &rhs ) ) + { + } + +# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) + LatencySurfaceCapabilitiesNV( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<VULKAN_HPP_NAMESPACE::PresentModeKHR> const & presentModes_, + const void * pNext_ = nullptr ) + : pNext( pNext_ ), presentModeCount( static_cast<uint32_t>( presentModes_.size() ) ), pPresentModes( presentModes_.data() ) + { + } +# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + LatencySurfaceCapabilitiesNV & operator=( LatencySurfaceCapabilitiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + LatencySurfaceCapabilitiesNV & operator=( VkLatencySurfaceCapabilitiesNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::LatencySurfaceCapabilitiesNV const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 LatencySurfaceCapabilitiesNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencySurfaceCapabilitiesNV & setPresentModeCount( uint32_t presentModeCount_ ) VULKAN_HPP_NOEXCEPT + { + presentModeCount = presentModeCount_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 LatencySurfaceCapabilitiesNV & setPPresentModes( VULKAN_HPP_NAMESPACE::PresentModeKHR * pPresentModes_ ) VULKAN_HPP_NOEXCEPT + { + pPresentModes = pPresentModes_; + return *this; + } + +# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) + LatencySurfaceCapabilitiesNV & + setPresentModes( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<VULKAN_HPP_NAMESPACE::PresentModeKHR> const & presentModes_ ) VULKAN_HPP_NOEXCEPT + { + presentModeCount = static_cast<uint32_t>( presentModes_.size() ); + pPresentModes = presentModes_.data(); + return *this; + } +# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkLatencySurfaceCapabilitiesNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkLatencySurfaceCapabilitiesNV *>( this ); + } + + operator VkLatencySurfaceCapabilitiesNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkLatencySurfaceCapabilitiesNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, const void * const &, uint32_t const &, VULKAN_HPP_NAMESPACE::PresentModeKHR * const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, presentModeCount, pPresentModes ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( LatencySurfaceCapabilitiesNV const & ) const = default; +#else + bool operator==( LatencySurfaceCapabilitiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( presentModeCount == rhs.presentModeCount ) && ( pPresentModes == rhs.pPresentModes ); +# endif + } + + bool operator!=( LatencySurfaceCapabilitiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eLatencySurfaceCapabilitiesNV; + const void * pNext = {}; + uint32_t presentModeCount = {}; + VULKAN_HPP_NAMESPACE::PresentModeKHR * pPresentModes = {}; + }; + + template <> + struct CppType<StructureType, StructureType::eLatencySurfaceCapabilitiesNV> + { + using Type = LatencySurfaceCapabilitiesNV; + }; + struct LayerProperties { using NativeType = VkLayerProperties; @@ -52383,6 +53586,103 @@ namespace VULKAN_HPP_NAMESPACE using Type = OpticalFlowSessionCreatePrivateDataInfoNV; }; + struct OutOfBandQueueTypeInfoNV + { + using NativeType = VkOutOfBandQueueTypeInfoNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eOutOfBandQueueTypeInfoNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR OutOfBandQueueTypeInfoNV( VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeNV queueType_ = VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeNV::eRender, + const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , queueType( queueType_ ) + { + } + + VULKAN_HPP_CONSTEXPR OutOfBandQueueTypeInfoNV( OutOfBandQueueTypeInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + OutOfBandQueueTypeInfoNV( VkOutOfBandQueueTypeInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT + : OutOfBandQueueTypeInfoNV( *reinterpret_cast<OutOfBandQueueTypeInfoNV const *>( &rhs ) ) + { + } + + OutOfBandQueueTypeInfoNV & operator=( OutOfBandQueueTypeInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + OutOfBandQueueTypeInfoNV & operator=( VkOutOfBandQueueTypeInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeInfoNV const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 OutOfBandQueueTypeInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 OutOfBandQueueTypeInfoNV & setQueueType( VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeNV queueType_ ) VULKAN_HPP_NOEXCEPT + { + queueType = queueType_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkOutOfBandQueueTypeInfoNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkOutOfBandQueueTypeInfoNV *>( this ); + } + + operator VkOutOfBandQueueTypeInfoNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkOutOfBandQueueTypeInfoNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, const void * const &, VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeNV const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, queueType ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( OutOfBandQueueTypeInfoNV const & ) const = default; +#else + bool operator==( OutOfBandQueueTypeInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( queueType == rhs.queueType ); +# endif + } + + bool operator!=( OutOfBandQueueTypeInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eOutOfBandQueueTypeInfoNV; + const void * pNext = {}; + VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeNV queueType = VULKAN_HPP_NAMESPACE::OutOfBandQueueTypeNV::eRender; + }; + + template <> + struct CppType<StructureType, StructureType::eOutOfBandQueueTypeInfoNV> + { + using Type = OutOfBandQueueTypeInfoNV; + }; + struct PastPresentationTimingGOOGLE { using NativeType = VkPastPresentationTimingGOOGLE; @@ -56634,6 +57934,200 @@ namespace VULKAN_HPP_NAMESPACE using Type = PhysicalDeviceCoverageReductionModeFeaturesNV; }; + struct PhysicalDeviceCubicClampFeaturesQCOM + { + using NativeType = VkPhysicalDeviceCubicClampFeaturesQCOM; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceCubicClampFeaturesQCOM; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceCubicClampFeaturesQCOM( VULKAN_HPP_NAMESPACE::Bool32 cubicRangeClamp_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , cubicRangeClamp( cubicRangeClamp_ ) + { + } + + VULKAN_HPP_CONSTEXPR PhysicalDeviceCubicClampFeaturesQCOM( PhysicalDeviceCubicClampFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceCubicClampFeaturesQCOM( VkPhysicalDeviceCubicClampFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceCubicClampFeaturesQCOM( *reinterpret_cast<PhysicalDeviceCubicClampFeaturesQCOM const *>( &rhs ) ) + { + } + + PhysicalDeviceCubicClampFeaturesQCOM & operator=( PhysicalDeviceCubicClampFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceCubicClampFeaturesQCOM & operator=( VkPhysicalDeviceCubicClampFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicClampFeaturesQCOM const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCubicClampFeaturesQCOM & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCubicClampFeaturesQCOM & setCubicRangeClamp( VULKAN_HPP_NAMESPACE::Bool32 cubicRangeClamp_ ) VULKAN_HPP_NOEXCEPT + { + cubicRangeClamp = cubicRangeClamp_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkPhysicalDeviceCubicClampFeaturesQCOM const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceCubicClampFeaturesQCOM *>( this ); + } + + operator VkPhysicalDeviceCubicClampFeaturesQCOM &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceCubicClampFeaturesQCOM *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::Bool32 const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, cubicRangeClamp ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceCubicClampFeaturesQCOM const & ) const = default; +#else + bool operator==( PhysicalDeviceCubicClampFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( cubicRangeClamp == rhs.cubicRangeClamp ); +# endif + } + + bool operator!=( PhysicalDeviceCubicClampFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceCubicClampFeaturesQCOM; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 cubicRangeClamp = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceCubicClampFeaturesQCOM> + { + using Type = PhysicalDeviceCubicClampFeaturesQCOM; + }; + + struct PhysicalDeviceCubicWeightsFeaturesQCOM + { + using NativeType = VkPhysicalDeviceCubicWeightsFeaturesQCOM; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceCubicWeightsFeaturesQCOM; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceCubicWeightsFeaturesQCOM( VULKAN_HPP_NAMESPACE::Bool32 selectableCubicWeights_ = {}, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , selectableCubicWeights( selectableCubicWeights_ ) + { + } + + VULKAN_HPP_CONSTEXPR PhysicalDeviceCubicWeightsFeaturesQCOM( PhysicalDeviceCubicWeightsFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceCubicWeightsFeaturesQCOM( VkPhysicalDeviceCubicWeightsFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceCubicWeightsFeaturesQCOM( *reinterpret_cast<PhysicalDeviceCubicWeightsFeaturesQCOM const *>( &rhs ) ) + { + } + + PhysicalDeviceCubicWeightsFeaturesQCOM & operator=( PhysicalDeviceCubicWeightsFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceCubicWeightsFeaturesQCOM & operator=( VkPhysicalDeviceCubicWeightsFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceCubicWeightsFeaturesQCOM const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCubicWeightsFeaturesQCOM & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCubicWeightsFeaturesQCOM & + setSelectableCubicWeights( VULKAN_HPP_NAMESPACE::Bool32 selectableCubicWeights_ ) VULKAN_HPP_NOEXCEPT + { + selectableCubicWeights = selectableCubicWeights_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkPhysicalDeviceCubicWeightsFeaturesQCOM const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceCubicWeightsFeaturesQCOM *>( this ); + } + + operator VkPhysicalDeviceCubicWeightsFeaturesQCOM &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceCubicWeightsFeaturesQCOM *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::Bool32 const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, selectableCubicWeights ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceCubicWeightsFeaturesQCOM const & ) const = default; +#else + bool operator==( PhysicalDeviceCubicWeightsFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( selectableCubicWeights == rhs.selectableCubicWeights ); +# endif + } + + bool operator!=( PhysicalDeviceCubicWeightsFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceCubicWeightsFeaturesQCOM; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 selectableCubicWeights = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceCubicWeightsFeaturesQCOM> + { + using Type = PhysicalDeviceCubicWeightsFeaturesQCOM; + }; + struct PhysicalDeviceCustomBorderColorFeaturesEXT { using NativeType = VkPhysicalDeviceCustomBorderColorFeaturesEXT; @@ -58523,6 +60017,106 @@ namespace VULKAN_HPP_NAMESPACE }; using PhysicalDeviceDescriptorIndexingPropertiesEXT = PhysicalDeviceDescriptorIndexingProperties; + struct PhysicalDeviceDescriptorPoolOverallocationFeaturesNV + { + using NativeType = VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDescriptorPoolOverallocationFeaturesNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceDescriptorPoolOverallocationFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 descriptorPoolOverallocation_ = {}, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , descriptorPoolOverallocation( descriptorPoolOverallocation_ ) + { + } + + VULKAN_HPP_CONSTEXPR + PhysicalDeviceDescriptorPoolOverallocationFeaturesNV( PhysicalDeviceDescriptorPoolOverallocationFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceDescriptorPoolOverallocationFeaturesNV( VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceDescriptorPoolOverallocationFeaturesNV( *reinterpret_cast<PhysicalDeviceDescriptorPoolOverallocationFeaturesNV const *>( &rhs ) ) + { + } + + PhysicalDeviceDescriptorPoolOverallocationFeaturesNV & + operator=( PhysicalDeviceDescriptorPoolOverallocationFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceDescriptorPoolOverallocationFeaturesNV & operator=( VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorPoolOverallocationFeaturesNV const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorPoolOverallocationFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorPoolOverallocationFeaturesNV & + setDescriptorPoolOverallocation( VULKAN_HPP_NAMESPACE::Bool32 descriptorPoolOverallocation_ ) VULKAN_HPP_NOEXCEPT + { + descriptorPoolOverallocation = descriptorPoolOverallocation_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *>( this ); + } + + operator VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::Bool32 const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, descriptorPoolOverallocation ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceDescriptorPoolOverallocationFeaturesNV const & ) const = default; +#else + bool operator==( PhysicalDeviceDescriptorPoolOverallocationFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( descriptorPoolOverallocation == rhs.descriptorPoolOverallocation ); +# endif + } + + bool operator!=( PhysicalDeviceDescriptorPoolOverallocationFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDescriptorPoolOverallocationFeaturesNV; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 descriptorPoolOverallocation = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceDescriptorPoolOverallocationFeaturesNV> + { + using Type = PhysicalDeviceDescriptorPoolOverallocationFeaturesNV; + }; + struct PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE { using NativeType = VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE; @@ -60770,6 +62364,202 @@ namespace VULKAN_HPP_NAMESPACE using Type = PhysicalDeviceExtendedDynamicStateFeaturesEXT; }; + struct PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV + { + using NativeType = VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExtendedSparseAddressSpaceFeaturesNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 extendedSparseAddressSpace_ = {}, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , extendedSparseAddressSpace( extendedSparseAddressSpace_ ) + { + } + + VULKAN_HPP_CONSTEXPR + PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV( PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV( VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV( *reinterpret_cast<PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV const *>( &rhs ) ) + { + } + + PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV & + operator=( PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV & operator=( VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV & + setExtendedSparseAddressSpace( VULKAN_HPP_NAMESPACE::Bool32 extendedSparseAddressSpace_ ) VULKAN_HPP_NOEXCEPT + { + extendedSparseAddressSpace = extendedSparseAddressSpace_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *>( this ); + } + + operator VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::Bool32 const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, extendedSparseAddressSpace ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV const & ) const = default; +#else + bool operator==( PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( extendedSparseAddressSpace == rhs.extendedSparseAddressSpace ); +# endif + } + + bool operator!=( PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExtendedSparseAddressSpaceFeaturesNV; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 extendedSparseAddressSpace = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceExtendedSparseAddressSpaceFeaturesNV> + { + using Type = PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV; + }; + + struct PhysicalDeviceExtendedSparseAddressSpacePropertiesNV + { + using NativeType = VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExtendedSparseAddressSpacePropertiesNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceExtendedSparseAddressSpacePropertiesNV( VULKAN_HPP_NAMESPACE::DeviceSize extendedSparseAddressSpaceSize_ = {}, + VULKAN_HPP_NAMESPACE::ImageUsageFlags extendedSparseImageUsageFlags_ = {}, + VULKAN_HPP_NAMESPACE::BufferUsageFlags extendedSparseBufferUsageFlags_ = {}, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , extendedSparseAddressSpaceSize( extendedSparseAddressSpaceSize_ ) + , extendedSparseImageUsageFlags( extendedSparseImageUsageFlags_ ) + , extendedSparseBufferUsageFlags( extendedSparseBufferUsageFlags_ ) + { + } + + VULKAN_HPP_CONSTEXPR + PhysicalDeviceExtendedSparseAddressSpacePropertiesNV( PhysicalDeviceExtendedSparseAddressSpacePropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceExtendedSparseAddressSpacePropertiesNV( VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceExtendedSparseAddressSpacePropertiesNV( *reinterpret_cast<PhysicalDeviceExtendedSparseAddressSpacePropertiesNV const *>( &rhs ) ) + { + } + + PhysicalDeviceExtendedSparseAddressSpacePropertiesNV & + operator=( PhysicalDeviceExtendedSparseAddressSpacePropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceExtendedSparseAddressSpacePropertiesNV & operator=( VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedSparseAddressSpacePropertiesNV const *>( &rhs ); + return *this; + } + + operator VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV *>( this ); + } + + operator VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, + void * const &, + VULKAN_HPP_NAMESPACE::DeviceSize const &, + VULKAN_HPP_NAMESPACE::ImageUsageFlags const &, + VULKAN_HPP_NAMESPACE::BufferUsageFlags const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, extendedSparseAddressSpaceSize, extendedSparseImageUsageFlags, extendedSparseBufferUsageFlags ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceExtendedSparseAddressSpacePropertiesNV const & ) const = default; +#else + bool operator==( PhysicalDeviceExtendedSparseAddressSpacePropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( extendedSparseAddressSpaceSize == rhs.extendedSparseAddressSpaceSize ) && + ( extendedSparseImageUsageFlags == rhs.extendedSparseImageUsageFlags ) && ( extendedSparseBufferUsageFlags == rhs.extendedSparseBufferUsageFlags ); +# endif + } + + bool operator!=( PhysicalDeviceExtendedSparseAddressSpacePropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExtendedSparseAddressSpacePropertiesNV; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::DeviceSize extendedSparseAddressSpaceSize = {}; + VULKAN_HPP_NAMESPACE::ImageUsageFlags extendedSparseImageUsageFlags = {}; + VULKAN_HPP_NAMESPACE::BufferUsageFlags extendedSparseBufferUsageFlags = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceExtendedSparseAddressSpacePropertiesNV> + { + using Type = PhysicalDeviceExtendedSparseAddressSpacePropertiesNV; + }; + struct PhysicalDeviceExternalBufferInfo { using NativeType = VkPhysicalDeviceExternalBufferInfo; @@ -60992,6 +62782,209 @@ namespace VULKAN_HPP_NAMESPACE }; using PhysicalDeviceExternalFenceInfoKHR = PhysicalDeviceExternalFenceInfo; +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) + struct PhysicalDeviceExternalFormatResolveFeaturesANDROID + { + using NativeType = VkPhysicalDeviceExternalFormatResolveFeaturesANDROID; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExternalFormatResolveFeaturesANDROID; + +# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalFormatResolveFeaturesANDROID( VULKAN_HPP_NAMESPACE::Bool32 externalFormatResolve_ = {}, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , externalFormatResolve( externalFormatResolve_ ) + { + } + + VULKAN_HPP_CONSTEXPR + PhysicalDeviceExternalFormatResolveFeaturesANDROID( PhysicalDeviceExternalFormatResolveFeaturesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceExternalFormatResolveFeaturesANDROID( VkPhysicalDeviceExternalFormatResolveFeaturesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceExternalFormatResolveFeaturesANDROID( *reinterpret_cast<PhysicalDeviceExternalFormatResolveFeaturesANDROID const *>( &rhs ) ) + { + } + + PhysicalDeviceExternalFormatResolveFeaturesANDROID & + operator=( PhysicalDeviceExternalFormatResolveFeaturesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; +# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceExternalFormatResolveFeaturesANDROID & operator=( VkPhysicalDeviceExternalFormatResolveFeaturesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolveFeaturesANDROID const *>( &rhs ); + return *this; + } + +# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalFormatResolveFeaturesANDROID & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalFormatResolveFeaturesANDROID & + setExternalFormatResolve( VULKAN_HPP_NAMESPACE::Bool32 externalFormatResolve_ ) VULKAN_HPP_NOEXCEPT + { + externalFormatResolve = externalFormatResolve_; + return *this; + } +# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkPhysicalDeviceExternalFormatResolveFeaturesANDROID const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceExternalFormatResolveFeaturesANDROID *>( this ); + } + + operator VkPhysicalDeviceExternalFormatResolveFeaturesANDROID &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceExternalFormatResolveFeaturesANDROID *>( this ); + } + +# if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::Bool32 const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, externalFormatResolve ); + } +# endif + +# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceExternalFormatResolveFeaturesANDROID const & ) const = default; +# else + bool operator==( PhysicalDeviceExternalFormatResolveFeaturesANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( externalFormatResolve == rhs.externalFormatResolve ); +# endif + } + + bool operator!=( PhysicalDeviceExternalFormatResolveFeaturesANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +# endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExternalFormatResolveFeaturesANDROID; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 externalFormatResolve = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceExternalFormatResolveFeaturesANDROID> + { + using Type = PhysicalDeviceExternalFormatResolveFeaturesANDROID; + }; +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) + struct PhysicalDeviceExternalFormatResolvePropertiesANDROID + { + using NativeType = VkPhysicalDeviceExternalFormatResolvePropertiesANDROID; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExternalFormatResolvePropertiesANDROID; + +# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalFormatResolvePropertiesANDROID( + VULKAN_HPP_NAMESPACE::Bool32 nullColorAttachmentWithExternalFormatResolve_ = {}, + VULKAN_HPP_NAMESPACE::ChromaLocation externalFormatResolveChromaOffsetX_ = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven, + VULKAN_HPP_NAMESPACE::ChromaLocation externalFormatResolveChromaOffsetY_ = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , nullColorAttachmentWithExternalFormatResolve( nullColorAttachmentWithExternalFormatResolve_ ) + , externalFormatResolveChromaOffsetX( externalFormatResolveChromaOffsetX_ ) + , externalFormatResolveChromaOffsetY( externalFormatResolveChromaOffsetY_ ) + { + } + + VULKAN_HPP_CONSTEXPR + PhysicalDeviceExternalFormatResolvePropertiesANDROID( PhysicalDeviceExternalFormatResolvePropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceExternalFormatResolvePropertiesANDROID( VkPhysicalDeviceExternalFormatResolvePropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceExternalFormatResolvePropertiesANDROID( *reinterpret_cast<PhysicalDeviceExternalFormatResolvePropertiesANDROID const *>( &rhs ) ) + { + } + + PhysicalDeviceExternalFormatResolvePropertiesANDROID & + operator=( PhysicalDeviceExternalFormatResolvePropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; +# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceExternalFormatResolvePropertiesANDROID & operator=( VkPhysicalDeviceExternalFormatResolvePropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFormatResolvePropertiesANDROID const *>( &rhs ); + return *this; + } + + operator VkPhysicalDeviceExternalFormatResolvePropertiesANDROID const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceExternalFormatResolvePropertiesANDROID *>( this ); + } + + operator VkPhysicalDeviceExternalFormatResolvePropertiesANDROID &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceExternalFormatResolvePropertiesANDROID *>( this ); + } + +# if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, + void * const &, + VULKAN_HPP_NAMESPACE::Bool32 const &, + VULKAN_HPP_NAMESPACE::ChromaLocation const &, + VULKAN_HPP_NAMESPACE::ChromaLocation const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, nullColorAttachmentWithExternalFormatResolve, externalFormatResolveChromaOffsetX, externalFormatResolveChromaOffsetY ); + } +# endif + +# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceExternalFormatResolvePropertiesANDROID const & ) const = default; +# else + bool operator==( PhysicalDeviceExternalFormatResolvePropertiesANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && + ( nullColorAttachmentWithExternalFormatResolve == rhs.nullColorAttachmentWithExternalFormatResolve ) && + ( externalFormatResolveChromaOffsetX == rhs.externalFormatResolveChromaOffsetX ) && + ( externalFormatResolveChromaOffsetY == rhs.externalFormatResolveChromaOffsetY ); +# endif + } + + bool operator!=( PhysicalDeviceExternalFormatResolvePropertiesANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +# endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExternalFormatResolvePropertiesANDROID; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 nullColorAttachmentWithExternalFormatResolve = {}; + VULKAN_HPP_NAMESPACE::ChromaLocation externalFormatResolveChromaOffsetX = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven; + VULKAN_HPP_NAMESPACE::ChromaLocation externalFormatResolveChromaOffsetY = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceExternalFormatResolvePropertiesANDROID> + { + using Type = PhysicalDeviceExternalFormatResolvePropertiesANDROID; + }; +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + struct PhysicalDeviceExternalImageFormatInfo { using NativeType = VkPhysicalDeviceExternalImageFormatInfo; @@ -63397,6 +65390,102 @@ namespace VULKAN_HPP_NAMESPACE using Type = PhysicalDeviceFragmentShadingRatePropertiesKHR; }; + struct PhysicalDeviceFrameBoundaryFeaturesEXT + { + using NativeType = VkPhysicalDeviceFrameBoundaryFeaturesEXT; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFrameBoundaryFeaturesEXT; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceFrameBoundaryFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 frameBoundary_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , frameBoundary( frameBoundary_ ) + { + } + + VULKAN_HPP_CONSTEXPR PhysicalDeviceFrameBoundaryFeaturesEXT( PhysicalDeviceFrameBoundaryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceFrameBoundaryFeaturesEXT( VkPhysicalDeviceFrameBoundaryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceFrameBoundaryFeaturesEXT( *reinterpret_cast<PhysicalDeviceFrameBoundaryFeaturesEXT const *>( &rhs ) ) + { + } + + PhysicalDeviceFrameBoundaryFeaturesEXT & operator=( PhysicalDeviceFrameBoundaryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceFrameBoundaryFeaturesEXT & operator=( VkPhysicalDeviceFrameBoundaryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceFrameBoundaryFeaturesEXT const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFrameBoundaryFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFrameBoundaryFeaturesEXT & setFrameBoundary( VULKAN_HPP_NAMESPACE::Bool32 frameBoundary_ ) VULKAN_HPP_NOEXCEPT + { + frameBoundary = frameBoundary_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkPhysicalDeviceFrameBoundaryFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceFrameBoundaryFeaturesEXT *>( this ); + } + + operator VkPhysicalDeviceFrameBoundaryFeaturesEXT &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceFrameBoundaryFeaturesEXT *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::Bool32 const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, frameBoundary ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceFrameBoundaryFeaturesEXT const & ) const = default; +#else + bool operator==( PhysicalDeviceFrameBoundaryFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( frameBoundary == rhs.frameBoundary ); +# endif + } + + bool operator!=( PhysicalDeviceFrameBoundaryFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFrameBoundaryFeaturesEXT; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 frameBoundary = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceFrameBoundaryFeaturesEXT> + { + using Type = PhysicalDeviceFrameBoundaryFeaturesEXT; + }; + struct PhysicalDeviceGlobalPriorityQueryFeaturesKHR { using NativeType = VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR; @@ -64896,6 +66985,187 @@ namespace VULKAN_HPP_NAMESPACE }; using PhysicalDeviceImageFormatInfo2KHR = PhysicalDeviceImageFormatInfo2; + struct PhysicalDeviceImageProcessing2FeaturesQCOM + { + using NativeType = VkPhysicalDeviceImageProcessing2FeaturesQCOM; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImageProcessing2FeaturesQCOM; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceImageProcessing2FeaturesQCOM( VULKAN_HPP_NAMESPACE::Bool32 textureBlockMatch2_ = {}, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , textureBlockMatch2( textureBlockMatch2_ ) + { + } + + VULKAN_HPP_CONSTEXPR PhysicalDeviceImageProcessing2FeaturesQCOM( PhysicalDeviceImageProcessing2FeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceImageProcessing2FeaturesQCOM( VkPhysicalDeviceImageProcessing2FeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceImageProcessing2FeaturesQCOM( *reinterpret_cast<PhysicalDeviceImageProcessing2FeaturesQCOM const *>( &rhs ) ) + { + } + + PhysicalDeviceImageProcessing2FeaturesQCOM & operator=( PhysicalDeviceImageProcessing2FeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceImageProcessing2FeaturesQCOM & operator=( VkPhysicalDeviceImageProcessing2FeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2FeaturesQCOM const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageProcessing2FeaturesQCOM & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageProcessing2FeaturesQCOM & + setTextureBlockMatch2( VULKAN_HPP_NAMESPACE::Bool32 textureBlockMatch2_ ) VULKAN_HPP_NOEXCEPT + { + textureBlockMatch2 = textureBlockMatch2_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkPhysicalDeviceImageProcessing2FeaturesQCOM const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceImageProcessing2FeaturesQCOM *>( this ); + } + + operator VkPhysicalDeviceImageProcessing2FeaturesQCOM &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceImageProcessing2FeaturesQCOM *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::Bool32 const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, textureBlockMatch2 ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceImageProcessing2FeaturesQCOM const & ) const = default; +#else + bool operator==( PhysicalDeviceImageProcessing2FeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( textureBlockMatch2 == rhs.textureBlockMatch2 ); +# endif + } + + bool operator!=( PhysicalDeviceImageProcessing2FeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImageProcessing2FeaturesQCOM; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 textureBlockMatch2 = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceImageProcessing2FeaturesQCOM> + { + using Type = PhysicalDeviceImageProcessing2FeaturesQCOM; + }; + + struct PhysicalDeviceImageProcessing2PropertiesQCOM + { + using NativeType = VkPhysicalDeviceImageProcessing2PropertiesQCOM; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImageProcessing2PropertiesQCOM; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceImageProcessing2PropertiesQCOM( VULKAN_HPP_NAMESPACE::Extent2D maxBlockMatchWindow_ = {}, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , maxBlockMatchWindow( maxBlockMatchWindow_ ) + { + } + + VULKAN_HPP_CONSTEXPR PhysicalDeviceImageProcessing2PropertiesQCOM( PhysicalDeviceImageProcessing2PropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceImageProcessing2PropertiesQCOM( VkPhysicalDeviceImageProcessing2PropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceImageProcessing2PropertiesQCOM( *reinterpret_cast<PhysicalDeviceImageProcessing2PropertiesQCOM const *>( &rhs ) ) + { + } + + PhysicalDeviceImageProcessing2PropertiesQCOM & operator=( PhysicalDeviceImageProcessing2PropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceImageProcessing2PropertiesQCOM & operator=( VkPhysicalDeviceImageProcessing2PropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessing2PropertiesQCOM const *>( &rhs ); + return *this; + } + + operator VkPhysicalDeviceImageProcessing2PropertiesQCOM const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceImageProcessing2PropertiesQCOM *>( this ); + } + + operator VkPhysicalDeviceImageProcessing2PropertiesQCOM &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceImageProcessing2PropertiesQCOM *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::Extent2D const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, maxBlockMatchWindow ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceImageProcessing2PropertiesQCOM const & ) const = default; +#else + bool operator==( PhysicalDeviceImageProcessing2PropertiesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxBlockMatchWindow == rhs.maxBlockMatchWindow ); +# endif + } + + bool operator!=( PhysicalDeviceImageProcessing2PropertiesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImageProcessing2PropertiesQCOM; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Extent2D maxBlockMatchWindow = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceImageProcessing2PropertiesQCOM> + { + using Type = PhysicalDeviceImageProcessing2PropertiesQCOM; + }; + struct PhysicalDeviceImageProcessingFeaturesQCOM { using NativeType = VkPhysicalDeviceImageProcessingFeaturesQCOM; @@ -66123,6 +68393,90 @@ namespace VULKAN_HPP_NAMESPACE using Type = PhysicalDeviceInvocationMaskFeaturesHUAWEI; }; + struct PhysicalDeviceLayeredDriverPropertiesMSFT + { + using NativeType = VkPhysicalDeviceLayeredDriverPropertiesMSFT; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceLayeredDriverPropertiesMSFT; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceLayeredDriverPropertiesMSFT( + VULKAN_HPP_NAMESPACE::LayeredDriverUnderlyingApiMSFT underlyingAPI_ = VULKAN_HPP_NAMESPACE::LayeredDriverUnderlyingApiMSFT::eNone, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , underlyingAPI( underlyingAPI_ ) + { + } + + VULKAN_HPP_CONSTEXPR PhysicalDeviceLayeredDriverPropertiesMSFT( PhysicalDeviceLayeredDriverPropertiesMSFT const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceLayeredDriverPropertiesMSFT( VkPhysicalDeviceLayeredDriverPropertiesMSFT const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceLayeredDriverPropertiesMSFT( *reinterpret_cast<PhysicalDeviceLayeredDriverPropertiesMSFT const *>( &rhs ) ) + { + } + + PhysicalDeviceLayeredDriverPropertiesMSFT & operator=( PhysicalDeviceLayeredDriverPropertiesMSFT const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceLayeredDriverPropertiesMSFT & operator=( VkPhysicalDeviceLayeredDriverPropertiesMSFT const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceLayeredDriverPropertiesMSFT const *>( &rhs ); + return *this; + } + + operator VkPhysicalDeviceLayeredDriverPropertiesMSFT const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceLayeredDriverPropertiesMSFT *>( this ); + } + + operator VkPhysicalDeviceLayeredDriverPropertiesMSFT &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceLayeredDriverPropertiesMSFT *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::LayeredDriverUnderlyingApiMSFT const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, underlyingAPI ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceLayeredDriverPropertiesMSFT const & ) const = default; +#else + bool operator==( PhysicalDeviceLayeredDriverPropertiesMSFT const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( underlyingAPI == rhs.underlyingAPI ); +# endif + } + + bool operator!=( PhysicalDeviceLayeredDriverPropertiesMSFT const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceLayeredDriverPropertiesMSFT; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::LayeredDriverUnderlyingApiMSFT underlyingAPI = VULKAN_HPP_NAMESPACE::LayeredDriverUnderlyingApiMSFT::eNone; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceLayeredDriverPropertiesMSFT> + { + using Type = PhysicalDeviceLayeredDriverPropertiesMSFT; + }; + struct PhysicalDeviceLegacyDitheringFeaturesEXT { using NativeType = VkPhysicalDeviceLegacyDitheringFeaturesEXT; @@ -69751,6 +72105,229 @@ namespace VULKAN_HPP_NAMESPACE }; using PhysicalDeviceMutableDescriptorTypeFeaturesVALVE = PhysicalDeviceMutableDescriptorTypeFeaturesEXT; + struct PhysicalDeviceNestedCommandBufferFeaturesEXT + { + using NativeType = VkPhysicalDeviceNestedCommandBufferFeaturesEXT; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceNestedCommandBufferFeaturesEXT; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceNestedCommandBufferFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 nestedCommandBuffer_ = {}, + VULKAN_HPP_NAMESPACE::Bool32 nestedCommandBufferRendering_ = {}, + VULKAN_HPP_NAMESPACE::Bool32 nestedCommandBufferSimultaneousUse_ = {}, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , nestedCommandBuffer( nestedCommandBuffer_ ) + , nestedCommandBufferRendering( nestedCommandBufferRendering_ ) + , nestedCommandBufferSimultaneousUse( nestedCommandBufferSimultaneousUse_ ) + { + } + + VULKAN_HPP_CONSTEXPR PhysicalDeviceNestedCommandBufferFeaturesEXT( PhysicalDeviceNestedCommandBufferFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceNestedCommandBufferFeaturesEXT( VkPhysicalDeviceNestedCommandBufferFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceNestedCommandBufferFeaturesEXT( *reinterpret_cast<PhysicalDeviceNestedCommandBufferFeaturesEXT const *>( &rhs ) ) + { + } + + PhysicalDeviceNestedCommandBufferFeaturesEXT & operator=( PhysicalDeviceNestedCommandBufferFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceNestedCommandBufferFeaturesEXT & operator=( VkPhysicalDeviceNestedCommandBufferFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferFeaturesEXT const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceNestedCommandBufferFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceNestedCommandBufferFeaturesEXT & + setNestedCommandBuffer( VULKAN_HPP_NAMESPACE::Bool32 nestedCommandBuffer_ ) VULKAN_HPP_NOEXCEPT + { + nestedCommandBuffer = nestedCommandBuffer_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceNestedCommandBufferFeaturesEXT & + setNestedCommandBufferRendering( VULKAN_HPP_NAMESPACE::Bool32 nestedCommandBufferRendering_ ) VULKAN_HPP_NOEXCEPT + { + nestedCommandBufferRendering = nestedCommandBufferRendering_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceNestedCommandBufferFeaturesEXT & + setNestedCommandBufferSimultaneousUse( VULKAN_HPP_NAMESPACE::Bool32 nestedCommandBufferSimultaneousUse_ ) VULKAN_HPP_NOEXCEPT + { + nestedCommandBufferSimultaneousUse = nestedCommandBufferSimultaneousUse_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkPhysicalDeviceNestedCommandBufferFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceNestedCommandBufferFeaturesEXT *>( this ); + } + + operator VkPhysicalDeviceNestedCommandBufferFeaturesEXT &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceNestedCommandBufferFeaturesEXT *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, + void * const &, + VULKAN_HPP_NAMESPACE::Bool32 const &, + VULKAN_HPP_NAMESPACE::Bool32 const &, + VULKAN_HPP_NAMESPACE::Bool32 const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, nestedCommandBuffer, nestedCommandBufferRendering, nestedCommandBufferSimultaneousUse ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceNestedCommandBufferFeaturesEXT const & ) const = default; +#else + bool operator==( PhysicalDeviceNestedCommandBufferFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( nestedCommandBuffer == rhs.nestedCommandBuffer ) && + ( nestedCommandBufferRendering == rhs.nestedCommandBufferRendering ) && + ( nestedCommandBufferSimultaneousUse == rhs.nestedCommandBufferSimultaneousUse ); +# endif + } + + bool operator!=( PhysicalDeviceNestedCommandBufferFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceNestedCommandBufferFeaturesEXT; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 nestedCommandBuffer = {}; + VULKAN_HPP_NAMESPACE::Bool32 nestedCommandBufferRendering = {}; + VULKAN_HPP_NAMESPACE::Bool32 nestedCommandBufferSimultaneousUse = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceNestedCommandBufferFeaturesEXT> + { + using Type = PhysicalDeviceNestedCommandBufferFeaturesEXT; + }; + + struct PhysicalDeviceNestedCommandBufferPropertiesEXT + { + using NativeType = VkPhysicalDeviceNestedCommandBufferPropertiesEXT; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceNestedCommandBufferPropertiesEXT; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceNestedCommandBufferPropertiesEXT( uint32_t maxCommandBufferNestingLevel_ = {}, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , maxCommandBufferNestingLevel( maxCommandBufferNestingLevel_ ) + { + } + + VULKAN_HPP_CONSTEXPR + PhysicalDeviceNestedCommandBufferPropertiesEXT( PhysicalDeviceNestedCommandBufferPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceNestedCommandBufferPropertiesEXT( VkPhysicalDeviceNestedCommandBufferPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceNestedCommandBufferPropertiesEXT( *reinterpret_cast<PhysicalDeviceNestedCommandBufferPropertiesEXT const *>( &rhs ) ) + { + } + + PhysicalDeviceNestedCommandBufferPropertiesEXT & operator=( PhysicalDeviceNestedCommandBufferPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceNestedCommandBufferPropertiesEXT & operator=( VkPhysicalDeviceNestedCommandBufferPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceNestedCommandBufferPropertiesEXT const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceNestedCommandBufferPropertiesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceNestedCommandBufferPropertiesEXT & + setMaxCommandBufferNestingLevel( uint32_t maxCommandBufferNestingLevel_ ) VULKAN_HPP_NOEXCEPT + { + maxCommandBufferNestingLevel = maxCommandBufferNestingLevel_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkPhysicalDeviceNestedCommandBufferPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceNestedCommandBufferPropertiesEXT *>( this ); + } + + operator VkPhysicalDeviceNestedCommandBufferPropertiesEXT &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceNestedCommandBufferPropertiesEXT *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, uint32_t const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, maxCommandBufferNestingLevel ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceNestedCommandBufferPropertiesEXT const & ) const = default; +#else + bool operator==( PhysicalDeviceNestedCommandBufferPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxCommandBufferNestingLevel == rhs.maxCommandBufferNestingLevel ); +# endif + } + + bool operator!=( PhysicalDeviceNestedCommandBufferPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceNestedCommandBufferPropertiesEXT; + void * pNext = {}; + uint32_t maxCommandBufferNestingLevel = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceNestedCommandBufferPropertiesEXT> + { + using Type = PhysicalDeviceNestedCommandBufferPropertiesEXT; + }; + struct PhysicalDeviceNonSeamlessCubeMapFeaturesEXT { using NativeType = VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT; @@ -84338,6 +86915,102 @@ namespace VULKAN_HPP_NAMESPACE using Type = PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT; }; + struct PhysicalDeviceYcbcrDegammaFeaturesQCOM + { + using NativeType = VkPhysicalDeviceYcbcrDegammaFeaturesQCOM; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceYcbcrDegammaFeaturesQCOM; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR PhysicalDeviceYcbcrDegammaFeaturesQCOM( VULKAN_HPP_NAMESPACE::Bool32 ycbcrDegamma_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , ycbcrDegamma( ycbcrDegamma_ ) + { + } + + VULKAN_HPP_CONSTEXPR PhysicalDeviceYcbcrDegammaFeaturesQCOM( PhysicalDeviceYcbcrDegammaFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + PhysicalDeviceYcbcrDegammaFeaturesQCOM( VkPhysicalDeviceYcbcrDegammaFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + : PhysicalDeviceYcbcrDegammaFeaturesQCOM( *reinterpret_cast<PhysicalDeviceYcbcrDegammaFeaturesQCOM const *>( &rhs ) ) + { + } + + PhysicalDeviceYcbcrDegammaFeaturesQCOM & operator=( PhysicalDeviceYcbcrDegammaFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + PhysicalDeviceYcbcrDegammaFeaturesQCOM & operator=( VkPhysicalDeviceYcbcrDegammaFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcrDegammaFeaturesQCOM const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceYcbcrDegammaFeaturesQCOM & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceYcbcrDegammaFeaturesQCOM & setYcbcrDegamma( VULKAN_HPP_NAMESPACE::Bool32 ycbcrDegamma_ ) VULKAN_HPP_NOEXCEPT + { + ycbcrDegamma = ycbcrDegamma_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkPhysicalDeviceYcbcrDegammaFeaturesQCOM const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *>( this ); + } + + operator VkPhysicalDeviceYcbcrDegammaFeaturesQCOM &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkPhysicalDeviceYcbcrDegammaFeaturesQCOM *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::Bool32 const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, ycbcrDegamma ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( PhysicalDeviceYcbcrDegammaFeaturesQCOM const & ) const = default; +#else + bool operator==( PhysicalDeviceYcbcrDegammaFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( ycbcrDegamma == rhs.ycbcrDegamma ); +# endif + } + + bool operator!=( PhysicalDeviceYcbcrDegammaFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceYcbcrDegammaFeaturesQCOM; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 ycbcrDegamma = {}; + }; + + template <> + struct CppType<StructureType, StructureType::ePhysicalDeviceYcbcrDegammaFeaturesQCOM> + { + using Type = PhysicalDeviceYcbcrDegammaFeaturesQCOM; + }; + struct PhysicalDeviceYcbcrImageArraysFeaturesEXT { using NativeType = VkPhysicalDeviceYcbcrImageArraysFeaturesEXT; @@ -92616,10 +95289,10 @@ namespace VULKAN_HPP_NAMESPACE #if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) VULKAN_HPP_CONSTEXPR RayTracingShaderGroupCreateInfoKHR( VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR type_ = VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR::eGeneral, - uint32_t generalShader_ = {}, - uint32_t closestHitShader_ = {}, - uint32_t anyHitShader_ = {}, - uint32_t intersectionShader_ = {}, + uint32_t generalShader_ = VULKAN_HPP_NAMESPACE::ShaderUnusedKHR, + uint32_t closestHitShader_ = VULKAN_HPP_NAMESPACE::ShaderUnusedKHR, + uint32_t anyHitShader_ = VULKAN_HPP_NAMESPACE::ShaderUnusedKHR, + uint32_t intersectionShader_ = VULKAN_HPP_NAMESPACE::ShaderUnusedKHR, const void * pShaderGroupCaptureReplayHandle_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT : pNext( pNext_ ) @@ -92746,10 +95419,10 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRayTracingShaderGroupCreateInfoKHR; const void * pNext = {}; VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR type = VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR::eGeneral; - uint32_t generalShader = {}; - uint32_t closestHitShader = {}; - uint32_t anyHitShader = {}; - uint32_t intersectionShader = {}; + uint32_t generalShader = VULKAN_HPP_NAMESPACE::ShaderUnusedKHR; + uint32_t closestHitShader = VULKAN_HPP_NAMESPACE::ShaderUnusedKHR; + uint32_t anyHitShader = VULKAN_HPP_NAMESPACE::ShaderUnusedKHR; + uint32_t intersectionShader = VULKAN_HPP_NAMESPACE::ShaderUnusedKHR; const void * pShaderGroupCaptureReplayHandle = {}; }; @@ -93157,10 +95830,10 @@ namespace VULKAN_HPP_NAMESPACE #if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) VULKAN_HPP_CONSTEXPR RayTracingShaderGroupCreateInfoNV( VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR type_ = VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR::eGeneral, - uint32_t generalShader_ = {}, - uint32_t closestHitShader_ = {}, - uint32_t anyHitShader_ = {}, - uint32_t intersectionShader_ = {}, + uint32_t generalShader_ = VULKAN_HPP_NAMESPACE::ShaderUnusedNV, + uint32_t closestHitShader_ = VULKAN_HPP_NAMESPACE::ShaderUnusedNV, + uint32_t anyHitShader_ = VULKAN_HPP_NAMESPACE::ShaderUnusedNV, + uint32_t intersectionShader_ = VULKAN_HPP_NAMESPACE::ShaderUnusedNV, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT : pNext( pNext_ ) , type( type_ ) @@ -93276,10 +95949,10 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRayTracingShaderGroupCreateInfoNV; const void * pNext = {}; VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR type = VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR::eGeneral; - uint32_t generalShader = {}; - uint32_t closestHitShader = {}; - uint32_t anyHitShader = {}; - uint32_t intersectionShader = {}; + uint32_t generalShader = VULKAN_HPP_NAMESPACE::ShaderUnusedNV; + uint32_t closestHitShader = VULKAN_HPP_NAMESPACE::ShaderUnusedNV; + uint32_t anyHitShader = VULKAN_HPP_NAMESPACE::ShaderUnusedNV; + uint32_t intersectionShader = VULKAN_HPP_NAMESPACE::ShaderUnusedNV; }; template <> @@ -97483,6 +100156,117 @@ namespace VULKAN_HPP_NAMESPACE }; using ResolveImageInfo2KHR = ResolveImageInfo2; + struct SamplerBlockMatchWindowCreateInfoQCOM + { + using NativeType = VkSamplerBlockMatchWindowCreateInfoQCOM; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSamplerBlockMatchWindowCreateInfoQCOM; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR SamplerBlockMatchWindowCreateInfoQCOM( + VULKAN_HPP_NAMESPACE::Extent2D windowExtent_ = {}, + VULKAN_HPP_NAMESPACE::BlockMatchWindowCompareModeQCOM windowCompareMode_ = VULKAN_HPP_NAMESPACE::BlockMatchWindowCompareModeQCOM::eMin, + const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , windowExtent( windowExtent_ ) + , windowCompareMode( windowCompareMode_ ) + { + } + + VULKAN_HPP_CONSTEXPR SamplerBlockMatchWindowCreateInfoQCOM( SamplerBlockMatchWindowCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + SamplerBlockMatchWindowCreateInfoQCOM( VkSamplerBlockMatchWindowCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + : SamplerBlockMatchWindowCreateInfoQCOM( *reinterpret_cast<SamplerBlockMatchWindowCreateInfoQCOM const *>( &rhs ) ) + { + } + + SamplerBlockMatchWindowCreateInfoQCOM & operator=( SamplerBlockMatchWindowCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + SamplerBlockMatchWindowCreateInfoQCOM & operator=( VkSamplerBlockMatchWindowCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::SamplerBlockMatchWindowCreateInfoQCOM const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 SamplerBlockMatchWindowCreateInfoQCOM & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 SamplerBlockMatchWindowCreateInfoQCOM & setWindowExtent( VULKAN_HPP_NAMESPACE::Extent2D const & windowExtent_ ) VULKAN_HPP_NOEXCEPT + { + windowExtent = windowExtent_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 SamplerBlockMatchWindowCreateInfoQCOM & + setWindowCompareMode( VULKAN_HPP_NAMESPACE::BlockMatchWindowCompareModeQCOM windowCompareMode_ ) VULKAN_HPP_NOEXCEPT + { + windowCompareMode = windowCompareMode_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkSamplerBlockMatchWindowCreateInfoQCOM const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkSamplerBlockMatchWindowCreateInfoQCOM *>( this ); + } + + operator VkSamplerBlockMatchWindowCreateInfoQCOM &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkSamplerBlockMatchWindowCreateInfoQCOM *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, + const void * const &, + VULKAN_HPP_NAMESPACE::Extent2D const &, + VULKAN_HPP_NAMESPACE::BlockMatchWindowCompareModeQCOM const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, windowExtent, windowCompareMode ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( SamplerBlockMatchWindowCreateInfoQCOM const & ) const = default; +#else + bool operator==( SamplerBlockMatchWindowCreateInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( windowExtent == rhs.windowExtent ) && ( windowCompareMode == rhs.windowCompareMode ); +# endif + } + + bool operator!=( SamplerBlockMatchWindowCreateInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSamplerBlockMatchWindowCreateInfoQCOM; + const void * pNext = {}; + VULKAN_HPP_NAMESPACE::Extent2D windowExtent = {}; + VULKAN_HPP_NAMESPACE::BlockMatchWindowCompareModeQCOM windowCompareMode = VULKAN_HPP_NAMESPACE::BlockMatchWindowCompareModeQCOM::eMin; + }; + + template <> + struct CppType<StructureType, StructureType::eSamplerBlockMatchWindowCreateInfoQCOM> + { + using Type = SamplerBlockMatchWindowCreateInfoQCOM; + }; + struct SamplerBorderColorComponentMappingCreateInfoEXT { using NativeType = VkSamplerBorderColorComponentMappingCreateInfoEXT; @@ -97957,6 +100741,105 @@ namespace VULKAN_HPP_NAMESPACE using Type = SamplerCreateInfo; }; + struct SamplerCubicWeightsCreateInfoQCOM + { + using NativeType = VkSamplerCubicWeightsCreateInfoQCOM; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSamplerCubicWeightsCreateInfoQCOM; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR + SamplerCubicWeightsCreateInfoQCOM( VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM cubicWeights_ = VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM::eCatmullRom, + const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , cubicWeights( cubicWeights_ ) + { + } + + VULKAN_HPP_CONSTEXPR SamplerCubicWeightsCreateInfoQCOM( SamplerCubicWeightsCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + SamplerCubicWeightsCreateInfoQCOM( VkSamplerCubicWeightsCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + : SamplerCubicWeightsCreateInfoQCOM( *reinterpret_cast<SamplerCubicWeightsCreateInfoQCOM const *>( &rhs ) ) + { + } + + SamplerCubicWeightsCreateInfoQCOM & operator=( SamplerCubicWeightsCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + SamplerCubicWeightsCreateInfoQCOM & operator=( VkSamplerCubicWeightsCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::SamplerCubicWeightsCreateInfoQCOM const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 SamplerCubicWeightsCreateInfoQCOM & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 SamplerCubicWeightsCreateInfoQCOM & + setCubicWeights( VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM cubicWeights_ ) VULKAN_HPP_NOEXCEPT + { + cubicWeights = cubicWeights_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkSamplerCubicWeightsCreateInfoQCOM const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkSamplerCubicWeightsCreateInfoQCOM *>( this ); + } + + operator VkSamplerCubicWeightsCreateInfoQCOM &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkSamplerCubicWeightsCreateInfoQCOM *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, const void * const &, VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, cubicWeights ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( SamplerCubicWeightsCreateInfoQCOM const & ) const = default; +#else + bool operator==( SamplerCubicWeightsCreateInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( cubicWeights == rhs.cubicWeights ); +# endif + } + + bool operator!=( SamplerCubicWeightsCreateInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSamplerCubicWeightsCreateInfoQCOM; + const void * pNext = {}; + VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM cubicWeights = VULKAN_HPP_NAMESPACE::CubicFilterWeightsQCOM::eCatmullRom; + }; + + template <> + struct CppType<StructureType, StructureType::eSamplerCubicWeightsCreateInfoQCOM> + { + using Type = SamplerCubicWeightsCreateInfoQCOM; + }; + struct SamplerCustomBorderColorCreateInfoEXT { using NativeType = VkSamplerCustomBorderColorCreateInfoEXT; @@ -98506,6 +101389,115 @@ namespace VULKAN_HPP_NAMESPACE }; using SamplerYcbcrConversionInfoKHR = SamplerYcbcrConversionInfo; + struct SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM + { + using NativeType = VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM( VULKAN_HPP_NAMESPACE::Bool32 enableYDegamma_ = {}, + VULKAN_HPP_NAMESPACE::Bool32 enableCbCrDegamma_ = {}, + void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , enableYDegamma( enableYDegamma_ ) + , enableCbCrDegamma( enableCbCrDegamma_ ) + { + } + + VULKAN_HPP_CONSTEXPR + SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM( SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM( VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + : SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM( *reinterpret_cast<SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM const *>( &rhs ) ) + { + } + + SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM & operator=( SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM & operator=( VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM & + setEnableYDegamma( VULKAN_HPP_NAMESPACE::Bool32 enableYDegamma_ ) VULKAN_HPP_NOEXCEPT + { + enableYDegamma = enableYDegamma_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM & + setEnableCbCrDegamma( VULKAN_HPP_NAMESPACE::Bool32 enableCbCrDegamma_ ) VULKAN_HPP_NOEXCEPT + { + enableCbCrDegamma = enableCbCrDegamma_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM *>( this ); + } + + operator VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, void * const &, VULKAN_HPP_NAMESPACE::Bool32 const &, VULKAN_HPP_NAMESPACE::Bool32 const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, enableYDegamma, enableCbCrDegamma ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM const & ) const = default; +#else + bool operator==( SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( enableYDegamma == rhs.enableYDegamma ) && ( enableCbCrDegamma == rhs.enableCbCrDegamma ); +# endif + } + + bool operator!=( SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM; + void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 enableYDegamma = {}; + VULKAN_HPP_NAMESPACE::Bool32 enableCbCrDegamma = {}; + }; + + template <> + struct CppType<StructureType, StructureType::eSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM> + { + using Type = SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM; + }; + #if defined( VK_USE_PLATFORM_SCREEN_QNX ) struct ScreenBufferFormatPropertiesQNX { @@ -99791,6 +102783,112 @@ namespace VULKAN_HPP_NAMESPACE }; using SemaphoreWaitInfoKHR = SemaphoreWaitInfo; + struct SetLatencyMarkerInfoNV + { + using NativeType = VkSetLatencyMarkerInfoNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSetLatencyMarkerInfoNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR SetLatencyMarkerInfoNV( uint64_t presentID_ = {}, + VULKAN_HPP_NAMESPACE::LatencyMarkerNV marker_ = VULKAN_HPP_NAMESPACE::LatencyMarkerNV::eSimulationStart, + const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , presentID( presentID_ ) + , marker( marker_ ) + { + } + + VULKAN_HPP_CONSTEXPR SetLatencyMarkerInfoNV( SetLatencyMarkerInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + SetLatencyMarkerInfoNV( VkSetLatencyMarkerInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT + : SetLatencyMarkerInfoNV( *reinterpret_cast<SetLatencyMarkerInfoNV const *>( &rhs ) ) + { + } + + SetLatencyMarkerInfoNV & operator=( SetLatencyMarkerInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + SetLatencyMarkerInfoNV & operator=( VkSetLatencyMarkerInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::SetLatencyMarkerInfoNV const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 SetLatencyMarkerInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 SetLatencyMarkerInfoNV & setPresentID( uint64_t presentID_ ) VULKAN_HPP_NOEXCEPT + { + presentID = presentID_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 SetLatencyMarkerInfoNV & setMarker( VULKAN_HPP_NAMESPACE::LatencyMarkerNV marker_ ) VULKAN_HPP_NOEXCEPT + { + marker = marker_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkSetLatencyMarkerInfoNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkSetLatencyMarkerInfoNV *>( this ); + } + + operator VkSetLatencyMarkerInfoNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkSetLatencyMarkerInfoNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, const void * const &, uint64_t const &, VULKAN_HPP_NAMESPACE::LatencyMarkerNV const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, presentID, marker ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( SetLatencyMarkerInfoNV const & ) const = default; +#else + bool operator==( SetLatencyMarkerInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( presentID == rhs.presentID ) && ( marker == rhs.marker ); +# endif + } + + bool operator!=( SetLatencyMarkerInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSetLatencyMarkerInfoNV; + const void * pNext = {}; + uint64_t presentID = {}; + VULKAN_HPP_NAMESPACE::LatencyMarkerNV marker = VULKAN_HPP_NAMESPACE::LatencyMarkerNV::eSimulationStart; + }; + + template <> + struct CppType<StructureType, StructureType::eSetLatencyMarkerInfoNV> + { + using Type = SetLatencyMarkerInfoNV; + }; + struct SetStateFlagsIndirectCommandNV { using NativeType = VkSetStateFlagsIndirectCommandNV; @@ -104396,6 +107494,102 @@ namespace VULKAN_HPP_NAMESPACE using Type = SwapchainDisplayNativeHdrCreateInfoAMD; }; + struct SwapchainLatencyCreateInfoNV + { + using NativeType = VkSwapchainLatencyCreateInfoNV; + + static const bool allowDuplicate = false; + static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSwapchainLatencyCreateInfoNV; + +#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) + VULKAN_HPP_CONSTEXPR SwapchainLatencyCreateInfoNV( VULKAN_HPP_NAMESPACE::Bool32 latencyModeEnable_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT + : pNext( pNext_ ) + , latencyModeEnable( latencyModeEnable_ ) + { + } + + VULKAN_HPP_CONSTEXPR SwapchainLatencyCreateInfoNV( SwapchainLatencyCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; + + SwapchainLatencyCreateInfoNV( VkSwapchainLatencyCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT + : SwapchainLatencyCreateInfoNV( *reinterpret_cast<SwapchainLatencyCreateInfoNV const *>( &rhs ) ) + { + } + + SwapchainLatencyCreateInfoNV & operator=( SwapchainLatencyCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; +#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ + + SwapchainLatencyCreateInfoNV & operator=( VkSwapchainLatencyCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT + { + *this = *reinterpret_cast<VULKAN_HPP_NAMESPACE::SwapchainLatencyCreateInfoNV const *>( &rhs ); + return *this; + } + +#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) + VULKAN_HPP_CONSTEXPR_14 SwapchainLatencyCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT + { + pNext = pNext_; + return *this; + } + + VULKAN_HPP_CONSTEXPR_14 SwapchainLatencyCreateInfoNV & setLatencyModeEnable( VULKAN_HPP_NAMESPACE::Bool32 latencyModeEnable_ ) VULKAN_HPP_NOEXCEPT + { + latencyModeEnable = latencyModeEnable_; + return *this; + } +#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ + + operator VkSwapchainLatencyCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<const VkSwapchainLatencyCreateInfoNV *>( this ); + } + + operator VkSwapchainLatencyCreateInfoNV &() VULKAN_HPP_NOEXCEPT + { + return *reinterpret_cast<VkSwapchainLatencyCreateInfoNV *>( this ); + } + +#if defined( VULKAN_HPP_USE_REFLECT ) +# if 14 <= VULKAN_HPP_CPP_VERSION + auto +# else + std::tuple<VULKAN_HPP_NAMESPACE::StructureType const &, const void * const &, VULKAN_HPP_NAMESPACE::Bool32 const &> +# endif + reflect() const VULKAN_HPP_NOEXCEPT + { + return std::tie( sType, pNext, latencyModeEnable ); + } +#endif + +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + auto operator<=>( SwapchainLatencyCreateInfoNV const & ) const = default; +#else + bool operator==( SwapchainLatencyCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { +# if defined( VULKAN_HPP_USE_REFLECT ) + return this->reflect() == rhs.reflect(); +# else + return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( latencyModeEnable == rhs.latencyModeEnable ); +# endif + } + + bool operator!=( SwapchainLatencyCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT + { + return !operator==( rhs ); + } +#endif + + public: + VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSwapchainLatencyCreateInfoNV; + const void * pNext = {}; + VULKAN_HPP_NAMESPACE::Bool32 latencyModeEnable = {}; + }; + + template <> + struct CppType<StructureType, StructureType::eSwapchainLatencyCreateInfoNV> + { + using Type = SwapchainLatencyCreateInfoNV; + }; + struct SwapchainPresentBarrierCreateInfoNV { using NativeType = VkSwapchainPresentBarrierCreateInfoNV; diff --git a/thirdparty/vulkan/include/vulkan/vulkan_to_string.hpp b/thirdparty/vulkan/include/vulkan/vulkan_to_string.hpp index 3eac3e833f..3a34b36460 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_to_string.hpp +++ b/thirdparty/vulkan/include/vulkan/vulkan_to_string.hpp @@ -935,6 +935,10 @@ namespace VULKAN_HPP_NAMESPACE result += "UpdateAfterBind | "; if ( value & DescriptorPoolCreateFlagBits::eHostOnlyEXT ) result += "HostOnlyEXT | "; + if ( value & DescriptorPoolCreateFlagBits::eAllowOverallocationSetsNV ) + result += "AllowOverallocationSetsNV | "; + if ( value & DescriptorPoolCreateFlagBits::eAllowOverallocationPoolsNV ) + result += "AllowOverallocationPoolsNV | "; return "{ " + result.substr( 0, result.size() - 3 ) + " }"; } @@ -1456,6 +1460,10 @@ namespace VULKAN_HPP_NAMESPACE result += "Min | "; if ( value & ResolveModeFlagBits::eMax ) result += "Max | "; +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) + if ( value & ResolveModeFlagBits::eExternalFormatDownsampleANDROID ) + result += "ExternalFormatDownsampleANDROID | "; +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ return "{ " + result.substr( 0, result.size() - 3 ) + " }"; } @@ -1733,6 +1741,8 @@ namespace VULKAN_HPP_NAMESPACE result += "Suspending | "; if ( value & RenderingFlagBits::eResuming ) result += "Resuming | "; + if ( value & RenderingFlagBits::eContentsInlineEXT ) + result += "ContentsInlineEXT | "; if ( value & RenderingFlagBits::eEnableLegacyDitheringEXT ) result += "EnableLegacyDitheringEXT | "; @@ -2256,6 +2266,10 @@ namespace VULKAN_HPP_NAMESPACE result += "DeblockingFilterEnabled | "; if ( value & VideoEncodeH264StdFlagBitsEXT::eDeblockingFilterPartial ) result += "DeblockingFilterPartial | "; + if ( value & VideoEncodeH264StdFlagBitsEXT::eSliceQpDelta ) + result += "SliceQpDelta | "; + if ( value & VideoEncodeH264StdFlagBitsEXT::eDifferentSliceQpDelta ) + result += "DifferentSliceQpDelta | "; return "{ " + result.substr( 0, result.size() - 3 ) + " }"; } @@ -2358,6 +2372,10 @@ namespace VULKAN_HPP_NAMESPACE result += "DependentSliceSegmentsEnabledFlagSet | "; if ( value & VideoEncodeH265StdFlagBitsEXT::eDependentSliceSegmentFlagSet ) result += "DependentSliceSegmentFlagSet | "; + if ( value & VideoEncodeH265StdFlagBitsEXT::eSliceQpDelta ) + result += "SliceQpDelta | "; + if ( value & VideoEncodeH265StdFlagBitsEXT::eDifferentSliceQpDelta ) + result += "DifferentSliceQpDelta | "; return "{ " + result.substr( 0, result.size() - 3 ) + " }"; } @@ -2893,6 +2911,8 @@ namespace VULKAN_HPP_NAMESPACE std::string result; if ( value & VideoEncodeCapabilityFlagBitsKHR::ePrecedingExternallyEncodedBytes ) result += "PrecedingExternallyEncodedBytes | "; + if ( value & VideoEncodeCapabilityFlagBitsKHR::eInsufficientstreamBufferRangeDetectionBit ) + result += "InsufficientstreamBufferRangeDetectionBit | "; return "{ " + result.substr( 0, result.size() - 3 ) + " }"; } @@ -3175,6 +3195,20 @@ namespace VULKAN_HPP_NAMESPACE } #endif /*VK_USE_PLATFORM_FUCHSIA*/ + //=== VK_EXT_frame_boundary === + + VULKAN_HPP_INLINE std::string to_string( FrameBoundaryFlagsEXT value ) + { + if ( !value ) + return "{}"; + + std::string result; + if ( value & FrameBoundaryFlagBitsEXT::eFrameEnd ) + result += "FrameEnd | "; + + return "{ " + result.substr( 0, result.size() - 3 ) + " }"; + } + #if defined( VK_USE_PLATFORM_SCREEN_QNX ) //=== VK_QNX_screen_surface === @@ -4304,6 +4338,8 @@ namespace VULKAN_HPP_NAMESPACE case StructureType::ePhysicalDeviceExternalMemoryRdmaFeaturesNV: return "PhysicalDeviceExternalMemoryRdmaFeaturesNV"; case StructureType::ePipelinePropertiesIdentifierEXT: return "PipelinePropertiesIdentifierEXT"; case StructureType::ePhysicalDevicePipelinePropertiesFeaturesEXT: return "PhysicalDevicePipelinePropertiesFeaturesEXT"; + case StructureType::ePhysicalDeviceFrameBoundaryFeaturesEXT: return "PhysicalDeviceFrameBoundaryFeaturesEXT"; + case StructureType::eFrameBoundaryEXT: return "FrameBoundaryEXT"; case StructureType::ePhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT: return "PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT"; case StructureType::eSubpassResolvePerformanceQueryEXT: return "SubpassResolvePerformanceQueryEXT"; case StructureType::eMultisampledRenderToSingleSampledInfoEXT: return "MultisampledRenderToSingleSampledInfoEXT"; @@ -4365,6 +4401,8 @@ namespace VULKAN_HPP_NAMESPACE case StructureType::ePhysicalDeviceImageProcessingFeaturesQCOM: return "PhysicalDeviceImageProcessingFeaturesQCOM"; case StructureType::ePhysicalDeviceImageProcessingPropertiesQCOM: return "PhysicalDeviceImageProcessingPropertiesQCOM"; case StructureType::eImageViewSampleWeightCreateInfoQCOM: return "ImageViewSampleWeightCreateInfoQCOM"; + case StructureType::ePhysicalDeviceNestedCommandBufferFeaturesEXT: return "PhysicalDeviceNestedCommandBufferFeaturesEXT"; + case StructureType::ePhysicalDeviceNestedCommandBufferPropertiesEXT: return "PhysicalDeviceNestedCommandBufferPropertiesEXT"; case StructureType::eExternalMemoryAcquireUnmodifiedEXT: return "ExternalMemoryAcquireUnmodifiedEXT"; case StructureType::ePhysicalDeviceExtendedDynamicState3FeaturesEXT: return "PhysicalDeviceExtendedDynamicState3FeaturesEXT"; case StructureType::ePhysicalDeviceExtendedDynamicState3PropertiesEXT: return "PhysicalDeviceExtendedDynamicState3PropertiesEXT"; @@ -4388,6 +4426,11 @@ namespace VULKAN_HPP_NAMESPACE case StructureType::eOpticalFlowSessionCreatePrivateDataInfoNV: return "OpticalFlowSessionCreatePrivateDataInfoNV"; case StructureType::ePhysicalDeviceLegacyDitheringFeaturesEXT: return "PhysicalDeviceLegacyDitheringFeaturesEXT"; case StructureType::ePhysicalDevicePipelineProtectedAccessFeaturesEXT: return "PhysicalDevicePipelineProtectedAccessFeaturesEXT"; +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) + case StructureType::ePhysicalDeviceExternalFormatResolveFeaturesANDROID: return "PhysicalDeviceExternalFormatResolveFeaturesANDROID"; + case StructureType::ePhysicalDeviceExternalFormatResolvePropertiesANDROID: return "PhysicalDeviceExternalFormatResolvePropertiesANDROID"; + case StructureType::eAndroidHardwareBufferFormatResolvePropertiesANDROID: return "AndroidHardwareBufferFormatResolvePropertiesANDROID"; +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ case StructureType::ePhysicalDeviceMaintenance5FeaturesKHR: return "PhysicalDeviceMaintenance5FeaturesKHR"; case StructureType::ePhysicalDeviceMaintenance5PropertiesKHR: return "PhysicalDeviceMaintenance5PropertiesKHR"; case StructureType::eRenderingAreaInfoKHR: return "RenderingAreaInfoKHR"; @@ -4407,17 +4450,37 @@ namespace VULKAN_HPP_NAMESPACE case StructureType::ePhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM: return "PhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM"; case StructureType::ePhysicalDeviceRayTracingInvocationReorderFeaturesNV: return "PhysicalDeviceRayTracingInvocationReorderFeaturesNV"; case StructureType::ePhysicalDeviceRayTracingInvocationReorderPropertiesNV: return "PhysicalDeviceRayTracingInvocationReorderPropertiesNV"; + case StructureType::ePhysicalDeviceExtendedSparseAddressSpaceFeaturesNV: return "PhysicalDeviceExtendedSparseAddressSpaceFeaturesNV"; + case StructureType::ePhysicalDeviceExtendedSparseAddressSpacePropertiesNV: return "PhysicalDeviceExtendedSparseAddressSpacePropertiesNV"; case StructureType::ePhysicalDeviceMutableDescriptorTypeFeaturesEXT: return "PhysicalDeviceMutableDescriptorTypeFeaturesEXT"; case StructureType::eMutableDescriptorTypeCreateInfoEXT: return "MutableDescriptorTypeCreateInfoEXT"; case StructureType::ePhysicalDeviceShaderCoreBuiltinsFeaturesARM: return "PhysicalDeviceShaderCoreBuiltinsFeaturesARM"; case StructureType::ePhysicalDeviceShaderCoreBuiltinsPropertiesARM: return "PhysicalDeviceShaderCoreBuiltinsPropertiesARM"; case StructureType::ePhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT: return "PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT"; case StructureType::ePhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT: return "PhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT"; + case StructureType::eLatencySleepModeInfoNV: return "LatencySleepModeInfoNV"; + case StructureType::eLatencySleepInfoNV: return "LatencySleepInfoNV"; + case StructureType::eSetLatencyMarkerInfoNV: return "SetLatencyMarkerInfoNV"; + case StructureType::eGetLatencyMarkerInfoNV: return "GetLatencyMarkerInfoNV"; + case StructureType::eLatencyTimingsFrameReportNV: return "LatencyTimingsFrameReportNV"; + case StructureType::eLatencySubmissionPresentIdNV: return "LatencySubmissionPresentIdNV"; + case StructureType::eOutOfBandQueueTypeInfoNV: return "OutOfBandQueueTypeInfoNV"; + case StructureType::eSwapchainLatencyCreateInfoNV: return "SwapchainLatencyCreateInfoNV"; + case StructureType::eLatencySurfaceCapabilitiesNV: return "LatencySurfaceCapabilitiesNV"; case StructureType::ePhysicalDeviceCooperativeMatrixFeaturesKHR: return "PhysicalDeviceCooperativeMatrixFeaturesKHR"; case StructureType::eCooperativeMatrixPropertiesKHR: return "CooperativeMatrixPropertiesKHR"; case StructureType::ePhysicalDeviceCooperativeMatrixPropertiesKHR: return "PhysicalDeviceCooperativeMatrixPropertiesKHR"; case StructureType::ePhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM: return "PhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM"; case StructureType::eMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM: return "MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM"; + case StructureType::ePhysicalDeviceImageProcessing2FeaturesQCOM: return "PhysicalDeviceImageProcessing2FeaturesQCOM"; + case StructureType::ePhysicalDeviceImageProcessing2PropertiesQCOM: return "PhysicalDeviceImageProcessing2PropertiesQCOM"; + case StructureType::eSamplerBlockMatchWindowCreateInfoQCOM: return "SamplerBlockMatchWindowCreateInfoQCOM"; + case StructureType::eSamplerCubicWeightsCreateInfoQCOM: return "SamplerCubicWeightsCreateInfoQCOM"; + case StructureType::ePhysicalDeviceCubicWeightsFeaturesQCOM: return "PhysicalDeviceCubicWeightsFeaturesQCOM"; + case StructureType::eBlitImageCubicWeightsInfoQCOM: return "BlitImageCubicWeightsInfoQCOM"; + case StructureType::ePhysicalDeviceYcbcrDegammaFeaturesQCOM: return "PhysicalDeviceYcbcrDegammaFeaturesQCOM"; + case StructureType::eSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM: return "SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM"; + case StructureType::ePhysicalDeviceCubicClampFeaturesQCOM: return "PhysicalDeviceCubicClampFeaturesQCOM"; case StructureType::ePhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT: return "PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT"; #if defined( VK_USE_PLATFORM_SCREEN_QNX ) case StructureType::eScreenBufferPropertiesQNX: return "ScreenBufferPropertiesQNX"; @@ -4426,6 +4489,8 @@ namespace VULKAN_HPP_NAMESPACE case StructureType::eExternalFormatQNX: return "ExternalFormatQNX"; case StructureType::ePhysicalDeviceExternalMemoryScreenBufferFeaturesQNX: return "PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX"; #endif /*VK_USE_PLATFORM_SCREEN_QNX*/ + case StructureType::ePhysicalDeviceLayeredDriverPropertiesMSFT: return "PhysicalDeviceLayeredDriverPropertiesMSFT"; + case StructureType::ePhysicalDeviceDescriptorPoolOverallocationFeaturesNV: return "PhysicalDeviceDescriptorPoolOverallocationFeaturesNV"; default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; } } @@ -5002,6 +5067,15 @@ namespace VULKAN_HPP_NAMESPACE return "(void)"; } + VULKAN_HPP_INLINE std::string to_string( DeviceQueueCreateFlagBits value ) + { + switch ( value ) + { + case DeviceQueueCreateFlagBits::eProtected: return "Protected"; + default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; + } + } + VULKAN_HPP_INLINE std::string to_string( PipelineStageFlagBits value ) { switch ( value ) @@ -5323,6 +5397,15 @@ namespace VULKAN_HPP_NAMESPACE return "(void)"; } + VULKAN_HPP_INLINE std::string to_string( PipelineCacheCreateFlagBits value ) + { + switch ( value ) + { + case PipelineCacheCreateFlagBits::eExternallySynchronized: return "ExternallySynchronized"; + default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; + } + } + VULKAN_HPP_INLINE std::string to_string( BlendFactor value ) { switch ( value ) @@ -5697,6 +5780,25 @@ namespace VULKAN_HPP_NAMESPACE } } + VULKAN_HPP_INLINE std::string to_string( PipelineColorBlendStateCreateFlagBits value ) + { + switch ( value ) + { + case PipelineColorBlendStateCreateFlagBits::eRasterizationOrderAttachmentAccessEXT: return "RasterizationOrderAttachmentAccessEXT"; + default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; + } + } + + VULKAN_HPP_INLINE std::string to_string( PipelineDepthStencilStateCreateFlagBits value ) + { + switch ( value ) + { + case PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentDepthAccessEXT: return "RasterizationOrderAttachmentDepthAccessEXT"; + case PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentStencilAccessEXT: return "RasterizationOrderAttachmentStencilAccessEXT"; + default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; + } + } + VULKAN_HPP_INLINE std::string to_string( PipelineDynamicStateCreateFlagBits ) { return "(void)"; @@ -5707,6 +5809,15 @@ namespace VULKAN_HPP_NAMESPACE return "(void)"; } + VULKAN_HPP_INLINE std::string to_string( PipelineLayoutCreateFlagBits value ) + { + switch ( value ) + { + case PipelineLayoutCreateFlagBits::eIndependentSetsEXT: return "IndependentSetsEXT"; + default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; + } + } + VULKAN_HPP_INLINE std::string to_string( PipelineMultisampleStateCreateFlagBits ) { return "(void)"; @@ -5802,6 +5913,8 @@ namespace VULKAN_HPP_NAMESPACE case DescriptorPoolCreateFlagBits::eFreeDescriptorSet: return "FreeDescriptorSet"; case DescriptorPoolCreateFlagBits::eUpdateAfterBind: return "UpdateAfterBind"; case DescriptorPoolCreateFlagBits::eHostOnlyEXT: return "HostOnlyEXT"; + case DescriptorPoolCreateFlagBits::eAllowOverallocationSetsNV: return "AllowOverallocationSetsNV"; + case DescriptorPoolCreateFlagBits::eAllowOverallocationPoolsNV: return "AllowOverallocationPoolsNV"; default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; } } @@ -6068,6 +6181,7 @@ namespace VULKAN_HPP_NAMESPACE { case SubpassContents::eInline: return "Inline"; case SubpassContents::eSecondaryCommandBuffers: return "SecondaryCommandBuffers"; + case SubpassContents::eInlineAndSecondaryCommandBuffersEXT: return "InlineAndSecondaryCommandBuffersEXT"; default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; } } @@ -6139,15 +6253,6 @@ namespace VULKAN_HPP_NAMESPACE } } - VULKAN_HPP_INLINE std::string to_string( DeviceQueueCreateFlagBits value ) - { - switch ( value ) - { - case DeviceQueueCreateFlagBits::eProtected: return "Protected"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; - } - } - VULKAN_HPP_INLINE std::string to_string( SamplerYcbcrModelConversion value ) { switch ( value ) @@ -6332,6 +6437,7 @@ namespace VULKAN_HPP_NAMESPACE case DriverId::eMesaDozen: return "MesaDozen"; case DriverId::eMesaNvk: return "MesaNvk"; case DriverId::eImaginationOpenSourceMESA: return "ImaginationOpenSourceMESA"; + case DriverId::eMesaAgxv: return "MesaAgxv"; default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; } } @@ -6368,6 +6474,9 @@ namespace VULKAN_HPP_NAMESPACE case ResolveModeFlagBits::eAverage: return "Average"; case ResolveModeFlagBits::eMin: return "Min"; case ResolveModeFlagBits::eMax: return "Max"; +#if defined( VK_USE_PLATFORM_ANDROID_KHR ) + case ResolveModeFlagBits::eExternalFormatDownsampleANDROID: return "ExternalFormatDownsampleANDROID"; +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; } } @@ -6379,6 +6488,7 @@ namespace VULKAN_HPP_NAMESPACE case SamplerReductionMode::eWeightedAverage: return "WeightedAverage"; case SamplerReductionMode::eMin: return "Min"; case SamplerReductionMode::eMax: return "Max"; + case SamplerReductionMode::eWeightedAverageRangeclampQCOM: return "WeightedAverageRangeclampQCOM"; default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; } } @@ -6556,6 +6666,7 @@ namespace VULKAN_HPP_NAMESPACE case RenderingFlagBits::eContentsSecondaryCommandBuffers: return "ContentsSecondaryCommandBuffers"; case RenderingFlagBits::eSuspending: return "Suspending"; case RenderingFlagBits::eResuming: return "Resuming"; + case RenderingFlagBits::eContentsInlineEXT: return "ContentsInlineEXT"; case RenderingFlagBits::eEnableLegacyDitheringEXT: return "EnableLegacyDitheringEXT"; default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; } @@ -6939,6 +7050,9 @@ namespace VULKAN_HPP_NAMESPACE case QueryResultStatusKHR::eError: return "Error"; case QueryResultStatusKHR::eNotReady: return "NotReady"; case QueryResultStatusKHR::eComplete: return "Complete"; +#if defined( VK_ENABLE_BETA_EXTENSIONS ) + case QueryResultStatusKHR::eInsufficientBitstreamBufferRange: return "InsufficientBitstreamBufferRange"; +#endif /*VK_ENABLE_BETA_EXTENSIONS*/ default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; } } @@ -7036,6 +7150,8 @@ namespace VULKAN_HPP_NAMESPACE case VideoEncodeH264StdFlagBitsEXT::eDeblockingFilterDisabled: return "DeblockingFilterDisabled"; case VideoEncodeH264StdFlagBitsEXT::eDeblockingFilterEnabled: return "DeblockingFilterEnabled"; case VideoEncodeH264StdFlagBitsEXT::eDeblockingFilterPartial: return "DeblockingFilterPartial"; + case VideoEncodeH264StdFlagBitsEXT::eSliceQpDelta: return "SliceQpDelta"; + case VideoEncodeH264StdFlagBitsEXT::eDifferentSliceQpDelta: return "DifferentSliceQpDelta"; default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; } } @@ -7098,6 +7214,8 @@ namespace VULKAN_HPP_NAMESPACE case VideoEncodeH265StdFlagBitsEXT::eDeblockingFilterOverrideEnabledFlagSet: return "DeblockingFilterOverrideEnabledFlagSet"; case VideoEncodeH265StdFlagBitsEXT::eDependentSliceSegmentsEnabledFlagSet: return "DependentSliceSegmentsEnabledFlagSet"; case VideoEncodeH265StdFlagBitsEXT::eDependentSliceSegmentFlagSet: return "DependentSliceSegmentFlagSet"; + case VideoEncodeH265StdFlagBitsEXT::eSliceQpDelta: return "SliceQpDelta"; + case VideoEncodeH265StdFlagBitsEXT::eDifferentSliceQpDelta: return "DifferentSliceQpDelta"; default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; } } @@ -8097,17 +8215,6 @@ namespace VULKAN_HPP_NAMESPACE return "(void)"; } - //=== VK_EXT_pipeline_creation_cache_control === - - VULKAN_HPP_INLINE std::string to_string( PipelineCacheCreateFlagBits value ) - { - switch ( value ) - { - case PipelineCacheCreateFlagBits::eExternallySynchronized: return "ExternallySynchronized"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; - } - } - #if defined( VK_ENABLE_BETA_EXTENSIONS ) //=== VK_KHR_video_encode_queue === @@ -8116,6 +8223,7 @@ namespace VULKAN_HPP_NAMESPACE switch ( value ) { case VideoEncodeCapabilityFlagBitsKHR::ePrecedingExternallyEncodedBytes: return "PrecedingExternallyEncodedBytes"; + case VideoEncodeCapabilityFlagBitsKHR::eInsufficientstreamBufferRangeDetectionBit: return "InsufficientstreamBufferRangeDetectionBit"; default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; } } @@ -8238,15 +8346,6 @@ namespace VULKAN_HPP_NAMESPACE } } - VULKAN_HPP_INLINE std::string to_string( PipelineLayoutCreateFlagBits value ) - { - switch ( value ) - { - case PipelineLayoutCreateFlagBits::eIndependentSetsEXT: return "IndependentSetsEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; - } - } - //=== VK_NV_fragment_shading_rate_enums === VULKAN_HPP_INLINE std::string to_string( FragmentShadingRateNV value ) @@ -8427,6 +8526,17 @@ namespace VULKAN_HPP_NAMESPACE } #endif /*VK_USE_PLATFORM_FUCHSIA*/ + //=== VK_EXT_frame_boundary === + + VULKAN_HPP_INLINE std::string to_string( FrameBoundaryFlagBitsEXT value ) + { + switch ( value ) + { + case FrameBoundaryFlagBitsEXT::eFrameEnd: return "FrameEnd"; + default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; + } + } + #if defined( VK_USE_PLATFORM_SCREEN_QNX ) //=== VK_QNX_screen_surface === @@ -8580,27 +8690,6 @@ namespace VULKAN_HPP_NAMESPACE return "(void)"; } - //=== VK_EXT_rasterization_order_attachment_access === - - VULKAN_HPP_INLINE std::string to_string( PipelineColorBlendStateCreateFlagBits value ) - { - switch ( value ) - { - case PipelineColorBlendStateCreateFlagBits::eRasterizationOrderAttachmentAccessEXT: return "RasterizationOrderAttachmentAccessEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineDepthStencilStateCreateFlagBits value ) - { - switch ( value ) - { - case PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentDepthAccessEXT: return "RasterizationOrderAttachmentDepthAccessEXT"; - case PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentStencilAccessEXT: return "RasterizationOrderAttachmentStencilAccessEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; - } - } - //=== VK_NV_optical_flow === VULKAN_HPP_INLINE std::string to_string( OpticalFlowUsageFlagBitsNV value ) @@ -8799,6 +8888,38 @@ namespace VULKAN_HPP_NAMESPACE } } + //=== VK_NV_low_latency2 === + + VULKAN_HPP_INLINE std::string to_string( LatencyMarkerNV value ) + { + switch ( value ) + { + case LatencyMarkerNV::eSimulationStart: return "SimulationStart"; + case LatencyMarkerNV::eSimulationEnd: return "SimulationEnd"; + case LatencyMarkerNV::eRendersubmitStart: return "RendersubmitStart"; + case LatencyMarkerNV::eRendersubmitEnd: return "RendersubmitEnd"; + case LatencyMarkerNV::ePresentStart: return "PresentStart"; + case LatencyMarkerNV::ePresentEnd: return "PresentEnd"; + case LatencyMarkerNV::eInputSample: return "InputSample"; + case LatencyMarkerNV::eTriggerFlash: return "TriggerFlash"; + case LatencyMarkerNV::eOutOfBandRendersubmitStart: return "OutOfBandRendersubmitStart"; + case LatencyMarkerNV::eOutOfBandRendersubmitEnd: return "OutOfBandRendersubmitEnd"; + case LatencyMarkerNV::eOutOfBandPresentStart: return "OutOfBandPresentStart"; + case LatencyMarkerNV::eOutOfBandPresentEnd: return "OutOfBandPresentEnd"; + default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; + } + } + + VULKAN_HPP_INLINE std::string to_string( OutOfBandQueueTypeNV value ) + { + switch ( value ) + { + case OutOfBandQueueTypeNV::eRender: return "Render"; + case OutOfBandQueueTypeNV::ePresent: return "Present"; + default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; + } + } + //=== VK_KHR_cooperative_matrix === VULKAN_HPP_INLINE std::string to_string( ScopeKHR value ) @@ -8832,5 +8953,43 @@ namespace VULKAN_HPP_NAMESPACE } } + //=== VK_QCOM_image_processing2 === + + VULKAN_HPP_INLINE std::string to_string( BlockMatchWindowCompareModeQCOM value ) + { + switch ( value ) + { + case BlockMatchWindowCompareModeQCOM::eMin: return "Min"; + case BlockMatchWindowCompareModeQCOM::eMax: return "Max"; + default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; + } + } + + //=== VK_QCOM_filter_cubic_weights === + + VULKAN_HPP_INLINE std::string to_string( CubicFilterWeightsQCOM value ) + { + switch ( value ) + { + case CubicFilterWeightsQCOM::eCatmullRom: return "CatmullRom"; + case CubicFilterWeightsQCOM::eZeroTangentCardinal: return "ZeroTangentCardinal"; + case CubicFilterWeightsQCOM::eBSpline: return "BSpline"; + case CubicFilterWeightsQCOM::eMitchellNetravali: return "MitchellNetravali"; + default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; + } + } + + //=== VK_MSFT_layered_driver === + + VULKAN_HPP_INLINE std::string to_string( LayeredDriverUnderlyingApiMSFT value ) + { + switch ( value ) + { + case LayeredDriverUnderlyingApiMSFT::eNone: return "None"; + case LayeredDriverUnderlyingApiMSFT::eD3D12: return "D3D12"; + default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast<uint32_t>( value ) ) + " )"; + } + } + } // namespace VULKAN_HPP_NAMESPACE #endif diff --git a/thirdparty/vulkan/include/vulkan/vulkan_video.hpp b/thirdparty/vulkan/include/vulkan/vulkan_video.hpp index 7465938270..76dc641aed 100644 --- a/thirdparty/vulkan/include/vulkan/vulkan_video.hpp +++ b/thirdparty/vulkan/include/vulkan/vulkan_video.hpp @@ -1028,9 +1028,9 @@ namespace VULKAN_HPP_NAMESPACE bool operator==( EncodeH264RefPicMarkingEntry const & rhs ) const VULKAN_HPP_NOEXCEPT { - return ( operation == rhs.operation ) && ( difference_of_pic_nums_minus1 == rhs.difference_of_pic_nums_minus1 ) && - ( long_term_pic_num == rhs.long_term_pic_num ) && ( long_term_frame_idx == rhs.long_term_frame_idx ) && - ( max_long_term_frame_idx_plus1 == rhs.max_long_term_frame_idx_plus1 ); + return ( memory_management_control_operation == rhs.memory_management_control_operation ) && + ( difference_of_pic_nums_minus1 == rhs.difference_of_pic_nums_minus1 ) && ( long_term_pic_num == rhs.long_term_pic_num ) && + ( long_term_frame_idx == rhs.long_term_frame_idx ) && ( max_long_term_frame_idx_plus1 == rhs.max_long_term_frame_idx_plus1 ); } bool operator!=( EncodeH264RefPicMarkingEntry const & rhs ) const VULKAN_HPP_NOEXCEPT @@ -1039,7 +1039,7 @@ namespace VULKAN_HPP_NAMESPACE } public: - VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264MemMgmtControlOp operation = + VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264MemMgmtControlOp memory_management_control_operation = VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264MemMgmtControlOp::eEnd; uint16_t difference_of_pic_nums_minus1 = {}; uint16_t long_term_pic_num = {}; @@ -1185,7 +1185,7 @@ namespace VULKAN_HPP_NAMESPACE { return ( flags == rhs.flags ) && ( first_mb_in_slice == rhs.first_mb_in_slice ) && ( slice_type == rhs.slice_type ) && ( slice_alpha_c0_offset_div2 == rhs.slice_alpha_c0_offset_div2 ) && ( slice_beta_offset_div2 == rhs.slice_beta_offset_div2 ) && - ( reserved1 == rhs.reserved1 ) && ( cabac_init_idc == rhs.cabac_init_idc ) && + ( slice_qp_delta == rhs.slice_qp_delta ) && ( reserved1 == rhs.reserved1 ) && ( cabac_init_idc == rhs.cabac_init_idc ) && ( disable_deblocking_filter_idc == rhs.disable_deblocking_filter_idc ) && ( pWeightTable == rhs.pWeightTable ); } @@ -1200,7 +1200,8 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264SliceType slice_type = VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264SliceType::eP; int8_t slice_alpha_c0_offset_div2 = {}; int8_t slice_beta_offset_div2 = {}; - uint16_t reserved1 = {}; + int8_t slice_qp_delta = {}; + uint8_t reserved1 = {}; VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264CabacInitIdc cabac_init_idc = VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264CabacInitIdc::e0; VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264DisableDeblockingFilterIdc disable_deblocking_filter_idc = @@ -2416,7 +2417,8 @@ namespace VULKAN_HPP_NAMESPACE ( slice_cb_qp_offset == rhs.slice_cb_qp_offset ) && ( slice_cr_qp_offset == rhs.slice_cr_qp_offset ) && ( slice_beta_offset_div2 == rhs.slice_beta_offset_div2 ) && ( slice_tc_offset_div2 == rhs.slice_tc_offset_div2 ) && ( slice_act_y_qp_offset == rhs.slice_act_y_qp_offset ) && ( slice_act_cb_qp_offset == rhs.slice_act_cb_qp_offset ) && - ( slice_act_cr_qp_offset == rhs.slice_act_cr_qp_offset ) && ( reserved1 == rhs.reserved1 ) && ( pWeightTable == rhs.pWeightTable ); + ( slice_act_cr_qp_offset == rhs.slice_act_cr_qp_offset ) && ( slice_qp_delta == rhs.slice_qp_delta ) && ( reserved1 == rhs.reserved1 ) && + ( pWeightTable == rhs.pWeightTable ); } bool operator!=( EncodeH265SliceSegmentHeader const & rhs ) const VULKAN_HPP_NOEXCEPT @@ -2437,7 +2439,8 @@ namespace VULKAN_HPP_NAMESPACE int8_t slice_act_y_qp_offset = {}; int8_t slice_act_cb_qp_offset = {}; int8_t slice_act_cr_qp_offset = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D<uint8_t, 3> reserved1 = {}; + int8_t slice_qp_delta = {}; + uint16_t reserved1 = {}; const VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265WeightTable * pWeightTable = {}; }; @@ -2550,28 +2553,28 @@ namespace VULKAN_HPP_NAMESPACE uint32_t reserved : 23; }; - struct EncodeH265SliceSegmentLongTermRefPics + struct EncodeH265LongTermRefPics { - using NativeType = StdVideoEncodeH265SliceSegmentLongTermRefPics; + using NativeType = StdVideoEncodeH265LongTermRefPics; - operator StdVideoEncodeH265SliceSegmentLongTermRefPics const &() const VULKAN_HPP_NOEXCEPT + operator StdVideoEncodeH265LongTermRefPics const &() const VULKAN_HPP_NOEXCEPT { - return *reinterpret_cast<const StdVideoEncodeH265SliceSegmentLongTermRefPics *>( this ); + return *reinterpret_cast<const StdVideoEncodeH265LongTermRefPics *>( this ); } - operator StdVideoEncodeH265SliceSegmentLongTermRefPics &() VULKAN_HPP_NOEXCEPT + operator StdVideoEncodeH265LongTermRefPics &() VULKAN_HPP_NOEXCEPT { - return *reinterpret_cast<StdVideoEncodeH265SliceSegmentLongTermRefPics *>( this ); + return *reinterpret_cast<StdVideoEncodeH265LongTermRefPics *>( this ); } - bool operator==( EncodeH265SliceSegmentLongTermRefPics const & rhs ) const VULKAN_HPP_NOEXCEPT + bool operator==( EncodeH265LongTermRefPics const & rhs ) const VULKAN_HPP_NOEXCEPT { return ( num_long_term_sps == rhs.num_long_term_sps ) && ( num_long_term_pics == rhs.num_long_term_pics ) && ( lt_idx_sps == rhs.lt_idx_sps ) && ( poc_lsb_lt == rhs.poc_lsb_lt ) && ( used_by_curr_pic_lt_flag == rhs.used_by_curr_pic_lt_flag ) && ( delta_poc_msb_present_flag == rhs.delta_poc_msb_present_flag ) && ( delta_poc_msb_cycle_lt == rhs.delta_poc_msb_cycle_lt ); } - bool operator!=( EncodeH265SliceSegmentLongTermRefPics const & rhs ) const VULKAN_HPP_NOEXCEPT + bool operator!=( EncodeH265LongTermRefPics const & rhs ) const VULKAN_HPP_NOEXCEPT { return !operator==( rhs ); } @@ -2617,16 +2620,16 @@ namespace VULKAN_HPP_NAMESPACE public: VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265PictureInfoFlags flags = {}; VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265PictureType pic_type = VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265PictureType::eP; - uint8_t sps_video_parameter_set_id = {}; - uint8_t pps_seq_parameter_set_id = {}; - uint8_t pps_pic_parameter_set_id = {}; - uint8_t short_term_ref_pic_set_idx = {}; - int32_t PicOrderCntVal = {}; - uint8_t TemporalId = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D<uint8_t, 7> reserved1 = {}; - const VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265ReferenceListsInfo * pRefLists = {}; - const VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265ShortTermRefPicSet * pShortTermRefPicSet = {}; - const VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265SliceSegmentLongTermRefPics * pLongTermRefPics = {}; + uint8_t sps_video_parameter_set_id = {}; + uint8_t pps_seq_parameter_set_id = {}; + uint8_t pps_pic_parameter_set_id = {}; + uint8_t short_term_ref_pic_set_idx = {}; + int32_t PicOrderCntVal = {}; + uint8_t TemporalId = {}; + VULKAN_HPP_NAMESPACE::ArrayWrapper1D<uint8_t, 7> reserved1 = {}; + const VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265ReferenceListsInfo * pRefLists = {}; + const VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265ShortTermRefPicSet * pShortTermRefPicSet = {}; + const VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265LongTermRefPics * pLongTermRefPics = {}; }; struct EncodeH265ReferenceInfoFlags diff --git a/thirdparty/vulkan/vk_enum_string_helper.h b/thirdparty/vulkan/vk_enum_string_helper.h index be968c091d..f0039db3f2 100644 --- a/thirdparty/vulkan/vk_enum_string_helper.h +++ b/thirdparty/vulkan/vk_enum_string_helper.h @@ -1,26 +1,11 @@ // *** THIS FILE IS GENERATED - DO NOT EDIT *** // See enum_string_helper_generator.py for modifications +// Copyright 2023 The Khronos Group Inc. +// Copyright 2023 Valve Corporation +// Copyright 2023 LunarG, Inc. +// +// SPDX-License-Identifier: Apache-2.0 -/*************************************************************************** -* -* Copyright (c) 2015-2023 The Khronos Group Inc. -* Copyright (c) 2015-2023 Valve Corporation -* Copyright (c) 2015-2023 LunarG, Inc. -* Copyright (c) 2015-2023 Google Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -****************************************************************************/ -// NOLINTBEGIN #pragma once #include <string> #ifdef USE_VOLK @@ -29,24 +14,6 @@ #include <vulkan/vulkan.h> #endif -static inline bool IsDuplicatePnext(VkStructureType input_value) { - switch (input_value) { - case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO: - case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: - case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: - case VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT: - case VK_STRUCTURE_TYPE_EXPORT_METAL_COMMAND_QUEUE_INFO_EXT: - case VK_STRUCTURE_TYPE_EXPORT_METAL_BUFFER_INFO_EXT: - case VK_STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT: - case VK_STRUCTURE_TYPE_IMPORT_METAL_TEXTURE_INFO_EXT: - case VK_STRUCTURE_TYPE_EXPORT_METAL_IO_SURFACE_INFO_EXT: - case VK_STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT: - return true; - default: - return false; - } -} - static inline const char* string_VkResult(VkResult input_value) { switch (input_value) { case VK_SUCCESS: @@ -1645,6 +1612,10 @@ static inline const char* string_VkStructureType(VkStructureType input_value) { return "VK_STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT"; + case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: + return "VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT"; case VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT: @@ -1765,6 +1736,10 @@ static inline const char* string_VkStructureType(VkStructureType input_value) { return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM"; case VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM: return "VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT"; case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: return "VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT: @@ -1811,6 +1786,12 @@ static inline const char* string_VkStructureType(VkStructureType input_value) { return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_PROPERTIES_ANDROID: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_PROPERTIES_ANDROID"; + case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_RESOLVE_PROPERTIES_ANDROID: + return "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_RESOLVE_PROPERTIES_ANDROID"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR: @@ -1849,6 +1830,10 @@ static inline const char* string_VkStructureType(VkStructureType input_value) { return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT"; case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT: @@ -1861,6 +1846,24 @@ static inline const char* string_VkStructureType(VkStructureType input_value) { return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT"; + case VK_STRUCTURE_TYPE_LATENCY_SLEEP_MODE_INFO_NV: + return "VK_STRUCTURE_TYPE_LATENCY_SLEEP_MODE_INFO_NV"; + case VK_STRUCTURE_TYPE_LATENCY_SLEEP_INFO_NV: + return "VK_STRUCTURE_TYPE_LATENCY_SLEEP_INFO_NV"; + case VK_STRUCTURE_TYPE_SET_LATENCY_MARKER_INFO_NV: + return "VK_STRUCTURE_TYPE_SET_LATENCY_MARKER_INFO_NV"; + case VK_STRUCTURE_TYPE_GET_LATENCY_MARKER_INFO_NV: + return "VK_STRUCTURE_TYPE_GET_LATENCY_MARKER_INFO_NV"; + case VK_STRUCTURE_TYPE_LATENCY_TIMINGS_FRAME_REPORT_NV: + return "VK_STRUCTURE_TYPE_LATENCY_TIMINGS_FRAME_REPORT_NV"; + case VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV: + return "VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV"; + case VK_STRUCTURE_TYPE_OUT_OF_BAND_QUEUE_TYPE_INFO_NV: + return "VK_STRUCTURE_TYPE_OUT_OF_BAND_QUEUE_TYPE_INFO_NV"; + case VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV: + return "VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV"; + case VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV: + return "VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR"; case VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR: @@ -1871,6 +1874,24 @@ static inline const char* string_VkStructureType(VkStructureType input_value) { return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM"; case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM: return "VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM"; + case VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM: + return "VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM"; + case VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM: + return "VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM"; + case VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM: + return "VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM"; + case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM: + return "VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT"; case VK_STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX: @@ -1883,6 +1904,10 @@ static inline const char* string_VkStructureType(VkStructureType input_value) { return "VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX"; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT"; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV: + return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV"; default: return "Unhandled VkStructureType"; } @@ -3369,6 +3394,8 @@ static inline const char* string_VkSubpassContents(VkSubpassContents input_value return "VK_SUBPASS_CONTENTS_INLINE"; case VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS: return "VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS"; + case VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT: + return "VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT"; default: return "Unhandled VkSubpassContents"; } @@ -3491,6 +3518,8 @@ static inline const char* string_VkDriverId(VkDriverId input_value) { return "VK_DRIVER_ID_MESA_NVK"; case VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA: return "VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA"; + case VK_DRIVER_ID_MESA_AGXV: + return "VK_DRIVER_ID_MESA_AGXV"; default: return "Unhandled VkDriverId"; } @@ -3515,6 +3544,8 @@ static inline const char* string_VkSamplerReductionMode(VkSamplerReductionMode i return "VK_SAMPLER_REDUCTION_MODE_MIN"; case VK_SAMPLER_REDUCTION_MODE_MAX: return "VK_SAMPLER_REDUCTION_MODE_MAX"; + case VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM: + return "VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM"; default: return "Unhandled VkSamplerReductionMode"; } @@ -3593,6 +3624,8 @@ static inline const char* string_VkQueryResultStatusKHR(VkQueryResultStatusKHR i return "VK_QUERY_RESULT_STATUS_NOT_READY_KHR"; case VK_QUERY_RESULT_STATUS_COMPLETE_KHR: return "VK_QUERY_RESULT_STATUS_COMPLETE_KHR"; + case VK_QUERY_RESULT_STATUS_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_KHR: + return "VK_QUERY_RESULT_STATUS_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_KHR"; default: return "Unhandled VkQueryResultStatusKHR"; } @@ -4623,6 +4656,80 @@ static inline const char* string_VkRayTracingInvocationReorderModeNV(VkRayTracin return "Unhandled VkRayTracingInvocationReorderModeNV"; } } +static inline const char* string_VkLatencyMarkerNV(VkLatencyMarkerNV input_value) { + switch (input_value) { + case VK_LATENCY_MARKER_SIMULATION_START_NV: + return "VK_LATENCY_MARKER_SIMULATION_START_NV"; + case VK_LATENCY_MARKER_SIMULATION_END_NV: + return "VK_LATENCY_MARKER_SIMULATION_END_NV"; + case VK_LATENCY_MARKER_RENDERSUBMIT_START_NV: + return "VK_LATENCY_MARKER_RENDERSUBMIT_START_NV"; + case VK_LATENCY_MARKER_RENDERSUBMIT_END_NV: + return "VK_LATENCY_MARKER_RENDERSUBMIT_END_NV"; + case VK_LATENCY_MARKER_PRESENT_START_NV: + return "VK_LATENCY_MARKER_PRESENT_START_NV"; + case VK_LATENCY_MARKER_PRESENT_END_NV: + return "VK_LATENCY_MARKER_PRESENT_END_NV"; + case VK_LATENCY_MARKER_INPUT_SAMPLE_NV: + return "VK_LATENCY_MARKER_INPUT_SAMPLE_NV"; + case VK_LATENCY_MARKER_TRIGGER_FLASH_NV: + return "VK_LATENCY_MARKER_TRIGGER_FLASH_NV"; + case VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_START_NV: + return "VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_START_NV"; + case VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_END_NV: + return "VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_END_NV"; + case VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_START_NV: + return "VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_START_NV"; + case VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_END_NV: + return "VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_END_NV"; + default: + return "Unhandled VkLatencyMarkerNV"; + } +} +static inline const char* string_VkOutOfBandQueueTypeNV(VkOutOfBandQueueTypeNV input_value) { + switch (input_value) { + case VK_OUT_OF_BAND_QUEUE_TYPE_RENDER_NV: + return "VK_OUT_OF_BAND_QUEUE_TYPE_RENDER_NV"; + case VK_OUT_OF_BAND_QUEUE_TYPE_PRESENT_NV: + return "VK_OUT_OF_BAND_QUEUE_TYPE_PRESENT_NV"; + default: + return "Unhandled VkOutOfBandQueueTypeNV"; + } +} +static inline const char* string_VkBlockMatchWindowCompareModeQCOM(VkBlockMatchWindowCompareModeQCOM input_value) { + switch (input_value) { + case VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MIN_QCOM: + return "VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MIN_QCOM"; + case VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_QCOM: + return "VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_QCOM"; + default: + return "Unhandled VkBlockMatchWindowCompareModeQCOM"; + } +} +static inline const char* string_VkCubicFilterWeightsQCOM(VkCubicFilterWeightsQCOM input_value) { + switch (input_value) { + case VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM: + return "VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM"; + case VK_CUBIC_FILTER_WEIGHTS_ZERO_TANGENT_CARDINAL_QCOM: + return "VK_CUBIC_FILTER_WEIGHTS_ZERO_TANGENT_CARDINAL_QCOM"; + case VK_CUBIC_FILTER_WEIGHTS_B_SPLINE_QCOM: + return "VK_CUBIC_FILTER_WEIGHTS_B_SPLINE_QCOM"; + case VK_CUBIC_FILTER_WEIGHTS_MITCHELL_NETRAVALI_QCOM: + return "VK_CUBIC_FILTER_WEIGHTS_MITCHELL_NETRAVALI_QCOM"; + default: + return "Unhandled VkCubicFilterWeightsQCOM"; + } +} +static inline const char* string_VkLayeredDriverUnderlyingApiMSFT(VkLayeredDriverUnderlyingApiMSFT input_value) { + switch (input_value) { + case VK_LAYERED_DRIVER_UNDERLYING_API_NONE_MSFT: + return "VK_LAYERED_DRIVER_UNDERLYING_API_NONE_MSFT"; + case VK_LAYERED_DRIVER_UNDERLYING_API_D3D12_MSFT: + return "VK_LAYERED_DRIVER_UNDERLYING_API_D3D12_MSFT"; + default: + return "Unhandled VkLayeredDriverUnderlyingApiMSFT"; + } +} static inline const char* string_VkBuildAccelerationStructureModeKHR(VkBuildAccelerationStructureModeKHR input_value) { switch (input_value) { case VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR: @@ -4713,6 +4820,7 @@ static inline const char* string_VkAccessFlagBits(VkAccessFlagBits input_value) } } +#ifdef __cplusplus static inline std::string string_VkAccessFlags(VkAccessFlags input_value) { std::string ret; int index = 0; @@ -4727,6 +4835,7 @@ static inline std::string string_VkAccessFlags(VkAccessFlags input_value) { if (ret.empty()) ret.append("VkAccessFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkImageAspectFlagBits(VkImageAspectFlagBits input_value) { switch (input_value) { case VK_IMAGE_ASPECT_COLOR_BIT: @@ -4758,6 +4867,7 @@ static inline const char* string_VkImageAspectFlagBits(VkImageAspectFlagBits inp } } +#ifdef __cplusplus static inline std::string string_VkImageAspectFlags(VkImageAspectFlags input_value) { std::string ret; int index = 0; @@ -4772,6 +4882,7 @@ static inline std::string string_VkImageAspectFlags(VkImageAspectFlags input_val if (ret.empty()) ret.append("VkImageAspectFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkFormatFeatureFlagBits(VkFormatFeatureFlagBits input_value) { switch (input_value) { case VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT: @@ -4845,6 +4956,7 @@ static inline const char* string_VkFormatFeatureFlagBits(VkFormatFeatureFlagBits } } +#ifdef __cplusplus static inline std::string string_VkFormatFeatureFlags(VkFormatFeatureFlags input_value) { std::string ret; int index = 0; @@ -4859,6 +4971,7 @@ static inline std::string string_VkFormatFeatureFlags(VkFormatFeatureFlags input if (ret.empty()) ret.append("VkFormatFeatureFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkImageCreateFlagBits(VkImageCreateFlagBits input_value) { switch (input_value) { case VK_IMAGE_CREATE_SPARSE_BINDING_BIT: @@ -4904,6 +5017,7 @@ static inline const char* string_VkImageCreateFlagBits(VkImageCreateFlagBits inp } } +#ifdef __cplusplus static inline std::string string_VkImageCreateFlags(VkImageCreateFlags input_value) { std::string ret; int index = 0; @@ -4918,6 +5032,7 @@ static inline std::string string_VkImageCreateFlags(VkImageCreateFlags input_val if (ret.empty()) ret.append("VkImageCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSampleCountFlagBits(VkSampleCountFlagBits input_value) { switch (input_value) { case VK_SAMPLE_COUNT_1_BIT: @@ -4939,6 +5054,7 @@ static inline const char* string_VkSampleCountFlagBits(VkSampleCountFlagBits inp } } +#ifdef __cplusplus static inline std::string string_VkSampleCountFlags(VkSampleCountFlags input_value) { std::string ret; int index = 0; @@ -4953,6 +5069,7 @@ static inline std::string string_VkSampleCountFlags(VkSampleCountFlags input_val if (ret.empty()) ret.append("VkSampleCountFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkImageUsageFlagBits(VkImageUsageFlagBits input_value) { switch (input_value) { case VK_IMAGE_USAGE_TRANSFER_SRC_BIT: @@ -5008,6 +5125,7 @@ static inline const char* string_VkImageUsageFlagBits(VkImageUsageFlagBits input } } +#ifdef __cplusplus static inline std::string string_VkImageUsageFlags(VkImageUsageFlags input_value) { std::string ret; int index = 0; @@ -5022,6 +5140,7 @@ static inline std::string string_VkImageUsageFlags(VkImageUsageFlags input_value if (ret.empty()) ret.append("VkImageUsageFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkInstanceCreateFlagBits(VkInstanceCreateFlagBits input_value) { switch (input_value) { case VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR: @@ -5031,6 +5150,7 @@ static inline const char* string_VkInstanceCreateFlagBits(VkInstanceCreateFlagBi } } +#ifdef __cplusplus static inline std::string string_VkInstanceCreateFlags(VkInstanceCreateFlags input_value) { std::string ret; int index = 0; @@ -5045,6 +5165,7 @@ static inline std::string string_VkInstanceCreateFlags(VkInstanceCreateFlags inp if (ret.empty()) ret.append("VkInstanceCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkMemoryHeapFlagBits(VkMemoryHeapFlagBits input_value) { switch (input_value) { case VK_MEMORY_HEAP_DEVICE_LOCAL_BIT: @@ -5056,6 +5177,7 @@ static inline const char* string_VkMemoryHeapFlagBits(VkMemoryHeapFlagBits input } } +#ifdef __cplusplus static inline std::string string_VkMemoryHeapFlags(VkMemoryHeapFlags input_value) { std::string ret; int index = 0; @@ -5070,6 +5192,7 @@ static inline std::string string_VkMemoryHeapFlags(VkMemoryHeapFlags input_value if (ret.empty()) ret.append("VkMemoryHeapFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkMemoryPropertyFlagBits(VkMemoryPropertyFlagBits input_value) { switch (input_value) { case VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT: @@ -5095,6 +5218,7 @@ static inline const char* string_VkMemoryPropertyFlagBits(VkMemoryPropertyFlagBi } } +#ifdef __cplusplus static inline std::string string_VkMemoryPropertyFlags(VkMemoryPropertyFlags input_value) { std::string ret; int index = 0; @@ -5109,6 +5233,7 @@ static inline std::string string_VkMemoryPropertyFlags(VkMemoryPropertyFlags inp if (ret.empty()) ret.append("VkMemoryPropertyFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkQueueFlagBits(VkQueueFlagBits input_value) { switch (input_value) { case VK_QUEUE_GRAPHICS_BIT: @@ -5134,6 +5259,7 @@ static inline const char* string_VkQueueFlagBits(VkQueueFlagBits input_value) { } } +#ifdef __cplusplus static inline std::string string_VkQueueFlags(VkQueueFlags input_value) { std::string ret; int index = 0; @@ -5148,6 +5274,7 @@ static inline std::string string_VkQueueFlags(VkQueueFlags input_value) { if (ret.empty()) ret.append("VkQueueFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDeviceQueueCreateFlagBits(VkDeviceQueueCreateFlagBits input_value) { switch (input_value) { case VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT: @@ -5157,6 +5284,7 @@ static inline const char* string_VkDeviceQueueCreateFlagBits(VkDeviceQueueCreate } } +#ifdef __cplusplus static inline std::string string_VkDeviceQueueCreateFlags(VkDeviceQueueCreateFlags input_value) { std::string ret; int index = 0; @@ -5171,6 +5299,7 @@ static inline std::string string_VkDeviceQueueCreateFlags(VkDeviceQueueCreateFla if (ret.empty()) ret.append("VkDeviceQueueCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPipelineStageFlagBits(VkPipelineStageFlagBits input_value) { switch (input_value) { case VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT: @@ -5232,6 +5361,7 @@ static inline const char* string_VkPipelineStageFlagBits(VkPipelineStageFlagBits } } +#ifdef __cplusplus static inline std::string string_VkPipelineStageFlags(VkPipelineStageFlags input_value) { std::string ret; int index = 0; @@ -5246,6 +5376,7 @@ static inline std::string string_VkPipelineStageFlags(VkPipelineStageFlags input if (ret.empty()) ret.append("VkPipelineStageFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSparseMemoryBindFlagBits(VkSparseMemoryBindFlagBits input_value) { switch (input_value) { case VK_SPARSE_MEMORY_BIND_METADATA_BIT: @@ -5255,6 +5386,7 @@ static inline const char* string_VkSparseMemoryBindFlagBits(VkSparseMemoryBindFl } } +#ifdef __cplusplus static inline std::string string_VkSparseMemoryBindFlags(VkSparseMemoryBindFlags input_value) { std::string ret; int index = 0; @@ -5269,6 +5401,7 @@ static inline std::string string_VkSparseMemoryBindFlags(VkSparseMemoryBindFlags if (ret.empty()) ret.append("VkSparseMemoryBindFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSparseImageFormatFlagBits(VkSparseImageFormatFlagBits input_value) { switch (input_value) { case VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT: @@ -5282,6 +5415,7 @@ static inline const char* string_VkSparseImageFormatFlagBits(VkSparseImageFormat } } +#ifdef __cplusplus static inline std::string string_VkSparseImageFormatFlags(VkSparseImageFormatFlags input_value) { std::string ret; int index = 0; @@ -5296,6 +5430,7 @@ static inline std::string string_VkSparseImageFormatFlags(VkSparseImageFormatFla if (ret.empty()) ret.append("VkSparseImageFormatFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkFenceCreateFlagBits(VkFenceCreateFlagBits input_value) { switch (input_value) { case VK_FENCE_CREATE_SIGNALED_BIT: @@ -5305,6 +5440,7 @@ static inline const char* string_VkFenceCreateFlagBits(VkFenceCreateFlagBits inp } } +#ifdef __cplusplus static inline std::string string_VkFenceCreateFlags(VkFenceCreateFlags input_value) { std::string ret; int index = 0; @@ -5319,6 +5455,7 @@ static inline std::string string_VkFenceCreateFlags(VkFenceCreateFlags input_val if (ret.empty()) ret.append("VkFenceCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkEventCreateFlagBits(VkEventCreateFlagBits input_value) { switch (input_value) { case VK_EVENT_CREATE_DEVICE_ONLY_BIT: @@ -5328,6 +5465,7 @@ static inline const char* string_VkEventCreateFlagBits(VkEventCreateFlagBits inp } } +#ifdef __cplusplus static inline std::string string_VkEventCreateFlags(VkEventCreateFlags input_value) { std::string ret; int index = 0; @@ -5342,6 +5480,7 @@ static inline std::string string_VkEventCreateFlags(VkEventCreateFlags input_val if (ret.empty()) ret.append("VkEventCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkQueryPipelineStatisticFlagBits(VkQueryPipelineStatisticFlagBits input_value) { switch (input_value) { case VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT: @@ -5377,6 +5516,7 @@ static inline const char* string_VkQueryPipelineStatisticFlagBits(VkQueryPipelin } } +#ifdef __cplusplus static inline std::string string_VkQueryPipelineStatisticFlags(VkQueryPipelineStatisticFlags input_value) { std::string ret; int index = 0; @@ -5391,6 +5531,7 @@ static inline std::string string_VkQueryPipelineStatisticFlags(VkQueryPipelineSt if (ret.empty()) ret.append("VkQueryPipelineStatisticFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkQueryResultFlagBits(VkQueryResultFlagBits input_value) { switch (input_value) { case VK_QUERY_RESULT_64_BIT: @@ -5408,6 +5549,7 @@ static inline const char* string_VkQueryResultFlagBits(VkQueryResultFlagBits inp } } +#ifdef __cplusplus static inline std::string string_VkQueryResultFlags(VkQueryResultFlags input_value) { std::string ret; int index = 0; @@ -5422,6 +5564,7 @@ static inline std::string string_VkQueryResultFlags(VkQueryResultFlags input_val if (ret.empty()) ret.append("VkQueryResultFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkBufferCreateFlagBits(VkBufferCreateFlagBits input_value) { switch (input_value) { case VK_BUFFER_CREATE_SPARSE_BINDING_BIT: @@ -5441,6 +5584,7 @@ static inline const char* string_VkBufferCreateFlagBits(VkBufferCreateFlagBits i } } +#ifdef __cplusplus static inline std::string string_VkBufferCreateFlags(VkBufferCreateFlags input_value) { std::string ret; int index = 0; @@ -5455,6 +5599,7 @@ static inline std::string string_VkBufferCreateFlags(VkBufferCreateFlags input_v if (ret.empty()) ret.append("VkBufferCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkBufferUsageFlagBits(VkBufferUsageFlagBits input_value) { switch (input_value) { case VK_BUFFER_USAGE_TRANSFER_SRC_BIT: @@ -5520,6 +5665,7 @@ static inline const char* string_VkBufferUsageFlagBits(VkBufferUsageFlagBits inp } } +#ifdef __cplusplus static inline std::string string_VkBufferUsageFlags(VkBufferUsageFlags input_value) { std::string ret; int index = 0; @@ -5534,6 +5680,7 @@ static inline std::string string_VkBufferUsageFlags(VkBufferUsageFlags input_val if (ret.empty()) ret.append("VkBufferUsageFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkImageViewCreateFlagBits(VkImageViewCreateFlagBits input_value) { switch (input_value) { case VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT: @@ -5547,6 +5694,7 @@ static inline const char* string_VkImageViewCreateFlagBits(VkImageViewCreateFlag } } +#ifdef __cplusplus static inline std::string string_VkImageViewCreateFlags(VkImageViewCreateFlags input_value) { std::string ret; int index = 0; @@ -5561,6 +5709,7 @@ static inline std::string string_VkImageViewCreateFlags(VkImageViewCreateFlags i if (ret.empty()) ret.append("VkImageViewCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPipelineCacheCreateFlagBits(VkPipelineCacheCreateFlagBits input_value) { switch (input_value) { case VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT: @@ -5570,6 +5719,7 @@ static inline const char* string_VkPipelineCacheCreateFlagBits(VkPipelineCacheCr } } +#ifdef __cplusplus static inline std::string string_VkPipelineCacheCreateFlags(VkPipelineCacheCreateFlags input_value) { std::string ret; int index = 0; @@ -5584,6 +5734,7 @@ static inline std::string string_VkPipelineCacheCreateFlags(VkPipelineCacheCreat if (ret.empty()) ret.append("VkPipelineCacheCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkColorComponentFlagBits(VkColorComponentFlagBits input_value) { switch (input_value) { case VK_COLOR_COMPONENT_R_BIT: @@ -5599,6 +5750,7 @@ static inline const char* string_VkColorComponentFlagBits(VkColorComponentFlagBi } } +#ifdef __cplusplus static inline std::string string_VkColorComponentFlags(VkColorComponentFlags input_value) { std::string ret; int index = 0; @@ -5613,6 +5765,7 @@ static inline std::string string_VkColorComponentFlags(VkColorComponentFlags inp if (ret.empty()) ret.append("VkColorComponentFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPipelineCreateFlagBits(VkPipelineCreateFlagBits input_value) { switch (input_value) { case VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT: @@ -5684,6 +5837,7 @@ static inline const char* string_VkPipelineCreateFlagBits(VkPipelineCreateFlagBi } } +#ifdef __cplusplus static inline std::string string_VkPipelineCreateFlags(VkPipelineCreateFlags input_value) { std::string ret; int index = 0; @@ -5698,6 +5852,7 @@ static inline std::string string_VkPipelineCreateFlags(VkPipelineCreateFlags inp if (ret.empty()) ret.append("VkPipelineCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPipelineShaderStageCreateFlagBits(VkPipelineShaderStageCreateFlagBits input_value) { switch (input_value) { case VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT: @@ -5709,6 +5864,7 @@ static inline const char* string_VkPipelineShaderStageCreateFlagBits(VkPipelineS } } +#ifdef __cplusplus static inline std::string string_VkPipelineShaderStageCreateFlags(VkPipelineShaderStageCreateFlags input_value) { std::string ret; int index = 0; @@ -5723,6 +5879,7 @@ static inline std::string string_VkPipelineShaderStageCreateFlags(VkPipelineShad if (ret.empty()) ret.append("VkPipelineShaderStageCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkShaderStageFlagBits(VkShaderStageFlagBits input_value) { switch (input_value) { case VK_SHADER_STAGE_VERTEX_BIT: @@ -5762,6 +5919,7 @@ static inline const char* string_VkShaderStageFlagBits(VkShaderStageFlagBits inp } } +#ifdef __cplusplus static inline std::string string_VkShaderStageFlags(VkShaderStageFlags input_value) { if (input_value == VK_SHADER_STAGE_ALL_GRAPHICS) { return "VK_SHADER_STAGE_ALL_GRAPHICS"; } if (input_value == VK_SHADER_STAGE_ALL) { return "VK_SHADER_STAGE_ALL"; } @@ -5778,6 +5936,7 @@ static inline std::string string_VkShaderStageFlags(VkShaderStageFlags input_val if (ret.empty()) ret.append("VkShaderStageFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkCullModeFlagBits(VkCullModeFlagBits input_value) { switch (input_value) { case VK_CULL_MODE_NONE: @@ -5791,6 +5950,7 @@ static inline const char* string_VkCullModeFlagBits(VkCullModeFlagBits input_val } } +#ifdef __cplusplus static inline std::string string_VkCullModeFlags(VkCullModeFlags input_value) { if (input_value == VK_CULL_MODE_FRONT_AND_BACK) { return "VK_CULL_MODE_FRONT_AND_BACK"; } std::string ret; @@ -5806,6 +5966,7 @@ static inline std::string string_VkCullModeFlags(VkCullModeFlags input_value) { if (ret.empty()) ret.append("VkCullModeFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPipelineDepthStencilStateCreateFlagBits(VkPipelineDepthStencilStateCreateFlagBits input_value) { switch (input_value) { case VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT: @@ -5817,6 +5978,7 @@ static inline const char* string_VkPipelineDepthStencilStateCreateFlagBits(VkPip } } +#ifdef __cplusplus static inline std::string string_VkPipelineDepthStencilStateCreateFlags(VkPipelineDepthStencilStateCreateFlags input_value) { std::string ret; int index = 0; @@ -5831,6 +5993,7 @@ static inline std::string string_VkPipelineDepthStencilStateCreateFlags(VkPipeli if (ret.empty()) ret.append("VkPipelineDepthStencilStateCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPipelineColorBlendStateCreateFlagBits(VkPipelineColorBlendStateCreateFlagBits input_value) { switch (input_value) { case VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT: @@ -5840,6 +6003,7 @@ static inline const char* string_VkPipelineColorBlendStateCreateFlagBits(VkPipel } } +#ifdef __cplusplus static inline std::string string_VkPipelineColorBlendStateCreateFlags(VkPipelineColorBlendStateCreateFlags input_value) { std::string ret; int index = 0; @@ -5854,6 +6018,7 @@ static inline std::string string_VkPipelineColorBlendStateCreateFlags(VkPipeline if (ret.empty()) ret.append("VkPipelineColorBlendStateCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPipelineLayoutCreateFlagBits(VkPipelineLayoutCreateFlagBits input_value) { switch (input_value) { case VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT: @@ -5863,6 +6028,7 @@ static inline const char* string_VkPipelineLayoutCreateFlagBits(VkPipelineLayout } } +#ifdef __cplusplus static inline std::string string_VkPipelineLayoutCreateFlags(VkPipelineLayoutCreateFlags input_value) { std::string ret; int index = 0; @@ -5877,6 +6043,7 @@ static inline std::string string_VkPipelineLayoutCreateFlags(VkPipelineLayoutCre if (ret.empty()) ret.append("VkPipelineLayoutCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSamplerCreateFlagBits(VkSamplerCreateFlagBits input_value) { switch (input_value) { case VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT: @@ -5894,6 +6061,7 @@ static inline const char* string_VkSamplerCreateFlagBits(VkSamplerCreateFlagBits } } +#ifdef __cplusplus static inline std::string string_VkSamplerCreateFlags(VkSamplerCreateFlags input_value) { std::string ret; int index = 0; @@ -5908,6 +6076,7 @@ static inline std::string string_VkSamplerCreateFlags(VkSamplerCreateFlags input if (ret.empty()) ret.append("VkSamplerCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDescriptorPoolCreateFlagBits(VkDescriptorPoolCreateFlagBits input_value) { switch (input_value) { case VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT: @@ -5916,11 +6085,16 @@ static inline const char* string_VkDescriptorPoolCreateFlagBits(VkDescriptorPool return "VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT"; case VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT: return "VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT"; + case VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV: + return "VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV"; + case VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_POOLS_BIT_NV: + return "VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_POOLS_BIT_NV"; default: return "Unhandled VkDescriptorPoolCreateFlagBits"; } } +#ifdef __cplusplus static inline std::string string_VkDescriptorPoolCreateFlags(VkDescriptorPoolCreateFlags input_value) { std::string ret; int index = 0; @@ -5935,6 +6109,7 @@ static inline std::string string_VkDescriptorPoolCreateFlags(VkDescriptorPoolCre if (ret.empty()) ret.append("VkDescriptorPoolCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDescriptorSetLayoutCreateFlagBits(VkDescriptorSetLayoutCreateFlagBits input_value) { switch (input_value) { case VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT: @@ -5954,6 +6129,7 @@ static inline const char* string_VkDescriptorSetLayoutCreateFlagBits(VkDescripto } } +#ifdef __cplusplus static inline std::string string_VkDescriptorSetLayoutCreateFlags(VkDescriptorSetLayoutCreateFlags input_value) { std::string ret; int index = 0; @@ -5968,6 +6144,7 @@ static inline std::string string_VkDescriptorSetLayoutCreateFlags(VkDescriptorSe if (ret.empty()) ret.append("VkDescriptorSetLayoutCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkAttachmentDescriptionFlagBits(VkAttachmentDescriptionFlagBits input_value) { switch (input_value) { case VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT: @@ -5977,6 +6154,7 @@ static inline const char* string_VkAttachmentDescriptionFlagBits(VkAttachmentDes } } +#ifdef __cplusplus static inline std::string string_VkAttachmentDescriptionFlags(VkAttachmentDescriptionFlags input_value) { std::string ret; int index = 0; @@ -5991,6 +6169,7 @@ static inline std::string string_VkAttachmentDescriptionFlags(VkAttachmentDescri if (ret.empty()) ret.append("VkAttachmentDescriptionFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDependencyFlagBits(VkDependencyFlagBits input_value) { switch (input_value) { case VK_DEPENDENCY_BY_REGION_BIT: @@ -6006,6 +6185,7 @@ static inline const char* string_VkDependencyFlagBits(VkDependencyFlagBits input } } +#ifdef __cplusplus static inline std::string string_VkDependencyFlags(VkDependencyFlags input_value) { std::string ret; int index = 0; @@ -6020,6 +6200,7 @@ static inline std::string string_VkDependencyFlags(VkDependencyFlags input_value if (ret.empty()) ret.append("VkDependencyFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkFramebufferCreateFlagBits(VkFramebufferCreateFlagBits input_value) { switch (input_value) { case VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT: @@ -6029,6 +6210,7 @@ static inline const char* string_VkFramebufferCreateFlagBits(VkFramebufferCreate } } +#ifdef __cplusplus static inline std::string string_VkFramebufferCreateFlags(VkFramebufferCreateFlags input_value) { std::string ret; int index = 0; @@ -6043,6 +6225,7 @@ static inline std::string string_VkFramebufferCreateFlags(VkFramebufferCreateFla if (ret.empty()) ret.append("VkFramebufferCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkRenderPassCreateFlagBits(VkRenderPassCreateFlagBits input_value) { switch (input_value) { case VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM: @@ -6052,6 +6235,7 @@ static inline const char* string_VkRenderPassCreateFlagBits(VkRenderPassCreateFl } } +#ifdef __cplusplus static inline std::string string_VkRenderPassCreateFlags(VkRenderPassCreateFlags input_value) { std::string ret; int index = 0; @@ -6066,6 +6250,7 @@ static inline std::string string_VkRenderPassCreateFlags(VkRenderPassCreateFlags if (ret.empty()) ret.append("VkRenderPassCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSubpassDescriptionFlagBits(VkSubpassDescriptionFlagBits input_value) { switch (input_value) { case VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX: @@ -6089,6 +6274,7 @@ static inline const char* string_VkSubpassDescriptionFlagBits(VkSubpassDescripti } } +#ifdef __cplusplus static inline std::string string_VkSubpassDescriptionFlags(VkSubpassDescriptionFlags input_value) { std::string ret; int index = 0; @@ -6103,6 +6289,7 @@ static inline std::string string_VkSubpassDescriptionFlags(VkSubpassDescriptionF if (ret.empty()) ret.append("VkSubpassDescriptionFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkCommandPoolCreateFlagBits(VkCommandPoolCreateFlagBits input_value) { switch (input_value) { case VK_COMMAND_POOL_CREATE_TRANSIENT_BIT: @@ -6116,6 +6303,7 @@ static inline const char* string_VkCommandPoolCreateFlagBits(VkCommandPoolCreate } } +#ifdef __cplusplus static inline std::string string_VkCommandPoolCreateFlags(VkCommandPoolCreateFlags input_value) { std::string ret; int index = 0; @@ -6130,6 +6318,7 @@ static inline std::string string_VkCommandPoolCreateFlags(VkCommandPoolCreateFla if (ret.empty()) ret.append("VkCommandPoolCreateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkCommandPoolResetFlagBits(VkCommandPoolResetFlagBits input_value) { switch (input_value) { case VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT: @@ -6139,6 +6328,7 @@ static inline const char* string_VkCommandPoolResetFlagBits(VkCommandPoolResetFl } } +#ifdef __cplusplus static inline std::string string_VkCommandPoolResetFlags(VkCommandPoolResetFlags input_value) { std::string ret; int index = 0; @@ -6153,6 +6343,7 @@ static inline std::string string_VkCommandPoolResetFlags(VkCommandPoolResetFlags if (ret.empty()) ret.append("VkCommandPoolResetFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkCommandBufferUsageFlagBits(VkCommandBufferUsageFlagBits input_value) { switch (input_value) { case VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT: @@ -6166,6 +6357,7 @@ static inline const char* string_VkCommandBufferUsageFlagBits(VkCommandBufferUsa } } +#ifdef __cplusplus static inline std::string string_VkCommandBufferUsageFlags(VkCommandBufferUsageFlags input_value) { std::string ret; int index = 0; @@ -6180,6 +6372,7 @@ static inline std::string string_VkCommandBufferUsageFlags(VkCommandBufferUsageF if (ret.empty()) ret.append("VkCommandBufferUsageFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkQueryControlFlagBits(VkQueryControlFlagBits input_value) { switch (input_value) { case VK_QUERY_CONTROL_PRECISE_BIT: @@ -6189,6 +6382,7 @@ static inline const char* string_VkQueryControlFlagBits(VkQueryControlFlagBits i } } +#ifdef __cplusplus static inline std::string string_VkQueryControlFlags(VkQueryControlFlags input_value) { std::string ret; int index = 0; @@ -6203,6 +6397,7 @@ static inline std::string string_VkQueryControlFlags(VkQueryControlFlags input_v if (ret.empty()) ret.append("VkQueryControlFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkCommandBufferResetFlagBits(VkCommandBufferResetFlagBits input_value) { switch (input_value) { case VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT: @@ -6212,6 +6407,7 @@ static inline const char* string_VkCommandBufferResetFlagBits(VkCommandBufferRes } } +#ifdef __cplusplus static inline std::string string_VkCommandBufferResetFlags(VkCommandBufferResetFlags input_value) { std::string ret; int index = 0; @@ -6226,6 +6422,7 @@ static inline std::string string_VkCommandBufferResetFlags(VkCommandBufferResetF if (ret.empty()) ret.append("VkCommandBufferResetFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkStencilFaceFlagBits(VkStencilFaceFlagBits input_value) { switch (input_value) { case VK_STENCIL_FACE_FRONT_BIT: @@ -6237,6 +6434,7 @@ static inline const char* string_VkStencilFaceFlagBits(VkStencilFaceFlagBits inp } } +#ifdef __cplusplus static inline std::string string_VkStencilFaceFlags(VkStencilFaceFlags input_value) { if (input_value == VK_STENCIL_FACE_FRONT_AND_BACK) { return "VK_STENCIL_FACE_FRONT_AND_BACK"; } std::string ret; @@ -6252,6 +6450,7 @@ static inline std::string string_VkStencilFaceFlags(VkStencilFaceFlags input_val if (ret.empty()) ret.append("VkStencilFaceFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSubgroupFeatureFlagBits(VkSubgroupFeatureFlagBits input_value) { switch (input_value) { case VK_SUBGROUP_FEATURE_BASIC_BIT: @@ -6277,6 +6476,7 @@ static inline const char* string_VkSubgroupFeatureFlagBits(VkSubgroupFeatureFlag } } +#ifdef __cplusplus static inline std::string string_VkSubgroupFeatureFlags(VkSubgroupFeatureFlags input_value) { std::string ret; int index = 0; @@ -6291,6 +6491,7 @@ static inline std::string string_VkSubgroupFeatureFlags(VkSubgroupFeatureFlags i if (ret.empty()) ret.append("VkSubgroupFeatureFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPeerMemoryFeatureFlagBits(VkPeerMemoryFeatureFlagBits input_value) { switch (input_value) { case VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT: @@ -6306,6 +6507,7 @@ static inline const char* string_VkPeerMemoryFeatureFlagBits(VkPeerMemoryFeature } } +#ifdef __cplusplus static inline std::string string_VkPeerMemoryFeatureFlags(VkPeerMemoryFeatureFlags input_value) { std::string ret; int index = 0; @@ -6320,6 +6522,7 @@ static inline std::string string_VkPeerMemoryFeatureFlags(VkPeerMemoryFeatureFla if (ret.empty()) ret.append("VkPeerMemoryFeatureFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkMemoryAllocateFlagBits(VkMemoryAllocateFlagBits input_value) { switch (input_value) { case VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT: @@ -6333,6 +6536,7 @@ static inline const char* string_VkMemoryAllocateFlagBits(VkMemoryAllocateFlagBi } } +#ifdef __cplusplus static inline std::string string_VkMemoryAllocateFlags(VkMemoryAllocateFlags input_value) { std::string ret; int index = 0; @@ -6347,6 +6551,7 @@ static inline std::string string_VkMemoryAllocateFlags(VkMemoryAllocateFlags inp if (ret.empty()) ret.append("VkMemoryAllocateFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkExternalMemoryHandleTypeFlagBits(VkExternalMemoryHandleTypeFlagBits input_value) { switch (input_value) { case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT: @@ -6382,6 +6587,7 @@ static inline const char* string_VkExternalMemoryHandleTypeFlagBits(VkExternalMe } } +#ifdef __cplusplus static inline std::string string_VkExternalMemoryHandleTypeFlags(VkExternalMemoryHandleTypeFlags input_value) { std::string ret; int index = 0; @@ -6396,6 +6602,7 @@ static inline std::string string_VkExternalMemoryHandleTypeFlags(VkExternalMemor if (ret.empty()) ret.append("VkExternalMemoryHandleTypeFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkExternalMemoryFeatureFlagBits(VkExternalMemoryFeatureFlagBits input_value) { switch (input_value) { case VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT: @@ -6409,6 +6616,7 @@ static inline const char* string_VkExternalMemoryFeatureFlagBits(VkExternalMemor } } +#ifdef __cplusplus static inline std::string string_VkExternalMemoryFeatureFlags(VkExternalMemoryFeatureFlags input_value) { std::string ret; int index = 0; @@ -6423,6 +6631,7 @@ static inline std::string string_VkExternalMemoryFeatureFlags(VkExternalMemoryFe if (ret.empty()) ret.append("VkExternalMemoryFeatureFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkExternalFenceHandleTypeFlagBits(VkExternalFenceHandleTypeFlagBits input_value) { switch (input_value) { case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT: @@ -6438,6 +6647,7 @@ static inline const char* string_VkExternalFenceHandleTypeFlagBits(VkExternalFen } } +#ifdef __cplusplus static inline std::string string_VkExternalFenceHandleTypeFlags(VkExternalFenceHandleTypeFlags input_value) { std::string ret; int index = 0; @@ -6452,6 +6662,7 @@ static inline std::string string_VkExternalFenceHandleTypeFlags(VkExternalFenceH if (ret.empty()) ret.append("VkExternalFenceHandleTypeFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkExternalFenceFeatureFlagBits(VkExternalFenceFeatureFlagBits input_value) { switch (input_value) { case VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT: @@ -6463,6 +6674,7 @@ static inline const char* string_VkExternalFenceFeatureFlagBits(VkExternalFenceF } } +#ifdef __cplusplus static inline std::string string_VkExternalFenceFeatureFlags(VkExternalFenceFeatureFlags input_value) { std::string ret; int index = 0; @@ -6477,6 +6689,7 @@ static inline std::string string_VkExternalFenceFeatureFlags(VkExternalFenceFeat if (ret.empty()) ret.append("VkExternalFenceFeatureFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkFenceImportFlagBits(VkFenceImportFlagBits input_value) { switch (input_value) { case VK_FENCE_IMPORT_TEMPORARY_BIT: @@ -6486,6 +6699,7 @@ static inline const char* string_VkFenceImportFlagBits(VkFenceImportFlagBits inp } } +#ifdef __cplusplus static inline std::string string_VkFenceImportFlags(VkFenceImportFlags input_value) { std::string ret; int index = 0; @@ -6500,6 +6714,7 @@ static inline std::string string_VkFenceImportFlags(VkFenceImportFlags input_val if (ret.empty()) ret.append("VkFenceImportFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSemaphoreImportFlagBits(VkSemaphoreImportFlagBits input_value) { switch (input_value) { case VK_SEMAPHORE_IMPORT_TEMPORARY_BIT: @@ -6509,6 +6724,7 @@ static inline const char* string_VkSemaphoreImportFlagBits(VkSemaphoreImportFlag } } +#ifdef __cplusplus static inline std::string string_VkSemaphoreImportFlags(VkSemaphoreImportFlags input_value) { std::string ret; int index = 0; @@ -6523,6 +6739,7 @@ static inline std::string string_VkSemaphoreImportFlags(VkSemaphoreImportFlags i if (ret.empty()) ret.append("VkSemaphoreImportFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkExternalSemaphoreHandleTypeFlagBits(VkExternalSemaphoreHandleTypeFlagBits input_value) { switch (input_value) { case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT: @@ -6542,6 +6759,7 @@ static inline const char* string_VkExternalSemaphoreHandleTypeFlagBits(VkExterna } } +#ifdef __cplusplus static inline std::string string_VkExternalSemaphoreHandleTypeFlags(VkExternalSemaphoreHandleTypeFlags input_value) { std::string ret; int index = 0; @@ -6556,6 +6774,7 @@ static inline std::string string_VkExternalSemaphoreHandleTypeFlags(VkExternalSe if (ret.empty()) ret.append("VkExternalSemaphoreHandleTypeFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkExternalSemaphoreFeatureFlagBits(VkExternalSemaphoreFeatureFlagBits input_value) { switch (input_value) { case VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT: @@ -6567,6 +6786,7 @@ static inline const char* string_VkExternalSemaphoreFeatureFlagBits(VkExternalSe } } +#ifdef __cplusplus static inline std::string string_VkExternalSemaphoreFeatureFlags(VkExternalSemaphoreFeatureFlags input_value) { std::string ret; int index = 0; @@ -6581,6 +6801,7 @@ static inline std::string string_VkExternalSemaphoreFeatureFlags(VkExternalSemap if (ret.empty()) ret.append("VkExternalSemaphoreFeatureFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkResolveModeFlagBits(VkResolveModeFlagBits input_value) { switch (input_value) { case VK_RESOLVE_MODE_NONE: @@ -6593,11 +6814,14 @@ static inline const char* string_VkResolveModeFlagBits(VkResolveModeFlagBits inp return "VK_RESOLVE_MODE_MIN_BIT"; case VK_RESOLVE_MODE_MAX_BIT: return "VK_RESOLVE_MODE_MAX_BIT"; + case VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID: + return "VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID"; default: return "Unhandled VkResolveModeFlagBits"; } } +#ifdef __cplusplus static inline std::string string_VkResolveModeFlags(VkResolveModeFlags input_value) { std::string ret; int index = 0; @@ -6612,6 +6836,7 @@ static inline std::string string_VkResolveModeFlags(VkResolveModeFlags input_val if (ret.empty()) ret.append("VkResolveModeFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDescriptorBindingFlagBits(VkDescriptorBindingFlagBits input_value) { switch (input_value) { case VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT: @@ -6627,6 +6852,7 @@ static inline const char* string_VkDescriptorBindingFlagBits(VkDescriptorBinding } } +#ifdef __cplusplus static inline std::string string_VkDescriptorBindingFlags(VkDescriptorBindingFlags input_value) { std::string ret; int index = 0; @@ -6641,6 +6867,7 @@ static inline std::string string_VkDescriptorBindingFlags(VkDescriptorBindingFla if (ret.empty()) ret.append("VkDescriptorBindingFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSemaphoreWaitFlagBits(VkSemaphoreWaitFlagBits input_value) { switch (input_value) { case VK_SEMAPHORE_WAIT_ANY_BIT: @@ -6650,6 +6877,7 @@ static inline const char* string_VkSemaphoreWaitFlagBits(VkSemaphoreWaitFlagBits } } +#ifdef __cplusplus static inline std::string string_VkSemaphoreWaitFlags(VkSemaphoreWaitFlags input_value) { std::string ret; int index = 0; @@ -6664,6 +6892,7 @@ static inline std::string string_VkSemaphoreWaitFlags(VkSemaphoreWaitFlags input if (ret.empty()) ret.append("VkSemaphoreWaitFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPipelineCreationFeedbackFlagBits(VkPipelineCreationFeedbackFlagBits input_value) { switch (input_value) { case VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT: @@ -6677,6 +6906,7 @@ static inline const char* string_VkPipelineCreationFeedbackFlagBits(VkPipelineCr } } +#ifdef __cplusplus static inline std::string string_VkPipelineCreationFeedbackFlags(VkPipelineCreationFeedbackFlags input_value) { std::string ret; int index = 0; @@ -6691,6 +6921,7 @@ static inline std::string string_VkPipelineCreationFeedbackFlags(VkPipelineCreat if (ret.empty()) ret.append("VkPipelineCreationFeedbackFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkToolPurposeFlagBits(VkToolPurposeFlagBits input_value) { switch (input_value) { case VK_TOOL_PURPOSE_VALIDATION_BIT: @@ -6712,6 +6943,7 @@ static inline const char* string_VkToolPurposeFlagBits(VkToolPurposeFlagBits inp } } +#ifdef __cplusplus static inline std::string string_VkToolPurposeFlags(VkToolPurposeFlags input_value) { std::string ret; int index = 0; @@ -6726,99 +6958,56 @@ static inline std::string string_VkToolPurposeFlags(VkToolPurposeFlags input_val if (ret.empty()) ret.append("VkToolPurposeFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPipelineStageFlagBits2(uint64_t input_value) { - switch (input_value) { - case VK_PIPELINE_STAGE_2_NONE: - return "VK_PIPELINE_STAGE_2_NONE"; - case VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT: - return "VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT"; - case VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT: - return "VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT"; - case VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT: - return "VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT"; - case VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT: - return "VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT"; - case VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT: - return "VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT"; - case VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT: - return "VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT"; - case VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT: - return "VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT"; - case VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT: - return "VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT"; - case VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT: - return "VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT"; - case VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT: - return "VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT"; - case VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT: - return "VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT"; - case VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT: - return "VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT"; - case VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT: - return "VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT"; - case VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT: - return "VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT"; - case VK_PIPELINE_STAGE_2_HOST_BIT: - return "VK_PIPELINE_STAGE_2_HOST_BIT"; - case VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT: - return "VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT"; - case VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT: - return "VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT"; - case VK_PIPELINE_STAGE_2_COPY_BIT: - return "VK_PIPELINE_STAGE_2_COPY_BIT"; - case VK_PIPELINE_STAGE_2_RESOLVE_BIT: - return "VK_PIPELINE_STAGE_2_RESOLVE_BIT"; - case VK_PIPELINE_STAGE_2_BLIT_BIT: - return "VK_PIPELINE_STAGE_2_BLIT_BIT"; - case VK_PIPELINE_STAGE_2_CLEAR_BIT: - return "VK_PIPELINE_STAGE_2_CLEAR_BIT"; - case VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT: - return "VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT"; - case VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT: - return "VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT"; - case VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT: - return "VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT"; - case VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR: - return "VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR"; + if (input_value == VK_PIPELINE_STAGE_2_NONE) return "VK_PIPELINE_STAGE_2_NONE"; + if (input_value == VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT) return "VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT) return "VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT) return "VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT) return "VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT) return "VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT) return "VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT) return "VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT) return "VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT) return "VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT) return "VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT) return "VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT) return "VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT) return "VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT) return "VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_HOST_BIT) return "VK_PIPELINE_STAGE_2_HOST_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT) return "VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT) return "VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_COPY_BIT) return "VK_PIPELINE_STAGE_2_COPY_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_RESOLVE_BIT) return "VK_PIPELINE_STAGE_2_RESOLVE_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_BLIT_BIT) return "VK_PIPELINE_STAGE_2_BLIT_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_CLEAR_BIT) return "VK_PIPELINE_STAGE_2_CLEAR_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT) return "VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT) return "VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT) return "VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT"; + if (input_value == VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR) return "VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR"; #ifdef VK_ENABLE_BETA_EXTENSIONS - case VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR: - return "VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR"; + if (input_value == VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR) return "VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR"; #endif //VK_ENABLE_BETA_EXTENSIONS - case VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT: - return "VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT"; - case VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT: - return "VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT"; - case VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV: - return "VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV"; - case VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR: - return "VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"; - case VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR: - return "VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR"; - case VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR: - return "VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR"; - case VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT: - return "VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT"; - case VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT: - return "VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT"; - case VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT: - return "VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT"; - case VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI: - return "VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI"; - case VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI: - return "VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI"; - case VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR: - return "VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR"; - case VK_PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT: - return "VK_PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT"; - case VK_PIPELINE_STAGE_2_CLUSTER_CULLING_SHADER_BIT_HUAWEI: - return "VK_PIPELINE_STAGE_2_CLUSTER_CULLING_SHADER_BIT_HUAWEI"; - case VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV: - return "VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV"; - default: - return "Unhandled VkPipelineStageFlagBits2"; - } -} - + if (input_value == VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT) return "VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT"; + if (input_value == VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT) return "VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT"; + if (input_value == VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV) return "VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV"; + if (input_value == VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR) return "VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"; + if (input_value == VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR) return "VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR"; + if (input_value == VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR) return "VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR"; + if (input_value == VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT) return "VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT"; + if (input_value == VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT) return "VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT"; + if (input_value == VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT) return "VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT"; + if (input_value == VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI) return "VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI"; + if (input_value == VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI) return "VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI"; + if (input_value == VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR) return "VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR"; + if (input_value == VK_PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT) return "VK_PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT"; + if (input_value == VK_PIPELINE_STAGE_2_CLUSTER_CULLING_SHADER_BIT_HUAWEI) return "VK_PIPELINE_STAGE_2_CLUSTER_CULLING_SHADER_BIT_HUAWEI"; + if (input_value == VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV) return "VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV"; + return "Unhandled VkPipelineStageFlagBits2"; +} + +#ifdef __cplusplus static inline std::string string_VkPipelineStageFlags2(VkPipelineStageFlags2 input_value) { std::string ret; int index = 0; @@ -6833,103 +7022,59 @@ static inline std::string string_VkPipelineStageFlags2(VkPipelineStageFlags2 inp if (ret.empty()) ret.append("VkPipelineStageFlags2(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkAccessFlagBits2(uint64_t input_value) { - switch (input_value) { - case VK_ACCESS_2_NONE: - return "VK_ACCESS_2_NONE"; - case VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT: - return "VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT"; - case VK_ACCESS_2_INDEX_READ_BIT: - return "VK_ACCESS_2_INDEX_READ_BIT"; - case VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT: - return "VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT"; - case VK_ACCESS_2_UNIFORM_READ_BIT: - return "VK_ACCESS_2_UNIFORM_READ_BIT"; - case VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT: - return "VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT"; - case VK_ACCESS_2_SHADER_READ_BIT: - return "VK_ACCESS_2_SHADER_READ_BIT"; - case VK_ACCESS_2_SHADER_WRITE_BIT: - return "VK_ACCESS_2_SHADER_WRITE_BIT"; - case VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT: - return "VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT"; - case VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT: - return "VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT"; - case VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT: - return "VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT"; - case VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT: - return "VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT"; - case VK_ACCESS_2_TRANSFER_READ_BIT: - return "VK_ACCESS_2_TRANSFER_READ_BIT"; - case VK_ACCESS_2_TRANSFER_WRITE_BIT: - return "VK_ACCESS_2_TRANSFER_WRITE_BIT"; - case VK_ACCESS_2_HOST_READ_BIT: - return "VK_ACCESS_2_HOST_READ_BIT"; - case VK_ACCESS_2_HOST_WRITE_BIT: - return "VK_ACCESS_2_HOST_WRITE_BIT"; - case VK_ACCESS_2_MEMORY_READ_BIT: - return "VK_ACCESS_2_MEMORY_READ_BIT"; - case VK_ACCESS_2_MEMORY_WRITE_BIT: - return "VK_ACCESS_2_MEMORY_WRITE_BIT"; - case VK_ACCESS_2_SHADER_SAMPLED_READ_BIT: - return "VK_ACCESS_2_SHADER_SAMPLED_READ_BIT"; - case VK_ACCESS_2_SHADER_STORAGE_READ_BIT: - return "VK_ACCESS_2_SHADER_STORAGE_READ_BIT"; - case VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT: - return "VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT"; - case VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR: - return "VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR"; - case VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR: - return "VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR"; + if (input_value == VK_ACCESS_2_NONE) return "VK_ACCESS_2_NONE"; + if (input_value == VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT) return "VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT"; + if (input_value == VK_ACCESS_2_INDEX_READ_BIT) return "VK_ACCESS_2_INDEX_READ_BIT"; + if (input_value == VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT) return "VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT"; + if (input_value == VK_ACCESS_2_UNIFORM_READ_BIT) return "VK_ACCESS_2_UNIFORM_READ_BIT"; + if (input_value == VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT) return "VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT"; + if (input_value == VK_ACCESS_2_SHADER_READ_BIT) return "VK_ACCESS_2_SHADER_READ_BIT"; + if (input_value == VK_ACCESS_2_SHADER_WRITE_BIT) return "VK_ACCESS_2_SHADER_WRITE_BIT"; + if (input_value == VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT) return "VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT"; + if (input_value == VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT) return "VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT"; + if (input_value == VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT) return "VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT"; + if (input_value == VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT) return "VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT"; + if (input_value == VK_ACCESS_2_TRANSFER_READ_BIT) return "VK_ACCESS_2_TRANSFER_READ_BIT"; + if (input_value == VK_ACCESS_2_TRANSFER_WRITE_BIT) return "VK_ACCESS_2_TRANSFER_WRITE_BIT"; + if (input_value == VK_ACCESS_2_HOST_READ_BIT) return "VK_ACCESS_2_HOST_READ_BIT"; + if (input_value == VK_ACCESS_2_HOST_WRITE_BIT) return "VK_ACCESS_2_HOST_WRITE_BIT"; + if (input_value == VK_ACCESS_2_MEMORY_READ_BIT) return "VK_ACCESS_2_MEMORY_READ_BIT"; + if (input_value == VK_ACCESS_2_MEMORY_WRITE_BIT) return "VK_ACCESS_2_MEMORY_WRITE_BIT"; + if (input_value == VK_ACCESS_2_SHADER_SAMPLED_READ_BIT) return "VK_ACCESS_2_SHADER_SAMPLED_READ_BIT"; + if (input_value == VK_ACCESS_2_SHADER_STORAGE_READ_BIT) return "VK_ACCESS_2_SHADER_STORAGE_READ_BIT"; + if (input_value == VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT) return "VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT"; + if (input_value == VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR) return "VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR"; + if (input_value == VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR) return "VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR"; #ifdef VK_ENABLE_BETA_EXTENSIONS - case VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR: - return "VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR"; + if (input_value == VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR) return "VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR"; #endif //VK_ENABLE_BETA_EXTENSIONS #ifdef VK_ENABLE_BETA_EXTENSIONS - case VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR: - return "VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR"; + if (input_value == VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR) return "VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR"; #endif //VK_ENABLE_BETA_EXTENSIONS - case VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT: - return "VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT"; - case VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT: - return "VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT"; - case VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT: - return "VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT"; - case VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT: - return "VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT"; - case VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV: - return "VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV"; - case VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV: - return "VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV"; - case VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR: - return "VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR"; - case VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR: - return "VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR"; - case VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR: - return "VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR"; - case VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT: - return "VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT"; - case VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT: - return "VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT"; - case VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT: - return "VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT"; - case VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI: - return "VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI"; - case VK_ACCESS_2_SHADER_BINDING_TABLE_READ_BIT_KHR: - return "VK_ACCESS_2_SHADER_BINDING_TABLE_READ_BIT_KHR"; - case VK_ACCESS_2_MICROMAP_READ_BIT_EXT: - return "VK_ACCESS_2_MICROMAP_READ_BIT_EXT"; - case VK_ACCESS_2_MICROMAP_WRITE_BIT_EXT: - return "VK_ACCESS_2_MICROMAP_WRITE_BIT_EXT"; - case VK_ACCESS_2_OPTICAL_FLOW_READ_BIT_NV: - return "VK_ACCESS_2_OPTICAL_FLOW_READ_BIT_NV"; - case VK_ACCESS_2_OPTICAL_FLOW_WRITE_BIT_NV: - return "VK_ACCESS_2_OPTICAL_FLOW_WRITE_BIT_NV"; - default: - return "Unhandled VkAccessFlagBits2"; - } -} - + if (input_value == VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT) return "VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT"; + if (input_value == VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT) return "VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT"; + if (input_value == VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT) return "VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT"; + if (input_value == VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT) return "VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT"; + if (input_value == VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV) return "VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV"; + if (input_value == VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV) return "VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV"; + if (input_value == VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR) return "VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR"; + if (input_value == VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR) return "VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR"; + if (input_value == VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR) return "VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR"; + if (input_value == VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT) return "VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT"; + if (input_value == VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT) return "VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT"; + if (input_value == VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT) return "VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT"; + if (input_value == VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI) return "VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI"; + if (input_value == VK_ACCESS_2_SHADER_BINDING_TABLE_READ_BIT_KHR) return "VK_ACCESS_2_SHADER_BINDING_TABLE_READ_BIT_KHR"; + if (input_value == VK_ACCESS_2_MICROMAP_READ_BIT_EXT) return "VK_ACCESS_2_MICROMAP_READ_BIT_EXT"; + if (input_value == VK_ACCESS_2_MICROMAP_WRITE_BIT_EXT) return "VK_ACCESS_2_MICROMAP_WRITE_BIT_EXT"; + if (input_value == VK_ACCESS_2_OPTICAL_FLOW_READ_BIT_NV) return "VK_ACCESS_2_OPTICAL_FLOW_READ_BIT_NV"; + if (input_value == VK_ACCESS_2_OPTICAL_FLOW_WRITE_BIT_NV) return "VK_ACCESS_2_OPTICAL_FLOW_WRITE_BIT_NV"; + return "Unhandled VkAccessFlagBits2"; +} + +#ifdef __cplusplus static inline std::string string_VkAccessFlags2(VkAccessFlags2 input_value) { std::string ret; int index = 0; @@ -6944,6 +7089,7 @@ static inline std::string string_VkAccessFlags2(VkAccessFlags2 input_value) { if (ret.empty()) ret.append("VkAccessFlags2(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSubmitFlagBits(VkSubmitFlagBits input_value) { switch (input_value) { case VK_SUBMIT_PROTECTED_BIT: @@ -6953,6 +7099,7 @@ static inline const char* string_VkSubmitFlagBits(VkSubmitFlagBits input_value) } } +#ifdef __cplusplus static inline std::string string_VkSubmitFlags(VkSubmitFlags input_value) { std::string ret; int index = 0; @@ -6967,6 +7114,7 @@ static inline std::string string_VkSubmitFlags(VkSubmitFlags input_value) { if (ret.empty()) ret.append("VkSubmitFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkRenderingFlagBits(VkRenderingFlagBits input_value) { switch (input_value) { case VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT: @@ -6975,6 +7123,8 @@ static inline const char* string_VkRenderingFlagBits(VkRenderingFlagBits input_v return "VK_RENDERING_SUSPENDING_BIT"; case VK_RENDERING_RESUMING_BIT: return "VK_RENDERING_RESUMING_BIT"; + case VK_RENDERING_CONTENTS_INLINE_BIT_EXT: + return "VK_RENDERING_CONTENTS_INLINE_BIT_EXT"; case VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT: return "VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT"; default: @@ -6982,6 +7132,7 @@ static inline const char* string_VkRenderingFlagBits(VkRenderingFlagBits input_v } } +#ifdef __cplusplus static inline std::string string_VkRenderingFlags(VkRenderingFlags input_value) { std::string ret; int index = 0; @@ -6996,103 +7147,59 @@ static inline std::string string_VkRenderingFlags(VkRenderingFlags input_value) if (ret.empty()) ret.append("VkRenderingFlags(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkFormatFeatureFlagBits2(uint64_t input_value) { - switch (input_value) { - case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT: - return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT"; - case VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT: - return "VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT"; - case VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT: - return "VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT"; - case VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT: - return "VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT"; - case VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT: - return "VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT"; - case VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT: - return "VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"; - case VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT: - return "VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT"; - case VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT: - return "VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT"; - case VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT: - return "VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT"; - case VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT: - return "VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT"; - case VK_FORMAT_FEATURE_2_BLIT_SRC_BIT: - return "VK_FORMAT_FEATURE_2_BLIT_SRC_BIT"; - case VK_FORMAT_FEATURE_2_BLIT_DST_BIT: - return "VK_FORMAT_FEATURE_2_BLIT_DST_BIT"; - case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT: - return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT"; - case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT: - return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT"; - case VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT: - return "VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT"; - case VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT: - return "VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT"; - case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT: - return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT"; - case VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT: - return "VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT"; - case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT: - return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT"; - case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT: - return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT"; - case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT: - return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT"; - case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT: - return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT"; - case VK_FORMAT_FEATURE_2_DISJOINT_BIT: - return "VK_FORMAT_FEATURE_2_DISJOINT_BIT"; - case VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT: - return "VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT"; - case VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT: - return "VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT"; - case VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT: - return "VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT"; - case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT: - return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT"; - case VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR: - return "VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR"; - case VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR: - return "VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR"; - case VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR: - return "VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR"; - case VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT: - return "VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT"; - case VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR: - return "VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"; - case VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT: - return "VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT"; + if (input_value == VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT) return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT) return "VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT) return "VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT) return "VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT) return "VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) return "VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT) return "VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT) return "VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT) return "VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT) return "VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_BLIT_SRC_BIT) return "VK_FORMAT_FEATURE_2_BLIT_SRC_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_BLIT_DST_BIT) return "VK_FORMAT_FEATURE_2_BLIT_DST_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT) return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT) return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT) return "VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT) return "VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT) return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT) return "VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT) return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT) return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT) return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT) return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_DISJOINT_BIT) return "VK_FORMAT_FEATURE_2_DISJOINT_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT) return "VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT) return "VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT) return "VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT) return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT"; + if (input_value == VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR) return "VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR"; + if (input_value == VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR) return "VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR"; + if (input_value == VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR) return "VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR"; + if (input_value == VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT) return "VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT"; + if (input_value == VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR) return "VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"; + if (input_value == VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT) return "VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT"; #ifdef VK_ENABLE_BETA_EXTENSIONS - case VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR: - return "VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR"; + if (input_value == VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR) return "VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR"; #endif //VK_ENABLE_BETA_EXTENSIONS #ifdef VK_ENABLE_BETA_EXTENSIONS - case VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR: - return "VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR"; + if (input_value == VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR) return "VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR"; #endif //VK_ENABLE_BETA_EXTENSIONS - case VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV: - return "VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV"; - case VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM: - return "VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM"; - case VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM: - return "VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM"; - case VK_FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM: - return "VK_FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM"; - case VK_FORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM: - return "VK_FORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM"; - case VK_FORMAT_FEATURE_2_OPTICAL_FLOW_IMAGE_BIT_NV: - return "VK_FORMAT_FEATURE_2_OPTICAL_FLOW_IMAGE_BIT_NV"; - case VK_FORMAT_FEATURE_2_OPTICAL_FLOW_VECTOR_BIT_NV: - return "VK_FORMAT_FEATURE_2_OPTICAL_FLOW_VECTOR_BIT_NV"; - case VK_FORMAT_FEATURE_2_OPTICAL_FLOW_COST_BIT_NV: - return "VK_FORMAT_FEATURE_2_OPTICAL_FLOW_COST_BIT_NV"; - default: - return "Unhandled VkFormatFeatureFlagBits2"; - } -} - + if (input_value == VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV) return "VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV"; + if (input_value == VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM) return "VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM"; + if (input_value == VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM) return "VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM"; + if (input_value == VK_FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM) return "VK_FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM"; + if (input_value == VK_FORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM) return "VK_FORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM"; + if (input_value == VK_FORMAT_FEATURE_2_OPTICAL_FLOW_IMAGE_BIT_NV) return "VK_FORMAT_FEATURE_2_OPTICAL_FLOW_IMAGE_BIT_NV"; + if (input_value == VK_FORMAT_FEATURE_2_OPTICAL_FLOW_VECTOR_BIT_NV) return "VK_FORMAT_FEATURE_2_OPTICAL_FLOW_VECTOR_BIT_NV"; + if (input_value == VK_FORMAT_FEATURE_2_OPTICAL_FLOW_COST_BIT_NV) return "VK_FORMAT_FEATURE_2_OPTICAL_FLOW_COST_BIT_NV"; + return "Unhandled VkFormatFeatureFlagBits2"; +} + +#ifdef __cplusplus static inline std::string string_VkFormatFeatureFlags2(VkFormatFeatureFlags2 input_value) { std::string ret; int index = 0; @@ -7107,6 +7214,7 @@ static inline std::string string_VkFormatFeatureFlags2(VkFormatFeatureFlags2 inp if (ret.empty()) ret.append("VkFormatFeatureFlags2(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSurfaceTransformFlagBitsKHR(VkSurfaceTransformFlagBitsKHR input_value) { switch (input_value) { case VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR: @@ -7132,6 +7240,7 @@ static inline const char* string_VkSurfaceTransformFlagBitsKHR(VkSurfaceTransfor } } +#ifdef __cplusplus static inline std::string string_VkSurfaceTransformFlagsKHR(VkSurfaceTransformFlagsKHR input_value) { std::string ret; int index = 0; @@ -7146,6 +7255,7 @@ static inline std::string string_VkSurfaceTransformFlagsKHR(VkSurfaceTransformFl if (ret.empty()) ret.append("VkSurfaceTransformFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkCompositeAlphaFlagBitsKHR(VkCompositeAlphaFlagBitsKHR input_value) { switch (input_value) { case VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR: @@ -7161,6 +7271,7 @@ static inline const char* string_VkCompositeAlphaFlagBitsKHR(VkCompositeAlphaFla } } +#ifdef __cplusplus static inline std::string string_VkCompositeAlphaFlagsKHR(VkCompositeAlphaFlagsKHR input_value) { std::string ret; int index = 0; @@ -7175,6 +7286,7 @@ static inline std::string string_VkCompositeAlphaFlagsKHR(VkCompositeAlphaFlagsK if (ret.empty()) ret.append("VkCompositeAlphaFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSwapchainCreateFlagBitsKHR(VkSwapchainCreateFlagBitsKHR input_value) { switch (input_value) { case VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR: @@ -7190,6 +7302,7 @@ static inline const char* string_VkSwapchainCreateFlagBitsKHR(VkSwapchainCreateF } } +#ifdef __cplusplus static inline std::string string_VkSwapchainCreateFlagsKHR(VkSwapchainCreateFlagsKHR input_value) { std::string ret; int index = 0; @@ -7204,6 +7317,7 @@ static inline std::string string_VkSwapchainCreateFlagsKHR(VkSwapchainCreateFlag if (ret.empty()) ret.append("VkSwapchainCreateFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDeviceGroupPresentModeFlagBitsKHR(VkDeviceGroupPresentModeFlagBitsKHR input_value) { switch (input_value) { case VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR: @@ -7219,6 +7333,7 @@ static inline const char* string_VkDeviceGroupPresentModeFlagBitsKHR(VkDeviceGro } } +#ifdef __cplusplus static inline std::string string_VkDeviceGroupPresentModeFlagsKHR(VkDeviceGroupPresentModeFlagsKHR input_value) { std::string ret; int index = 0; @@ -7233,6 +7348,7 @@ static inline std::string string_VkDeviceGroupPresentModeFlagsKHR(VkDeviceGroupP if (ret.empty()) ret.append("VkDeviceGroupPresentModeFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDisplayPlaneAlphaFlagBitsKHR(VkDisplayPlaneAlphaFlagBitsKHR input_value) { switch (input_value) { case VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR: @@ -7248,6 +7364,7 @@ static inline const char* string_VkDisplayPlaneAlphaFlagBitsKHR(VkDisplayPlaneAl } } +#ifdef __cplusplus static inline std::string string_VkDisplayPlaneAlphaFlagsKHR(VkDisplayPlaneAlphaFlagsKHR input_value) { std::string ret; int index = 0; @@ -7262,6 +7379,7 @@ static inline std::string string_VkDisplayPlaneAlphaFlagsKHR(VkDisplayPlaneAlpha if (ret.empty()) ret.append("VkDisplayPlaneAlphaFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkVideoCodecOperationFlagBitsKHR(VkVideoCodecOperationFlagBitsKHR input_value) { switch (input_value) { case VK_VIDEO_CODEC_OPERATION_NONE_KHR: @@ -7283,6 +7401,7 @@ static inline const char* string_VkVideoCodecOperationFlagBitsKHR(VkVideoCodecOp } } +#ifdef __cplusplus static inline std::string string_VkVideoCodecOperationFlagsKHR(VkVideoCodecOperationFlagsKHR input_value) { std::string ret; int index = 0; @@ -7297,6 +7416,7 @@ static inline std::string string_VkVideoCodecOperationFlagsKHR(VkVideoCodecOpera if (ret.empty()) ret.append("VkVideoCodecOperationFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkVideoChromaSubsamplingFlagBitsKHR(VkVideoChromaSubsamplingFlagBitsKHR input_value) { switch (input_value) { case VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_KHR: @@ -7314,6 +7434,7 @@ static inline const char* string_VkVideoChromaSubsamplingFlagBitsKHR(VkVideoChro } } +#ifdef __cplusplus static inline std::string string_VkVideoChromaSubsamplingFlagsKHR(VkVideoChromaSubsamplingFlagsKHR input_value) { std::string ret; int index = 0; @@ -7328,6 +7449,7 @@ static inline std::string string_VkVideoChromaSubsamplingFlagsKHR(VkVideoChromaS if (ret.empty()) ret.append("VkVideoChromaSubsamplingFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkVideoComponentBitDepthFlagBitsKHR(VkVideoComponentBitDepthFlagBitsKHR input_value) { switch (input_value) { case VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR: @@ -7343,6 +7465,7 @@ static inline const char* string_VkVideoComponentBitDepthFlagBitsKHR(VkVideoComp } } +#ifdef __cplusplus static inline std::string string_VkVideoComponentBitDepthFlagsKHR(VkVideoComponentBitDepthFlagsKHR input_value) { std::string ret; int index = 0; @@ -7357,6 +7480,7 @@ static inline std::string string_VkVideoComponentBitDepthFlagsKHR(VkVideoCompone if (ret.empty()) ret.append("VkVideoComponentBitDepthFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkVideoCapabilityFlagBitsKHR(VkVideoCapabilityFlagBitsKHR input_value) { switch (input_value) { case VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR: @@ -7368,6 +7492,7 @@ static inline const char* string_VkVideoCapabilityFlagBitsKHR(VkVideoCapabilityF } } +#ifdef __cplusplus static inline std::string string_VkVideoCapabilityFlagsKHR(VkVideoCapabilityFlagsKHR input_value) { std::string ret; int index = 0; @@ -7382,6 +7507,7 @@ static inline std::string string_VkVideoCapabilityFlagsKHR(VkVideoCapabilityFlag if (ret.empty()) ret.append("VkVideoCapabilityFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkVideoSessionCreateFlagBitsKHR(VkVideoSessionCreateFlagBitsKHR input_value) { switch (input_value) { case VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR: @@ -7395,6 +7521,7 @@ static inline const char* string_VkVideoSessionCreateFlagBitsKHR(VkVideoSessionC } } +#ifdef __cplusplus static inline std::string string_VkVideoSessionCreateFlagsKHR(VkVideoSessionCreateFlagsKHR input_value) { std::string ret; int index = 0; @@ -7409,6 +7536,7 @@ static inline std::string string_VkVideoSessionCreateFlagsKHR(VkVideoSessionCrea if (ret.empty()) ret.append("VkVideoSessionCreateFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkVideoCodingControlFlagBitsKHR(VkVideoCodingControlFlagBitsKHR input_value) { switch (input_value) { case VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR: @@ -7426,6 +7554,7 @@ static inline const char* string_VkVideoCodingControlFlagBitsKHR(VkVideoCodingCo } } +#ifdef __cplusplus static inline std::string string_VkVideoCodingControlFlagsKHR(VkVideoCodingControlFlagsKHR input_value) { std::string ret; int index = 0; @@ -7440,6 +7569,7 @@ static inline std::string string_VkVideoCodingControlFlagsKHR(VkVideoCodingContr if (ret.empty()) ret.append("VkVideoCodingControlFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkVideoDecodeCapabilityFlagBitsKHR(VkVideoDecodeCapabilityFlagBitsKHR input_value) { switch (input_value) { case VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR: @@ -7451,6 +7581,7 @@ static inline const char* string_VkVideoDecodeCapabilityFlagBitsKHR(VkVideoDecod } } +#ifdef __cplusplus static inline std::string string_VkVideoDecodeCapabilityFlagsKHR(VkVideoDecodeCapabilityFlagsKHR input_value) { std::string ret; int index = 0; @@ -7465,6 +7596,7 @@ static inline std::string string_VkVideoDecodeCapabilityFlagsKHR(VkVideoDecodeCa if (ret.empty()) ret.append("VkVideoDecodeCapabilityFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkVideoDecodeUsageFlagBitsKHR(VkVideoDecodeUsageFlagBitsKHR input_value) { switch (input_value) { case VK_VIDEO_DECODE_USAGE_DEFAULT_KHR: @@ -7480,6 +7612,7 @@ static inline const char* string_VkVideoDecodeUsageFlagBitsKHR(VkVideoDecodeUsag } } +#ifdef __cplusplus static inline std::string string_VkVideoDecodeUsageFlagsKHR(VkVideoDecodeUsageFlagsKHR input_value) { std::string ret; int index = 0; @@ -7494,6 +7627,7 @@ static inline std::string string_VkVideoDecodeUsageFlagsKHR(VkVideoDecodeUsageFl if (ret.empty()) ret.append("VkVideoDecodeUsageFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkVideoDecodeH264PictureLayoutFlagBitsKHR(VkVideoDecodeH264PictureLayoutFlagBitsKHR input_value) { switch (input_value) { case VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR: @@ -7507,6 +7641,7 @@ static inline const char* string_VkVideoDecodeH264PictureLayoutFlagBitsKHR(VkVid } } +#ifdef __cplusplus static inline std::string string_VkVideoDecodeH264PictureLayoutFlagsKHR(VkVideoDecodeH264PictureLayoutFlagsKHR input_value) { std::string ret; int index = 0; @@ -7521,6 +7656,7 @@ static inline std::string string_VkVideoDecodeH264PictureLayoutFlagsKHR(VkVideoD if (ret.empty()) ret.append("VkVideoDecodeH264PictureLayoutFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPerformanceCounterDescriptionFlagBitsKHR(VkPerformanceCounterDescriptionFlagBitsKHR input_value) { switch (input_value) { case VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR: @@ -7532,6 +7668,7 @@ static inline const char* string_VkPerformanceCounterDescriptionFlagBitsKHR(VkPe } } +#ifdef __cplusplus static inline std::string string_VkPerformanceCounterDescriptionFlagsKHR(VkPerformanceCounterDescriptionFlagsKHR input_value) { std::string ret; int index = 0; @@ -7546,16 +7683,20 @@ static inline std::string string_VkPerformanceCounterDescriptionFlagsKHR(VkPerfo if (ret.empty()) ret.append("VkPerformanceCounterDescriptionFlagsKHR(0)"); return ret; } +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeCapabilityFlagBitsKHR(VkVideoEncodeCapabilityFlagBitsKHR input_value) { switch (input_value) { case VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR: return "VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR"; + case VK_VIDEO_ENCODE_CAPABILITY_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_DETECTION_BIT_KHR: + return "VK_VIDEO_ENCODE_CAPABILITY_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_DETECTION_BIT_KHR"; default: return "Unhandled VkVideoEncodeCapabilityFlagBitsKHR"; } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeCapabilityFlagsKHR(VkVideoEncodeCapabilityFlagsKHR input_value) { std::string ret; int index = 0; @@ -7571,6 +7712,7 @@ static inline std::string string_VkVideoEncodeCapabilityFlagsKHR(VkVideoEncodeCa return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeRateControlModeFlagBitsKHR(VkVideoEncodeRateControlModeFlagBitsKHR input_value) { switch (input_value) { @@ -7587,6 +7729,7 @@ static inline const char* string_VkVideoEncodeRateControlModeFlagBitsKHR(VkVideo } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeRateControlModeFlagsKHR(VkVideoEncodeRateControlModeFlagsKHR input_value) { std::string ret; int index = 0; @@ -7602,6 +7745,7 @@ static inline std::string string_VkVideoEncodeRateControlModeFlagsKHR(VkVideoEnc return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeFeedbackFlagBitsKHR(VkVideoEncodeFeedbackFlagBitsKHR input_value) { switch (input_value) { @@ -7616,6 +7760,7 @@ static inline const char* string_VkVideoEncodeFeedbackFlagBitsKHR(VkVideoEncodeF } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeFeedbackFlagsKHR(VkVideoEncodeFeedbackFlagsKHR input_value) { std::string ret; int index = 0; @@ -7631,6 +7776,7 @@ static inline std::string string_VkVideoEncodeFeedbackFlagsKHR(VkVideoEncodeFeed return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeUsageFlagBitsKHR(VkVideoEncodeUsageFlagBitsKHR input_value) { switch (input_value) { @@ -7649,6 +7795,7 @@ static inline const char* string_VkVideoEncodeUsageFlagBitsKHR(VkVideoEncodeUsag } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeUsageFlagsKHR(VkVideoEncodeUsageFlagsKHR input_value) { std::string ret; int index = 0; @@ -7664,6 +7811,7 @@ static inline std::string string_VkVideoEncodeUsageFlagsKHR(VkVideoEncodeUsageFl return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeContentFlagBitsKHR(VkVideoEncodeContentFlagBitsKHR input_value) { switch (input_value) { @@ -7680,6 +7828,7 @@ static inline const char* string_VkVideoEncodeContentFlagBitsKHR(VkVideoEncodeCo } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeContentFlagsKHR(VkVideoEncodeContentFlagsKHR input_value) { std::string ret; int index = 0; @@ -7695,75 +7844,43 @@ static inline std::string string_VkVideoEncodeContentFlagsKHR(VkVideoEncodeConte return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus static inline const char* string_VkPipelineCreateFlagBits2KHR(uint64_t input_value) { - switch (input_value) { - case VK_PIPELINE_CREATE_2_DISABLE_OPTIMIZATION_BIT_KHR: - return "VK_PIPELINE_CREATE_2_DISABLE_OPTIMIZATION_BIT_KHR"; - case VK_PIPELINE_CREATE_2_ALLOW_DERIVATIVES_BIT_KHR: - return "VK_PIPELINE_CREATE_2_ALLOW_DERIVATIVES_BIT_KHR"; - case VK_PIPELINE_CREATE_2_DERIVATIVE_BIT_KHR: - return "VK_PIPELINE_CREATE_2_DERIVATIVE_BIT_KHR"; - case VK_PIPELINE_CREATE_2_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR: - return "VK_PIPELINE_CREATE_2_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR"; - case VK_PIPELINE_CREATE_2_DISPATCH_BASE_BIT_KHR: - return "VK_PIPELINE_CREATE_2_DISPATCH_BASE_BIT_KHR"; - case VK_PIPELINE_CREATE_2_DEFER_COMPILE_BIT_NV: - return "VK_PIPELINE_CREATE_2_DEFER_COMPILE_BIT_NV"; - case VK_PIPELINE_CREATE_2_CAPTURE_STATISTICS_BIT_KHR: - return "VK_PIPELINE_CREATE_2_CAPTURE_STATISTICS_BIT_KHR"; - case VK_PIPELINE_CREATE_2_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR: - return "VK_PIPELINE_CREATE_2_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR"; - case VK_PIPELINE_CREATE_2_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_KHR: - return "VK_PIPELINE_CREATE_2_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_KHR"; - case VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR: - return "VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR"; - case VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT: - return "VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT"; - case VK_PIPELINE_CREATE_2_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT: - return "VK_PIPELINE_CREATE_2_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT"; - case VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR: - return "VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR"; - case VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR: - return "VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR"; - case VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_AABBS_BIT_KHR: - return "VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_AABBS_BIT_KHR"; - case VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR: - return "VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR"; - case VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR: - return "VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR"; - case VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR: - return "VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR"; - case VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR: - return "VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR"; - case VK_PIPELINE_CREATE_2_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR: - return "VK_PIPELINE_CREATE_2_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR"; - case VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_NV: - return "VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_NV"; - case VK_PIPELINE_CREATE_2_RAY_TRACING_ALLOW_MOTION_BIT_NV: - return "VK_PIPELINE_CREATE_2_RAY_TRACING_ALLOW_MOTION_BIT_NV"; - case VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR: - return "VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"; - case VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT: - return "VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT"; - case VK_PIPELINE_CREATE_2_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT: - return "VK_PIPELINE_CREATE_2_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT"; - case VK_PIPELINE_CREATE_2_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT: - return "VK_PIPELINE_CREATE_2_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT"; - case VK_PIPELINE_CREATE_2_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT: - return "VK_PIPELINE_CREATE_2_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT"; - case VK_PIPELINE_CREATE_2_NO_PROTECTED_ACCESS_BIT_EXT: - return "VK_PIPELINE_CREATE_2_NO_PROTECTED_ACCESS_BIT_EXT"; - case VK_PIPELINE_CREATE_2_PROTECTED_ACCESS_ONLY_BIT_EXT: - return "VK_PIPELINE_CREATE_2_PROTECTED_ACCESS_ONLY_BIT_EXT"; - case VK_PIPELINE_CREATE_2_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV: - return "VK_PIPELINE_CREATE_2_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV"; - case VK_PIPELINE_CREATE_2_DESCRIPTOR_BUFFER_BIT_EXT: - return "VK_PIPELINE_CREATE_2_DESCRIPTOR_BUFFER_BIT_EXT"; - default: - return "Unhandled VkPipelineCreateFlagBits2KHR"; - } -} - + if (input_value == VK_PIPELINE_CREATE_2_DISABLE_OPTIMIZATION_BIT_KHR) return "VK_PIPELINE_CREATE_2_DISABLE_OPTIMIZATION_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_ALLOW_DERIVATIVES_BIT_KHR) return "VK_PIPELINE_CREATE_2_ALLOW_DERIVATIVES_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_DERIVATIVE_BIT_KHR) return "VK_PIPELINE_CREATE_2_DERIVATIVE_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR) return "VK_PIPELINE_CREATE_2_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_DISPATCH_BASE_BIT_KHR) return "VK_PIPELINE_CREATE_2_DISPATCH_BASE_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_DEFER_COMPILE_BIT_NV) return "VK_PIPELINE_CREATE_2_DEFER_COMPILE_BIT_NV"; + if (input_value == VK_PIPELINE_CREATE_2_CAPTURE_STATISTICS_BIT_KHR) return "VK_PIPELINE_CREATE_2_CAPTURE_STATISTICS_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR) return "VK_PIPELINE_CREATE_2_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_KHR) return "VK_PIPELINE_CREATE_2_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR) return "VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT) return "VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT"; + if (input_value == VK_PIPELINE_CREATE_2_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT) return "VK_PIPELINE_CREATE_2_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT"; + if (input_value == VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR) return "VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR) return "VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_AABBS_BIT_KHR) return "VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_AABBS_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR) return "VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR) return "VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR) return "VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR) return "VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR) return "VK_PIPELINE_CREATE_2_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_NV) return "VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_NV"; + if (input_value == VK_PIPELINE_CREATE_2_RAY_TRACING_ALLOW_MOTION_BIT_NV) return "VK_PIPELINE_CREATE_2_RAY_TRACING_ALLOW_MOTION_BIT_NV"; + if (input_value == VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR) return "VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"; + if (input_value == VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT) return "VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT"; + if (input_value == VK_PIPELINE_CREATE_2_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT) return "VK_PIPELINE_CREATE_2_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT"; + if (input_value == VK_PIPELINE_CREATE_2_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT) return "VK_PIPELINE_CREATE_2_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT"; + if (input_value == VK_PIPELINE_CREATE_2_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT) return "VK_PIPELINE_CREATE_2_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT"; + if (input_value == VK_PIPELINE_CREATE_2_NO_PROTECTED_ACCESS_BIT_EXT) return "VK_PIPELINE_CREATE_2_NO_PROTECTED_ACCESS_BIT_EXT"; + if (input_value == VK_PIPELINE_CREATE_2_PROTECTED_ACCESS_ONLY_BIT_EXT) return "VK_PIPELINE_CREATE_2_PROTECTED_ACCESS_ONLY_BIT_EXT"; + if (input_value == VK_PIPELINE_CREATE_2_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV) return "VK_PIPELINE_CREATE_2_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV"; + if (input_value == VK_PIPELINE_CREATE_2_DESCRIPTOR_BUFFER_BIT_EXT) return "VK_PIPELINE_CREATE_2_DESCRIPTOR_BUFFER_BIT_EXT"; + return "Unhandled VkPipelineCreateFlagBits2KHR"; +} + +#ifdef __cplusplus static inline std::string string_VkPipelineCreateFlags2KHR(VkPipelineCreateFlags2KHR input_value) { std::string ret; int index = 0; @@ -7778,69 +7895,42 @@ static inline std::string string_VkPipelineCreateFlags2KHR(VkPipelineCreateFlags if (ret.empty()) ret.append("VkPipelineCreateFlags2KHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkBufferUsageFlagBits2KHR(uint64_t input_value) { - switch (input_value) { - case VK_BUFFER_USAGE_2_TRANSFER_SRC_BIT_KHR: - return "VK_BUFFER_USAGE_2_TRANSFER_SRC_BIT_KHR"; - case VK_BUFFER_USAGE_2_TRANSFER_DST_BIT_KHR: - return "VK_BUFFER_USAGE_2_TRANSFER_DST_BIT_KHR"; - case VK_BUFFER_USAGE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR: - return "VK_BUFFER_USAGE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR"; - case VK_BUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT_KHR: - return "VK_BUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT_KHR"; - case VK_BUFFER_USAGE_2_UNIFORM_BUFFER_BIT_KHR: - return "VK_BUFFER_USAGE_2_UNIFORM_BUFFER_BIT_KHR"; - case VK_BUFFER_USAGE_2_STORAGE_BUFFER_BIT_KHR: - return "VK_BUFFER_USAGE_2_STORAGE_BUFFER_BIT_KHR"; - case VK_BUFFER_USAGE_2_INDEX_BUFFER_BIT_KHR: - return "VK_BUFFER_USAGE_2_INDEX_BUFFER_BIT_KHR"; - case VK_BUFFER_USAGE_2_VERTEX_BUFFER_BIT_KHR: - return "VK_BUFFER_USAGE_2_VERTEX_BUFFER_BIT_KHR"; - case VK_BUFFER_USAGE_2_INDIRECT_BUFFER_BIT_KHR: - return "VK_BUFFER_USAGE_2_INDIRECT_BUFFER_BIT_KHR"; - case VK_BUFFER_USAGE_2_EXECUTION_GRAPH_SCRATCH_BIT_AMDX: - return "VK_BUFFER_USAGE_2_EXECUTION_GRAPH_SCRATCH_BIT_AMDX"; - case VK_BUFFER_USAGE_2_CONDITIONAL_RENDERING_BIT_EXT: - return "VK_BUFFER_USAGE_2_CONDITIONAL_RENDERING_BIT_EXT"; - case VK_BUFFER_USAGE_2_SHADER_BINDING_TABLE_BIT_KHR: - return "VK_BUFFER_USAGE_2_SHADER_BINDING_TABLE_BIT_KHR"; - case VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT: - return "VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT"; - case VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT: - return "VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT"; - case VK_BUFFER_USAGE_2_VIDEO_DECODE_SRC_BIT_KHR: - return "VK_BUFFER_USAGE_2_VIDEO_DECODE_SRC_BIT_KHR"; - case VK_BUFFER_USAGE_2_VIDEO_DECODE_DST_BIT_KHR: - return "VK_BUFFER_USAGE_2_VIDEO_DECODE_DST_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_TRANSFER_SRC_BIT_KHR) return "VK_BUFFER_USAGE_2_TRANSFER_SRC_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_TRANSFER_DST_BIT_KHR) return "VK_BUFFER_USAGE_2_TRANSFER_DST_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR) return "VK_BUFFER_USAGE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT_KHR) return "VK_BUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_UNIFORM_BUFFER_BIT_KHR) return "VK_BUFFER_USAGE_2_UNIFORM_BUFFER_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_STORAGE_BUFFER_BIT_KHR) return "VK_BUFFER_USAGE_2_STORAGE_BUFFER_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_INDEX_BUFFER_BIT_KHR) return "VK_BUFFER_USAGE_2_INDEX_BUFFER_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_VERTEX_BUFFER_BIT_KHR) return "VK_BUFFER_USAGE_2_VERTEX_BUFFER_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_INDIRECT_BUFFER_BIT_KHR) return "VK_BUFFER_USAGE_2_INDIRECT_BUFFER_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_EXECUTION_GRAPH_SCRATCH_BIT_AMDX) return "VK_BUFFER_USAGE_2_EXECUTION_GRAPH_SCRATCH_BIT_AMDX"; + if (input_value == VK_BUFFER_USAGE_2_CONDITIONAL_RENDERING_BIT_EXT) return "VK_BUFFER_USAGE_2_CONDITIONAL_RENDERING_BIT_EXT"; + if (input_value == VK_BUFFER_USAGE_2_SHADER_BINDING_TABLE_BIT_KHR) return "VK_BUFFER_USAGE_2_SHADER_BINDING_TABLE_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT) return "VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT"; + if (input_value == VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT) return "VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT"; + if (input_value == VK_BUFFER_USAGE_2_VIDEO_DECODE_SRC_BIT_KHR) return "VK_BUFFER_USAGE_2_VIDEO_DECODE_SRC_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_VIDEO_DECODE_DST_BIT_KHR) return "VK_BUFFER_USAGE_2_VIDEO_DECODE_DST_BIT_KHR"; #ifdef VK_ENABLE_BETA_EXTENSIONS - case VK_BUFFER_USAGE_2_VIDEO_ENCODE_DST_BIT_KHR: - return "VK_BUFFER_USAGE_2_VIDEO_ENCODE_DST_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_VIDEO_ENCODE_DST_BIT_KHR) return "VK_BUFFER_USAGE_2_VIDEO_ENCODE_DST_BIT_KHR"; #endif //VK_ENABLE_BETA_EXTENSIONS #ifdef VK_ENABLE_BETA_EXTENSIONS - case VK_BUFFER_USAGE_2_VIDEO_ENCODE_SRC_BIT_KHR: - return "VK_BUFFER_USAGE_2_VIDEO_ENCODE_SRC_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_VIDEO_ENCODE_SRC_BIT_KHR) return "VK_BUFFER_USAGE_2_VIDEO_ENCODE_SRC_BIT_KHR"; #endif //VK_ENABLE_BETA_EXTENSIONS - case VK_BUFFER_USAGE_2_SHADER_DEVICE_ADDRESS_BIT_KHR: - return "VK_BUFFER_USAGE_2_SHADER_DEVICE_ADDRESS_BIT_KHR"; - case VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR: - return "VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR"; - case VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR: - return "VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR"; - case VK_BUFFER_USAGE_2_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT: - return "VK_BUFFER_USAGE_2_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT"; - case VK_BUFFER_USAGE_2_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT: - return "VK_BUFFER_USAGE_2_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT"; - case VK_BUFFER_USAGE_2_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT: - return "VK_BUFFER_USAGE_2_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT"; - case VK_BUFFER_USAGE_2_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT: - return "VK_BUFFER_USAGE_2_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT"; - case VK_BUFFER_USAGE_2_MICROMAP_STORAGE_BIT_EXT: - return "VK_BUFFER_USAGE_2_MICROMAP_STORAGE_BIT_EXT"; - default: - return "Unhandled VkBufferUsageFlagBits2KHR"; - } -} - + if (input_value == VK_BUFFER_USAGE_2_SHADER_DEVICE_ADDRESS_BIT_KHR) return "VK_BUFFER_USAGE_2_SHADER_DEVICE_ADDRESS_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR) return "VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR) return "VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR"; + if (input_value == VK_BUFFER_USAGE_2_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT) return "VK_BUFFER_USAGE_2_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT"; + if (input_value == VK_BUFFER_USAGE_2_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT) return "VK_BUFFER_USAGE_2_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT"; + if (input_value == VK_BUFFER_USAGE_2_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT) return "VK_BUFFER_USAGE_2_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT"; + if (input_value == VK_BUFFER_USAGE_2_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT) return "VK_BUFFER_USAGE_2_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT"; + if (input_value == VK_BUFFER_USAGE_2_MICROMAP_STORAGE_BIT_EXT) return "VK_BUFFER_USAGE_2_MICROMAP_STORAGE_BIT_EXT"; + return "Unhandled VkBufferUsageFlagBits2KHR"; +} + +#ifdef __cplusplus static inline std::string string_VkBufferUsageFlags2KHR(VkBufferUsageFlags2KHR input_value) { std::string ret; int index = 0; @@ -7855,6 +7945,7 @@ static inline std::string string_VkBufferUsageFlags2KHR(VkBufferUsageFlags2KHR i if (ret.empty()) ret.append("VkBufferUsageFlags2KHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDebugReportFlagBitsEXT(VkDebugReportFlagBitsEXT input_value) { switch (input_value) { case VK_DEBUG_REPORT_INFORMATION_BIT_EXT: @@ -7872,6 +7963,7 @@ static inline const char* string_VkDebugReportFlagBitsEXT(VkDebugReportFlagBitsE } } +#ifdef __cplusplus static inline std::string string_VkDebugReportFlagsEXT(VkDebugReportFlagsEXT input_value) { std::string ret; int index = 0; @@ -7886,6 +7978,7 @@ static inline std::string string_VkDebugReportFlagsEXT(VkDebugReportFlagsEXT inp if (ret.empty()) ret.append("VkDebugReportFlagsEXT(0)"); return ret; } +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeH264CapabilityFlagBitsEXT(VkVideoEncodeH264CapabilityFlagBitsEXT input_value) { switch (input_value) { @@ -7912,6 +8005,7 @@ static inline const char* string_VkVideoEncodeH264CapabilityFlagBitsEXT(VkVideoE } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeH264CapabilityFlagsEXT(VkVideoEncodeH264CapabilityFlagsEXT input_value) { std::string ret; int index = 0; @@ -7927,6 +8021,7 @@ static inline std::string string_VkVideoEncodeH264CapabilityFlagsEXT(VkVideoEnco return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeH264StdFlagBitsEXT(VkVideoEncodeH264StdFlagBitsEXT input_value) { switch (input_value) { @@ -7966,11 +8061,16 @@ static inline const char* string_VkVideoEncodeH264StdFlagBitsEXT(VkVideoEncodeH2 return "VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_ENABLED_BIT_EXT"; case VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_PARTIAL_BIT_EXT: return "VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_PARTIAL_BIT_EXT"; + case VK_VIDEO_ENCODE_H264_STD_SLICE_QP_DELTA_BIT_EXT: + return "VK_VIDEO_ENCODE_H264_STD_SLICE_QP_DELTA_BIT_EXT"; + case VK_VIDEO_ENCODE_H264_STD_DIFFERENT_SLICE_QP_DELTA_BIT_EXT: + return "VK_VIDEO_ENCODE_H264_STD_DIFFERENT_SLICE_QP_DELTA_BIT_EXT"; default: return "Unhandled VkVideoEncodeH264StdFlagBitsEXT"; } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeH264StdFlagsEXT(VkVideoEncodeH264StdFlagsEXT input_value) { std::string ret; int index = 0; @@ -7986,6 +8086,7 @@ static inline std::string string_VkVideoEncodeH264StdFlagsEXT(VkVideoEncodeH264S return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeH264RateControlFlagBitsEXT(VkVideoEncodeH264RateControlFlagBitsEXT input_value) { switch (input_value) { @@ -8004,6 +8105,7 @@ static inline const char* string_VkVideoEncodeH264RateControlFlagBitsEXT(VkVideo } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeH264RateControlFlagsEXT(VkVideoEncodeH264RateControlFlagsEXT input_value) { std::string ret; int index = 0; @@ -8019,6 +8121,7 @@ static inline std::string string_VkVideoEncodeH264RateControlFlagsEXT(VkVideoEnc return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeH265CapabilityFlagBitsEXT(VkVideoEncodeH265CapabilityFlagBitsEXT input_value) { switch (input_value) { @@ -8047,6 +8150,7 @@ static inline const char* string_VkVideoEncodeH265CapabilityFlagBitsEXT(VkVideoE } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeH265CapabilityFlagsEXT(VkVideoEncodeH265CapabilityFlagsEXT input_value) { std::string ret; int index = 0; @@ -8062,6 +8166,7 @@ static inline std::string string_VkVideoEncodeH265CapabilityFlagsEXT(VkVideoEnco return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeH265StdFlagBitsEXT(VkVideoEncodeH265StdFlagBitsEXT input_value) { switch (input_value) { @@ -8103,11 +8208,16 @@ static inline const char* string_VkVideoEncodeH265StdFlagBitsEXT(VkVideoEncodeH2 return "VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENTS_ENABLED_FLAG_SET_BIT_EXT"; case VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_EXT: return "VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_EXT"; + case VK_VIDEO_ENCODE_H265_STD_SLICE_QP_DELTA_BIT_EXT: + return "VK_VIDEO_ENCODE_H265_STD_SLICE_QP_DELTA_BIT_EXT"; + case VK_VIDEO_ENCODE_H265_STD_DIFFERENT_SLICE_QP_DELTA_BIT_EXT: + return "VK_VIDEO_ENCODE_H265_STD_DIFFERENT_SLICE_QP_DELTA_BIT_EXT"; default: return "Unhandled VkVideoEncodeH265StdFlagBitsEXT"; } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeH265StdFlagsEXT(VkVideoEncodeH265StdFlagsEXT input_value) { std::string ret; int index = 0; @@ -8123,6 +8233,7 @@ static inline std::string string_VkVideoEncodeH265StdFlagsEXT(VkVideoEncodeH265S return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeH265CtbSizeFlagBitsEXT(VkVideoEncodeH265CtbSizeFlagBitsEXT input_value) { switch (input_value) { @@ -8137,6 +8248,7 @@ static inline const char* string_VkVideoEncodeH265CtbSizeFlagBitsEXT(VkVideoEnco } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeH265CtbSizeFlagsEXT(VkVideoEncodeH265CtbSizeFlagsEXT input_value) { std::string ret; int index = 0; @@ -8152,6 +8264,7 @@ static inline std::string string_VkVideoEncodeH265CtbSizeFlagsEXT(VkVideoEncodeH return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeH265TransformBlockSizeFlagBitsEXT(VkVideoEncodeH265TransformBlockSizeFlagBitsEXT input_value) { switch (input_value) { @@ -8168,6 +8281,7 @@ static inline const char* string_VkVideoEncodeH265TransformBlockSizeFlagBitsEXT( } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeH265TransformBlockSizeFlagsEXT(VkVideoEncodeH265TransformBlockSizeFlagsEXT input_value) { std::string ret; int index = 0; @@ -8183,6 +8297,7 @@ static inline std::string string_VkVideoEncodeH265TransformBlockSizeFlagsEXT(VkV return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus #ifdef VK_ENABLE_BETA_EXTENSIONS static inline const char* string_VkVideoEncodeH265RateControlFlagBitsEXT(VkVideoEncodeH265RateControlFlagBitsEXT input_value) { switch (input_value) { @@ -8201,6 +8316,7 @@ static inline const char* string_VkVideoEncodeH265RateControlFlagBitsEXT(VkVideo } } +#ifdef __cplusplus static inline std::string string_VkVideoEncodeH265RateControlFlagsEXT(VkVideoEncodeH265RateControlFlagsEXT input_value) { std::string ret; int index = 0; @@ -8216,6 +8332,7 @@ static inline std::string string_VkVideoEncodeH265RateControlFlagsEXT(VkVideoEnc return ret; } #endif //VK_ENABLE_BETA_EXTENSIONS +#endif // __cplusplus static inline const char* string_VkExternalMemoryHandleTypeFlagBitsNV(VkExternalMemoryHandleTypeFlagBitsNV input_value) { switch (input_value) { case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV: @@ -8231,6 +8348,7 @@ static inline const char* string_VkExternalMemoryHandleTypeFlagBitsNV(VkExternal } } +#ifdef __cplusplus static inline std::string string_VkExternalMemoryHandleTypeFlagsNV(VkExternalMemoryHandleTypeFlagsNV input_value) { std::string ret; int index = 0; @@ -8245,6 +8363,7 @@ static inline std::string string_VkExternalMemoryHandleTypeFlagsNV(VkExternalMem if (ret.empty()) ret.append("VkExternalMemoryHandleTypeFlagsNV(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkExternalMemoryFeatureFlagBitsNV(VkExternalMemoryFeatureFlagBitsNV input_value) { switch (input_value) { case VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV: @@ -8258,6 +8377,7 @@ static inline const char* string_VkExternalMemoryFeatureFlagBitsNV(VkExternalMem } } +#ifdef __cplusplus static inline std::string string_VkExternalMemoryFeatureFlagsNV(VkExternalMemoryFeatureFlagsNV input_value) { std::string ret; int index = 0; @@ -8272,6 +8392,7 @@ static inline std::string string_VkExternalMemoryFeatureFlagsNV(VkExternalMemory if (ret.empty()) ret.append("VkExternalMemoryFeatureFlagsNV(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkConditionalRenderingFlagBitsEXT(VkConditionalRenderingFlagBitsEXT input_value) { switch (input_value) { case VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT: @@ -8281,6 +8402,7 @@ static inline const char* string_VkConditionalRenderingFlagBitsEXT(VkConditional } } +#ifdef __cplusplus static inline std::string string_VkConditionalRenderingFlagsEXT(VkConditionalRenderingFlagsEXT input_value) { std::string ret; int index = 0; @@ -8295,6 +8417,7 @@ static inline std::string string_VkConditionalRenderingFlagsEXT(VkConditionalRen if (ret.empty()) ret.append("VkConditionalRenderingFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkSurfaceCounterFlagBitsEXT(VkSurfaceCounterFlagBitsEXT input_value) { switch (input_value) { case VK_SURFACE_COUNTER_VBLANK_BIT_EXT: @@ -8304,6 +8427,7 @@ static inline const char* string_VkSurfaceCounterFlagBitsEXT(VkSurfaceCounterFla } } +#ifdef __cplusplus static inline std::string string_VkSurfaceCounterFlagsEXT(VkSurfaceCounterFlagsEXT input_value) { std::string ret; int index = 0; @@ -8318,6 +8442,7 @@ static inline std::string string_VkSurfaceCounterFlagsEXT(VkSurfaceCounterFlagsE if (ret.empty()) ret.append("VkSurfaceCounterFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDebugUtilsMessageSeverityFlagBitsEXT(VkDebugUtilsMessageSeverityFlagBitsEXT input_value) { switch (input_value) { case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT: @@ -8333,6 +8458,7 @@ static inline const char* string_VkDebugUtilsMessageSeverityFlagBitsEXT(VkDebugU } } +#ifdef __cplusplus static inline std::string string_VkDebugUtilsMessageSeverityFlagsEXT(VkDebugUtilsMessageSeverityFlagsEXT input_value) { std::string ret; int index = 0; @@ -8347,6 +8473,7 @@ static inline std::string string_VkDebugUtilsMessageSeverityFlagsEXT(VkDebugUtil if (ret.empty()) ret.append("VkDebugUtilsMessageSeverityFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDebugUtilsMessageTypeFlagBitsEXT(VkDebugUtilsMessageTypeFlagBitsEXT input_value) { switch (input_value) { case VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT: @@ -8362,6 +8489,7 @@ static inline const char* string_VkDebugUtilsMessageTypeFlagBitsEXT(VkDebugUtils } } +#ifdef __cplusplus static inline std::string string_VkDebugUtilsMessageTypeFlagsEXT(VkDebugUtilsMessageTypeFlagsEXT input_value) { std::string ret; int index = 0; @@ -8376,6 +8504,7 @@ static inline std::string string_VkDebugUtilsMessageTypeFlagsEXT(VkDebugUtilsMes if (ret.empty()) ret.append("VkDebugUtilsMessageTypeFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkGeometryFlagBitsKHR(VkGeometryFlagBitsKHR input_value) { switch (input_value) { case VK_GEOMETRY_OPAQUE_BIT_KHR: @@ -8387,6 +8516,7 @@ static inline const char* string_VkGeometryFlagBitsKHR(VkGeometryFlagBitsKHR inp } } +#ifdef __cplusplus static inline std::string string_VkGeometryFlagsKHR(VkGeometryFlagsKHR input_value) { std::string ret; int index = 0; @@ -8401,6 +8531,7 @@ static inline std::string string_VkGeometryFlagsKHR(VkGeometryFlagsKHR input_val if (ret.empty()) ret.append("VkGeometryFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkGeometryInstanceFlagBitsKHR(VkGeometryInstanceFlagBitsKHR input_value) { switch (input_value) { case VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR: @@ -8420,6 +8551,7 @@ static inline const char* string_VkGeometryInstanceFlagBitsKHR(VkGeometryInstanc } } +#ifdef __cplusplus static inline std::string string_VkGeometryInstanceFlagsKHR(VkGeometryInstanceFlagsKHR input_value) { std::string ret; int index = 0; @@ -8434,6 +8566,7 @@ static inline std::string string_VkGeometryInstanceFlagsKHR(VkGeometryInstanceFl if (ret.empty()) ret.append("VkGeometryInstanceFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkBuildAccelerationStructureFlagBitsKHR(VkBuildAccelerationStructureFlagBitsKHR input_value) { switch (input_value) { case VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR: @@ -8465,6 +8598,7 @@ static inline const char* string_VkBuildAccelerationStructureFlagBitsKHR(VkBuild } } +#ifdef __cplusplus static inline std::string string_VkBuildAccelerationStructureFlagsKHR(VkBuildAccelerationStructureFlagsKHR input_value) { std::string ret; int index = 0; @@ -8479,6 +8613,7 @@ static inline std::string string_VkBuildAccelerationStructureFlagsKHR(VkBuildAcc if (ret.empty()) ret.append("VkBuildAccelerationStructureFlagsKHR(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkHostImageCopyFlagBitsEXT(VkHostImageCopyFlagBitsEXT input_value) { switch (input_value) { case VK_HOST_IMAGE_COPY_MEMCPY_EXT: @@ -8488,6 +8623,7 @@ static inline const char* string_VkHostImageCopyFlagBitsEXT(VkHostImageCopyFlagB } } +#ifdef __cplusplus static inline std::string string_VkHostImageCopyFlagsEXT(VkHostImageCopyFlagsEXT input_value) { std::string ret; int index = 0; @@ -8502,6 +8638,7 @@ static inline std::string string_VkHostImageCopyFlagsEXT(VkHostImageCopyFlagsEXT if (ret.empty()) ret.append("VkHostImageCopyFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPresentScalingFlagBitsEXT(VkPresentScalingFlagBitsEXT input_value) { switch (input_value) { case VK_PRESENT_SCALING_ONE_TO_ONE_BIT_EXT: @@ -8515,6 +8652,7 @@ static inline const char* string_VkPresentScalingFlagBitsEXT(VkPresentScalingFla } } +#ifdef __cplusplus static inline std::string string_VkPresentScalingFlagsEXT(VkPresentScalingFlagsEXT input_value) { std::string ret; int index = 0; @@ -8529,6 +8667,7 @@ static inline std::string string_VkPresentScalingFlagsEXT(VkPresentScalingFlagsE if (ret.empty()) ret.append("VkPresentScalingFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkPresentGravityFlagBitsEXT(VkPresentGravityFlagBitsEXT input_value) { switch (input_value) { case VK_PRESENT_GRAVITY_MIN_BIT_EXT: @@ -8542,6 +8681,7 @@ static inline const char* string_VkPresentGravityFlagBitsEXT(VkPresentGravityFla } } +#ifdef __cplusplus static inline std::string string_VkPresentGravityFlagsEXT(VkPresentGravityFlagsEXT input_value) { std::string ret; int index = 0; @@ -8556,6 +8696,7 @@ static inline std::string string_VkPresentGravityFlagsEXT(VkPresentGravityFlagsE if (ret.empty()) ret.append("VkPresentGravityFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkIndirectStateFlagBitsNV(VkIndirectStateFlagBitsNV input_value) { switch (input_value) { case VK_INDIRECT_STATE_FLAG_FRONTFACE_BIT_NV: @@ -8565,6 +8706,7 @@ static inline const char* string_VkIndirectStateFlagBitsNV(VkIndirectStateFlagBi } } +#ifdef __cplusplus static inline std::string string_VkIndirectStateFlagsNV(VkIndirectStateFlagsNV input_value) { std::string ret; int index = 0; @@ -8579,6 +8721,7 @@ static inline std::string string_VkIndirectStateFlagsNV(VkIndirectStateFlagsNV i if (ret.empty()) ret.append("VkIndirectStateFlagsNV(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkIndirectCommandsLayoutUsageFlagBitsNV(VkIndirectCommandsLayoutUsageFlagBitsNV input_value) { switch (input_value) { case VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_NV: @@ -8592,6 +8735,7 @@ static inline const char* string_VkIndirectCommandsLayoutUsageFlagBitsNV(VkIndir } } +#ifdef __cplusplus static inline std::string string_VkIndirectCommandsLayoutUsageFlagsNV(VkIndirectCommandsLayoutUsageFlagsNV input_value) { std::string ret; int index = 0; @@ -8606,6 +8750,7 @@ static inline std::string string_VkIndirectCommandsLayoutUsageFlagsNV(VkIndirect if (ret.empty()) ret.append("VkIndirectCommandsLayoutUsageFlagsNV(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDeviceDiagnosticsConfigFlagBitsNV(VkDeviceDiagnosticsConfigFlagBitsNV input_value) { switch (input_value) { case VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_DEBUG_INFO_BIT_NV: @@ -8621,6 +8766,7 @@ static inline const char* string_VkDeviceDiagnosticsConfigFlagBitsNV(VkDeviceDia } } +#ifdef __cplusplus static inline std::string string_VkDeviceDiagnosticsConfigFlagsNV(VkDeviceDiagnosticsConfigFlagsNV input_value) { std::string ret; int index = 0; @@ -8635,6 +8781,7 @@ static inline std::string string_VkDeviceDiagnosticsConfigFlagsNV(VkDeviceDiagno if (ret.empty()) ret.append("VkDeviceDiagnosticsConfigFlagsNV(0)"); return ret; } +#endif // __cplusplus #ifdef VK_USE_PLATFORM_METAL_EXT static inline const char* string_VkExportMetalObjectTypeFlagBitsEXT(VkExportMetalObjectTypeFlagBitsEXT input_value) { switch (input_value) { @@ -8655,6 +8802,7 @@ static inline const char* string_VkExportMetalObjectTypeFlagBitsEXT(VkExportMeta } } +#ifdef __cplusplus static inline std::string string_VkExportMetalObjectTypeFlagsEXT(VkExportMetalObjectTypeFlagsEXT input_value) { std::string ret; int index = 0; @@ -8670,6 +8818,7 @@ static inline std::string string_VkExportMetalObjectTypeFlagsEXT(VkExportMetalOb return ret; } #endif //VK_USE_PLATFORM_METAL_EXT +#endif // __cplusplus static inline const char* string_VkGraphicsPipelineLibraryFlagBitsEXT(VkGraphicsPipelineLibraryFlagBitsEXT input_value) { switch (input_value) { case VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT: @@ -8685,6 +8834,7 @@ static inline const char* string_VkGraphicsPipelineLibraryFlagBitsEXT(VkGraphics } } +#ifdef __cplusplus static inline std::string string_VkGraphicsPipelineLibraryFlagsEXT(VkGraphicsPipelineLibraryFlagsEXT input_value) { std::string ret; int index = 0; @@ -8699,6 +8849,7 @@ static inline std::string string_VkGraphicsPipelineLibraryFlagsEXT(VkGraphicsPip if (ret.empty()) ret.append("VkGraphicsPipelineLibraryFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkImageCompressionFlagBitsEXT(VkImageCompressionFlagBitsEXT input_value) { switch (input_value) { case VK_IMAGE_COMPRESSION_DEFAULT_EXT: @@ -8714,6 +8865,7 @@ static inline const char* string_VkImageCompressionFlagBitsEXT(VkImageCompressio } } +#ifdef __cplusplus static inline std::string string_VkImageCompressionFlagsEXT(VkImageCompressionFlagsEXT input_value) { std::string ret; int index = 0; @@ -8728,6 +8880,7 @@ static inline std::string string_VkImageCompressionFlagsEXT(VkImageCompressionFl if (ret.empty()) ret.append("VkImageCompressionFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkImageCompressionFixedRateFlagBitsEXT(VkImageCompressionFixedRateFlagBitsEXT input_value) { switch (input_value) { case VK_IMAGE_COMPRESSION_FIXED_RATE_NONE_EXT: @@ -8785,6 +8938,7 @@ static inline const char* string_VkImageCompressionFixedRateFlagBitsEXT(VkImageC } } +#ifdef __cplusplus static inline std::string string_VkImageCompressionFixedRateFlagsEXT(VkImageCompressionFixedRateFlagsEXT input_value) { std::string ret; int index = 0; @@ -8799,6 +8953,7 @@ static inline std::string string_VkImageCompressionFixedRateFlagsEXT(VkImageComp if (ret.empty()) ret.append("VkImageCompressionFixedRateFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkDeviceAddressBindingFlagBitsEXT(VkDeviceAddressBindingFlagBitsEXT input_value) { switch (input_value) { case VK_DEVICE_ADDRESS_BINDING_INTERNAL_OBJECT_BIT_EXT: @@ -8808,6 +8963,7 @@ static inline const char* string_VkDeviceAddressBindingFlagBitsEXT(VkDeviceAddre } } +#ifdef __cplusplus static inline std::string string_VkDeviceAddressBindingFlagsEXT(VkDeviceAddressBindingFlagsEXT input_value) { std::string ret; int index = 0; @@ -8822,6 +8978,7 @@ static inline std::string string_VkDeviceAddressBindingFlagsEXT(VkDeviceAddressB if (ret.empty()) ret.append("VkDeviceAddressBindingFlagsEXT(0)"); return ret; } +#endif // __cplusplus #ifdef VK_USE_PLATFORM_FUCHSIA static inline const char* string_VkImageConstraintsInfoFlagBitsFUCHSIA(VkImageConstraintsInfoFlagBitsFUCHSIA input_value) { switch (input_value) { @@ -8840,6 +8997,7 @@ static inline const char* string_VkImageConstraintsInfoFlagBitsFUCHSIA(VkImageCo } } +#ifdef __cplusplus static inline std::string string_VkImageConstraintsInfoFlagsFUCHSIA(VkImageConstraintsInfoFlagsFUCHSIA input_value) { std::string ret; int index = 0; @@ -8855,6 +9013,32 @@ static inline std::string string_VkImageConstraintsInfoFlagsFUCHSIA(VkImageConst return ret; } #endif //VK_USE_PLATFORM_FUCHSIA +#endif // __cplusplus +static inline const char* string_VkFrameBoundaryFlagBitsEXT(VkFrameBoundaryFlagBitsEXT input_value) { + switch (input_value) { + case VK_FRAME_BOUNDARY_FRAME_END_BIT_EXT: + return "VK_FRAME_BOUNDARY_FRAME_END_BIT_EXT"; + default: + return "Unhandled VkFrameBoundaryFlagBitsEXT"; + } +} + +#ifdef __cplusplus +static inline std::string string_VkFrameBoundaryFlagsEXT(VkFrameBoundaryFlagsEXT input_value) { + std::string ret; + int index = 0; + while(input_value) { + if (input_value & 1) { + if( !ret.empty()) ret.append("|"); + ret.append(string_VkFrameBoundaryFlagBitsEXT(static_cast<VkFrameBoundaryFlagBitsEXT>(1U << index))); + } + ++index; + input_value >>= 1; + } + if (ret.empty()) ret.append("VkFrameBoundaryFlagsEXT(0)"); + return ret; +} +#endif // __cplusplus static inline const char* string_VkBuildMicromapFlagBitsEXT(VkBuildMicromapFlagBitsEXT input_value) { switch (input_value) { case VK_BUILD_MICROMAP_PREFER_FAST_TRACE_BIT_EXT: @@ -8868,6 +9052,7 @@ static inline const char* string_VkBuildMicromapFlagBitsEXT(VkBuildMicromapFlagB } } +#ifdef __cplusplus static inline std::string string_VkBuildMicromapFlagsEXT(VkBuildMicromapFlagsEXT input_value) { std::string ret; int index = 0; @@ -8882,6 +9067,7 @@ static inline std::string string_VkBuildMicromapFlagsEXT(VkBuildMicromapFlagsEXT if (ret.empty()) ret.append("VkBuildMicromapFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkMicromapCreateFlagBitsEXT(VkMicromapCreateFlagBitsEXT input_value) { switch (input_value) { case VK_MICROMAP_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT: @@ -8891,6 +9077,7 @@ static inline const char* string_VkMicromapCreateFlagBitsEXT(VkMicromapCreateFla } } +#ifdef __cplusplus static inline std::string string_VkMicromapCreateFlagsEXT(VkMicromapCreateFlagsEXT input_value) { std::string ret; int index = 0; @@ -8905,15 +9092,13 @@ static inline std::string string_VkMicromapCreateFlagsEXT(VkMicromapCreateFlagsE if (ret.empty()) ret.append("VkMicromapCreateFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkMemoryDecompressionMethodFlagBitsNV(uint64_t input_value) { - switch (input_value) { - case VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV: - return "VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV"; - default: - return "Unhandled VkMemoryDecompressionMethodFlagBitsNV"; - } + if (input_value == VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV) return "VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV"; + return "Unhandled VkMemoryDecompressionMethodFlagBitsNV"; } +#ifdef __cplusplus static inline std::string string_VkMemoryDecompressionMethodFlagsNV(VkMemoryDecompressionMethodFlagsNV input_value) { std::string ret; int index = 0; @@ -8928,6 +9113,7 @@ static inline std::string string_VkMemoryDecompressionMethodFlagsNV(VkMemoryDeco if (ret.empty()) ret.append("VkMemoryDecompressionMethodFlagsNV(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkOpticalFlowGridSizeFlagBitsNV(VkOpticalFlowGridSizeFlagBitsNV input_value) { switch (input_value) { case VK_OPTICAL_FLOW_GRID_SIZE_UNKNOWN_NV: @@ -8945,6 +9131,7 @@ static inline const char* string_VkOpticalFlowGridSizeFlagBitsNV(VkOpticalFlowGr } } +#ifdef __cplusplus static inline std::string string_VkOpticalFlowGridSizeFlagsNV(VkOpticalFlowGridSizeFlagsNV input_value) { std::string ret; int index = 0; @@ -8959,6 +9146,7 @@ static inline std::string string_VkOpticalFlowGridSizeFlagsNV(VkOpticalFlowGridS if (ret.empty()) ret.append("VkOpticalFlowGridSizeFlagsNV(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkOpticalFlowUsageFlagBitsNV(VkOpticalFlowUsageFlagBitsNV input_value) { switch (input_value) { case VK_OPTICAL_FLOW_USAGE_UNKNOWN_NV: @@ -8978,6 +9166,7 @@ static inline const char* string_VkOpticalFlowUsageFlagBitsNV(VkOpticalFlowUsage } } +#ifdef __cplusplus static inline std::string string_VkOpticalFlowUsageFlagsNV(VkOpticalFlowUsageFlagsNV input_value) { std::string ret; int index = 0; @@ -8992,6 +9181,7 @@ static inline std::string string_VkOpticalFlowUsageFlagsNV(VkOpticalFlowUsageFla if (ret.empty()) ret.append("VkOpticalFlowUsageFlagsNV(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkOpticalFlowSessionCreateFlagBitsNV(VkOpticalFlowSessionCreateFlagBitsNV input_value) { switch (input_value) { case VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_HINT_BIT_NV: @@ -9009,6 +9199,7 @@ static inline const char* string_VkOpticalFlowSessionCreateFlagBitsNV(VkOpticalF } } +#ifdef __cplusplus static inline std::string string_VkOpticalFlowSessionCreateFlagsNV(VkOpticalFlowSessionCreateFlagsNV input_value) { std::string ret; int index = 0; @@ -9023,6 +9214,7 @@ static inline std::string string_VkOpticalFlowSessionCreateFlagsNV(VkOpticalFlow if (ret.empty()) ret.append("VkOpticalFlowSessionCreateFlagsNV(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkOpticalFlowExecuteFlagBitsNV(VkOpticalFlowExecuteFlagBitsNV input_value) { switch (input_value) { case VK_OPTICAL_FLOW_EXECUTE_DISABLE_TEMPORAL_HINTS_BIT_NV: @@ -9032,6 +9224,7 @@ static inline const char* string_VkOpticalFlowExecuteFlagBitsNV(VkOpticalFlowExe } } +#ifdef __cplusplus static inline std::string string_VkOpticalFlowExecuteFlagsNV(VkOpticalFlowExecuteFlagsNV input_value) { std::string ret; int index = 0; @@ -9046,6 +9239,7 @@ static inline std::string string_VkOpticalFlowExecuteFlagsNV(VkOpticalFlowExecut if (ret.empty()) ret.append("VkOpticalFlowExecuteFlagsNV(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkShaderCreateFlagBitsEXT(VkShaderCreateFlagBitsEXT input_value) { switch (input_value) { case VK_SHADER_CREATE_LINK_STAGE_BIT_EXT: @@ -9067,6 +9261,7 @@ static inline const char* string_VkShaderCreateFlagBitsEXT(VkShaderCreateFlagBit } } +#ifdef __cplusplus static inline std::string string_VkShaderCreateFlagsEXT(VkShaderCreateFlagsEXT input_value) { std::string ret; int index = 0; @@ -9081,6 +9276,7 @@ static inline std::string string_VkShaderCreateFlagsEXT(VkShaderCreateFlagsEXT i if (ret.empty()) ret.append("VkShaderCreateFlagsEXT(0)"); return ret; } +#endif // __cplusplus static inline const char* string_VkAccelerationStructureCreateFlagBitsKHR(VkAccelerationStructureCreateFlagBitsKHR input_value) { switch (input_value) { case VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR: @@ -9094,6 +9290,7 @@ static inline const char* string_VkAccelerationStructureCreateFlagBitsKHR(VkAcce } } +#ifdef __cplusplus static inline std::string string_VkAccelerationStructureCreateFlagsKHR(VkAccelerationStructureCreateFlagsKHR input_value) { std::string ret; int index = 0; @@ -9108,4 +9305,5 @@ static inline std::string string_VkAccelerationStructureCreateFlagsKHR(VkAcceler if (ret.empty()) ret.append("VkAccelerationStructureCreateFlagsKHR(0)"); return ret; } -// NOLINTEND +#endif // __cplusplus + |