File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,17 @@ WindowTraits::WindowTraits(CommandLine& arguments)
5454 arguments.read (" --screen" , screenNum);
5555 arguments.read (" --display" , display);
5656 arguments.read (" --samples" , samples);
57+
58+ auto setDevicePref = [&](const VkPhysicalDeviceType typeIn)
59+ {
60+ auto it = std::find (deviceTypePreferences.begin (), deviceTypePreferences.end (), typeIn);
61+ if (it != deviceTypePreferences.end ()) deviceTypePreferences.erase (it);
62+ deviceTypePreferences.insert (deviceTypePreferences.begin (), typeIn);
63+ };
64+ if (arguments.read (" --prefer-integrated" )) setDevicePref (VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU);
65+ if (arguments.read (" --prefer-discrete" )) setDevicePref (VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU);
66+ if (arguments.read (" --prefer-virtual" )) setDevicePref (VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU);
67+ if (arguments.read (" --prefer-cpu" )) setDevicePref (VK_PHYSICAL_DEVICE_TYPE_CPU);
5768}
5869
5970WindowTraits::WindowTraits (const WindowTraits& traits, const CopyOp& copyop) :
You can’t perform that action at this time.
0 commit comments