radv: add RADV_DEBUG=allentrypoints
This debug option allows vkGet[Instance/Device]ProcAddr() to succeed even if the extension associated with the requested entrypoint was not enabled. This has come in handy in a few instances when debugging VR applications, so I thought it would be good to have a cleaned up version upstreamed. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
0ae72df013
commit
bd960390bb
|
@ -54,6 +54,7 @@ enum {
|
||||||
RADV_DEBUG_NO_LOAD_STORE_OPT = 0x1000000,
|
RADV_DEBUG_NO_LOAD_STORE_OPT = 0x1000000,
|
||||||
RADV_DEBUG_NO_NGG = 0x2000000,
|
RADV_DEBUG_NO_NGG = 0x2000000,
|
||||||
RADV_DEBUG_NO_SHADER_BALLOT = 0x4000000,
|
RADV_DEBUG_NO_SHADER_BALLOT = 0x4000000,
|
||||||
|
RADV_DEBUG_ALL_ENTRYPOINTS = 0x8000000,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -497,6 +497,7 @@ static const struct debug_control radv_debug_options[] = {
|
||||||
{"noloadstoreopt", RADV_DEBUG_NO_LOAD_STORE_OPT},
|
{"noloadstoreopt", RADV_DEBUG_NO_LOAD_STORE_OPT},
|
||||||
{"nongg", RADV_DEBUG_NO_NGG},
|
{"nongg", RADV_DEBUG_NO_NGG},
|
||||||
{"noshaderballot", RADV_DEBUG_NO_SHADER_BALLOT},
|
{"noshaderballot", RADV_DEBUG_NO_SHADER_BALLOT},
|
||||||
|
{"allentrypoints", RADV_DEBUG_ALL_ENTRYPOINTS},
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3271,11 +3272,16 @@ PFN_vkVoidFunction radv_GetInstanceProcAddr(
|
||||||
const char* pName)
|
const char* pName)
|
||||||
{
|
{
|
||||||
RADV_FROM_HANDLE(radv_instance, instance, _instance);
|
RADV_FROM_HANDLE(radv_instance, instance, _instance);
|
||||||
|
bool unchecked = instance ? instance->debug_flags & RADV_DEBUG_ALL_ENTRYPOINTS : false;
|
||||||
|
|
||||||
return radv_lookup_entrypoint_checked(pName,
|
if (unchecked) {
|
||||||
instance ? instance->apiVersion : 0,
|
return radv_lookup_entrypoint_unchecked(pName);
|
||||||
instance ? &instance->enabled_extensions : NULL,
|
} else {
|
||||||
NULL);
|
return radv_lookup_entrypoint_checked(pName,
|
||||||
|
instance ? instance->apiVersion : 0,
|
||||||
|
instance ? &instance->enabled_extensions : NULL,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The loader wants us to expose a second GetInstanceProcAddr function
|
/* The loader wants us to expose a second GetInstanceProcAddr function
|
||||||
|
@ -3316,11 +3322,16 @@ PFN_vkVoidFunction radv_GetDeviceProcAddr(
|
||||||
const char* pName)
|
const char* pName)
|
||||||
{
|
{
|
||||||
RADV_FROM_HANDLE(radv_device, device, _device);
|
RADV_FROM_HANDLE(radv_device, device, _device);
|
||||||
|
bool unchecked = device ? device->instance->debug_flags & RADV_DEBUG_ALL_ENTRYPOINTS : false;
|
||||||
|
|
||||||
return radv_lookup_entrypoint_checked(pName,
|
if (unchecked) {
|
||||||
device->instance->apiVersion,
|
return radv_lookup_entrypoint_unchecked(pName);
|
||||||
&device->instance->enabled_extensions,
|
} else {
|
||||||
&device->enabled_extensions);
|
return radv_lookup_entrypoint_checked(pName,
|
||||||
|
device->instance->apiVersion,
|
||||||
|
&device->instance->enabled_extensions,
|
||||||
|
&device->enabled_extensions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool radv_get_memory_fd(struct radv_device *device,
|
bool radv_get_memory_fd(struct radv_device *device,
|
||||||
|
|
Loading…
Reference in New Issue