check for geometry shader availability

This commit is contained in:
nek0 2022-07-11 05:21:57 +02:00
parent 8b4dc69e5c
commit 836012beea

View file

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