Add protections for debug marker functions
This commit is contained in:
parent
2ce04b686d
commit
30fa329550
1 changed files with 12 additions and 8 deletions
|
@ -193,11 +193,13 @@ VkResult name_object(VkDevice device, VkObjectType type, uint64_t object, std::s
|
|||
|
||||
void cmd_debug_marker_begin(VkDevice device, VkCommandBuffer command_buffer, VkDebugUtilsLabelEXT marker_info) {
|
||||
auto func = (PFN_vkCmdBeginDebugUtilsLabelEXT)vkGetDeviceProcAddr(device, "vkCmdBeginDebugUtilsLabelEXT");
|
||||
if(func != nullptr)
|
||||
func(command_buffer, &marker_info);
|
||||
}
|
||||
|
||||
void cmd_debug_marker_end(VkDevice device, VkCommandBuffer command_buffer) {
|
||||
auto func = (PFN_vkCmdEndDebugUtilsLabelEXT)vkGetDeviceProcAddr(device, "vkCmdEndDebugUtilsLabelEXT");
|
||||
if(func != nullptr)
|
||||
func(command_buffer);
|
||||
}
|
||||
|
||||
|
@ -1805,7 +1807,7 @@ void GFXVulkan::createInstance(std::vector<const char*> layers, std::vector<cons
|
|||
appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
|
||||
appInfo.pEngineName = "Prism Engine";
|
||||
appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
|
||||
appInfo.apiVersion = VK_API_VERSION_1_2;
|
||||
appInfo.apiVersion = VK_API_VERSION_1_1;
|
||||
|
||||
VkInstanceCreateInfo createInfo = {};
|
||||
createInfo.pNext = &debugCreateInfo;
|
||||
|
@ -1830,12 +1832,14 @@ void GFXVulkan::createLogicalDevice(std::vector<const char*> extensions) {
|
|||
std::vector<VkPhysicalDevice> devices(deviceCount);
|
||||
vkEnumeratePhysicalDevices(instance, &deviceCount, devices.data());
|
||||
|
||||
physicalDevice = devices[0];
|
||||
|
||||
for(auto device : devices) {
|
||||
VkPhysicalDeviceProperties deviceProperties;
|
||||
vkGetPhysicalDeviceProperties(physicalDevice, &deviceProperties);
|
||||
vkGetPhysicalDeviceProperties(device, &deviceProperties);
|
||||
|
||||
prism::log("GPU = {}", deviceProperties.deviceName);
|
||||
}
|
||||
|
||||
physicalDevice = devices[0];
|
||||
|
||||
uint32_t extensionCount = 0;
|
||||
vkEnumerateDeviceExtensionProperties(physicalDevice, nullptr, &extensionCount, nullptr);
|
||||
|
|
Reference in a new issue