202: Added vkGetPhysicalDeviceWin32PresentationSupportKHR r=kvark a=SaschaWillems

This PR adds vkGetPhysicalDeviceWin32PresentationSupportKHR, which will allow applications that query this work with gfx-portability. One such application is my Vulkan Hardware Capability Viewer.

Adding this function will also silences a Vulkan loader debug message that is shown for ICDs not implementing vkGetPhysicalDeviceWin32PresentationSupportKHR.

The implementation will always just return true.

Co-authored-by: Sascha Willems <webmaster@saschawillems.de>
This commit is contained in:
bors[bot] 2019-10-24 20:48:59 +00:00 committed by GitHub
commit a9edbc0337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 0 deletions

View file

@ -521,6 +521,7 @@ pub extern "C" fn gfxGetInstanceProcAddr(
vkGetPhysicalDeviceSurfaceCapabilitiesKHR, PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR => gfxGetPhysicalDeviceSurfaceCapabilitiesKHR,
vkGetPhysicalDeviceSurfaceFormatsKHR, PFN_vkGetPhysicalDeviceSurfaceFormatsKHR => gfxGetPhysicalDeviceSurfaceFormatsKHR,
vkGetPhysicalDeviceSurfacePresentModesKHR, PFN_vkGetPhysicalDeviceSurfacePresentModesKHR => gfxGetPhysicalDeviceSurfacePresentModesKHR,
vkGetPhysicalDeviceWin32PresentationSupportKHR, PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR => gfxGetPhysicalDeviceWin32PresentationSupportKHR,
vkCreateWin32SurfaceKHR, PFN_vkCreateWin32SurfaceKHR => gfxCreateWin32SurfaceKHR,
vkCreateMetalSurfaceEXT, PFN_vkCreateMetalSurfaceEXT => gfxCreateMetalSurfaceEXT,
@ -4384,6 +4385,14 @@ pub extern "C" fn gfxGetPhysicalDeviceSurfacePresentModesKHR(
code
}
#[inline]
pub extern "C" fn gfxGetPhysicalDeviceWin32PresentationSupportKHR(
adapter: VkPhysicalDevice,
queueFamilyIndex: u32
) -> VkBool32 {
VK_TRUE
}
#[inline]
pub extern "C" fn gfxCreateSwapchainKHR(
gpu: VkDevice,

View file

@ -6938,6 +6938,10 @@ pub type PFN_vkCreateMacOSSurfaceMVK = ::std::option::Option<unsafe extern "C" f
pSurface: *mut VkSurfaceKHR,
) -> VkResult>;
pub type PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR = ::std::option::Option<unsafe extern "C" fn(
physicalDevice: VkPhysicalDevice,
queueFamilyIndex: u32,
) -> VkBool32>;
#[repr(C)]
#[derive(Debug, Copy)]

View file

@ -55,5 +55,6 @@ pub extern "C" fn vk_icdGetPhysicalDeviceProcAddr(
vkGetPhysicalDeviceSurfaceCapabilitiesKHR, PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR => gfxGetPhysicalDeviceSurfaceCapabilitiesKHR,
vkGetPhysicalDeviceSurfaceFormatsKHR, PFN_vkGetPhysicalDeviceSurfaceFormatsKHR => gfxGetPhysicalDeviceSurfaceFormatsKHR,
vkGetPhysicalDeviceSurfacePresentModesKHR, PFN_vkGetPhysicalDeviceSurfacePresentModesKHR => gfxGetPhysicalDeviceSurfacePresentModesKHR,
vkGetPhysicalDeviceWin32PresentationSupportKHR, PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR => gfxGetPhysicalDeviceWin32PresentationSupportKHR,
}
}

View file

@ -239,6 +239,14 @@ pub extern "C" fn vkGetPhysicalDeviceSurfacePresentModesKHR(
gfxGetPhysicalDeviceSurfacePresentModesKHR(adapter, surface, pPresentModeCount, pPresentModes)
}
#[no_mangle]
pub extern "C" fn vkGetPhysicalDeviceWin32PresentationSupportKHR(
adapter: VkPhysicalDevice,
queueFamilyIndex: u32,
) -> VkBool32 {
gfxGetPhysicalDeviceWin32PresentationSupportKHR(adapter, queueFamilyIndex)
}
#[no_mangle]
pub extern "C" fn vkCreateSwapchainKHR(
device: VkDevice,