Browse Source

Fix adapter selection in Vulkan demo (#17442)

Changed the adapter index in the for loop to correctly iterate through available adapters. This ensures that the correct adapter is selected based on its Luid.
Matt Heimlich 11 months ago
parent
commit
9cecb90ba1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      samples/GpuInterop/VulkanDemo/D3DMemoryHelper.cs

+ 1 - 1
samples/GpuInterop/VulkanDemo/D3DMemoryHelper.cs

@@ -17,7 +17,7 @@ public class D3DMemoryHelper
         var longLuid = MemoryMarshal.Cast<byte, long>(luid)[0];
         for (var c = 0; c < factory.GetAdapterCount1(); c++)
         {
-            using var adapter = factory.GetAdapter1(0);
+            using var adapter = factory.GetAdapter1(c);
             if (adapter.Description1.Luid != longLuid)
                 continue;