Skip to content

Commit b1fb2a3

Browse files
Prefer RT-capable GPUs in adapter ranking for multi-GPU systems
1 parent 1b5b0fb commit b1fb2a3

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

src/dxvk/dxvk_adapter.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ namespace dxvk {
299299
* and general troubleshooting.
300300
*/
301301
void logAdapterInfo() const;
302-
302+
303303
/**
304304
* \brief Checks whether this is a UMA system
305305
*
@@ -308,9 +308,19 @@ namespace dxvk {
308308
* \returns \c true if the system has unified memory.
309309
*/
310310
bool isUnifiedMemoryArchitecture() const;
311-
312311

313312
// NV-DXVK start: Device filtering
313+
314+
/**
315+
* \brief Checks whether a device extension is supported
316+
*
317+
* \param [in] pName Extension name
318+
* \returns \c true if the extension is supported
319+
*/
320+
bool supportsExtension(const char* pName) const {
321+
return m_deviceExtensions.supports(pName) != 0;
322+
}
323+
314324
/**
315325
* \brief Checks if adapter is emulated
316326
*

src/dxvk/dxvk_instance.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,20 @@ namespace dxvk {
910910
if (b->deviceProperties().deviceType == deviceTypes[i]) bRank = i;
911911
}
912912

913-
return aRank < bRank;
913+
if (aRank != bRank)
914+
return aRank < bRank;
915+
916+
// Among adapters of the same device type, prefer ones that support
917+
// ray tracing extensions required by RTX Remix.
918+
const bool aSupportsRT = a->supportsExtension(VK_KHR_RAY_QUERY_EXTENSION_NAME)
919+
&& a->supportsExtension(VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME);
920+
const bool bSupportsRT = b->supportsExtension(VK_KHR_RAY_QUERY_EXTENSION_NAME)
921+
&& b->supportsExtension(VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME);
922+
923+
if (aSupportsRT != bSupportsRT)
924+
return aSupportsRT;
925+
926+
return false;
914927
});
915928

916929
if (result.size() == 0) {

0 commit comments

Comments
 (0)