From 341260b2cdc89c1e15eefb68b0e333f8da1cb3cd Mon Sep 17 00:00:00 2001 From: nek0 Date: Sat, 7 Jan 2023 00:14:39 +0100 Subject: [PATCH] meowy --- flake.nix | 1 + src/Init.hs | 2 +- src/Instance.hs | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 165c82f..8e2f259 100644 --- a/flake.nix +++ b/flake.nix @@ -36,6 +36,7 @@ ]) ++ (with pkgs; [ shaderc ]); + SDL_VULKAN_LIBRARY = "${pkgs.vulkan-loader}/lib/libvulkan.so"; }; #devShell = pkgs.mkShell { # buildInputs = with haskellPackages; [ diff --git a/src/Init.hs b/src/Init.hs index de6c991..b4a482c 100644 --- a/src/Init.hs +++ b/src/Init.hs @@ -37,7 +37,7 @@ initEngine initEngine = do -- initialize SDL2 with all subsystems void $ allocate_ - SDL.initializeAll + (SDL.initialize [ SDL.InitVideo ]) (do putStrLn "This is the end!" SDL.quit diff --git a/src/Instance.hs b/src/Instance.hs index b74701b..c865734 100644 --- a/src/Instance.hs +++ b/src/Instance.hs @@ -14,8 +14,9 @@ import qualified Vulkan.Zero as Vk createInstance :: MonadResource m => SDL.Window -> m Vk.Instance createInstance window = do - windowExtensions <- liftIO $ fmap (Vk.EXT_DEBUG_UTILS_EXTENSION_NAME :) $ - traverse BS.packCString =<< SDL.vkGetInstanceExtensions window + windowExtensions <- + (++) [Vk.KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, Vk.EXT_DEBUG_UTILS_EXTENSION_NAME] <$> + ((liftIO . mapM BS.packCString) =<< SDL.vkGetInstanceExtensions window) liftIO $ do putStrLn "activating followinfg extensions:" print windowExtensions @@ -30,6 +31,8 @@ createInstance window = do , Vk.enabledLayerNames = V.singleton "VK_LAYER_KHRONOS_validation" } + SDL.vkLoadLibrary Nothing + (_, inst) <- allocate (Vk.createInstance createInfo Nothing) (\inst -> do