it würgs

This commit is contained in:
nek0 2022-12-02 16:58:57 +01:00
parent d1b73ba36e
commit 2219355483
2 changed files with 9 additions and 9 deletions

View file

@ -21,10 +21,10 @@ initAllocator
-> Vk.Instance -> Vk.Instance
-> m VMA.Allocator -> m VMA.Allocator
initAllocator physicalDevice device instance' = do initAllocator physicalDevice device instance' = do
instanceProcAddr <- liftIO $ peek $ castFunPtrToPtr $ let instanceProcAddr = castFunPtr $
Vk.pVkGetInstanceProcAddr ((Vk.instanceCmds :: Vk.Instance -> Vk.InstanceCmds) instance') Vk.pVkGetInstanceProcAddr ((Vk.instanceCmds :: Vk.Instance -> Vk.InstanceCmds) instance')
deviceProcAddr <- liftIO $ peek $ castFunPtrToPtr $ deviceProcAddr = castFunPtr $
Vk.pVkGetDeviceProcAddr ((Vk.deviceCmds :: Vk.Device -> Vk.DeviceCmds) device) Vk.pVkGetDeviceProcAddr ((Vk.deviceCmds :: Vk.Device -> Vk.DeviceCmds) device)
let allocatorInfo = Vk.zero let allocatorInfo = Vk.zero
{ VMA.physicalDevice = Vk.physicalDeviceHandle physicalDevice { VMA.physicalDevice = Vk.physicalDeviceHandle physicalDevice
, VMA.device = Vk.deviceHandle device , VMA.device = Vk.deviceHandle device

View file

@ -10,7 +10,7 @@ import qualified Data.Vector as V
import Foreign import Foreign
import Linear (V3(..)) import Linear (V3(..), V4(..))
import qualified VulkanMemoryAllocator as VMA import qualified VulkanMemoryAllocator as VMA
import qualified Vulkan.Core10 as Vk import qualified Vulkan.Core10 as Vk
@ -24,9 +24,9 @@ loadMeshes
:: V.Vector Vertex :: V.Vector Vertex
loadMeshes = loadMeshes =
V.fromList 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) (V4 0 0 0 0)
, Vertex (V3 (-0.5) 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 (-0.5) 0) (V3 0 1 0) undefined , Vertex (V3 0 (-0.5) 0) (V3 0 1 0) (V4 0 0 0 0)
] ]
uploadMesh uploadMesh
@ -36,7 +36,7 @@ uploadMesh
-> m Mesh -> m Mesh
uploadMesh vertices allocator = do uploadMesh vertices allocator = do
let bufferCreateInfo = Vk.zero 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 , Vk.usage = Vk.BUFFER_USAGE_VERTEX_BUFFER_BIT
} }
allocationCreateInfo = Vk.zero allocationCreateInfo = Vk.zero