Closed johnhutch111 closed 2 years ago
It seems ALL the procedures with ...2KHR are returning NIL during the LoadVulcanGlobalCommands
Hm, I'm currently working with a NVIDIA Geforce RTX3070 Mobile on PasVulkan. Which NVIDIA driver version you have? I've 512.59. But I'll double check by enforcing a Vulkan 1.2 context later.
Hm, are you working with a Vulkan 1.0, 1.1, 1.2 or 1.3 context? Since vkGetPhysicalDeviceProperties2KHR does exist only at Vulkan 1.0, since it was promoted to a Core API at Vulkan 1.1, see https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties2.html .
At my NVIDIA RTX3070 Mobile with driver version 512.59 vkGetPhysicalDeviceProperties2KHR does exist, even at >= Vulkan 1.1 contexts.
As well at my Intel Iris Xe Graphics iGPU (Intel Core i7 11370H)
So ignore it from LoadVulkanGlobalCommands and instead use it from LoadVulkanInstanceCommands . Vulkan is differencely layered here in this context, where not all API functions are already directly usable as global commands, but rather first later as instance commands or even later as device commands.
This also means fInstance.Commands is from LoadVulkanInstanceCommands and not from LoadVulkanGlobalCommands. So I see no issue here?
I am using the same NVIDIA driver 512.59. In my original post, the code ..
_if (fInstance.APIVersion and VK_API_VERSION_WITHOUT_PATCH_MASK)=VK_API_VERSION_10 then begin fInstance.Commands.GetPhysicalDeviceFeatures2KHR(Handle,@fFeatures2KHR); end else begin fInstance.Commands.GetPhysicalDeviceFeatures2(Handle,@fFeatures2KHR); end;
comes from pasvulkan.framework and does use fInstance.Commands as suggested. This is where the first fail is.
Shouldn't the code be something like..
if (fInstance.APIVersion and VK_API_VERSION_WITHOUT_PATCH_MASK)=VK_API_VERSION_1_0 AND Assigned(fInstance.Commands.GetPhysicalDeviceFeatures2KHR) then begin fInstance.Commands.GetPhysicalDeviceFeatures2KHR(Handle,@fFeatures2KHR); end else begin fInstance.Commands.GetPhysicalDeviceFeatures2(Handle,@fFeatures2KHR); end;
I can see why my last post won't work.
You use a lot of fInstance.APIVersion to test the current version for call availability. As this is user selected shouldn't there be another APIVersion which reflects the ACTUAL version of the API and not the user selected version. Or there needs another mechanism to handle the depricated calls.
Perhaps assigning the Procedure entry point for the new version to the old version in this case may work??
if not assigned(vkGetPhysicalDeviceProperties2KHR) then begin @vkGetPhysicalDeviceProperties2KHR:=vkVoidFunctionToPointer(vkGetProcAddress(LibVulkan,'vkGetPhysicalDeviceProperties2KHR')); If not assigned(vkGetPhysicalDeviceProperties2KHR) then @vkGetPhysicalDeviceProperties2KHR:= @vkGetPhysicalDeviceProperties2; @vk.fCommands.GetPhysicalDeviceProperties2KHR:=addr(vkGetPhysicalDeviceProperties2KHR); end;
In my system (Delphi XE8) fInstance.Commands.GetPhysicalDeviceProperties2KHR is NIL.
That fixed it. Thanks
if not assigned(vkGetPhysicalDeviceProperties2KHR) then begin @vkGetPhysicalDeviceProperties2KHR:=vkVoidFunctionToPointer(vkGetProcAddress(LibVulkan,'vkGetPhysicalDeviceProperties2KHR')); @vk.fCommands.GetPhysicalDeviceProperties2KHR:=addr(vkGetPhysicalDeviceProperties2KHR); end;
vkGetPhysicalDeviceProperties2KHR returns nil in LoadVulkanGlobalCommands
if (fInstance.APIVersion and VK_API_VERSION_WITHOUT_PATCH_MASK)=VK_API_VERSION_1_0 then begin fInstance.Commands.GetPhysicalDeviceFeatures2KHR(Handle,@fFeatures2KHR); end else begin fInstance.Commands.GetPhysicalDeviceFeatures2(Handle,@fFeatures2KHR); end;
Fails when fInstance.APIVersion = VK_API_VERSION_1_0 OK when GetPhysicalDeviceFeatures2 is called
VK_KHR_get_physical_device_properties2 extension NOT available on my NVIDIA RTX 3080 or Intel UHD hardware.
Vulkan API version 1.2.162. Any Suggestions??