mirror of
https://gitlab.freedesktop.org/mesa/vulkan-wsi-layer.git
synced 2025-12-20 05:40:10 +01:00
Handle NULL instance parameter in vkGetInstanceProcAddr
The Vulkan spec allows passing a NULL VkInstance to vkGetInstanceProcAddr when querying global (pre-instance) function pointers, but these functions must be resolved only through the loader, not through layers. This change ensures that the layer correctly handles NULL instance and prevents such incorrect behavior comming from upper layers. Signed-off-by: Muhamad Sammar <muhamad.sammar@arm.com> Change-Id: Icd67fa4fb819a6f5ab4c5f40d73514ba79174c05
This commit is contained in:
parent
a0947a5ae8
commit
29a7a23847
1 changed files with 5 additions and 0 deletions
|
|
@ -756,6 +756,11 @@ wsi_layer_vkGetInstanceProcAddr(VkInstance instance, const char *funcName) VWL_A
|
|||
GET_PROC_ADDR(vkDestroyInstance);
|
||||
GET_PROC_ADDR(vkCreateDevice);
|
||||
|
||||
if (instance == VK_NULL_HANDLE)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto &instance_data = layer::instance_private_data::get(instance);
|
||||
const bool core_1_1 = instance_data.api_version >= VK_API_VERSION_1_1;
|
||||
if ((instance_data.is_instance_extension_enabled(VK_KHR_DEVICE_GROUP_EXTENSION_NAME) &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue