Skip to content

Commit

Permalink
Fix adapter selection in Vulkan demo (#17442)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SCLDGit authored Nov 6, 2024
1 parent 8f7686f commit 9cecb90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/GpuInterop/VulkanDemo/D3DMemoryHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static D3DDevice CreateDeviceByLuid(Span<byte> luid)
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;

Expand Down

0 comments on commit 9cecb90

Please sign in to comment.