mirror of
https://github.com/yquake2/ref_vk.git
synced 2024-11-26 13:51:07 +00:00
r_validation CVar to take in account only when positive.
This commit is contained in:
parent
39738797a1
commit
3907262678
5 changed files with 17 additions and 17 deletions
|
@ -1749,7 +1749,7 @@ qboolean QVk_Init(void)
|
|||
}
|
||||
|
||||
// add space for validation layer
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
extCount++;
|
||||
|
||||
#if defined(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME) && defined(__APPLE__)
|
||||
|
@ -1766,7 +1766,7 @@ qboolean QVk_Init(void)
|
|||
}
|
||||
|
||||
// restore extensions count
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
{
|
||||
extCount++;
|
||||
wantedExtensions[extCount - 1] = VK_EXT_DEBUG_UTILS_EXTENSION_NAME;
|
||||
|
@ -1855,7 +1855,7 @@ qboolean QVk_Init(void)
|
|||
const char *validationLayers[] = { "VK_LAYER_LUNARG_standard_validation" };
|
||||
#endif
|
||||
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
{
|
||||
createInfo.enabledLayerCount = sizeof(validationLayers) / sizeof(validationLayers[0]);
|
||||
createInfo.ppEnabledLayerNames = validationLayers;
|
||||
|
@ -1867,7 +1867,7 @@ qboolean QVk_Init(void)
|
|||
|
||||
VkResult res = vkCreateInstance(&createInfo, NULL, &vk_instance);
|
||||
|
||||
if (res == VK_ERROR_LAYER_NOT_PRESENT && r_validation->value) {
|
||||
if (res == VK_ERROR_LAYER_NOT_PRESENT && r_validation->value > 0) {
|
||||
// we give a "last try" if the validation layer fails
|
||||
// before falling back to a GL renderer
|
||||
createInfo.enabledLayerCount = 0;
|
||||
|
@ -1889,7 +1889,7 @@ qboolean QVk_Init(void)
|
|||
|
||||
volkLoadInstance(vk_instance);
|
||||
R_Printf(PRINT_ALL, "...created Vulkan instance\n");
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
{
|
||||
// initialize function pointers
|
||||
qvkCreateDebugUtilsMessengerEXT = (PFN_vkCreateDebugUtilsMessengerEXT)vkGetInstanceProcAddr(vk_instance, "vkCreateDebugUtilsMessengerEXT");
|
||||
|
@ -1911,7 +1911,7 @@ qboolean QVk_Init(void)
|
|||
qvkInsertDebugUtilsLabelEXT = NULL;
|
||||
}
|
||||
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
QVk_CreateValidationLayers();
|
||||
|
||||
if (!Vkimp_CreateSurface(vk_window))
|
||||
|
@ -1927,7 +1927,7 @@ qboolean QVk_Init(void)
|
|||
}
|
||||
QVk_DebugSetObjectName((uintptr_t)vk_device.physical, VK_OBJECT_TYPE_PHYSICAL_DEVICE, va("Physical Device: %s", vk_config.vendor_name));
|
||||
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
vulkan_memory_types_show();
|
||||
|
||||
// setup swapchain
|
||||
|
|
|
@ -259,7 +259,7 @@ static VkResult createLogicalDevice()
|
|||
const char *validationLayers[] = { "VK_LAYER_LUNARG_standard_validation" };
|
||||
#endif
|
||||
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
{
|
||||
deviceCreateInfo.enabledLayerCount = sizeof(validationLayers)/sizeof(validationLayers[0]);
|
||||
deviceCreateInfo.ppEnabledLayerNames = validationLayers;
|
||||
|
|
|
@ -1150,7 +1150,7 @@ Vk_LoadPic(const char *name, byte *pic, int width, int realwidth,
|
|||
|
||||
// update count of loaded images
|
||||
img_loaded ++;
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: Load %s[%d]\n", __func__, image->name, img_loaded);
|
||||
}
|
||||
|
@ -1501,7 +1501,7 @@ image_t *Vk_FindImage (char *name, imagetype_t type)
|
|||
//
|
||||
image = Vk_LoadImage(name, namewe, ext, type);
|
||||
|
||||
if (!image && r_validation->value)
|
||||
if (!image && r_validation->value > 0)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: can't load %s\n", __func__, name);
|
||||
}
|
||||
|
@ -1578,7 +1578,7 @@ void Vk_FreeUnusedImages (void)
|
|||
if (image->type == it_pic)
|
||||
continue; // don't free pics
|
||||
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: Unload %s[%d]\n", __func__, image->name, img_loaded);
|
||||
}
|
||||
|
@ -1710,7 +1710,7 @@ void Vk_ShutdownImages (void)
|
|||
if (!image->registration_sequence)
|
||||
continue; // free image_t slot
|
||||
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: Unload %s[%d]\n", __func__, image->name, img_loaded);
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ static void Mod_Free (model_t *mod)
|
|||
return;
|
||||
}
|
||||
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: Unload %s[%d]\n", __func__, mod->name, mod_loaded);
|
||||
}
|
||||
|
@ -1078,7 +1078,7 @@ Mod_ForName (const char *name, model_t *parent_model, qboolean crash)
|
|||
__func__, mod->name);
|
||||
}
|
||||
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: Can't load %s\n", __func__, mod->name);
|
||||
}
|
||||
|
@ -1088,7 +1088,7 @@ Mod_ForName (const char *name, model_t *parent_model, qboolean crash)
|
|||
|
||||
// update count of loaded models
|
||||
mod_loaded ++;
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: Load %s[%d]\n", __func__, mod->name, mod_loaded);
|
||||
}
|
||||
|
|
|
@ -467,7 +467,7 @@ memory_create_by_property(VkMemoryRequirements* mem_reqs,
|
|||
VkMemoryPropertyFlags host_visible;
|
||||
uint32_t memory_index;
|
||||
|
||||
if (r_validation->value)
|
||||
if (r_validation->value > 0)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "Asked about memory properties with:\n");
|
||||
memory_type_print(mem_properties);
|
||||
|
@ -487,7 +487,7 @@ memory_create_by_property(VkMemoryRequirements* mem_reqs,
|
|||
__func__, __LINE__);
|
||||
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
|
||||
}
|
||||
else if (r_validation->value)
|
||||
else if (r_validation->value > 0)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s:%d: Selected %d memory properties with:\n",
|
||||
__func__, __LINE__, memory_index);
|
||||
|
|
Loading…
Reference in a new issue