diff --git a/src/Init.hs b/src/Init.hs index 144ebf1..497bbbc 100644 --- a/src/Init.hs +++ b/src/Init.hs @@ -10,6 +10,7 @@ import Control.Monad import Control.Monad.IO.Class import Control.Monad.Reader import Control.Monad.Trans.Resource +import Data.Bits import qualified Data.Map.Strict as M import Data.Maybe import qualified Data.Vector as V @@ -305,7 +306,9 @@ initDescriptors device = do , Vk.bindings = V.singleton textureBind } poolInfo = Vk.zero - { Vk.flags = Vk.DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT + { Vk.flags = + Vk.DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT .|. + Vk.DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT , Vk.maxSets = 10 , Vk.poolSizes = V.fromList [ Vk.zero @@ -333,10 +336,10 @@ initDescriptors device = do (_, descriptorSetLayout2) <- Vk.withDescriptorSetLayout device setInfo2 Nothing allocate - (_, descriptorPool) <- - Vk.withDescriptorPool device poolInfo Nothing allocate - (_, textureDescriptorSetLayout) <- Vk.withDescriptorSetLayout device setInfo3 Nothing allocate + (_, descriptorPool) <- + Vk.withDescriptorPool device poolInfo Nothing allocate + return (descriptorSetLayout1, descriptorSetLayout2, textureDescriptorSetLayout, descriptorPool)