#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
+#include <string.h>
#define _USE_MATH_DEFINES //to have M_PI* defined with MSVC
#include <math.h>
bool vkh_phyinfo_create_transfer_queues (VkhPhyInfo phy, uint32_t queueCount, const float* queue_priorities, VkDeviceQueueCreateInfo* const qInfo);
bool vkh_phyinfo_create_compute_queues (VkhPhyInfo phy, uint32_t queueCount, const float* queue_priorities, VkDeviceQueueCreateInfo* const qInfo);
+bool vkh_phyinfo_try_get_extension_properties (VkhPhyInfo phy, const char* name, const VkExtensionProperties* properties);
/*************
* VkhDevice *
*************/
}
void vkh_phyinfo_destroy (VkhPhyInfo phy) {
-
+ if (phy->pExtensionProperties != NULL)
+ free(phy->pExtensionProperties);
free(phy->queues);
free(phy);
}
}
return false;
}
+bool vkh_phyinfo_try_get_extension_properties (VkhPhyInfo phy, const char* name, const VkExtensionProperties* properties) {
+ if (phy->pExtensionProperties == NULL) {
+ VK_CHECK_RESULT(vkEnumerateDeviceExtensionProperties(phy->phy, NULL, &phy->extensionCount, NULL));
+ phy->pExtensionProperties = (VkExtensionProperties*)malloc(phy->extensionCount * sizeof(VkExtensionProperties));
+ VK_CHECK_RESULT(vkEnumerateDeviceExtensionProperties(phy->phy, NULL, &phy->extensionCount, phy->pExtensionProperties));
+ }
+ for (uint32_t i=0; i<phy->extensionCount; i++) {
+ if (strcmp(name, phy->pExtensionProperties[i].extensionName)==0) {
+ if (properties != NULL)
+ properties = &phy->pExtensionProperties[i];
+ return true;
+ }
+ }
+ properties = NULL;
+ return false;
+}
uint32_t qCreateInfosCount;
VkDeviceQueueCreateInfo* qCreateInfos;
+
+ VkExtensionProperties* pExtensionProperties;
+ uint32_t extensionCount;
}vkh_phy_t;
#ifdef __cplusplus
}