From 581442f8c9a62b77cf39408dd71d3b2dd42b70ad 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 | 8 ++++++++ 3 files changed, 14 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..9935c4f 100644 --- a/shell.nix +++ b/shell.nix @@ -16,6 +16,14 @@ mkShell { # renderdoc # Graphics debugger # tracy # Graphics profiler vulkan-tools-lunarg # vkconfig + + # bindings-GLFW + xorg.libX11 + xorg.libXi + xorg.libXrandr + xorg.libXxf86vm + xorg.libXcursor + xorg.libXinerama ]; buildInputs = with pkgs; [