mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 22:40:50 +00:00
Enable VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT only if the SDK supports it.
This commit is contained in:
parent
7eb075198e
commit
7784b197ca
2 changed files with 19 additions and 1 deletions
|
@ -1645,6 +1645,25 @@ qboolean QVk_Init(SDL_Window *window)
|
||||||
.ppEnabledExtensionNames = (const char* const*)wantedExtensions
|
.ppEnabledExtensionNames = (const char* const*)wantedExtensions
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// introduced in SDK 1.1.121
|
||||||
|
#if VK_HEADER_VERSION > 114
|
||||||
|
VkValidationFeatureEnableEXT validationFeaturesEnable[] = { VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT };
|
||||||
|
VkValidationFeaturesEXT validationFeatures = {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT,
|
||||||
|
.pNext = NULL,
|
||||||
|
.enabledValidationFeatureCount = sizeof(validationFeaturesEnable) / sizeof(validationFeaturesEnable[0]),
|
||||||
|
.pEnabledValidationFeatures = validationFeaturesEnable,
|
||||||
|
.disabledValidationFeatureCount = 0,
|
||||||
|
.pDisabledValidationFeatures = NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
if (vk_validation->value > 1)
|
||||||
|
{
|
||||||
|
createInfo.pNext = &validationFeatures;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// introduced in SDK 1.1.106
|
||||||
#if VK_HEADER_VERSION > 101
|
#if VK_HEADER_VERSION > 101
|
||||||
const char *validationLayers[] = { "VK_LAYER_KHRONOS_validation" };
|
const char *validationLayers[] = { "VK_LAYER_KHRONOS_validation" };
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -53,7 +53,6 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL debugUtilsCallback(VkDebugUtilsMessageSeve
|
||||||
break;
|
break;
|
||||||
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT:
|
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT:
|
||||||
R_Printf(PRINT_ALL, "VK_WARNING: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
R_Printf(PRINT_ALL, "VK_WARNING: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||||
assert(!"Vulkan warning occured!");
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
R_Printf(PRINT_ALL, "VK_ERROR: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
R_Printf(PRINT_ALL, "VK_ERROR: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||||
|
|
Loading…
Reference in a new issue