diff --git a/src/Memory.hs b/src/Memory.hs index be94627..0a4ea13 100644 --- a/src/Memory.hs +++ b/src/Memory.hs @@ -21,10 +21,10 @@ initAllocator -> Vk.Instance -> m VMA.Allocator initAllocator physicalDevice device instance' = do - instanceProcAddr <- liftIO $ peek $ castFunPtrToPtr $ - Vk.pVkGetInstanceProcAddr ((Vk.instanceCmds :: Vk.Instance -> Vk.InstanceCmds) instance') - deviceProcAddr <- liftIO $ peek $ castFunPtrToPtr $ - Vk.pVkGetDeviceProcAddr ((Vk.deviceCmds :: Vk.Device -> Vk.DeviceCmds) device) + let instanceProcAddr = castFunPtr $ + Vk.pVkGetInstanceProcAddr ((Vk.instanceCmds :: Vk.Instance -> Vk.InstanceCmds) instance') + deviceProcAddr = castFunPtr $ + Vk.pVkGetDeviceProcAddr ((Vk.deviceCmds :: Vk.Device -> Vk.DeviceCmds) device) let allocatorInfo = Vk.zero { VMA.physicalDevice = Vk.physicalDeviceHandle physicalDevice , VMA.device = Vk.deviceHandle device diff --git a/src/Mesh.hs b/src/Mesh.hs index 3d294f1..e89c2ee 100644 --- a/src/Mesh.hs +++ b/src/Mesh.hs @@ -10,7 +10,7 @@ import qualified Data.Vector as V import Foreign -import Linear (V3(..)) +import Linear (V3(..), V4(..)) import qualified VulkanMemoryAllocator as VMA import qualified Vulkan.Core10 as Vk @@ -24,9 +24,9 @@ loadMeshes :: V.Vector Vertex loadMeshes = V.fromList - [ Vertex (V3 0.5 0.5 0) (V3 0 1 0) undefined - , Vertex (V3 (-0.5) 0.5 0) (V3 0 1 0) undefined - , Vertex (V3 0 (-0.5) 0) (V3 0 1 0) undefined + [ Vertex (V3 0.5 0.5 0) (V3 0 1 0) (V4 0 0 0 0) + , Vertex (V3 (-0.5) 0.5 0) (V3 0 1 0) (V4 0 0 0 0) + , Vertex (V3 0 (-0.5) 0) (V3 0 1 0) (V4 0 0 0 0) ] uploadMesh @@ -36,7 +36,7 @@ uploadMesh -> m Mesh uploadMesh vertices allocator = do let bufferCreateInfo = Vk.zero - { Vk.size = fromIntegral $ sizeOf (undefined :: Vertex) + { Vk.size = fromIntegral $ sizeOf (Vertex (V3 0 0 0) (V3 0 0 0 ) (V4 0 0 0 0)) , Vk.usage = Vk.BUFFER_USAGE_VERTEX_BUFFER_BIT } allocationCreateInfo = Vk.zero