Hello!
I'm using framework part of vulkan samples to prototype small application and noticed, that physical device cannot be created in "C-mode". Here is minimal code showcase:
vkb::core::InstanceC instance("Sample", VK_API_VERSION_1_1, requested_layers, requested_extensions, vkb::core::get_default_create_flags<vkb::BindingType::C>);
VkPhysicalDevice selectedDevice = ...
vkb::core::PhysicalDeviceC physDevice(instance, selectedDevice);
This code will fail to compile with message:
'vkb::core::PhysicalDevice<vkb::BindingType::C>::instance': member could not be initialized
'initializing': cannot convert from 'vkb::core::Instance<vkb::BindingType::C>' to 'vkb::core::InstanceCpp &'
While PhysicalDevice<> requires InstanceC as input, but internally it always stores reference to InstanceCpp, causing compilation to fail.
Event if I'll adjust the class to store Instance<bindingType> instead, it still wont be enough to fix the issue, due to more code in constructor expects only Cpp version of instance:
|
inline PhysicalDevice<bindingType>::PhysicalDevice(vkb::core::Instance<bindingType> &instance, PhysicalDeviceType 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(); |
Hello!
I'm using
frameworkpart of vulkan samples to prototype small application and noticed, that physical device cannot be created in "C-mode". Here is minimal code showcase:This code will fail to compile with message:
While
PhysicalDevice<>requiresInstanceCas input, but internally it always stores reference toInstanceCpp, causing compilation to fail.Event if I'll adjust the class to store
Instance<bindingType>instead, it still wont be enough to fix the issue, due to more code in constructor expects only Cpp version of instance:Vulkan-Samples/framework/core/physical_device.h
Lines 191 to 198 in f9b1603