Parcourir la 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 il y a 1 an
Parent
commit
9cecb90ba1
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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;