From 46df688ea488cabf325baaf08c8f40f90cc8ed1c Mon Sep 17 00:00:00 2001 From: Rodrigo Mesquita Date: Sat, 18 May 2024 00:28:01 +0100 Subject: [PATCH] Portability bits --- ghengin-core/ghengin-vulkan/Ghengin/Vulkan/Renderer.hs | 2 ++ .../Ghengin/Vulkan/Renderer/Device/Instance.hs | 5 ++++- shell.nix | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ghengin-core/ghengin-vulkan/Ghengin/Vulkan/Renderer.hs b/ghengin-core/ghengin-vulkan/Ghengin/Vulkan/Renderer.hs index 25280eb..717cb06 100644 --- a/ghengin-core/ghengin-vulkan/Ghengin/Vulkan/Renderer.hs +++ b/ghengin-core/ghengin-vulkan/Ghengin/Vulkan/Renderer.hs @@ -254,7 +254,9 @@ deviceExtensions :: Vector ByteString deviceExtensions = [ Vk.KHR_SWAPCHAIN_EXTENSION_NAME -- required at least from 1.3 with MoltenVk +#if defined(darwin_HOST_OS) , Vk.KHR_PORTABILITY_SUBSET_EXTENSION_NAME +#endif ] rateFn :: Vk.SurfaceKHR -> DeviceRateFunction diff --git a/ghengin-core/ghengin-vulkan/Ghengin/Vulkan/Renderer/Device/Instance.hs b/ghengin-core/ghengin-vulkan/Ghengin/Vulkan/Renderer/Device/Instance.hs index c59cdd8..308b841 100644 --- a/ghengin-core/ghengin-vulkan/Ghengin/Vulkan/Renderer/Device/Instance.hs +++ b/ghengin-core/ghengin-vulkan/Ghengin/Vulkan/Renderer/Device/Instance.hs @@ -67,7 +67,10 @@ createInstance validationLayers = Linear.liftSystemIO $ do instanceInfo glfwe = Vk.InstanceCreateInfo {..} where next = () - flags = Vk.InstanceCreateFlagBits 0 .|. Vk.INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR -- required at least on 1.3 w MoltenVk + flags = Vk.InstanceCreateFlagBits 0 +#if defined(darwin_HOST_OS) + .|. Vk.INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR -- required at least on 1.3 w MoltenVk +#endif applicationInfo = Just appInfo enabledLayerNames = validationLayers enabledExtensionNames = instanceExtensions <> glfwe diff --git a/shell.nix b/shell.nix index e48a8fe..aab295e 100644 --- a/shell.nix +++ b/shell.nix @@ -16,6 +16,13 @@ mkShell { # renderdoc # Graphics debugger # tracy # Graphics profiler vulkan-tools-lunarg # vkconfig + + # bindings-GLFW + xorg.libX11 + xorg.libXi + xorg.libXrandr + xorg.libXxf86vm + xorg.libXcursor ]; buildInputs = with pkgs; [