diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7be71c..f06bd1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set Environment variables - run: echo "::set-env name=VULKAN_SDK::C:\VulkanSDK\${{env.VulkanSDKVersion}}" + run: echo "VULKAN_SDK=C:\VulkanSDK\${{env.VulkanSDKVersion}}" >> $GITHUB_ENV - name: Download & Install Vulkan SDK run: | Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/${{env.VulkanSDKVersion}}/windows/VulkanSDK-${{env.VulkanSDKVersion}}-Installer.exe?u= -OutFile ../vulkan-sdk-${{env.VulkanSDKVersion}}.exe @@ -65,10 +65,10 @@ jobs: - name: Set Environment variables run: | VULKAN_SDK=$GITHUB_WORKSPACE/../vulkansdk-macos-${{env.VulkanSDKVersion}}/macOS - echo ::set-env name=VULKAN_SDK::$VULKAN_SDK - echo ::set-env name=JULIA_VULKAN_SDK_SEARCH_PATH::$VULKAN_SDK/lib - echo ::set-env name=VK_LAYER_PATH::$VULKAN_SDK/share/vulkan/explicit_layer.d - echo ::set-env name=VK_ICD_FILENAMES::$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json + echo VULKAN_SDK=$VULKAN_SDK >> $GITHUB_ENV + echo JULIA_VULKAN_SDK_SEARCH_PATH=$VULKAN_SDK/lib >> $GITHUB_ENV + echo VK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d >> $GITHUB_ENV + echo VK_ICD_FILENAMES=$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json >> $GITHUB_ENV - name: Download & Extract Vulkan SDK run: | wget --no-cookies -O ../vulkansdk-macos-${{env.VulkanSDKVersion}}.dmg https://sdk.lunarg.com/sdk/download/${{env.VulkanSDKVersion}}/mac/vulkansdk-macos-${{env.VulkanSDKVersion}}.dmg?u= @@ -85,4 +85,4 @@ jobs: DISPLAY: :99 - uses: julia-actions/julia-uploadcodecov@latest env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/Project.toml b/Project.toml index 921010c..d08a40e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "VulkanCore" uuid = "16167f82-ea26-5cba-b1de-ed6fd5e30a11" -version = "1.2.1" +version = "1.2.2" [deps] CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" diff --git a/gen/generator.jl b/gen/generator.jl index 38e60ab..b1f1e22 100755 --- a/gen/generator.jl +++ b/gen/generator.jl @@ -9,6 +9,7 @@ VK_HEADERS = [joinpath(VK_INCLUDE, "vulkan.h")] # include all extensions VK_EXTENSIONS = [ + "VK_USE_PLATFORM_DIRECTFB_EXT", "VK_USE_PLATFORM_ANDROID_KHR", "VK_USE_PLATFORM_FUCHSIA", "VK_USE_PLATFORM_IOS_MVK", @@ -55,4 +56,4 @@ for func ∈ eachmatch(r"function (.*)\((.*)\)\n (ccall.*)\nend", api_str) end open(api_file, "a+") do io write(io, "\n" * join(wrapped_funcs, "\n")) -end \ No newline at end of file +end diff --git a/gen/vk_api.jl b/gen/vk_api.jl index 23c7cee..4fd473c 100755 --- a/gen/vk_api.jl +++ b/gen/vk_api.jl @@ -1626,6 +1626,14 @@ function vkGetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFami ccall((:vkGetPhysicalDeviceXlibPresentationSupportKHR, libvulkan), VkBool32, (VkPhysicalDevice, UInt32, Ptr{Display}, VisualID), physicalDevice, queueFamilyIndex, dpy, visualID) end +function vkCreateDirectFBSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface) + ccall((:vkCreateDirectFBSurfaceEXT, libvulkan), VkResult, (VkInstance, Ptr{VkDirectFBSurfaceCreateInfoEXT}, Ptr{VkAllocationCallbacks}, Ptr{VkSurfaceKHR}), instance, pCreateInfo, pAllocator, pSurface) +end + +function vkGetPhysicalDeviceDirectFBPresentationSupportEXT(physicalDevice, queueFamilyIndex, dfb) + ccall((:vkGetPhysicalDeviceDirectFBPresentationSupportEXT, libvulkan), VkBool32, (VkPhysicalDevice, UInt32, Ptr{Cint}), physicalDevice, queueFamilyIndex, dfb) +end + function vkAcquireXlibDisplayEXT(physicalDevice, dpy, display) ccall((:vkAcquireXlibDisplayEXT, libvulkan), VkResult, (VkPhysicalDevice, Ptr{Display}, VkDisplayKHR), physicalDevice, dpy, display) end @@ -3354,6 +3362,14 @@ function vkGetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFami ccall(fun_ptr, VkBool32, (VkPhysicalDevice, UInt32, Ptr{Display}, VisualID), physicalDevice, queueFamilyIndex, dpy, visualID) end +function vkCreateDirectFBSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface, fun_ptr) + ccall(fun_ptr, VkResult, (VkInstance, Ptr{VkDirectFBSurfaceCreateInfoEXT}, Ptr{VkAllocationCallbacks}, Ptr{VkSurfaceKHR}), instance, pCreateInfo, pAllocator, pSurface) +end + +function vkGetPhysicalDeviceDirectFBPresentationSupportEXT(physicalDevice, queueFamilyIndex, dfb, fun_ptr) + ccall(fun_ptr, VkBool32, (VkPhysicalDevice, UInt32, Ptr{Cint}), physicalDevice, queueFamilyIndex, dfb) +end + function vkAcquireXlibDisplayEXT(physicalDevice, dpy, display, fun_ptr) ccall(fun_ptr, VkResult, (VkPhysicalDevice, Ptr{Display}, VkDisplayKHR), physicalDevice, dpy, display) end diff --git a/gen/vk_common.jl b/gen/vk_common.jl index 1a84672..d3a630b 100755 --- a/gen/vk_common.jl +++ b/gen/vk_common.jl @@ -676,6 +676,10 @@ const VULKAN_XLIB_H_ = 1 const VK_KHR_xlib_surface = 1 const VK_KHR_XLIB_SURFACE_SPEC_VERSION = 6 const VK_KHR_XLIB_SURFACE_EXTENSION_NAME = "VK_KHR_xlib_surface" +const VULKAN_DIRECTFB_H_ = 1 +const VK_EXT_directfb_surface = 1 +const VK_EXT_DIRECTFB_SURFACE_SPEC_VERSION = 1 +const VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME = "VK_EXT_directfb_surface" const VULKAN_XLIB_XRANDR_H_ = 1 const VK_EXT_acquire_xlib_display = 1 const VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION = 1 @@ -8785,6 +8789,18 @@ end const PFN_vkCreateXlibSurfaceKHR = Ptr{Cvoid} const PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR = Ptr{Cvoid} +const VkDirectFBSurfaceCreateFlagsEXT = VkFlags + +struct VkDirectFBSurfaceCreateInfoEXT + sType::VkStructureType + pNext::Ptr{Cvoid} + flags::VkDirectFBSurfaceCreateFlagsEXT + dfb::Ptr{Cint} + surface::Ptr{Cint} +end + +const PFN_vkCreateDirectFBSurfaceEXT = Ptr{Cvoid} +const PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT = Ptr{Cvoid} const PFN_vkAcquireXlibDisplayEXT = Ptr{Cvoid} const PFN_vkGetRandROutputDisplayEXT = Ptr{Cvoid} const VkStreamDescriptorSurfaceCreateFlagsGGP = VkFlags diff --git a/src/LibVulkan.jl b/src/LibVulkan.jl index 5cfd8da..9bc155e 100644 --- a/src/LibVulkan.jl +++ b/src/LibVulkan.jl @@ -57,6 +57,19 @@ const ANativeWindow = Cvoid # TODO: make opaque for now # Windows const HINSTANCE = Ptr{Cvoid} const HWND = Ptr{Cvoid} +const HMONITOR = Ptr{Cvoid} +const HANDLE = HMONITOR +const DWORD = UInt32 +const LPCWSTR = UInt16 +const SECURITY_ATTRIBUTES = Cvoid # opaque struct +# DirectFB +const IDirectFB = Cvoid # opaque struct +const IDirectFBSurface = Cvoid # opaque struct +# Zircon +const zx_handle_t = UInt32 +# GGP C +const GgpStreamDescriptor = UInt32 +const GgpFrameToken = UInt32 # TODO: Clang.jl should support this kinda macros VK_MAKE_VERSION(major, minor, patch) = ( Cuint(major) << 22 ) | ( Cuint(minor) << 12 ) | patch