Rename vk_validation to r_validation

Prepare to merge share image load: https://github.com/yquake2/yquake2/pull/924
This commit is contained in:
Denis Pauk 2022-11-19 14:39:55 +02:00
parent 42ab79aa1d
commit 8a79f754d2
9 changed files with 26 additions and 26 deletions

View file

@ -32,9 +32,9 @@ windows.
## Console Variables
* **vk_validation**: Toggle validation layers:
* **r_validation**: Toggle validation layers:
* `0` - disabled (default in Release)
* `1` - only errors and warnings
* `1` - only errors and warnings, show image load issues
* `2` - best-practices validation
* **vk_strings**: Print some basic Vulkan/GPU information.

View file

@ -134,7 +134,7 @@ extern cvar_t *r_gunfov;
extern cvar_t *r_farsee;
extern cvar_t *vk_overbrightbits;
extern cvar_t *vk_validation;
extern cvar_t *r_validation;
extern cvar_t *vk_picmip;
extern cvar_t *vk_skymip;
extern cvar_t *vk_flashblend;

View file

@ -1749,7 +1749,7 @@ qboolean QVk_Init(void)
}
// add space for validation layer
if (vk_validation->value)
if (r_validation->value)
extCount++;
#if defined(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME) && defined(__APPLE__)
@ -1766,7 +1766,7 @@ qboolean QVk_Init(void)
}
// restore extensions count
if (vk_validation->value)
if (r_validation->value)
{
extCount++;
wantedExtensions[extCount - 1] = VK_EXT_DEBUG_UTILS_EXTENSION_NAME;
@ -1842,7 +1842,7 @@ qboolean QVk_Init(void)
.pDisabledValidationFeatures = NULL
};
if (vk_validation->value > 1)
if (r_validation->value > 1)
{
createInfo.pNext = &validationFeatures;
}
@ -1855,7 +1855,7 @@ qboolean QVk_Init(void)
const char *validationLayers[] = { "VK_LAYER_LUNARG_standard_validation" };
#endif
if (vk_validation->value)
if (r_validation->value)
{
createInfo.enabledLayerCount = sizeof(validationLayers) / sizeof(validationLayers[0]);
createInfo.ppEnabledLayerNames = validationLayers;
@ -1867,15 +1867,15 @@ qboolean QVk_Init(void)
VkResult res = vkCreateInstance(&createInfo, NULL, &vk_instance);
if (res == VK_ERROR_LAYER_NOT_PRESENT && vk_validation->value) {
if (res == VK_ERROR_LAYER_NOT_PRESENT && r_validation->value) {
// we give a "last try" if the validation layer fails
// before falling back to a GL renderer
createInfo.enabledLayerCount = 0;
createInfo.ppEnabledLayerNames = 0;
createInfo.pNext = NULL;
memset(vk_config.layers, 0, sizeof(vk_config.layers));
ri.Cvar_Set("vk_validation", "0");
R_Printf(PRINT_ALL, "%s(): Could not create Vulkan instance, disabling vk_validation\n", __func__);
ri.Cvar_Set("r_validation", "0");
R_Printf(PRINT_ALL, "%s(): Could not create Vulkan instance, disabling r_validation\n", __func__);
res = vkCreateInstance(&createInfo, NULL, &vk_instance);
}
@ -1889,7 +1889,7 @@ qboolean QVk_Init(void)
volkLoadInstance(vk_instance);
R_Printf(PRINT_ALL, "...created Vulkan instance\n");
if (vk_validation->value)
if (r_validation->value)
{
// initialize function pointers
qvkCreateDebugUtilsMessengerEXT = (PFN_vkCreateDebugUtilsMessengerEXT)vkGetInstanceProcAddr(vk_instance, "vkCreateDebugUtilsMessengerEXT");
@ -1911,7 +1911,7 @@ qboolean QVk_Init(void)
qvkInsertDebugUtilsLabelEXT = NULL;
}
if (vk_validation->value)
if (r_validation->value)
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 (vk_validation->value)
if (r_validation->value)
vulkan_memory_types_show();
// setup swapchain

View file

@ -259,7 +259,7 @@ static VkResult createLogicalDevice()
const char *validationLayers[] = { "VK_LAYER_LUNARG_standard_validation" };
#endif
if (vk_validation->value)
if (r_validation->value)
{
deviceCreateInfo.enabledLayerCount = sizeof(validationLayers)/sizeof(validationLayers[0]);
deviceCreateInfo.ppEnabledLayerNames = validationLayers;

View file

@ -1149,7 +1149,7 @@ Vk_LoadPic(const char *name, byte *pic, int width, int realwidth,
// update count of loaded images
img_loaded ++;
if (vk_validation->value)
if (r_validation->value)
{
R_Printf(PRINT_ALL, "%s: Load %s[%d]\n", __func__, image->name, img_loaded);
}
@ -1500,7 +1500,7 @@ image_t *Vk_FindImage (char *name, imagetype_t type)
//
image = Vk_LoadImage(name, namewe, ext, type);
if (!image && vk_validation->value)
if (!image && r_validation->value)
{
R_Printf(PRINT_ALL, "%s: can't load %s\n", __func__, name);
}
@ -1577,7 +1577,7 @@ void Vk_FreeUnusedImages (void)
if (image->type == it_pic)
continue; // don't free pics
if (vk_validation->value)
if (r_validation->value)
{
R_Printf(PRINT_ALL, "%s: Unload %s[%d]\n", __func__, image->name, img_loaded);
}
@ -1709,7 +1709,7 @@ void Vk_ShutdownImages (void)
if (!image->registration_sequence)
continue; // free image_t slot
if (vk_validation->value)
if (r_validation->value)
{
R_Printf(PRINT_ALL, "%s: Unload %s[%d]\n", __func__, image->name, img_loaded);
}

View file

@ -183,7 +183,7 @@ Mesh_Free
*/
void Mesh_Free (void)
{
if (vk_validation->value > 1)
if (r_validation->value > 1)
{
R_Printf(PRINT_ALL, "%s: Deallocated %d mesh verts\n",
__func__, verts_count);

View file

@ -148,7 +148,7 @@ static void Mod_Free (model_t *mod)
return;
}
if (vk_validation->value)
if (r_validation->value)
{
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 (vk_validation->value)
if (r_validation->value)
{
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 (vk_validation->value)
if (r_validation->value)
{
R_Printf(PRINT_ALL, "%s: Load %s[%d]\n", __func__, mod->name, mod_loaded);
}

View file

@ -92,7 +92,7 @@ static cvar_t *r_customheight;
cvar_t *r_lightlevel; // FIXME: This is a HACK to get the client's light level
cvar_t *vk_overbrightbits;
cvar_t *vk_validation;
cvar_t *r_validation;
cvar_t *vk_picmip;
cvar_t *vk_skymip;
cvar_t *vk_flashblend;
@ -1174,7 +1174,7 @@ R_Register( void )
r_customheight = ri.Cvar_Get("r_customheight", "768", CVAR_ARCHIVE);
vk_overbrightbits = ri.Cvar_Get("vk_overbrightbits", "1.0", CVAR_ARCHIVE);
vk_validation = ri.Cvar_Get("vk_validation", "0", CVAR_ARCHIVE);
r_validation = ri.Cvar_Get("r_validation", "0", CVAR_ARCHIVE);
vk_picmip = ri.Cvar_Get("vk_picmip", "0", 0);
vk_skymip = ri.Cvar_Get("vk_skymip", "0", 0);
vk_flashblend = ri.Cvar_Get("vk_flashblend", "0", 0);
@ -1287,7 +1287,7 @@ R_SetMode (void)
vk_msaa->modified = false;
r_clear->modified = false;
vk_validation->modified = false;
r_validation->modified = false;
vk_mip_nearfilter->modified = false;
vk_sampleshading->modified = false;
vk_device_idx->modified = false;

View file

@ -76,7 +76,7 @@ void QVk_CreateValidationLayers()
.pUserData = NULL
};
if (vk_validation->value > 1)
if (r_validation->value > 1)
{
callbackInfo.messageSeverity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT |
VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT;