From 556625b9486d106f8b1f2137c76bd1d6e473f429 Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Wed, 29 Apr 2026 11:53:33 +0200 Subject: [PATCH 1/2] Add missing constructor implementation of vkb::core::PhysicalDeviceC --- framework/core/physical_device.h | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/framework/core/physical_device.h b/framework/core/physical_device.h index fb00e05bb..3eed05598 100644 --- a/framework/core/physical_device.h +++ b/framework/core/physical_device.h @@ -163,6 +163,7 @@ class PhysicalDevice template FeatureType get_extension_features_impl(); uint32_t get_memory_type_impl(uint32_t bits, vk::MemoryPropertyFlags properties, vk::Bool32 *memory_type_found = nullptr) const; + void init(); template void request_required_feature_impl(vk::Bool32 FeatureType::*flag, std::string const &featureName, std::string const &flagName); @@ -187,15 +188,28 @@ using PhysicalDeviceCpp = PhysicalDevice; #define REQUEST_OPTIONAL_FEATURE(gpu, Feature, flag) gpu.request_optional_feature(&Feature::flag, #Feature, #flag) #define REQUEST_REQUIRED_FEATURE(gpu, Feature, flag) gpu.request_required_feature(&Feature::flag, #Feature, #flag) -template -inline PhysicalDevice::PhysicalDevice(vkb::core::Instance &instance, PhysicalDeviceType physical_device) : +template <> +inline PhysicalDeviceC::PhysicalDevice(vkb::core::InstanceC &instance, VkPhysicalDevice physical_device) : + instance{reinterpret_cast(instance)}, handle{physical_device} +{ + init(); +} + +template <> +inline PhysicalDeviceCpp::PhysicalDevice(vkb::core::InstanceCpp &instance, vk::PhysicalDevice physical_device) : instance{instance}, handle{physical_device} { - features = physical_device.getFeatures(); - properties = physical_device.getProperties(); - memory_properties = physical_device.getMemoryProperties(); - queue_family_properties = physical_device.getQueueFamilyProperties(); - device_extensions = physical_device.enumerateDeviceExtensionProperties(); + init(); +} + +template +inline void PhysicalDevice::init() +{ + features = handle.getFeatures(); + properties = handle.getProperties(); + memory_properties = handle.getMemoryProperties(); + queue_family_properties = handle.getQueueFamilyProperties(); + device_extensions = handle.enumerateDeviceExtensionProperties(); LOGI("Found GPU: {}", properties.deviceName.data()); From 95ae1e067e8021b2fadf7a8e2368616f2a6459e2 Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Tue, 9 Jun 2026 17:49:29 +0200 Subject: [PATCH 2/2] Try to resolve doxygen issue. --- framework/core/physical_device.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/core/physical_device.h b/framework/core/physical_device.h index 3eed05598..4ec56b09a 100644 --- a/framework/core/physical_device.h +++ b/framework/core/physical_device.h @@ -189,14 +189,14 @@ using PhysicalDeviceCpp = PhysicalDevice; #define REQUEST_REQUIRED_FEATURE(gpu, Feature, flag) gpu.request_required_feature(&Feature::flag, #Feature, #flag) template <> -inline PhysicalDeviceC::PhysicalDevice(vkb::core::InstanceC &instance, VkPhysicalDevice physical_device) : +inline PhysicalDevice::PhysicalDevice(vkb::core::InstanceC &instance, VkPhysicalDevice physical_device) : instance{reinterpret_cast(instance)}, handle{physical_device} { init(); } template <> -inline PhysicalDeviceCpp::PhysicalDevice(vkb::core::InstanceCpp &instance, vk::PhysicalDevice physical_device) : +inline PhysicalDevice::PhysicalDevice(vkb::core::InstanceCpp &instance, vk::PhysicalDevice physical_device) : instance{instance}, handle{physical_device} { init();