AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
26.04k stars 2.25k forks source link

Fix adapter selection in Vulkan demo #17442

Closed SCLDGit closed 2 weeks ago

SCLDGit commented 2 weeks ago

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.

What does the pull request do?

This request fixes an index error in D3DMemoryHelper.cs that prevented usage of any graphics adapters other than the one in slot 0.

What is the current behavior?

factory.GetAdapter1() was hard-coded to always use index zero when iterating through graphics devices

What is the updated/expected behavior with this PR?

factory.GetAdapter1() now properly uses the iterator index when iterating through graphics devices

How was the solution implemented (if it's not obvious)?

Changed hard-coded '0' value to the index variable.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

avaloniaui-bot commented 2 weeks ago

You can test this PR using the following package version. 11.3.999-cibuild0053108-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

cla-avalonia commented 2 weeks ago
SCLDGit commented 2 weeks ago

@cla-avalonia agree