diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/unix/ip_unix.cpp | 28 | ||||
-rw-r--r-- | drivers/unix/ip_unix.h | 8 | ||||
-rw-r--r-- | drivers/unix/net_socket_posix.cpp | 28 | ||||
-rw-r--r-- | drivers/unix/net_socket_posix.h | 24 | ||||
-rw-r--r-- | drivers/unix/os_unix.cpp | 2 | ||||
-rw-r--r-- | drivers/vulkan/rendering_device_vulkan.cpp | 4 | ||||
-rw-r--r-- | drivers/vulkan/vulkan_context.cpp | 94 | ||||
-rw-r--r-- | drivers/vulkan/vulkan_context.h | 8 |
8 files changed, 134 insertions, 62 deletions
diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp index 8ec1de4386..053e3fd9d6 100644 --- a/drivers/unix/ip_unix.cpp +++ b/drivers/unix/ip_unix.cpp @@ -75,8 +75,8 @@ #include <net/if.h> // Order is important on OpenBSD, leave as last #endif -static IP_Address _sockaddr2ip(struct sockaddr *p_addr) { - IP_Address ip; +static IPAddress _sockaddr2ip(struct sockaddr *p_addr) { + IPAddress ip; if (p_addr->sa_family == AF_INET) { struct sockaddr_in *addr = (struct sockaddr_in *)p_addr; @@ -89,7 +89,7 @@ static IP_Address _sockaddr2ip(struct sockaddr *p_addr) { return ip; }; -IP_Address IP_Unix::_resolve_hostname(const String &p_hostname, Type p_type) { +IPAddress IPUnix::_resolve_hostname(const String &p_hostname, Type p_type) { struct addrinfo hints; struct addrinfo *result = nullptr; @@ -108,7 +108,7 @@ IP_Address IP_Unix::_resolve_hostname(const String &p_hostname, Type p_type) { int s = getaddrinfo(p_hostname.utf8().get_data(), nullptr, &hints, &result); if (s != 0) { ERR_PRINT("getaddrinfo failed! Cannot resolve hostname."); - return IP_Address(); + return IPAddress(); }; if (result == nullptr || result->ai_addr == nullptr) { @@ -116,10 +116,10 @@ IP_Address IP_Unix::_resolve_hostname(const String &p_hostname, Type p_type) { if (result) { freeaddrinfo(result); } - return IP_Address(); + return IPAddress(); }; - IP_Address ip = _sockaddr2ip(result->ai_addr); + IPAddress ip = _sockaddr2ip(result->ai_addr); freeaddrinfo(result); @@ -130,7 +130,7 @@ IP_Address IP_Unix::_resolve_hostname(const String &p_hostname, Type p_type) { #if defined(UWP_ENABLED) -void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) const { +void IPUnix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) const { using namespace Windows::Networking; using namespace Windows::Networking::Connectivity; @@ -156,14 +156,14 @@ void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) co Interface_Info &info = E->get(); - IP_Address ip = IP_Address(hostname->CanonicalName->Data()); + IPAddress ip = IPAddress(hostname->CanonicalName->Data()); info.ip_addresses.push_front(ip); } } #else -void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) const { +void IPUnix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) const { ULONG buf_size = 1024; IP_ADAPTER_ADDRESSES *addrs; @@ -211,7 +211,7 @@ void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) co #else // UNIX -void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) const { +void IPUnix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) const { struct ifaddrs *ifAddrStruct = nullptr; struct ifaddrs *ifa = nullptr; int family; @@ -249,15 +249,15 @@ void IP_Unix::get_local_interfaces(Map<String, Interface_Info> *r_interfaces) co } #endif -void IP_Unix::make_default() { +void IPUnix::make_default() { _create = _create_unix; } -IP *IP_Unix::_create_unix() { - return memnew(IP_Unix); +IP *IPUnix::_create_unix() { + return memnew(IPUnix); } -IP_Unix::IP_Unix() { +IPUnix::IPUnix() { } #endif diff --git a/drivers/unix/ip_unix.h b/drivers/unix/ip_unix.h index ca2ee17f4e..e6479be6e5 100644 --- a/drivers/unix/ip_unix.h +++ b/drivers/unix/ip_unix.h @@ -35,10 +35,10 @@ #if defined(UNIX_ENABLED) || defined(WINDOWS_ENABLED) -class IP_Unix : public IP { - GDCLASS(IP_Unix, IP); +class IPUnix : public IP { + GDCLASS(IPUnix, IP); - virtual IP_Address _resolve_hostname(const String &p_hostname, IP::Type p_type) override; + virtual IPAddress _resolve_hostname(const String &p_hostname, IP::Type p_type) override; static IP *_create_unix(); @@ -46,7 +46,7 @@ public: virtual void get_local_interfaces(Map<String, Interface_Info> *r_interfaces) const override; static void make_default(); - IP_Unix(); + IPUnix(); }; #endif diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp index e2ad352c10..222aef998c 100644 --- a/drivers/unix/net_socket_posix.cpp +++ b/drivers/unix/net_socket_posix.cpp @@ -95,7 +95,7 @@ #endif -size_t NetSocketPosix::_set_addr_storage(struct sockaddr_storage *p_addr, const IP_Address &p_ip, uint16_t p_port, IP::Type p_ip_type) { +size_t NetSocketPosix::_set_addr_storage(struct sockaddr_storage *p_addr, const IPAddress &p_ip, uint16_t p_port, IP::Type p_ip_type) { memset(p_addr, 0, sizeof(struct sockaddr_storage)); if (p_ip_type == IP::TYPE_IPV6 || p_ip_type == IP::TYPE_ANY) { // IPv6 socket @@ -130,7 +130,7 @@ size_t NetSocketPosix::_set_addr_storage(struct sockaddr_storage *p_addr, const } } -void NetSocketPosix::_set_ip_port(struct sockaddr_storage *p_addr, IP_Address *r_ip, uint16_t *r_port) { +void NetSocketPosix::_set_ip_port(struct sockaddr_storage *p_addr, IPAddress *r_ip, uint16_t *r_port) { if (p_addr->ss_family == AF_INET) { struct sockaddr_in *addr4 = (struct sockaddr_in *)p_addr; if (r_ip) { @@ -233,7 +233,7 @@ NetSocketPosix::NetError NetSocketPosix::_get_socket_error() const { #pragma GCC diagnostic pop #endif -bool NetSocketPosix::_can_use_ip(const IP_Address &p_ip, const bool p_for_bind) const { +bool NetSocketPosix::_can_use_ip(const IPAddress &p_ip, const bool p_for_bind) const { if (p_for_bind && !(p_ip.is_valid() || p_ip.is_wildcard())) { return false; } else if (!p_for_bind && !p_ip.is_valid()) { @@ -244,7 +244,7 @@ bool NetSocketPosix::_can_use_ip(const IP_Address &p_ip, const bool p_for_bind) return !(_ip_type != IP::TYPE_ANY && !p_ip.is_wildcard() && _ip_type != type); } -_FORCE_INLINE_ Error NetSocketPosix::_change_multicast_group(IP_Address p_ip, String p_if_name, bool p_add) { +_FORCE_INLINE_ Error NetSocketPosix::_change_multicast_group(IPAddress p_ip, String p_if_name, bool p_add) { ERR_FAIL_COND_V(!is_open(), ERR_UNCONFIGURED); ERR_FAIL_COND_V(!_can_use_ip(p_ip, false), ERR_INVALID_PARAMETER); @@ -254,7 +254,7 @@ _FORCE_INLINE_ Error NetSocketPosix::_change_multicast_group(IP_Address p_ip, St int level = type == IP::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6; int ret = -1; - IP_Address if_ip; + IPAddress if_ip; uint32_t if_v6id = 0; Map<String, IP::Interface_Info> if_info; IP::get_singleton()->get_local_interfaces(&if_info); @@ -269,7 +269,7 @@ _FORCE_INLINE_ Error NetSocketPosix::_change_multicast_group(IP_Address p_ip, St break; // IPv6 uses index. } - for (List<IP_Address>::Element *F = c.ip_addresses.front(); F; F = F->next()) { + for (List<IPAddress>::Element *F = c.ip_addresses.front(); F; F = F->next()) { if (!F->get().is_ipv4()) { continue; // Wrong IP type } @@ -395,7 +395,7 @@ void NetSocketPosix::close() { _is_stream = false; } -Error NetSocketPosix::bind(IP_Address p_addr, uint16_t p_port) { +Error NetSocketPosix::bind(IPAddress p_addr, uint16_t p_port) { ERR_FAIL_COND_V(!is_open(), ERR_UNCONFIGURED); ERR_FAIL_COND_V(!_can_use_ip(p_addr, true), ERR_INVALID_PARAMETER); @@ -425,7 +425,7 @@ Error NetSocketPosix::listen(int p_max_pending) { return OK; } -Error NetSocketPosix::connect_to_host(IP_Address p_host, uint16_t p_port) { +Error NetSocketPosix::connect_to_host(IPAddress p_host, uint16_t p_port) { ERR_FAIL_COND_V(!is_open(), ERR_UNCONFIGURED); ERR_FAIL_COND_V(!_can_use_ip(p_host, false), ERR_INVALID_PARAMETER); @@ -559,7 +559,7 @@ Error NetSocketPosix::recv(uint8_t *p_buffer, int p_len, int &r_read) { return OK; } -Error NetSocketPosix::recvfrom(uint8_t *p_buffer, int p_len, int &r_read, IP_Address &r_ip, uint16_t &r_port, bool p_peek) { +Error NetSocketPosix::recvfrom(uint8_t *p_buffer, int p_len, int &r_read, IPAddress &r_ip, uint16_t &r_port, bool p_peek) { ERR_FAIL_COND_V(!is_open(), ERR_UNCONFIGURED); struct sockaddr_storage from; @@ -616,7 +616,7 @@ Error NetSocketPosix::send(const uint8_t *p_buffer, int p_len, int &r_sent) { return OK; } -Error NetSocketPosix::sendto(const uint8_t *p_buffer, int p_len, int &r_sent, IP_Address p_ip, uint16_t p_port) { +Error NetSocketPosix::sendto(const uint8_t *p_buffer, int p_len, int &r_sent, IPAddress p_ip, uint16_t p_port) { ERR_FAIL_COND_V(!is_open(), ERR_UNCONFIGURED); struct sockaddr_storage addr; @@ -735,7 +735,7 @@ int NetSocketPosix::get_available_bytes() const { return len; } -Error NetSocketPosix::get_socket_address(IP_Address *r_ip, uint16_t *r_port) const { +Error NetSocketPosix::get_socket_address(IPAddress *r_ip, uint16_t *r_port) const { ERR_FAIL_COND_V(!is_open(), FAILED); struct sockaddr_storage saddr; @@ -749,7 +749,7 @@ Error NetSocketPosix::get_socket_address(IP_Address *r_ip, uint16_t *r_port) con return OK; } -Ref<NetSocket> NetSocketPosix::accept(IP_Address &r_ip, uint16_t &r_port) { +Ref<NetSocket> NetSocketPosix::accept(IPAddress &r_ip, uint16_t &r_port) { Ref<NetSocket> out; ERR_FAIL_COND_V(!is_open(), out); @@ -770,11 +770,11 @@ Ref<NetSocket> NetSocketPosix::accept(IP_Address &r_ip, uint16_t &r_port) { return Ref<NetSocket>(ns); } -Error NetSocketPosix::join_multicast_group(const IP_Address &p_multi_address, String p_if_name) { +Error NetSocketPosix::join_multicast_group(const IPAddress &p_multi_address, String p_if_name) { return _change_multicast_group(p_multi_address, p_if_name, true); } -Error NetSocketPosix::leave_multicast_group(const IP_Address &p_multi_address, String p_if_name) { +Error NetSocketPosix::leave_multicast_group(const IPAddress &p_multi_address, String p_if_name) { return _change_multicast_group(p_multi_address, p_if_name, false); } #endif diff --git a/drivers/unix/net_socket_posix.h b/drivers/unix/net_socket_posix.h index dbfe3a524e..38c8170a52 100644 --- a/drivers/unix/net_socket_posix.h +++ b/drivers/unix/net_socket_posix.h @@ -61,35 +61,35 @@ private: NetError _get_socket_error() const; void _set_socket(SOCKET_TYPE p_sock, IP::Type p_ip_type, bool p_is_stream); - _FORCE_INLINE_ Error _change_multicast_group(IP_Address p_ip, String p_if_name, bool p_add); + _FORCE_INLINE_ Error _change_multicast_group(IPAddress p_ip, String p_if_name, bool p_add); _FORCE_INLINE_ void _set_close_exec_enabled(bool p_enabled); protected: static NetSocket *_create_func(); - bool _can_use_ip(const IP_Address &p_ip, const bool p_for_bind) const; + bool _can_use_ip(const IPAddress &p_ip, const bool p_for_bind) const; public: static void make_default(); static void cleanup(); - static void _set_ip_port(struct sockaddr_storage *p_addr, IP_Address *r_ip, uint16_t *r_port); - static size_t _set_addr_storage(struct sockaddr_storage *p_addr, const IP_Address &p_ip, uint16_t p_port, IP::Type p_ip_type); + static void _set_ip_port(struct sockaddr_storage *p_addr, IPAddress *r_ip, uint16_t *r_port); + static size_t _set_addr_storage(struct sockaddr_storage *p_addr, const IPAddress &p_ip, uint16_t p_port, IP::Type p_ip_type); virtual Error open(Type p_sock_type, IP::Type &ip_type); virtual void close(); - virtual Error bind(IP_Address p_addr, uint16_t p_port); + virtual Error bind(IPAddress p_addr, uint16_t p_port); virtual Error listen(int p_max_pending); - virtual Error connect_to_host(IP_Address p_host, uint16_t p_port); + virtual Error connect_to_host(IPAddress p_host, uint16_t p_port); virtual Error poll(PollType p_type, int timeout) const; virtual Error recv(uint8_t *p_buffer, int p_len, int &r_read); - virtual Error recvfrom(uint8_t *p_buffer, int p_len, int &r_read, IP_Address &r_ip, uint16_t &r_port, bool p_peek = false); + virtual Error recvfrom(uint8_t *p_buffer, int p_len, int &r_read, IPAddress &r_ip, uint16_t &r_port, bool p_peek = false); virtual Error send(const uint8_t *p_buffer, int p_len, int &r_sent); - virtual Error sendto(const uint8_t *p_buffer, int p_len, int &r_sent, IP_Address p_ip, uint16_t p_port); - virtual Ref<NetSocket> accept(IP_Address &r_ip, uint16_t &r_port); + virtual Error sendto(const uint8_t *p_buffer, int p_len, int &r_sent, IPAddress p_ip, uint16_t p_port); + virtual Ref<NetSocket> accept(IPAddress &r_ip, uint16_t &r_port); virtual bool is_open() const; virtual int get_available_bytes() const; - virtual Error get_socket_address(IP_Address *r_ip, uint16_t *r_port) const; + virtual Error get_socket_address(IPAddress *r_ip, uint16_t *r_port) const; virtual Error set_broadcasting_enabled(bool p_enabled); virtual void set_blocking_enabled(bool p_enabled); @@ -97,8 +97,8 @@ public: virtual void set_tcp_no_delay_enabled(bool p_enabled); virtual void set_reuse_address_enabled(bool p_enabled); virtual void set_reuse_port_enabled(bool p_enabled); - virtual Error join_multicast_group(const IP_Address &p_multi_address, String p_if_name); - virtual Error leave_multicast_group(const IP_Address &p_multi_address, String p_if_name); + virtual Error join_multicast_group(const IPAddress &p_multi_address, String p_if_name); + virtual Error leave_multicast_group(const IPAddress &p_multi_address, String p_if_name); NetSocketPosix(); ~NetSocketPosix(); diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index b9bd773c2e..15cd7bee92 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -129,7 +129,7 @@ void OS_Unix::initialize_core() { #ifndef NO_NETWORK NetSocketPosix::make_default(); - IP_Unix::make_default(); + IPUnix::make_default(); #endif _setup_clock(); diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 30cc01fd10..43b2a24172 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -7844,6 +7844,10 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context, bool p_local_de device_capabilities.subgroup_size = subgroup_capabilities.size; device_capabilities.subgroup_in_shaders = subgroup_capabilities.supported_stages_flags_rd(); device_capabilities.subgroup_operations = subgroup_capabilities.supported_operations_flags_rd(); + + // get info about further features + VulkanContext::MultiviewCapabilities multiview_capabilies = p_context->get_multiview_capabilities(); + device_capabilities.supports_multiview = multiview_capabilies.is_supported && multiview_capabilies.max_view_count > 1; } context = p_context; diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 0a8a5c746f..12a67c0e07 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -352,8 +352,6 @@ Error VulkanContext::_initialize_extensions() { return OK; } -typedef void(VKAPI_PTR *_vkGetPhysicalDeviceProperties2)(VkPhysicalDevice, VkPhysicalDeviceProperties2 *); - uint32_t VulkanContext::SubgroupCapabilities::supported_stages_flags_rd() const { uint32_t flags = 0; @@ -496,20 +494,70 @@ String VulkanContext::SubgroupCapabilities::supported_operations_desc() const { } Error VulkanContext::_check_capabilities() { - // check subgroups + // https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_KHR_multiview.html // https://www.khronos.org/blog/vulkan-subgroup-tutorial + // for Vulkan 1.0 vkGetPhysicalDeviceProperties2 is not available, including not in the loader we compile against on Android. - _vkGetPhysicalDeviceProperties2 func = (_vkGetPhysicalDeviceProperties2)vkGetInstanceProcAddr(inst, "vkGetPhysicalDeviceProperties2"); - if (func != nullptr) { + + // so we check if the functions are accessible by getting their function pointers and skipping if not + // (note that the desktop loader does a better job here but the android loader doesn't) + + // assume not supported until proven otherwise + multiview_capabilities.is_supported = false; + multiview_capabilities.max_view_count = 0; + multiview_capabilities.max_instance_count = 0; + subgroup_capabilities.size = 0; + subgroup_capabilities.supportedStages = 0; + subgroup_capabilities.supportedOperations = 0; + subgroup_capabilities.quadOperationsInAllStages = false; + + // check for extended features + PFN_vkGetPhysicalDeviceFeatures2 device_features_func = (PFN_vkGetPhysicalDeviceFeatures2)vkGetInstanceProcAddr(inst, "vkGetPhysicalDeviceFeatures2"); + if (device_features_func == nullptr) { + // In Vulkan 1.0 might be accessible under its original extension name + device_features_func = (PFN_vkGetPhysicalDeviceFeatures2)vkGetInstanceProcAddr(inst, "vkGetPhysicalDeviceFeatures2KHR"); + } + if (device_features_func != nullptr) { + // check our extended features + VkPhysicalDeviceMultiviewFeatures multiview_features; + multiview_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES; + multiview_features.pNext = NULL; + + VkPhysicalDeviceFeatures2 device_features; + device_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; + device_features.pNext = &multiview_features; + + device_features_func(gpu, &device_features); + multiview_capabilities.is_supported = multiview_features.multiview; + // For now we ignore if multiview is available in geometry and tesselation as we do not currently support those + } + + // check extended properties + PFN_vkGetPhysicalDeviceProperties2 device_properties_func = (PFN_vkGetPhysicalDeviceProperties2)vkGetInstanceProcAddr(inst, "vkGetPhysicalDeviceProperties2"); + if (device_properties_func == nullptr) { + // In Vulkan 1.0 might be accessible under its original extension name + device_properties_func = (PFN_vkGetPhysicalDeviceProperties2)vkGetInstanceProcAddr(inst, "vkGetPhysicalDeviceProperties2KHR"); + } + if (device_properties_func != nullptr) { + VkPhysicalDeviceMultiviewProperties multiviewProperties; VkPhysicalDeviceSubgroupProperties subgroupProperties; + VkPhysicalDeviceProperties2 physicalDeviceProperties; + subgroupProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES; subgroupProperties.pNext = nullptr; - VkPhysicalDeviceProperties2 physicalDeviceProperties; physicalDeviceProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; - physicalDeviceProperties.pNext = &subgroupProperties; - func(gpu, &physicalDeviceProperties); + if (multiview_capabilities.is_supported) { + multiviewProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES; + multiviewProperties.pNext = &subgroupProperties; + + physicalDeviceProperties.pNext = &multiviewProperties; + } else { + physicalDeviceProperties.pNext = &subgroupProperties; + } + + device_properties_func(gpu, &physicalDeviceProperties); subgroup_capabilities.size = subgroupProperties.subgroupSize; subgroup_capabilities.supportedStages = subgroupProperties.supportedStages; @@ -519,18 +567,30 @@ Error VulkanContext::_check_capabilities() { // - supportedOperations has VK_SUBGROUP_FEATURE_QUAD_BIT subgroup_capabilities.quadOperationsInAllStages = subgroupProperties.quadOperationsInAllStages; - // only output this when debugging? - print_line("- Vulkan subgroup size " + itos(subgroup_capabilities.size)); - print_line("- Vulkan subgroup stages " + subgroup_capabilities.supported_stages_desc()); - print_line("- Vulkan subgroup supported ops " + subgroup_capabilities.supported_operations_desc()); + if (multiview_capabilities.is_supported) { + multiview_capabilities.max_view_count = multiviewProperties.maxMultiviewViewCount; + multiview_capabilities.max_instance_count = multiviewProperties.maxMultiviewInstanceIndex; + +#ifdef DEBUG_ENABLED + print_line("- Vulkan multiview supported:"); + print_line(" max views: " + itos(multiview_capabilities.max_view_count)); + print_line(" max instances: " + itos(multiview_capabilities.max_instance_count)); + } else { + print_line("- Vulkan multiview not supported"); +#endif + } + +#ifdef DEBUG_ENABLED + print_line("- Vulkan subgroup:"); + print_line(" size: " + itos(subgroup_capabilities.size)); + print_line(" stages: " + subgroup_capabilities.supported_stages_desc()); + print_line(" supported ops: " + subgroup_capabilities.supported_operations_desc()); if (subgroup_capabilities.quadOperationsInAllStages) { - print_line("- Vulkan subgroup quad operations in all stages"); + print_line(" quad operations in all stages"); } } else { - subgroup_capabilities.size = 0; - subgroup_capabilities.supportedStages = 0; - subgroup_capabilities.supportedOperations = 0; - subgroup_capabilities.quadOperationsInAllStages = false; + print_line("- Couldn't call vkGetPhysicalDeviceProperties2"); +#endif } return OK; diff --git a/drivers/vulkan/vulkan_context.h b/drivers/vulkan/vulkan_context.h index 88e4f26bb1..3d9b295c5a 100644 --- a/drivers/vulkan/vulkan_context.h +++ b/drivers/vulkan/vulkan_context.h @@ -54,6 +54,12 @@ public: String supported_operations_desc() const; }; + struct MultiviewCapabilities { + bool is_supported; + int32_t max_view_count; + int32_t max_instance_count; + }; + private: enum { MAX_EXTENSIONS = 128, @@ -75,6 +81,7 @@ private: uint32_t vulkan_major = 1; uint32_t vulkan_minor = 0; SubgroupCapabilities subgroup_capabilities; + MultiviewCapabilities multiview_capabilities; String device_vendor; String device_name; @@ -227,6 +234,7 @@ public: uint32_t get_vulkan_major() const { return vulkan_major; }; uint32_t get_vulkan_minor() const { return vulkan_minor; }; SubgroupCapabilities get_subgroup_capabilities() const { return subgroup_capabilities; }; + MultiviewCapabilities get_multiview_capabilities() const { return multiview_capabilities; }; VkDevice get_device(); VkPhysicalDevice get_physical_device(); |