Improve NX Vulkan support. (#3357)

This change was developed using publicly available information found in Vulkan headers and official documentation. No proprietary NX resources were used.

Co-authored-by: Бранимир Караџић <branimirkaradzic@gmail.com>
This commit is contained in:
Daniel Kalmar 2024-10-01 18:02:06 +02:00 committed by GitHub
parent 3303b451a1
commit 7e5bb54a3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -7022,6 +7022,16 @@ VK_DESTROY
result = vkCreateMacOSSurfaceMVK(instance, &sci, allocatorCb, &m_surface);
}
}
#elif BX_PLATFORM_NX
if (NULL != vkCreateViSurfaceNN)
{
VkViSurfaceCreateInfoNN sci;
sci.sType = VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN;
sci.pNext = NULL;
sci.flags = 0;
sci.window = m_nwh;
result = vkCreateViSurfaceNN(instance, &sci, allocatorCb, &m_surface);
}
#else
# error "Figure out KHR surface..."
#endif // BX_PLATFORM_

View File

@ -31,6 +31,10 @@
# define VK_USE_PLATFORM_MACOS_MVK
# define KHR_SURFACE_EXTENSION_NAME VK_MVK_MACOS_SURFACE_EXTENSION_NAME
# define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_MACOS
#elif BX_PLATFORM_NX
# define VK_USE_PLATFORM_VI_NN
# define KHR_SURFACE_EXTENSION_NAME VK_NN_VI_SURFACE_EXTENSION_NAME
# define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_NX
#else
# define KHR_SURFACE_EXTENSION_NAME ""
# define VK_IMPORT_INSTANCE_PLATFORM
@ -102,6 +106,10 @@
/* VK_MVK_macos_surface */ \
VK_IMPORT_INSTANCE_FUNC(true, vkCreateMacOSSurfaceMVK); \
#define VK_IMPORT_INSTANCE_NX \
/* VK_NN_vi_surface */ \
VK_IMPORT_INSTANCE_FUNC(true, vkCreateViSurfaceNN); \
#define VK_IMPORT_INSTANCE \
VK_IMPORT_INSTANCE_FUNC(false, vkDestroyInstance); \
VK_IMPORT_INSTANCE_FUNC(false, vkEnumeratePhysicalDevices); \