phobos-rs
phobos-rs copied to clipboard
Custom PhysicalDevice Selection Logic
'Tis my first feature request. Tell me if this is good or if I should add more detail.
Implement a proper interface to allow users to select their PhysicalDevice (with potential fallback if none are selected?).
Two ways this could be done:
Allow users to fetch an iterator of PhysicalDevices somehow, and then force the user to pass a reference of one of those PhysicalDevice to AppSettings``. This forces the user to have a fallback ready when their own GPU selection impl fails.
Have a callback fn (F: Fn(&PhysicalDevice) -> bool) that will loop over all PhysicalDevices internally, and let user select their preferred physical device. This could be further extended by using a scoring system but I'd feel like that's a higher-level thing than what this lib wants to achieve, but I'm not sure. One problem with this method though is that we need to somehow select a fallback PhysicalDevice if the function returns false for all previous iterations.
Oh actually we could fix the latter by forcing the user to select a PhysicalDevice by using a F: Fn(&[&PhysicalDevice]) -> usize, which would force the user to pick a physical device (or could return 0 for a default physical device if needed)
I like the scoring approach yeah