diff --git a/src/Devices.hs b/src/Devices.hs index faa72b7..91cd212 100644 --- a/src/Devices.hs +++ b/src/Devices.hs @@ -19,18 +19,22 @@ pickPhysicalDevice pickPhysicalDevice vkInstance = do physDevices <- snd <$> Vk.enumeratePhysicalDevices vkInstance - devicesWithProps <- V.mapM + devicesWithPropsAndFeatures <- V.mapM (\device -> do devProps <- Vk.getPhysicalDeviceProperties device - return (device, devProps) + devFeatures <- Vk.getPhysicalDeviceFeatures device + return (device, devProps, devFeatures) ) physDevices let discretePhysDevices = V.filter - (\(_, devProp) -> Vk.deviceType devProp == Vk.PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) - devicesWithProps - maxMemdiscretePhysDevice = fst $ V.foldl - (\acc@(_, devProp1) ndev@(_, devProp2) -> + (\(_, _, devFeatures) -> + -- Vk.deviceType devProp == Vk.PHYSICAL_DEVICE_TYPE_DISCRETE_GPU && + Vk.geometryShader devFeatures + ) + devicesWithPropsAndFeatures + maxMemdiscretePhysDevice = (\(x, _, _) -> x) $ V.foldl + (\acc@(_, devProp1, _) ndev@(_, devProp2, _) -> let dimension = Vk.maxImageDimension2D . Vk.limits in if dimension devProp1 < dimension devProp2