Laszlo Agocs 2b451c81a3 rhi: Introduce a way to enumerate adapters/physical devices
Requesting a given "adapter" (or whatever the native equivalent of that
is, e.g. a VkPhysicalDevice with Vulkan) has already been possible
either via the index-based environment-variables (QT_D3D_ADAPTER_INDEX
and QT_VK_PHYSICAL_DEVICE_INDEX), or by passing in a VkPhysicalDevice in
QRhiVulkanNativeHandles or an adapter LUID in QD3D1xNativeHandles to
create(). (the latter is what QQuickGraphicsDevice's fromAdapter() or
fromPhysicalDevice() builds on, and is one of the enablers for the
OpenXR integration in Qt Quick 3D for instance)

There was however no way to enumerate the adapters via QRhi APIs, in
order to implement something such as "iterate through the available
adapters and choose one from the list", without resorting directly to
DXGI or Vulkan. This is what enumerateAdapters() enables now.

Implemented for D3D11, D3D12, and Vulkan. There are no plans to
implement it for others for now. (meaning the resulting list is always
empty then)

For symmetry, it is also possible to get a single QRhiAdapter based on a
provided native adapter identity (i.e, LUID or VkPhysicalDevice),
although in practice that is just a heavier way to achieve the same that
was already possible by passing those native handles directly to
create() instead of going through a QRhiAdapter.

[ChangeLog][RHI] Introduced enumerateAdapters() in QRhi to provide a
an abstraction for enumerating adapters (physical devices) with
Direct 3D and Vulkan.

Fixes: QTBUG-129932
Change-Id: I072553afe594cbad6ebfa1ffe849a782c4c181db
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
2025-01-23 09:59:08 +01:00
2024-11-05 14:36:16 +01:00
2024-11-05 14:36:16 +01:00
2024-12-13 14:54:23 +00:00
2024-06-25 11:44:00 +02:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%