浏览代码

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 月之前
父节点
当前提交
9cecb90ba1
共有 1 个文件被更改,包括 1 次插入1 次删除
  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;