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,12 +193,14 @@ 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) {
|
void cmd_debug_marker_begin(VkDevice device, VkCommandBuffer command_buffer, VkDebugUtilsLabelEXT marker_info) {
|
||||||
auto func = (PFN_vkCmdBeginDebugUtilsLabelEXT)vkGetDeviceProcAddr(device, "vkCmdBeginDebugUtilsLabelEXT");
|
auto func = (PFN_vkCmdBeginDebugUtilsLabelEXT)vkGetDeviceProcAddr(device, "vkCmdBeginDebugUtilsLabelEXT");
|
||||||
func(command_buffer, &marker_info);
|
if(func != nullptr)
|
||||||
|
func(command_buffer, &marker_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmd_debug_marker_end(VkDevice device, VkCommandBuffer command_buffer) {
|
void cmd_debug_marker_end(VkDevice device, VkCommandBuffer command_buffer) {
|
||||||
auto func = (PFN_vkCmdEndDebugUtilsLabelEXT)vkGetDeviceProcAddr(device, "vkCmdEndDebugUtilsLabelEXT");
|
auto func = (PFN_vkCmdEndDebugUtilsLabelEXT)vkGetDeviceProcAddr(device, "vkCmdEndDebugUtilsLabelEXT");
|
||||||
func(command_buffer);
|
if(func != nullptr)
|
||||||
|
func(command_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GFXVulkan::initialize(const GFXCreateInfo& info) {
|
bool GFXVulkan::initialize(const GFXCreateInfo& info) {
|
||||||
|
@ -1805,7 +1807,7 @@ void GFXVulkan::createInstance(std::vector<const char*> layers, std::vector<cons
|
||||||
appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
|
appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
|
||||||
appInfo.pEngineName = "Prism Engine";
|
appInfo.pEngineName = "Prism Engine";
|
||||||
appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
|
appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
|
||||||
appInfo.apiVersion = VK_API_VERSION_1_2;
|
appInfo.apiVersion = VK_API_VERSION_1_1;
|
||||||
|
|
||||||
VkInstanceCreateInfo createInfo = {};
|
VkInstanceCreateInfo createInfo = {};
|
||||||
createInfo.pNext = &debugCreateInfo;
|
createInfo.pNext = &debugCreateInfo;
|
||||||
|
@ -1829,14 +1831,16 @@ void GFXVulkan::createLogicalDevice(std::vector<const char*> extensions) {
|
||||||
|
|
||||||
std::vector<VkPhysicalDevice> devices(deviceCount);
|
std::vector<VkPhysicalDevice> devices(deviceCount);
|
||||||
vkEnumeratePhysicalDevices(instance, &deviceCount, devices.data());
|
vkEnumeratePhysicalDevices(instance, &deviceCount, devices.data());
|
||||||
|
|
||||||
|
for(auto device : devices) {
|
||||||
|
VkPhysicalDeviceProperties deviceProperties;
|
||||||
|
vkGetPhysicalDeviceProperties(device, &deviceProperties);
|
||||||
|
|
||||||
|
prism::log("GPU = {}", deviceProperties.deviceName);
|
||||||
|
}
|
||||||
|
|
||||||
physicalDevice = devices[0];
|
physicalDevice = devices[0];
|
||||||
|
|
||||||
VkPhysicalDeviceProperties deviceProperties;
|
|
||||||
vkGetPhysicalDeviceProperties(physicalDevice, &deviceProperties);
|
|
||||||
|
|
||||||
prism::log("GPU = {}", deviceProperties.deviceName);
|
|
||||||
|
|
||||||
uint32_t extensionCount = 0;
|
uint32_t extensionCount = 0;
|
||||||
vkEnumerateDeviceExtensionProperties(physicalDevice, nullptr, &extensionCount, nullptr);
|
vkEnumerateDeviceExtensionProperties(physicalDevice, nullptr, &extensionCount, nullptr);
|
||||||
|
|
||||||
|
|
Reference in a new issue