inexorgame / vulkan-renderer

A new 3D game engine for Linux and Windows using C++20 and Vulkan API 1.3, in very early but ongoing development
https://inexor.org
MIT License
757 stars 33 forks source link

Show drop-down-list to select gpu in ImGui #536

Open IAmNotHanni opened 1 year ago

IAmNotHanni commented 1 year ago

Is your feature request related to a problem?

If multiple gpus are available, display a "select gpu" dropdown list in ImGui.

Description

If multiple gpus are available, we have the --gpu <index> command line which allows the user to specify which gpu will be picked. (The code will validate that the chosen index is valid and that the chosen gpu is suitable for the application's purpose). However, there is no way of switching the gpu at runtime.

In my system, I have an AMD 7950X with an internal gpu chip (VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) and an Intel Arc A770 16GB (VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU).

Alternatives

Do not implement this.

Affected Code

UI rendering

Operating System

all

Additional Context

Switching to another gpu should not be difficult. You simply shut down the engine and restart it with the new gpu. To create the list, you must enumerate the physical devices and store both the index and the name of it.