Fix horrifically broken switchable graphics layer
Fix horrifically broken switchable graphics layer

This layer crashes everything for me right now including vulkaninfo, this is because it's entirely broken when either
RADV or lavapipe appears before AMDVLK in the device ordering because...

You **can't** pass the caller's pPhysicalDeviceCount value down the chain!

You MUST to query ALL of the physical devices beforehand and THEN filter, you cannot
query only the number of physical devices you return because you've already removed them (!!!)

This also adds correct handling for returning VK_INCOMPLETE which was missing.

Also cleans up the 3 loops doing the same thing into one.

Signed-off-by: Joshua Ashton <d6955d9721560531274cb8f50ff595a9bd39d66f@froggi.es>

GPUOpen-Drivers/xgl,GPUOpen-Drivers/xgl,GPUOpen-Drivers/xgl