mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-26 00:34:35 +00:00
Trimmed branching in script and modified usage in core lib.
This commit is contained in:
parent
dd1df1396c
commit
a61e221d59
@ -91,10 +91,11 @@ for feature_node in features_node:
|
|||||||
for require_node in feature_node['require']:
|
for require_node in feature_node['require']:
|
||||||
for param_node in require_node:
|
for param_node in require_node:
|
||||||
if param_node == 'command':
|
if param_node == 'command':
|
||||||
if type(require_node[param_node]) is list:
|
if type(require_node[param_node]) is not list:
|
||||||
for param in require_node[param_node]:
|
require_node[param_node] = [require_node[param_node]]
|
||||||
if param['@name'] in device_commands:
|
for param in require_node[param_node]:
|
||||||
device_commands[param['@name']]['requirements'] += [[feature_node['@name']]]
|
if param['@name'] in device_commands:
|
||||||
|
device_commands[param['@name']]['requirements'] += [[feature_node['@name']]]
|
||||||
|
|
||||||
|
|
||||||
# Add requirements for extension PFN's
|
# Add requirements for extension PFN's
|
||||||
@ -112,20 +113,16 @@ for extension_node in extensions_node:
|
|||||||
if '@extension' in require_node.keys():
|
if '@extension' in require_node.keys():
|
||||||
requirements.append(require_node['@extension'])
|
requirements.append(require_node['@extension'])
|
||||||
if type(require_node['command']) is not list:
|
if type(require_node['command']) is not list:
|
||||||
if require_node['command']['@name'] in device_commands:
|
require_node['command'] = [require_node['command']]
|
||||||
device_commands[require_node['command']['@name']]['requirements'] += [requirements]
|
for command_node in require_node['command']:
|
||||||
else:
|
|
||||||
for command_node in require_node['command']:
|
|
||||||
if command_node['@name'] in device_commands:
|
|
||||||
device_commands[command_node['@name']]['requirements'] += [requirements]
|
|
||||||
elif require_node == 'command':
|
|
||||||
if type(require_nodes['command']) is not list:
|
|
||||||
if require_nodes['command']['@name'] in device_commands:
|
|
||||||
device_commands[require_nodes['command']['@name']]['requirements'] += [requirements]
|
|
||||||
else:
|
|
||||||
for command_node in require_nodes['command']:
|
|
||||||
if command_node['@name'] in device_commands:
|
if command_node['@name'] in device_commands:
|
||||||
device_commands[command_node['@name']]['requirements'] += [requirements]
|
device_commands[command_node['@name']]['requirements'] += [requirements]
|
||||||
|
elif require_node == 'command':
|
||||||
|
if type(require_nodes['command']) is not list:
|
||||||
|
require_nodes['command'] = [require_nodes['command']]
|
||||||
|
for command_node in require_nodes['command']:
|
||||||
|
if command_node['@name'] in device_commands:
|
||||||
|
device_commands[command_node['@name']]['requirements'] += [requirements]
|
||||||
|
|
||||||
# Generate macro templates
|
# Generate macro templates
|
||||||
for command in device_commands:
|
for command in device_commands:
|
||||||
|
@ -1308,12 +1308,6 @@ std::vector<VkQueueFamilyProperties> PhysicalDevice::get_queue_families() const
|
|||||||
return queue_families;
|
return queue_families;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- DispatchTable --- //
|
|
||||||
|
|
||||||
DispatchTable Device::get_dispatch_table() const {
|
|
||||||
return DispatchTable(device, detail::vulkan_functions().fp_vkGetDeviceProcAddr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---- Queues ---- //
|
// ---- Queues ---- //
|
||||||
|
|
||||||
detail::Result<uint32_t> Device::get_queue_index(QueueType type) const {
|
detail::Result<uint32_t> Device::get_queue_index(QueueType type) const {
|
||||||
@ -1484,6 +1478,9 @@ detail::Result<Device> DeviceBuilder::build() const {
|
|||||||
device.queue_families = physical_device.queue_families;
|
device.queue_families = physical_device.queue_families;
|
||||||
device.allocation_callbacks = info.allocation_callbacks;
|
device.allocation_callbacks = info.allocation_callbacks;
|
||||||
device.fp_vkGetDeviceProcAddr = detail::vulkan_functions().fp_vkGetDeviceProcAddr;
|
device.fp_vkGetDeviceProcAddr = detail::vulkan_functions().fp_vkGetDeviceProcAddr;
|
||||||
|
if(info.load_dispatch) {
|
||||||
|
device.dispatch = DispatchTable(device.device, device.fp_vkGetDeviceProcAddr);
|
||||||
|
}
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
DeviceBuilder& DeviceBuilder::custom_queue_setup(std::vector<CustomQueueDescription> queue_descriptions) {
|
DeviceBuilder& DeviceBuilder::custom_queue_setup(std::vector<CustomQueueDescription> queue_descriptions) {
|
||||||
@ -1494,6 +1491,10 @@ DeviceBuilder& DeviceBuilder::set_allocation_callbacks(VkAllocationCallbacks* ca
|
|||||||
info.allocation_callbacks = callbacks;
|
info.allocation_callbacks = callbacks;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
DeviceBuilder& DeviceBuilder::populate_dispatch_table() {
|
||||||
|
info.load_dispatch = true;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
// ---- Swapchain ---- //
|
// ---- Swapchain ---- //
|
||||||
|
|
||||||
|
@ -214,7 +214,6 @@ struct Instance {
|
|||||||
VkInstance instance = VK_NULL_HANDLE;
|
VkInstance instance = VK_NULL_HANDLE;
|
||||||
VkDebugUtilsMessengerEXT debug_messenger = VK_NULL_HANDLE;
|
VkDebugUtilsMessengerEXT debug_messenger = VK_NULL_HANDLE;
|
||||||
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
|
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
|
||||||
|
|
||||||
PFN_vkGetInstanceProcAddr fp_vkGetInstanceProcAddr = nullptr;
|
PFN_vkGetInstanceProcAddr fp_vkGetInstanceProcAddr = nullptr;
|
||||||
PFN_vkGetDeviceProcAddr fp_vkGetDeviceProcAddr = nullptr;
|
PFN_vkGetDeviceProcAddr fp_vkGetDeviceProcAddr = nullptr;
|
||||||
|
|
||||||
@ -544,8 +543,7 @@ struct Device {
|
|||||||
std::vector<VkQueueFamilyProperties> queue_families;
|
std::vector<VkQueueFamilyProperties> queue_families;
|
||||||
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
|
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
|
||||||
PFN_vkGetDeviceProcAddr fp_vkGetDeviceProcAddr = nullptr;
|
PFN_vkGetDeviceProcAddr fp_vkGetDeviceProcAddr = nullptr;
|
||||||
|
DispatchTable dispatch;
|
||||||
DispatchTable get_dispatch_table() const;
|
|
||||||
|
|
||||||
detail::Result<uint32_t> get_queue_index(QueueType type) const;
|
detail::Result<uint32_t> get_queue_index(QueueType type) const;
|
||||||
// Only a compute or transfer queue type is valid. All other queue types do not support a 'dedicated' queue index
|
// Only a compute or transfer queue type is valid. All other queue types do not support a 'dedicated' queue index
|
||||||
@ -587,6 +585,8 @@ class DeviceBuilder {
|
|||||||
// Provide custom allocation callbacks.
|
// Provide custom allocation callbacks.
|
||||||
DeviceBuilder& set_allocation_callbacks(VkAllocationCallbacks* callbacks);
|
DeviceBuilder& set_allocation_callbacks(VkAllocationCallbacks* callbacks);
|
||||||
|
|
||||||
|
// Populate dispatch table for the device
|
||||||
|
DeviceBuilder& populate_dispatch_table();
|
||||||
private:
|
private:
|
||||||
PhysicalDevice physical_device;
|
PhysicalDevice physical_device;
|
||||||
struct DeviceInfo {
|
struct DeviceInfo {
|
||||||
@ -594,6 +594,7 @@ class DeviceBuilder {
|
|||||||
std::vector<VkBaseOutStructure*> pNext_chain;
|
std::vector<VkBaseOutStructure*> pNext_chain;
|
||||||
std::vector<CustomQueueDescription> queue_descriptions;
|
std::vector<CustomQueueDescription> queue_descriptions;
|
||||||
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
|
VkAllocationCallbacks* allocation_callbacks = VK_NULL_HANDLE;
|
||||||
|
bool load_dispatch = false;
|
||||||
} info;
|
} info;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ struct DispatchTable {
|
|||||||
fp_vkCreateQueryPool = (PFN_vkCreateQueryPool)procAddr(device, "vkCreateQueryPool");
|
fp_vkCreateQueryPool = (PFN_vkCreateQueryPool)procAddr(device, "vkCreateQueryPool");
|
||||||
fp_vkDestroyQueryPool = (PFN_vkDestroyQueryPool)procAddr(device, "vkDestroyQueryPool");
|
fp_vkDestroyQueryPool = (PFN_vkDestroyQueryPool)procAddr(device, "vkDestroyQueryPool");
|
||||||
fp_vkGetQueryPoolResults = (PFN_vkGetQueryPoolResults)procAddr(device, "vkGetQueryPoolResults");
|
fp_vkGetQueryPoolResults = (PFN_vkGetQueryPoolResults)procAddr(device, "vkGetQueryPoolResults");
|
||||||
#if (defined(VK_EXT_host_query_reset))
|
#if (defined(VK_VERSION_1_2)) || (defined(VK_EXT_host_query_reset))
|
||||||
fp_vkResetQueryPool = (PFN_vkResetQueryPool)procAddr(device, "vkResetQueryPool");
|
fp_vkResetQueryPool = (PFN_vkResetQueryPool)procAddr(device, "vkResetQueryPool");
|
||||||
#endif
|
#endif
|
||||||
fp_vkCreateBuffer = (PFN_vkCreateBuffer)procAddr(device, "vkCreateBuffer");
|
fp_vkCreateBuffer = (PFN_vkCreateBuffer)procAddr(device, "vkCreateBuffer");
|
||||||
@ -213,7 +213,7 @@ struct DispatchTable {
|
|||||||
#if (defined(VK_KHR_push_descriptor))
|
#if (defined(VK_KHR_push_descriptor))
|
||||||
fp_vkCmdPushDescriptorSetKHR = (PFN_vkCmdPushDescriptorSetKHR)procAddr(device, "vkCmdPushDescriptorSetKHR");
|
fp_vkCmdPushDescriptorSetKHR = (PFN_vkCmdPushDescriptorSetKHR)procAddr(device, "vkCmdPushDescriptorSetKHR");
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance1))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance1))
|
||||||
fp_vkTrimCommandPool = (PFN_vkTrimCommandPool)procAddr(device, "vkTrimCommandPool");
|
fp_vkTrimCommandPool = (PFN_vkTrimCommandPool)procAddr(device, "vkTrimCommandPool");
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_external_memory_win32))
|
#if (defined(VK_KHR_external_memory_win32))
|
||||||
@ -348,7 +348,9 @@ struct DispatchTable {
|
|||||||
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_sampler_ycbcr_conversion))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_sampler_ycbcr_conversion))
|
||||||
fp_vkDestroySamplerYcbcrConversion = (PFN_vkDestroySamplerYcbcrConversion)procAddr(device, "vkDestroySamplerYcbcrConversion");
|
fp_vkDestroySamplerYcbcrConversion = (PFN_vkDestroySamplerYcbcrConversion)procAddr(device, "vkDestroySamplerYcbcrConversion");
|
||||||
#endif
|
#endif
|
||||||
|
#if (defined(VK_VERSION_1_1))
|
||||||
fp_vkGetDeviceQueue2 = (PFN_vkGetDeviceQueue2)procAddr(device, "vkGetDeviceQueue2");
|
fp_vkGetDeviceQueue2 = (PFN_vkGetDeviceQueue2)procAddr(device, "vkGetDeviceQueue2");
|
||||||
|
#endif
|
||||||
#if (defined(VK_EXT_validation_cache))
|
#if (defined(VK_EXT_validation_cache))
|
||||||
fp_vkCreateValidationCacheEXT = (PFN_vkCreateValidationCacheEXT)procAddr(device, "vkCreateValidationCacheEXT");
|
fp_vkCreateValidationCacheEXT = (PFN_vkCreateValidationCacheEXT)procAddr(device, "vkCreateValidationCacheEXT");
|
||||||
#endif
|
#endif
|
||||||
@ -361,7 +363,7 @@ struct DispatchTable {
|
|||||||
#if (defined(VK_EXT_validation_cache))
|
#if (defined(VK_EXT_validation_cache))
|
||||||
fp_vkMergeValidationCachesEXT = (PFN_vkMergeValidationCachesEXT)procAddr(device, "vkMergeValidationCachesEXT");
|
fp_vkMergeValidationCachesEXT = (PFN_vkMergeValidationCachesEXT)procAddr(device, "vkMergeValidationCachesEXT");
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance3))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance3))
|
||||||
fp_vkGetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport)procAddr(device, "vkGetDescriptorSetLayoutSupport");
|
fp_vkGetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport)procAddr(device, "vkGetDescriptorSetLayoutSupport");
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_ANDROID_native_buffer))
|
#if (defined(VK_ANDROID_native_buffer))
|
||||||
@ -850,10 +852,10 @@ struct DispatchTable {
|
|||||||
#if (defined(VK_NVX_binary_import))
|
#if (defined(VK_NVX_binary_import))
|
||||||
fp_vkCmdCuLaunchKernelNVX = (PFN_vkCmdCuLaunchKernelNVX)procAddr(device, "vkCmdCuLaunchKernelNVX");
|
fp_vkCmdCuLaunchKernelNVX = (PFN_vkCmdCuLaunchKernelNVX)procAddr(device, "vkCmdCuLaunchKernelNVX");
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_EXT_host_query_reset))
|
#if (defined(VK_VERSION_1_2)) || (defined(VK_EXT_host_query_reset))
|
||||||
fp_vkResetQueryPoolEXT = (PFN_vkResetQueryPoolEXT)procAddr(device, "vkResetQueryPoolEXT");
|
fp_vkResetQueryPoolEXT = (PFN_vkResetQueryPoolEXT)procAddr(device, "vkResetQueryPoolEXT");
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance1))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance1))
|
||||||
fp_vkTrimCommandPoolKHR = (PFN_vkTrimCommandPoolKHR)procAddr(device, "vkTrimCommandPoolKHR");
|
fp_vkTrimCommandPoolKHR = (PFN_vkTrimCommandPoolKHR)procAddr(device, "vkTrimCommandPoolKHR");
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_device_group))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_device_group))
|
||||||
@ -895,7 +897,7 @@ struct DispatchTable {
|
|||||||
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_sampler_ycbcr_conversion))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_sampler_ycbcr_conversion))
|
||||||
fp_vkDestroySamplerYcbcrConversionKHR = (PFN_vkDestroySamplerYcbcrConversionKHR)procAddr(device, "vkDestroySamplerYcbcrConversionKHR");
|
fp_vkDestroySamplerYcbcrConversionKHR = (PFN_vkDestroySamplerYcbcrConversionKHR)procAddr(device, "vkDestroySamplerYcbcrConversionKHR");
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance3))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance3))
|
||||||
fp_vkGetDescriptorSetLayoutSupportKHR = (PFN_vkGetDescriptorSetLayoutSupportKHR)procAddr(device, "vkGetDescriptorSetLayoutSupportKHR");
|
fp_vkGetDescriptorSetLayoutSupportKHR = (PFN_vkGetDescriptorSetLayoutSupportKHR)procAddr(device, "vkGetDescriptorSetLayoutSupportKHR");
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_VERSION_1_2)) || (defined(VK_KHR_create_renderpass2))
|
#if (defined(VK_VERSION_1_2)) || (defined(VK_KHR_create_renderpass2))
|
||||||
@ -1034,7 +1036,7 @@ struct DispatchTable {
|
|||||||
VkResult getQueryPoolResults(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags) const {
|
VkResult getQueryPoolResults(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags) const {
|
||||||
return fp_vkGetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
|
return fp_vkGetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
|
||||||
}
|
}
|
||||||
#if (defined(VK_EXT_host_query_reset))
|
#if (defined(VK_VERSION_1_2)) || (defined(VK_EXT_host_query_reset))
|
||||||
void resetQueryPool(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const {
|
void resetQueryPool(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const {
|
||||||
fp_vkResetQueryPool(device, queryPool, firstQuery, queryCount);
|
fp_vkResetQueryPool(device, queryPool, firstQuery, queryCount);
|
||||||
}
|
}
|
||||||
@ -1405,7 +1407,7 @@ struct DispatchTable {
|
|||||||
fp_vkCmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites);
|
fp_vkCmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance1))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance1))
|
||||||
void trimCommandPool(VkCommandPool commandPool, VkCommandPoolTrimFlags flags) const {
|
void trimCommandPool(VkCommandPool commandPool, VkCommandPoolTrimFlags flags) const {
|
||||||
fp_vkTrimCommandPool(device, commandPool, flags);
|
fp_vkTrimCommandPool(device, commandPool, flags);
|
||||||
}
|
}
|
||||||
@ -1630,9 +1632,11 @@ struct DispatchTable {
|
|||||||
fp_vkDestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator);
|
fp_vkDestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if (defined(VK_VERSION_1_1))
|
||||||
void getDeviceQueue2(const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) const {
|
void getDeviceQueue2(const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) const {
|
||||||
fp_vkGetDeviceQueue2(device, pQueueInfo, pQueue);
|
fp_vkGetDeviceQueue2(device, pQueueInfo, pQueue);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#if (defined(VK_EXT_validation_cache))
|
#if (defined(VK_EXT_validation_cache))
|
||||||
VkResult createValidationCacheEXT(const VkValidationCacheCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache) const {
|
VkResult createValidationCacheEXT(const VkValidationCacheCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache) const {
|
||||||
return fp_vkCreateValidationCacheEXT(device, pCreateInfo, pAllocator, pValidationCache);
|
return fp_vkCreateValidationCacheEXT(device, pCreateInfo, pAllocator, pValidationCache);
|
||||||
@ -1653,7 +1657,7 @@ struct DispatchTable {
|
|||||||
return fp_vkMergeValidationCachesEXT(device, dstCache, srcCacheCount, pSrcCaches);
|
return fp_vkMergeValidationCachesEXT(device, dstCache, srcCacheCount, pSrcCaches);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance3))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance3))
|
||||||
void getDescriptorSetLayoutSupport(const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) const {
|
void getDescriptorSetLayoutSupport(const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) const {
|
||||||
fp_vkGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport);
|
fp_vkGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport);
|
||||||
}
|
}
|
||||||
@ -2468,12 +2472,12 @@ struct DispatchTable {
|
|||||||
fp_vkCmdCuLaunchKernelNVX(commandBuffer, pLaunchInfo);
|
fp_vkCmdCuLaunchKernelNVX(commandBuffer, pLaunchInfo);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_EXT_host_query_reset))
|
#if (defined(VK_VERSION_1_2)) || (defined(VK_EXT_host_query_reset))
|
||||||
void resetQueryPoolEXT(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const {
|
void resetQueryPoolEXT(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const {
|
||||||
fp_vkResetQueryPoolEXT(device, queryPool, firstQuery, queryCount);
|
fp_vkResetQueryPoolEXT(device, queryPool, firstQuery, queryCount);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance1))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance1))
|
||||||
void trimCommandPoolKHR(VkCommandPool commandPool, VkCommandPoolTrimFlags flags) const {
|
void trimCommandPoolKHR(VkCommandPool commandPool, VkCommandPoolTrimFlags flags) const {
|
||||||
fp_vkTrimCommandPoolKHR(device, commandPool, flags);
|
fp_vkTrimCommandPoolKHR(device, commandPool, flags);
|
||||||
}
|
}
|
||||||
@ -2543,7 +2547,7 @@ struct DispatchTable {
|
|||||||
fp_vkDestroySamplerYcbcrConversionKHR(device, ycbcrConversion, pAllocator);
|
fp_vkDestroySamplerYcbcrConversionKHR(device, ycbcrConversion, pAllocator);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance3))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance3))
|
||||||
void getDescriptorSetLayoutSupportKHR(const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) const {
|
void getDescriptorSetLayoutSupportKHR(const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) const {
|
||||||
fp_vkGetDescriptorSetLayoutSupportKHR(device, pCreateInfo, pSupport);
|
fp_vkGetDescriptorSetLayoutSupportKHR(device, pCreateInfo, pSupport);
|
||||||
}
|
}
|
||||||
@ -2645,7 +2649,7 @@ struct DispatchTable {
|
|||||||
PFN_vkCreateQueryPool fp_vkCreateQueryPool = nullptr;
|
PFN_vkCreateQueryPool fp_vkCreateQueryPool = nullptr;
|
||||||
PFN_vkDestroyQueryPool fp_vkDestroyQueryPool = nullptr;
|
PFN_vkDestroyQueryPool fp_vkDestroyQueryPool = nullptr;
|
||||||
PFN_vkGetQueryPoolResults fp_vkGetQueryPoolResults = nullptr;
|
PFN_vkGetQueryPoolResults fp_vkGetQueryPoolResults = nullptr;
|
||||||
#if (defined(VK_EXT_host_query_reset))
|
#if (defined(VK_VERSION_1_2)) || (defined(VK_EXT_host_query_reset))
|
||||||
PFN_vkResetQueryPool fp_vkResetQueryPool = nullptr;
|
PFN_vkResetQueryPool fp_vkResetQueryPool = nullptr;
|
||||||
#endif
|
#endif
|
||||||
PFN_vkCreateBuffer fp_vkCreateBuffer = nullptr;
|
PFN_vkCreateBuffer fp_vkCreateBuffer = nullptr;
|
||||||
@ -2798,7 +2802,7 @@ struct DispatchTable {
|
|||||||
#if (defined(VK_KHR_push_descriptor))
|
#if (defined(VK_KHR_push_descriptor))
|
||||||
PFN_vkCmdPushDescriptorSetKHR fp_vkCmdPushDescriptorSetKHR = nullptr;
|
PFN_vkCmdPushDescriptorSetKHR fp_vkCmdPushDescriptorSetKHR = nullptr;
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance1))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance1))
|
||||||
PFN_vkTrimCommandPool fp_vkTrimCommandPool = nullptr;
|
PFN_vkTrimCommandPool fp_vkTrimCommandPool = nullptr;
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_external_memory_win32))
|
#if (defined(VK_KHR_external_memory_win32))
|
||||||
@ -2933,7 +2937,9 @@ struct DispatchTable {
|
|||||||
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_sampler_ycbcr_conversion))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_sampler_ycbcr_conversion))
|
||||||
PFN_vkDestroySamplerYcbcrConversion fp_vkDestroySamplerYcbcrConversion = nullptr;
|
PFN_vkDestroySamplerYcbcrConversion fp_vkDestroySamplerYcbcrConversion = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
#if (defined(VK_VERSION_1_1))
|
||||||
PFN_vkGetDeviceQueue2 fp_vkGetDeviceQueue2 = nullptr;
|
PFN_vkGetDeviceQueue2 fp_vkGetDeviceQueue2 = nullptr;
|
||||||
|
#endif
|
||||||
#if (defined(VK_EXT_validation_cache))
|
#if (defined(VK_EXT_validation_cache))
|
||||||
PFN_vkCreateValidationCacheEXT fp_vkCreateValidationCacheEXT = nullptr;
|
PFN_vkCreateValidationCacheEXT fp_vkCreateValidationCacheEXT = nullptr;
|
||||||
#endif
|
#endif
|
||||||
@ -2946,7 +2952,7 @@ struct DispatchTable {
|
|||||||
#if (defined(VK_EXT_validation_cache))
|
#if (defined(VK_EXT_validation_cache))
|
||||||
PFN_vkMergeValidationCachesEXT fp_vkMergeValidationCachesEXT = nullptr;
|
PFN_vkMergeValidationCachesEXT fp_vkMergeValidationCachesEXT = nullptr;
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance3))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance3))
|
||||||
PFN_vkGetDescriptorSetLayoutSupport fp_vkGetDescriptorSetLayoutSupport = nullptr;
|
PFN_vkGetDescriptorSetLayoutSupport fp_vkGetDescriptorSetLayoutSupport = nullptr;
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_ANDROID_native_buffer))
|
#if (defined(VK_ANDROID_native_buffer))
|
||||||
@ -3435,10 +3441,10 @@ struct DispatchTable {
|
|||||||
#if (defined(VK_NVX_binary_import))
|
#if (defined(VK_NVX_binary_import))
|
||||||
PFN_vkCmdCuLaunchKernelNVX fp_vkCmdCuLaunchKernelNVX = nullptr;
|
PFN_vkCmdCuLaunchKernelNVX fp_vkCmdCuLaunchKernelNVX = nullptr;
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_EXT_host_query_reset))
|
#if (defined(VK_VERSION_1_2)) || (defined(VK_EXT_host_query_reset))
|
||||||
PFN_vkResetQueryPoolEXT fp_vkResetQueryPoolEXT = nullptr;
|
PFN_vkResetQueryPoolEXT fp_vkResetQueryPoolEXT = nullptr;
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance1))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance1))
|
||||||
PFN_vkTrimCommandPoolKHR fp_vkTrimCommandPoolKHR = nullptr;
|
PFN_vkTrimCommandPoolKHR fp_vkTrimCommandPoolKHR = nullptr;
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_device_group))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_device_group))
|
||||||
@ -3480,7 +3486,7 @@ struct DispatchTable {
|
|||||||
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_sampler_ycbcr_conversion))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_sampler_ycbcr_conversion))
|
||||||
PFN_vkDestroySamplerYcbcrConversionKHR fp_vkDestroySamplerYcbcrConversionKHR = nullptr;
|
PFN_vkDestroySamplerYcbcrConversionKHR fp_vkDestroySamplerYcbcrConversionKHR = nullptr;
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_KHR_maintenance3))
|
#if (defined(VK_VERSION_1_1)) || (defined(VK_KHR_maintenance3))
|
||||||
PFN_vkGetDescriptorSetLayoutSupportKHR fp_vkGetDescriptorSetLayoutSupportKHR = nullptr;
|
PFN_vkGetDescriptorSetLayoutSupportKHR fp_vkGetDescriptorSetLayoutSupportKHR = nullptr;
|
||||||
#endif
|
#endif
|
||||||
#if (defined(VK_VERSION_1_2)) || (defined(VK_KHR_create_renderpass2))
|
#if (defined(VK_VERSION_1_2)) || (defined(VK_KHR_create_renderpass2))
|
||||||
|
@ -200,20 +200,19 @@ TEST_CASE("Loading Dispatch Table", "[VkBootstrap.bootstrap]") {
|
|||||||
REQUIRE(phys_dev_ret.has_value());
|
REQUIRE(phys_dev_ret.has_value());
|
||||||
|
|
||||||
vkb::DeviceBuilder device_builder(phys_dev_ret.value());
|
vkb::DeviceBuilder device_builder(phys_dev_ret.value());
|
||||||
auto device_ret = device_builder.build();
|
auto device_ret = device_builder.populate_dispatch_table().build();
|
||||||
REQUIRE(device_ret.has_value());
|
REQUIRE(device_ret.has_value());
|
||||||
|
auto device = device_ret.value();
|
||||||
vkb::DispatchTable table = device_ret->get_dispatch_table();
|
|
||||||
|
|
||||||
// Create a basic Device specific type to test with
|
// Create a basic Device specific type to test with
|
||||||
VkFenceCreateInfo info{};
|
VkFenceCreateInfo info{};
|
||||||
info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
|
info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
|
||||||
|
|
||||||
VkFence fence = VK_NULL_HANDLE;
|
VkFence fence = VK_NULL_HANDLE;
|
||||||
table.createFence(&info, nullptr, &fence);
|
device.dispatch.createFence(&info, nullptr, &fence);
|
||||||
REQUIRE(fence != VK_NULL_HANDLE);
|
REQUIRE(fence != VK_NULL_HANDLE);
|
||||||
|
|
||||||
table.destroyFence(fence, nullptr);
|
device.dispatch.destroyFence(fence, nullptr);
|
||||||
vkb::destroy_device(device_ret.value());
|
vkb::destroy_device(device_ret.value());
|
||||||
}
|
}
|
||||||
vkb::destroy_instance(instance_ret.value());
|
vkb::destroy_instance(instance_ret.value());
|
||||||
|
Loading…
Reference in New Issue
Block a user