فهرست منبع

Merge pull request #2 from SKY-13th/feature/posix-support

Posix support
Jason Yegge 8 سال پیش
والد
کامیت
acae5faa70

+ 2 - 2
.gitignore

@@ -1,5 +1,5 @@
 .dub
+dub.*
+bin
 docs.json
 __dummy.html
-*.o
-*.obj

+ 3 - 3
package.json → dub.json

@@ -4,11 +4,11 @@
 	"description": "A dynamic binding to the vulkan api.",
 	"copyright": "Copyright © 2016, Felix Hufnagel",
 	"authors": ["Felix Hufnagel"],
-	
 	"targetPath": "bin",
 	"targetType": "library",
-	
 	"dependencies": {
-		"derelict-util" : ">=1.0.0"
+		"derelict-util" : ">=1.0.0",
+		"xlib-d": "~>0.1.1",
+		"xcb-d": "~>2.1.0+1.11.1"
 	}
 }

+ 83 - 0
source/derelict/vulkan/base.d

@@ -0,0 +1,83 @@
+/*
+** Copyright (c) 2015-2016 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+module derelict.vulkan.base;
+extern(System):
+
+//#include "vk_platform.h"
+
+auto VK_MAKE_VERSION(int major, int minor, int patch) {
+  return (major << 22) | (minor << 12) | patch;
+}
+
+auto VK_VERSION_MAJOR(uint ver) {
+  return ver >> 22;
+}
+
+auto VK_VERSION_MINOR(uint ver) {
+  return (ver >> 12) & 0x3ff;
+}
+
+auto VK_VERSION_PATCH(uint ver) {
+  return ver & 0xfff;
+}
+
+package auto VK_DEFINE_HANDLE(string name) {
+  return "struct " ~ name ~ "_T; \n alias " ~ name ~ " = " ~ name ~ "_T*;";
+}
+
+package auto VK_DEFINE_NON_DISPATCHABLE_HANDLE(string name) {
+  // #if defined(__LP64__)    || defined(_WIN64) 
+  //  || defined(__x86_64__)  || defined(_M_X64) 
+  //  || defined(__ia64)      || defined (_M_IA64) 
+  //  || defined(__aarch64__) || defined(__powerpc64__)
+  return VK_DEFINE_HANDLE(name);
+}
+
+alias VkFlags      = uint;
+alias VkBool32     = uint;
+alias VkDeviceSize = ulong;
+alias VkSampleMask = uint;
+
+enum VK_VERSION_1_0 = 1;
+enum VK_API_VERSION = VK_MAKE_VERSION(1, 0, 3); // Vulkan API version supported by this file
+enum VK_NULL_HANDLE = null;
+
+enum VK_TRUE  = 1;
+enum VK_FALSE = 0;
+
+enum VK_UUID_SIZE  = 16;
+enum VK_WHOLE_SIZE = (~0UL);
+
+enum VK_LOD_CLAMP_NONE    = 1000.0f;
+enum VK_ATTACHMENT_UNUSED = (~0U);
+enum VK_SUBPASS_EXTERNAL  = (~0U);
+
+enum VK_QUEUE_FAMILY_IGNORED   = (~0U);
+enum VK_REMAINING_MIP_LEVELS   = (~0U);
+enum VK_REMAINING_ARRAY_LAYERS = (~0U);
+
+enum VK_MAX_MEMORY_TYPES        = 32;
+enum VK_MAX_MEMORY_HEAPS        = 16;
+enum VK_MAX_EXTENSION_NAME_SIZE = 256;
+enum VK_MAX_DESCRIPTION_SIZE    = 256;
+enum VK_MAX_PHYSICAL_DEVICE_NAME_SIZE = 256;

+ 3 - 8
source/derelict/vulkan/functions.d

@@ -26,10 +26,10 @@ DEALINGS IN THE SOFTWARE.
 
 */
 module derelict.vulkan.functions;
-
+public import derelict.vulkan.system;
 
 private {
-	import derelict.vulkan.vk;
+	import derelict.vulkan.types;
 	import derelict.util.system;
 }
 
@@ -182,10 +182,5 @@ __gshared {
 	PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
 	PFN_vkWaitForFences vkWaitForFences;
 
-	static if(Derelict_OS_Windows)
-	{
-		PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR;
-		PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR;
-
-	}
+	mixin Functions;
 }

+ 216 - 0
source/derelict/vulkan/package.d

@@ -0,0 +1,216 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+module derelict.vulkan;
+
+public {
+	import derelict.vulkan.system;
+	import derelict.vulkan.types;
+	import derelict.vulkan.functions;
+}
+
+private {
+	import derelict.util.loader;
+	import derelict.util.system;
+}
+
+static if (libNames.length == 0) {
+  pragma(msg, "Library names are not specified for this system, "
+            , "please specify them when loading the library. "
+            , "Example: DerelictVulkan.load(\"libvulkan.so\");");
+}
+
+class DerelictVulkanLoader : SharedLibLoader {
+	protected {
+		override void loadSymbols() {
+			bindFunc(cast(void**)&vkAcquireNextImageKHR, "vkAcquireNextImageKHR");
+			bindFunc(cast(void**)&vkAllocateCommandBuffers, "vkAllocateCommandBuffers");
+			bindFunc(cast(void**)&vkAllocateDescriptorSets, "vkAllocateDescriptorSets");
+			bindFunc(cast(void**)&vkAllocateMemory, "vkAllocateMemory");
+			bindFunc(cast(void**)&vkBeginCommandBuffer, "vkBeginCommandBuffer");
+			bindFunc(cast(void**)&vkBindBufferMemory, "vkBindBufferMemory");
+			bindFunc(cast(void**)&vkBindImageMemory, "vkBindImageMemory");
+			bindFunc(cast(void**)&vkCmdBeginQuery, "vkCmdBeginQuery");
+			bindFunc(cast(void**)&vkCmdBeginRenderPass, "vkCmdBeginRenderPass");
+			bindFunc(cast(void**)&vkCmdBindDescriptorSets, "vkCmdBindDescriptorSets");
+			bindFunc(cast(void**)&vkCmdBindIndexBuffer, "vkCmdBindIndexBuffer");
+			bindFunc(cast(void**)&vkCmdBindPipeline, "vkCmdBindPipeline");
+			bindFunc(cast(void**)&vkCmdBindVertexBuffers, "vkCmdBindVertexBuffers");
+			bindFunc(cast(void**)&vkCmdBlitImage, "vkCmdBlitImage");
+			bindFunc(cast(void**)&vkCmdClearAttachments, "vkCmdClearAttachments");
+			bindFunc(cast(void**)&vkCmdClearColorImage, "vkCmdClearColorImage");
+			bindFunc(cast(void**)&vkCmdClearDepthStencilImage, "vkCmdClearDepthStencilImage");
+			bindFunc(cast(void**)&vkCmdCopyBuffer, "vkCmdCopyBuffer");
+			bindFunc(cast(void**)&vkCmdCopyBufferToImage, "vkCmdCopyBufferToImage");
+			bindFunc(cast(void**)&vkCmdCopyImage, "vkCmdCopyImage");
+			bindFunc(cast(void**)&vkCmdCopyImageToBuffer, "vkCmdCopyImageToBuffer");
+			bindFunc(cast(void**)&vkCmdCopyQueryPoolResults, "vkCmdCopyQueryPoolResults");
+			bindFunc(cast(void**)&vkCmdDispatch, "vkCmdDispatch");
+			bindFunc(cast(void**)&vkCmdDispatchIndirect, "vkCmdDispatchIndirect");
+			bindFunc(cast(void**)&vkCmdDraw, "vkCmdDraw");
+			bindFunc(cast(void**)&vkCmdDrawIndexed, "vkCmdDrawIndexed");
+			bindFunc(cast(void**)&vkCmdDrawIndexedIndirect, "vkCmdDrawIndexedIndirect");
+			bindFunc(cast(void**)&vkCmdDrawIndirect, "vkCmdDrawIndirect");
+			bindFunc(cast(void**)&vkCmdEndQuery, "vkCmdEndQuery");
+			bindFunc(cast(void**)&vkCmdEndRenderPass, "vkCmdEndRenderPass");
+			bindFunc(cast(void**)&vkCmdExecuteCommands, "vkCmdExecuteCommands");
+			bindFunc(cast(void**)&vkCmdFillBuffer, "vkCmdFillBuffer");
+			bindFunc(cast(void**)&vkCmdNextSubpass, "vkCmdNextSubpass");
+			bindFunc(cast(void**)&vkCmdPipelineBarrier, "vkCmdPipelineBarrier");
+			bindFunc(cast(void**)&vkCmdPushConstants, "vkCmdPushConstants");
+			bindFunc(cast(void**)&vkCmdResetEvent, "vkCmdResetEvent");
+			bindFunc(cast(void**)&vkCmdResetQueryPool, "vkCmdResetQueryPool");
+			bindFunc(cast(void**)&vkCmdResolveImage, "vkCmdResolveImage");
+			bindFunc(cast(void**)&vkCmdSetBlendConstants, "vkCmdSetBlendConstants");
+			bindFunc(cast(void**)&vkCmdSetDepthBias, "vkCmdSetDepthBias");
+			bindFunc(cast(void**)&vkCmdSetDepthBounds, "vkCmdSetDepthBounds");
+			bindFunc(cast(void**)&vkCmdSetEvent, "vkCmdSetEvent");
+			bindFunc(cast(void**)&vkCmdSetLineWidth, "vkCmdSetLineWidth");
+			bindFunc(cast(void**)&vkCmdSetScissor, "vkCmdSetScissor");
+			bindFunc(cast(void**)&vkCmdSetStencilCompareMask, "vkCmdSetStencilCompareMask");
+			bindFunc(cast(void**)&vkCmdSetStencilReference, "vkCmdSetStencilReference");
+			bindFunc(cast(void**)&vkCmdSetStencilWriteMask, "vkCmdSetStencilWriteMask");
+			bindFunc(cast(void**)&vkCmdSetViewport, "vkCmdSetViewport");
+			bindFunc(cast(void**)&vkCmdUpdateBuffer, "vkCmdUpdateBuffer");
+			bindFunc(cast(void**)&vkCmdWaitEvents, "vkCmdWaitEvents");
+			bindFunc(cast(void**)&vkCmdWriteTimestamp, "vkCmdWriteTimestamp");
+			bindFunc(cast(void**)&vkCreateBuffer, "vkCreateBuffer");
+			bindFunc(cast(void**)&vkCreateBufferView, "vkCreateBufferView");
+			bindFunc(cast(void**)&vkCreateCommandPool, "vkCreateCommandPool");
+			bindFunc(cast(void**)&vkCreateComputePipelines, "vkCreateComputePipelines");
+			bindFunc(cast(void**)&vkCreateDescriptorPool, "vkCreateDescriptorPool");
+			bindFunc(cast(void**)&vkCreateDescriptorSetLayout, "vkCreateDescriptorSetLayout");
+			bindFunc(cast(void**)&vkCreateDevice, "vkCreateDevice");
+			bindFunc(cast(void**)&vkCreateEvent, "vkCreateEvent");
+			bindFunc(cast(void**)&vkCreateFence, "vkCreateFence");
+			bindFunc(cast(void**)&vkCreateFramebuffer, "vkCreateFramebuffer");
+			bindFunc(cast(void**)&vkCreateGraphicsPipelines, "vkCreateGraphicsPipelines");
+			bindFunc(cast(void**)&vkCreateImage, "vkCreateImage");
+			bindFunc(cast(void**)&vkCreateImageView, "vkCreateImageView");
+			bindFunc(cast(void**)&vkCreateInstance, "vkCreateInstance");
+			bindFunc(cast(void**)&vkCreatePipelineCache, "vkCreatePipelineCache");
+			bindFunc(cast(void**)&vkCreatePipelineLayout, "vkCreatePipelineLayout");
+			bindFunc(cast(void**)&vkCreateQueryPool, "vkCreateQueryPool");
+			bindFunc(cast(void**)&vkCreateRenderPass, "vkCreateRenderPass");
+			bindFunc(cast(void**)&vkCreateSampler, "vkCreateSampler");
+			bindFunc(cast(void**)&vkCreateSemaphore, "vkCreateSemaphore");
+			bindFunc(cast(void**)&vkCreateShaderModule, "vkCreateShaderModule");
+			bindFunc(cast(void**)&vkCreateSwapchainKHR, "vkCreateSwapchainKHR");
+			bindFunc(cast(void**)&vkDestroyBuffer, "vkDestroyBuffer");
+			bindFunc(cast(void**)&vkDestroyBufferView, "vkDestroyBufferView");
+			bindFunc(cast(void**)&vkDestroyCommandPool, "vkDestroyCommandPool");
+			bindFunc(cast(void**)&vkDestroyDescriptorPool, "vkDestroyDescriptorPool");
+			bindFunc(cast(void**)&vkDestroyDescriptorSetLayout, "vkDestroyDescriptorSetLayout");
+			bindFunc(cast(void**)&vkDestroyDevice, "vkDestroyDevice");
+			bindFunc(cast(void**)&vkDestroyEvent, "vkDestroyEvent");
+			bindFunc(cast(void**)&vkDestroyFence, "vkDestroyFence");
+			bindFunc(cast(void**)&vkDestroyFramebuffer, "vkDestroyFramebuffer");
+			bindFunc(cast(void**)&vkDestroyImage, "vkDestroyImage");
+			bindFunc(cast(void**)&vkDestroyImageView, "vkDestroyImageView");
+			bindFunc(cast(void**)&vkDestroyInstance, "vkDestroyInstance");
+			bindFunc(cast(void**)&vkDestroyPipeline, "vkDestroyPipeline");
+			bindFunc(cast(void**)&vkDestroyPipelineCache, "vkDestroyPipelineCache");
+			bindFunc(cast(void**)&vkDestroyPipelineLayout, "vkDestroyPipelineLayout");
+			bindFunc(cast(void**)&vkDestroyQueryPool, "vkDestroyQueryPool");
+			bindFunc(cast(void**)&vkDestroyRenderPass, "vkDestroyRenderPass");
+			bindFunc(cast(void**)&vkDestroySampler, "vkDestroySampler");
+			bindFunc(cast(void**)&vkDestroySemaphore, "vkDestroySemaphore");
+			bindFunc(cast(void**)&vkDestroyShaderModule, "vkDestroyShaderModule");
+			bindFunc(cast(void**)&vkDestroySurfaceKHR, "vkDestroySurfaceKHR");
+			bindFunc(cast(void**)&vkDestroySwapchainKHR, "vkDestroySwapchainKHR");
+			bindFunc(cast(void**)&vkDeviceWaitIdle, "vkDeviceWaitIdle");
+			bindFunc(cast(void**)&vkEndCommandBuffer, "vkEndCommandBuffer");
+			bindFunc(cast(void**)&vkEnumerateDeviceExtensionProperties, "vkEnumerateDeviceExtensionProperties");
+			bindFunc(cast(void**)&vkEnumerateDeviceLayerProperties, "vkEnumerateDeviceLayerProperties");
+			bindFunc(cast(void**)&vkEnumerateInstanceExtensionProperties, "vkEnumerateInstanceExtensionProperties");
+			bindFunc(cast(void**)&vkEnumerateInstanceLayerProperties, "vkEnumerateInstanceLayerProperties");
+			bindFunc(cast(void**)&vkEnumeratePhysicalDevices, "vkEnumeratePhysicalDevices");
+			bindFunc(cast(void**)&vkFlushMappedMemoryRanges, "vkFlushMappedMemoryRanges");
+			bindFunc(cast(void**)&vkFreeCommandBuffers, "vkFreeCommandBuffers");
+			bindFunc(cast(void**)&vkFreeDescriptorSets, "vkFreeDescriptorSets");
+			bindFunc(cast(void**)&vkFreeMemory, "vkFreeMemory");
+			bindFunc(cast(void**)&vkGetBufferMemoryRequirements, "vkGetBufferMemoryRequirements");
+			bindFunc(cast(void**)&vkGetDeviceMemoryCommitment, "vkGetDeviceMemoryCommitment");
+			bindFunc(cast(void**)&vkGetDeviceProcAddr, "vkGetDeviceProcAddr");
+			bindFunc(cast(void**)&vkGetDeviceQueue, "vkGetDeviceQueue");
+			bindFunc(cast(void**)&vkGetEventStatus, "vkGetEventStatus");
+			bindFunc(cast(void**)&vkGetFenceStatus, "vkGetFenceStatus");
+			bindFunc(cast(void**)&vkGetImageMemoryRequirements, "vkGetImageMemoryRequirements");
+			bindFunc(cast(void**)&vkGetImageSparseMemoryRequirements, "vkGetImageSparseMemoryRequirements");
+			bindFunc(cast(void**)&vkGetImageSubresourceLayout, "vkGetImageSubresourceLayout");
+			bindFunc(cast(void**)&vkGetInstanceProcAddr, "vkGetInstanceProcAddr");
+			bindFunc(cast(void**)&vkGetPhysicalDeviceFeatures, "vkGetPhysicalDeviceFeatures");
+			bindFunc(cast(void**)&vkGetPhysicalDeviceFormatProperties, "vkGetPhysicalDeviceFormatProperties");
+			bindFunc(cast(void**)&vkGetPhysicalDeviceImageFormatProperties, "vkGetPhysicalDeviceImageFormatProperties");
+			bindFunc(cast(void**)&vkGetPhysicalDeviceMemoryProperties, "vkGetPhysicalDeviceMemoryProperties");
+			bindFunc(cast(void**)&vkGetPhysicalDeviceProperties, "vkGetPhysicalDeviceProperties");
+			bindFunc(cast(void**)&vkGetPhysicalDeviceQueueFamilyProperties, "vkGetPhysicalDeviceQueueFamilyProperties");
+			bindFunc(cast(void**)&vkGetPhysicalDeviceSparseImageFormatProperties, "vkGetPhysicalDeviceSparseImageFormatProperties");
+			bindFunc(cast(void**)&vkGetPhysicalDeviceSurfaceCapabilitiesKHR, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
+			bindFunc(cast(void**)&vkGetPhysicalDeviceSurfaceFormatsKHR, "vkGetPhysicalDeviceSurfaceFormatsKHR");
+			bindFunc(cast(void**)&vkGetPhysicalDeviceSurfacePresentModesKHR, "vkGetPhysicalDeviceSurfacePresentModesKHR");
+			bindFunc(cast(void**)&vkGetPhysicalDeviceSurfaceSupportKHR, "vkGetPhysicalDeviceSurfaceSupportKHR");
+			bindFunc(cast(void**)&vkGetPipelineCacheData, "vkGetPipelineCacheData");
+			bindFunc(cast(void**)&vkGetQueryPoolResults, "vkGetQueryPoolResults");
+			bindFunc(cast(void**)&vkGetRenderAreaGranularity, "vkGetRenderAreaGranularity");
+			bindFunc(cast(void**)&vkGetSwapchainImagesKHR, "vkGetSwapchainImagesKHR");
+			bindFunc(cast(void**)&vkInvalidateMappedMemoryRanges, "vkInvalidateMappedMemoryRanges");
+			bindFunc(cast(void**)&vkMapMemory, "vkMapMemory");
+			bindFunc(cast(void**)&vkMergePipelineCaches, "vkMergePipelineCaches");
+			bindFunc(cast(void**)&vkQueueBindSparse, "vkQueueBindSparse");
+			bindFunc(cast(void**)&vkQueuePresentKHR, "vkQueuePresentKHR");
+			bindFunc(cast(void**)&vkQueueSubmit, "vkQueueSubmit");
+			bindFunc(cast(void**)&vkQueueWaitIdle, "vkQueueWaitIdle");
+			bindFunc(cast(void**)&vkResetCommandBuffer, "vkResetCommandBuffer");
+			bindFunc(cast(void**)&vkResetCommandPool, "vkResetCommandPool");
+			bindFunc(cast(void**)&vkResetDescriptorPool, "vkResetDescriptorPool");
+			bindFunc(cast(void**)&vkResetEvent, "vkResetEvent");
+			bindFunc(cast(void**)&vkResetFences, "vkResetFences");
+			bindFunc(cast(void**)&vkSetEvent, "vkSetEvent");
+			bindFunc(cast(void**)&vkUnmapMemory, "vkUnmapMemory");
+			bindFunc(cast(void**)&vkUpdateDescriptorSets, "vkUpdateDescriptorSets");
+			bindFunc(cast(void**)&vkWaitForFences, "vkWaitForFences");
+
+			bindFunctions!((void** ptr, string funcName) => bindFunc(ptr, funcName));
+		}
+	}
+	public {
+		this() {
+			super(libNames);
+		}
+	}
+}
+
+__gshared DerelictVulkanLoader DerelictVulkan;
+
+shared static this() {
+	DerelictVulkan = new DerelictVulkanLoader();
+}
+
+shared static ~this() {
+	DerelictVulkan.unload();
+}

+ 72 - 0
source/derelict/vulkan/system/android.d

@@ -0,0 +1,72 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.vulkan.system.android;
+version(Android):
+extern(System):
+
+public {
+  import derelict.vulkan.base;
+  import derelict.vulkan.types;
+}
+
+enum libNames = "";
+// #include <android/native_window.h>
+enum VK_KHR_android_surface = 1;
+enum VK_KHR_ANDROID_SURFACE_SPEC_VERSION   = 6;
+enum VK_KHR_ANDROID_SURFACE_EXTENSION_NAME = "VK_KHR_android_surface";
+
+alias VkAndroidSurfaceCreateFlagsKHR = VkFlags;
+
+struct VkAndroidSurfaceCreateInfoKHR {
+  VkStructureType                sType ;
+  const(void)*                   pNext ;
+  VkAndroidSurfaceCreateFlagsKHR flags ;
+  ANativeWindow*                 window;
+}
+
+alias PFN_vkCreateAndroidSurfaceKHR = nothrow 
+    VkResult function( VkInstance                            instance
+                     , const(VkAndroidSurfaceCreateInfoKHR)* pCreateInfo
+                     , const(VkAllocationCallbacks)*         pAllocator
+                     , VkSurfaceKHR*                         pSurface );
+
+mixin template Functions() {
+  PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR;
+  pragma(inline, true)
+  void bindFunctions(alias bind)() {
+    bind(cast(void**)&vkCreateAndroidSurfaceKHR, "vkCreateAndroidSurfaceKHR");
+  }
+}
+
+version (none) {
+  VkResult vkCreateAndroidSurfaceKHR( VkInstance instance
+                                    , const(VkAndroidSurfaceCreateInfoKHR)* pCreateInfo
+                                    , const(VkAllocationCallbacks)* pAllocator
+                                    , VkSurfaceKHR* pSurface);
+}

+ 39 - 0
source/derelict/vulkan/system/dummy.d

@@ -0,0 +1,39 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.vulkan.system.dummy;
+
+mixin template SystemFunctionality() {
+  pragma(msg, "This system is not supported. "
+            , "Please feel free to extend and submit a pull request.");
+  enum libNames = "";
+  mixin template Functions() {
+    pragma(inline, true)
+    void bindFunctions(alias bind)() {}
+  }
+}

+ 35 - 0
source/derelict/vulkan/system/package.d

@@ -0,0 +1,35 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.vulkan.system;
+import derelict.util.system;
+
+static if (Derelict_OS_Posix)        public import derelict.vulkan.system.posix;
+else static if (Derelict_OS_Windows) public import derelict.vulkan.system.windows;
+else static if (Derelict_OS_Android) public import derelict.vulkan.system.android;
+else public import derelict.vulkan.system.dummy;

+ 83 - 0
source/derelict/vulkan/system/posix/mir.d

@@ -0,0 +1,83 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.vulkan.system.posix.mir;
+version (VK_USE_PLATFORM_MIR_KHR):
+extern(System):
+
+public {
+  import derelict.vulkan.base;
+  import derelict.vulkan.types;
+}
+
+// TODO: add import of data related to Mir protocol
+// #include <mir_toolkit/client_types.h>
+enum VK_KHR_mir_surface = 1;
+enum VK_KHR_MIR_SURFACE_SPEC_VERSION   = 4;
+enum VK_KHR_MIR_SURFACE_EXTENSION_NAME = "VK_KHR_mir_surface";
+
+alias VkMirSurfaceCreateFlagsKHR = VkFlags;
+
+struct VkMirSurfaceCreateInfoKHR {
+  VkStructureType            sType     ;
+  const(void)*               pNext     ;
+  VkMirSurfaceCreateFlagsKHR flags     ;
+  MirConnection*             connection;
+  MirSurface*                mirSurface;
+}
+
+alias PFN_vkCreateMirSurfaceKHR = nothrow 
+    VkResult function( VkInstance                        instance
+                     , const(VkMirSurfaceCreateInfoKHR)* pCreateInfo
+                     , const(VkAllocationCallbacks)*     pAllocator
+                     , VkSurfaceKHR*                     pSurface );
+alias PFN_vkGetPhysicalDeviceMirPresentationSupportKHR = nothrow 
+    VkBool32 function( VkPhysicalDevice physicalDevice
+                     , uint queueFamilyIndex
+                     , MirConnection* connection);
+
+mixin template MirFunctions() {
+  PFN_vkCreateMirSurfaceKHR                        vkCreateMirSurfaceKHR;
+  PFN_vkGetPhysicalDeviceMirPresentationSupportKHR vkGetPhysicalDeviceMirPresentationSupportKHR;
+  pragma(inline, true)
+  void bindFunctionsMir(alias bind)() {
+    bind(cast(void**)&vkCreateMirSurfaceKHR, "vkCreateMirSurfaceKHR");
+    bind( cast(void**)&vkGetPhysicalDeviceMirPresentationSupportKHR
+        , "vkGetPhysicalDeviceMirPresentationSupportKHR");
+  }
+}
+
+version (none) {
+  VkResult vkCreateMirSurfaceKHR( VkInstance                        instance
+                                , const(VkMirSurfaceCreateInfoKHR)* pCreateInfo
+                                , const(VkAllocationCallbacks)*     pAllocator
+                                , VkSurfaceKHR*                     pSurface );
+  VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR( VkPhysicalDevice physicalDevice
+                                                       , uint             queueFamilyIndex
+                                                       , MirConnection*   connection );
+}

+ 53 - 0
source/derelict/vulkan/system/posix/package.d

@@ -0,0 +1,53 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.vulkan.system.posix;
+
+enum libNames = "libvulkan.so,libvulkan.so.1";
+version (VK_USE_PLATFORM_XCB_KHR)
+  public import derelict.vulkan.system.posix.xcb;
+version (VK_USE_PLATFORM_XLIB_KHR)
+  public import derelict.vulkan.system.posix.xlib;
+version (VK_USE_PLATFORM_MIR_KHR)
+  public import derelict.vulkan.system.posix.mir;
+version (VK_USE_PLATFORM_WAYLAND_KHR)
+  public import derelict.vulkan.system.posix.wayland;
+
+mixin template Functions() {
+  version (VK_USE_PLATFORM_XCB_KHR) mixin XCBFunctions;
+  version (VK_USE_PLATFORM_XLIB_KHR) mixin XLibFunctions;
+  version (VK_USE_PLATFORM_MIR_KHR) mixin MirFuntions;
+  version (VK_USE_PLATFORM_WAYLAND_KHR) mixin WaylandFunctions;
+  pragma(inline, true)
+  void bindFunctions(alias bind)() {
+    version (VK_USE_PLATFORM_XCB_KHR) bindFunctionsXCB!bind;
+    version (VK_USE_PLATFORM_XLIB_KHR) bindFunctionsXLib!bind;
+    version (VK_USE_PLATFORM_MIR_KHR) bindFunctionsMir!bind;
+    version (VK_USE_PLATFORM_WAYLAND_KHR) bindFunctionsWayland!bind;
+  }
+}

+ 83 - 0
source/derelict/vulkan/system/posix/wayland.d

@@ -0,0 +1,83 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.vulkan.system.posix.wayland;
+version (VK_USE_PLATFORM_WAYLAND_KHR):
+extern(System):
+
+public {
+  import derelict.vulkan.base;
+  import derelict.vulkan.types;
+}
+
+// TODO: add import of data related to Wayland protocol
+// #include <wayland-client.h>
+enum VK_KHR_wayland_surface = 1;
+enum VK_KHR_WAYLAND_SURFACE_SPEC_VERSION   = 5;
+enum VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME = "VK_KHR_wayland_surface";
+
+alias VkWaylandSurfaceCreateFlagsKHR = VkFlags;
+
+struct VkWaylandSurfaceCreateInfoKHR {
+  VkStructureType                sType  ;
+  const(void)*                   pNext  ;
+  VkWaylandSurfaceCreateFlagsKHR flags  ;
+  wl_display*                    display;
+  wl_surface*                    surface;
+}
+
+alias PFN_vkCreateWaylandSurfaceKHR = nothrow 
+    VkResult function( VkInstance                            instance
+                     , const(VkWaylandSurfaceCreateInfoKHR)* pCreateInfo
+                     , const(VkAllocationCallbacks)*         pAllocator
+                     , VkSurfaceKHR*                         pSurface );
+alias PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR = nothrow 
+    VkBool32 function( VkPhysicalDevice physicalDevice
+                     , uint             queueFamilyIndex
+                     , wl_display*      display );
+
+mixin template WaylandFunctions() {
+  PFN_vkCreateWaylandSurfaceKHR                        vkCreateWaylandSurfaceKHR;
+  PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR vkGetPhysicalDeviceWaylandPresentationSupportKHR;
+  pragma(inline, true)
+  void bindFunctionsWayland(alias bind)() {
+    bind(cast(void**)&vkCreateWaylandSurfaceKHR, "vkCreateWaylandSurfaceKHR");
+    bind( cast(void**)&vkGetPhysicalDeviceWaylandPresentationSupportKHR
+        , "vkGetPhysicalDeviceWaylandPresentationSupportKHR" );
+  }
+}
+
+version (none) {
+  VkResult vkCreateWaylandSurfaceKHR( VkInstance                            instance
+                                    , const(VkWaylandSurfaceCreateInfoKHR)* pCreateInfo
+                                    , const(VkAllocationCallbacks)*         pAllocator
+                                    , VkSurfaceKHR*                         pSurface );
+  VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR( VkPhysicalDevice physicalDevice
+                                                           , uint             queueFamilyIndex
+                                                           , wl_display*      display );
+}

+ 84 - 0
source/derelict/vulkan/system/posix/xcb.d

@@ -0,0 +1,84 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.vulkan.system.posix.xcb;
+version (VK_USE_PLATFORM_XCB_KHR):
+extern(System):
+
+public {
+  import derelict.vulkan.base;
+  import derelict.vulkan.types;
+}
+
+import xcb.xcb;
+enum VK_KHR_xcb_surface = 1;
+enum VK_KHR_XCB_SURFACE_SPEC_VERSION   = 6;
+enum VK_KHR_XCB_SURFACE_EXTENSION_NAME = "VK_KHR_xcb_surface";
+
+alias VkXcbSurfaceCreateFlagsKHR = VkFlags;
+
+struct VkXcbSurfaceCreateInfoKHR {
+  VkStructureType            sType     ;
+  const(void)*               pNext     ;
+  VkXcbSurfaceCreateFlagsKHR flags     ;
+  xcb_connection_t*          connection;
+  xcb_window_t               window    ;
+}
+
+alias PFN_vkCreateXcbSurfaceKHR = nothrow 
+    VkResult function( VkInstance                        instance
+                     , const(VkXcbSurfaceCreateInfoKHR)* pCreateInfo
+                     , const(VkAllocationCallbacks)*     pAllocator
+                     , VkSurfaceKHR*                     pSurface );
+alias PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR = nothrow 
+    VkBool32 function( VkPhysicalDevice  physicalDevice
+                     , uint              queueFamilyIndex
+                     , xcb_connection_t* connection
+                     , xcb_visualid_t    visual_id );
+
+mixin template XCBFunctions() {
+  PFN_vkCreateXcbSurfaceKHR                        vkCreateXcbSurfaceKHR;
+  PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR vkGetPhysicalDeviceXcbPresentationSupportKHR;
+  pragma(inline, true)
+  void bindFunctionsXCB(alias bind)() {
+    bind(cast(void**)&vkCreateXcbSurfaceKHR, "vkCreateXcbSurfaceKHR");
+    bind( cast(void**)&vkGetPhysicalDeviceXcbPresentationSupportKHR
+        , "vkGetPhysicalDeviceXcbPresentationSupportKHR" );
+  }
+}
+
+version (none) {
+  VkResult vkCreateXcbSurfaceKHR( VkInstance                        instance
+                                , const(VkXcbSurfaceCreateInfoKHR)* pCreateInfo
+                                , const(VkAllocationCallbacks)*     pAllocator
+                                , VkSurfaceKHR*                     pSurface );
+  VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR( VkPhysicalDevice  physicalDevice
+                                                       , uint              queueFamilyIndex
+                                                       , xcb_connection_t* connection
+                                                       , xcb_visualid_t    visual_id);
+}

+ 84 - 0
source/derelict/vulkan/system/posix/xlib.d

@@ -0,0 +1,84 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.vulkan.system.posix.xlib;
+version (VK_USE_PLATFORM_XLIB_KHR):
+extern(System):
+
+public {
+  import derelict.vulkan.base;
+  import derelict.vulkan.types;
+}
+import X11.Xlib;
+
+enum VK_KHR_xlib_surface = 1;
+enum VK_KHR_XLIB_SURFACE_SPEC_VERSION   = 6;
+enum VK_KHR_XLIB_SURFACE_EXTENSION_NAME = "VK_KHR_xlib_surface";
+
+alias VkXlibSurfaceCreateFlagsKHR = VkFlags;
+
+struct VkXlibSurfaceCreateInfoKHR {
+  VkStructureType             sType ;
+  const(void)*                pNext ;
+  VkXlibSurfaceCreateFlagsKHR flags ;
+  Display*                    dpy   ;
+  Window                      window;
+}
+
+alias PFN_vkCreateXlibSurfaceKHR = nothrow 
+    VkResult function( VkInstance                         instance
+                     , const(VkXlibSurfaceCreateInfoKHR)* pCreateInfo
+                     , const(VkAllocationCallbacks)*      pAllocator
+                     , VkSurfaceKHR*                      pSurface );
+alias PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR = nothrow 
+    VkBool32 function( VkPhysicalDevice physicalDevice
+                     , uint             queueFamilyIndex
+                     , Display*         dpy
+                     , VisualID         visualID);
+
+mixin template XLibFunctions() {
+  PFN_vkCreateXlibSurfaceKHR                        vkCreateXlibSurfaceKHR;
+  PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR vkGetPhysicalDeviceXlibPresentationSupportKHR;
+  pragma(inline, true)
+  void bindFunctionsXLib(alias bind)() {
+    bind(cast(void**)&vkCreateXlibSurfaceKHR, "vkCreateXlibSurfaceKHR");
+    bind( cast(void**)&vkGetPhysicalDeviceXlibPresentationSupportKHR
+        , "vkGetPhysicalDeviceXlibPresentationSupportKHR" );
+  }
+}
+
+version (none) {
+  VkResult vkCreateXlibSurfaceKHR( VkInstance                         instance
+                                 , const(VkXlibSurfaceCreateInfoKHR)* pCreateInfo
+                                 , const(VkAllocationCallbacks)*      pAllocator
+                                 , VkSurfaceKHR*                      pSurface );
+  VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR( VkPhysicalDevice physicalDevice
+                                                        , uint queueFamilyIndex
+                                                        , Display* dpy
+                                                        , VisualID visualID );
+}

+ 79 - 0
source/derelict/vulkan/system/windows.d

@@ -0,0 +1,79 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.vulkan.system.windows;
+version(Windows):
+extern(System):
+
+public {
+  import derelict.vulkan.base;
+  import derelict.vulkan.types;
+}
+import core.sys.windows.windows;
+
+enum libNames = "vulkan-1.dll";
+enum VK_KHR_win32_surface = 1;
+enum VK_KHR_WIN32_SURFACE_SPEC_VERSION   = 5;
+enum VK_KHR_WIN32_SURFACE_EXTENSION_NAME = "VK_KHR_win32_surface";
+
+alias VkWin32SurfaceCreateFlagsKHR = VkFlags;
+
+struct VkWin32SurfaceCreateInfoKHR {
+  VkStructureType              sType    ;
+  const(void)*                 pNext    ;
+  VkWin32SurfaceCreateFlagsKHR flags    ;
+  HINSTANCE                    hinstance;
+  HWND                         hwnd     ;
+}
+
+alias PFN_vkCreateWin32SurfaceKHR = nothrow 
+    VkResult function( VkInstance                          instance
+                     , const(VkWin32SurfaceCreateInfoKHR)* pCreateInfo
+                     , const(VkAllocationCallbacks)*       pAllocator
+                     , VkSurfaceKHR*                       pSurface );
+alias PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR = nothrow 
+    VkBool32 function( VkPhysicalDevice physicalDevice, uint queueFamilyIndex );
+
+mixin template Functions() {
+  PFN_vkCreateWin32SurfaceKHR                        vkCreateWin32SurfaceKHR;
+  PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR;
+  pragma(inline, true)
+  void bindFunctions(alias bind)() {
+    bind(cast(void**)&vkCreateWin32SurfaceKHR, "vkCreateWin32SurfaceKHR");
+    bind( cast(void**)&vkGetPhysicalDeviceWin32PresentationSupportKHR
+        , "vkGetPhysicalDeviceWin32PresentationSupportKHR");
+  }
+}
+
+version (none) {
+  VkResult vkCreateWin32SurfaceKHR( VkInstance                          instance
+                                  , const(VkWin32SurfaceCreateInfoKHR)* pCreateInfo
+                                  , const(VkAllocationCallbacks)*       pAllocator
+                                  , VkSurfaceKHR*                       pSurface );
+  VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR( VkPhysicalDevice physicalDevice, uint queueFamilyIndex );
+}

+ 4 - 213
source/derelict/vulkan/vk.d → source/derelict/vulkan/types.d

@@ -20,46 +20,11 @@
 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 */
-module derelict.vulkan.vk;
-extern(System):
-
-enum VK_VERSION_1_0 = 1;
-//#include "vk_platform.h"
-
-auto VK_MAKE_VERSION(int major, int minor, int patch) {
-	return (major << 22) | (minor << 12) | patch;
-}
-
-// Vulkan API version supported by this file
-enum VK_API_VERSION = VK_MAKE_VERSION(1, 0, 3);
-
-auto VK_VERSION_MAJOR(uint ver) {
-	return ver >> 22;
-}
-
-auto VK_VERSION_MINOR(uint ver) {
-	return (ver >> 12) & 0x3ff;
-}
+module derelict.vulkan.types;
+import derelict.vulkan.base;
+import derelict.vulkan.system;
 
-auto VK_VERSION_PATCH(uint ver) {
-	return ver & 0xfff;
-}
-
-enum VK_NULL_HANDLE = null;
-
-private auto VK_DEFINE_HANDLE(string name) {
-	return "struct " ~ name ~ "_T; \n alias " ~ name ~ " = " ~ name ~ "_T*;";
-}
-
-private auto VK_DEFINE_NON_DISPATCHABLE_HANDLE(string name) {
-	// #if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
-	return "struct " ~ name ~ "_T; \n alias " ~ name ~ " = " ~ name ~ "_T*;";
-}
-
-alias VkFlags = uint;
-alias VkBool32 = uint;
-alias VkDeviceSize = ulong;
-alias VkSampleMask = uint;
+extern(System):
 
 mixin(VK_DEFINE_HANDLE("VkInstance"));
 mixin(VK_DEFINE_HANDLE("VkPhysicalDevice"));
@@ -87,22 +52,6 @@ mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE("VkDescriptorSet"));
 mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE("VkFramebuffer"));
 mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE("VkCommandPool"));
 
-enum VK_LOD_CLAMP_NONE = 1000.0f;
-enum VK_REMAINING_MIP_LEVELS = (~0U);
-enum VK_REMAINING_ARRAY_LAYERS = (~0U);
-enum VK_WHOLE_SIZE = (~0UL);
-enum VK_ATTACHMENT_UNUSED = (~0U);
-enum VK_TRUE = 1;
-enum VK_FALSE = 0;
-enum VK_QUEUE_FAMILY_IGNORED = (~0U);
-enum VK_SUBPASS_EXTERNAL = (~0U);
-enum VK_MAX_PHYSICAL_DEVICE_NAME_SIZE = 256;
-enum VK_UUID_SIZE = 16;
-enum VK_MAX_MEMORY_TYPES = 32;
-enum VK_MAX_MEMORY_HEAPS = 16;
-enum VK_MAX_EXTENSION_NAME_SIZE = 256;
-enum VK_MAX_DESCRIPTION_SIZE = 256;
-
 enum VkPipelineCacheHeaderVersion {
 	VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
 	VK_PIPELINE_CACHE_HEADER_VERSION_BEGIN_RANGE = VK_PIPELINE_CACHE_HEADER_VERSION_ONE,
@@ -2897,164 +2846,6 @@ version (none) {
 	VkResult vkCreateSharedSwapchainsKHR(VkDevice device, uint swapchainCount, const(VkSwapchainCreateInfoKHR)* pCreateInfos, const(VkAllocationCallbacks)* pAllocator, VkSwapchainKHR* pSwapchains);
 }
 
-version (VK_USE_PLATFORM_XLIB_KHR) {
-	enum VK_KHR_xlib_surface = 1;
-	//#include <X11/Xlib.h>
-
-	enum VK_KHR_XLIB_SURFACE_SPEC_VERSION = 6;
-	enum VK_KHR_XLIB_SURFACE_EXTENSION_NAME = "VK_KHR_xlib_surface";
-
-	alias VkXlibSurfaceCreateFlagsKHR = VkFlags;
-
-	struct VkXlibSurfaceCreateInfoKHR {
-		VkStructureType sType;
-		const(void)* pNext;
-		VkXlibSurfaceCreateFlagsKHR flags;
-		Display* dpy;
-		Window window;
-	}
-
-	alias PFN_vkCreateXlibSurfaceKHR = nothrow VkResult function(VkInstance instance, const(VkXlibSurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-	alias PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR = nothrow VkBool32 function(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, Display* dpy, VisualID visualID);
-
-	version (none) {
-		VkResult vkCreateXlibSurfaceKHR(VkInstance instance, const(VkXlibSurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-
-		VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, Display* dpy, VisualID visualID);
-	}
-}
-
-version (VK_USE_PLATFORM_XCB_KHR) {
-	enum VK_KHR_xcb_surface = 1;
-	//#include <xcb/xcb.h>
-
-	enum VK_KHR_XCB_SURFACE_SPEC_VERSION = 6;
-	enum VK_KHR_XCB_SURFACE_EXTENSION_NAME = "VK_KHR_xcb_surface";
-
-	alias VkXcbSurfaceCreateFlagsKHR = VkFlags;
-
-	struct VkXcbSurfaceCreateInfoKHR {
-		VkStructureType sType;
-		const(void)* pNext;
-		VkXcbSurfaceCreateFlagsKHR flags;
-		xcb_connection_t* connection;
-		xcb_window_t window;
-	}
-
-	alias PFN_vkCreateXcbSurfaceKHR = nothrow VkResult function(VkInstance instance, const(VkXcbSurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-	alias PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR = nothrow VkBool32 function(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id);
-
-	version (none) {
-		VkResult vkCreateXcbSurfaceKHR(VkInstance instance, const(VkXcbSurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-
-		VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id);
-	}
-}
-
-version (VK_USE_PLATFORM_WAYLAND_KHR) {
-	enum VK_KHR_wayland_surface = 1;
-	//#include <wayland-client.h>
-
-	enum VK_KHR_WAYLAND_SURFACE_SPEC_VERSION = 5;
-	enum VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME = "VK_KHR_wayland_surface";
-
-	alias VkWaylandSurfaceCreateFlagsKHR = VkFlags;
-
-	struct VkWaylandSurfaceCreateInfoKHR {
-		VkStructureType sType;
-		const(void)* pNext;
-		VkWaylandSurfaceCreateFlagsKHR flags;
-		wl_display* display;
-		wl_surface* surface;
-	}
-
-	alias PFN_vkCreateWaylandSurfaceKHR = nothrow VkResult function(VkInstance instance, const(VkWaylandSurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-	alias PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR = nothrow VkBool32 function(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, wl_display* display);
-
-	version (none) {
-		VkResult vkCreateWaylandSurfaceKHR(VkInstance instance, const(VkWaylandSurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-
-		VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, wl_display* display);
-	}
-}
-
-version (VK_USE_PLATFORM_MIR_KHR) {
-	enum VK_KHR_mir_surface = 1;
-	//#include <mir_toolkit/client_types.h>
-
-	enum VK_KHR_MIR_SURFACE_SPEC_VERSION = 4;
-	enum VK_KHR_MIR_SURFACE_EXTENSION_NAME = "VK_KHR_mir_surface";
-
-	alias VkMirSurfaceCreateFlagsKHR = VkFlags;
-
-	struct VkMirSurfaceCreateInfoKHR {
-		VkStructureType sType;
-		const(void)* pNext;
-		VkMirSurfaceCreateFlagsKHR flags;
-		MirConnection* connection;
-		MirSurface* mirSurface;
-	}
-
-	alias PFN_vkCreateMirSurfaceKHR = nothrow VkResult function(VkInstance instance, const(VkMirSurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-	alias PFN_vkGetPhysicalDeviceMirPresentationSupportKHR = nothrow VkBool32 function(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, MirConnection* connection);
-
-	version (none) {
-		VkResult vkCreateMirSurfaceKHR(VkInstance instance, const(VkMirSurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-
-		VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, MirConnection* connection);
-	}
-}
-
-version (VK_USE_PLATFORM_ANDROID_KHR) {
-	enum VK_KHR_android_surface = 1;
-	//#include <android/native_window.h>
-
-	enum VK_KHR_ANDROID_SURFACE_SPEC_VERSION = 6;
-	enum VK_KHR_ANDROID_SURFACE_EXTENSION_NAME = "VK_KHR_android_surface";
-
-	alias VkAndroidSurfaceCreateFlagsKHR = VkFlags;
-
-	struct VkAndroidSurfaceCreateInfoKHR {
-		VkStructureType sType;
-		const(void)* pNext;
-		VkAndroidSurfaceCreateFlagsKHR flags;
-		ANativeWindow* window;
-	}
-
-	alias PFN_vkCreateAndroidSurfaceKHR = nothrow VkResult function(VkInstance instance, const(VkAndroidSurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-
-	version (none) {
-		VkResult vkCreateAndroidSurfaceKHR(VkInstance instance, const(VkAndroidSurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-	}
-}
-
-version (Windows) {
-    import core.sys.windows.windows;
-	enum VK_KHR_win32_surface = 1;
-
-	enum VK_KHR_WIN32_SURFACE_SPEC_VERSION = 5;
-	enum VK_KHR_WIN32_SURFACE_EXTENSION_NAME = "VK_KHR_win32_surface";
-
-	alias VkWin32SurfaceCreateFlagsKHR = VkFlags;
-
-	struct VkWin32SurfaceCreateInfoKHR {
-		VkStructureType sType;
-		const(void)* pNext;
-		VkWin32SurfaceCreateFlagsKHR flags;
-		HINSTANCE hinstance;
-		HWND hwnd;
-	}
-
-	alias PFN_vkCreateWin32SurfaceKHR = nothrow VkResult function(VkInstance instance, const(VkWin32SurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-	alias PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR = nothrow VkBool32 function(VkPhysicalDevice physicalDevice, uint queueFamilyIndex);
-
-	version (none) {
-		VkResult vkCreateWin32SurfaceKHR(VkInstance instance, const(VkWin32SurfaceCreateInfoKHR)* pCreateInfo, const(VkAllocationCallbacks)* pAllocator, VkSurfaceKHR* pSurface);
-
-		VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint queueFamilyIndex);
-	}
-}
-
 enum VK_EXT_debug_report = 1;
 mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE("VkDebugReportCallbackEXT"));
 

+ 2 - 199
source/derelict/vulkan/vulkan.d

@@ -1,21 +1,17 @@
 /*
-
 Boost Software License - Version 1.0 - August 17th, 2003
-
 Permission is hereby granted, free of charge, to any person or organization
 obtaining a copy of the software and accompanying documentation covered by
 this license (the "Software") to use, reproduce, display, distribute,
 execute, and transmit the Software, and to prepare derivative works of the
 Software, and to permit third-parties to whom the Software is furnished to
 do so, all subject to the following:
-
 The copyright notices in the Software and this entire statement, including
 the above license grant, this restriction and the following disclaimer,
 must be included in all copies of the Software, in whole or in part, and
 all derivative works of the Software, unless such copies or derivative
 works are solely in the form of machine-executable object code generated by
 a source language processor.
-
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
@@ -23,200 +19,7 @@ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 DEALINGS IN THE SOFTWARE.
-
 */
-module derelict.vulkan.vulkan;
-
-public {
-	import derelict.vulkan.vk;
-	import derelict.vulkan.functions;
-}
 
-private {
-	import derelict.util.loader;
-	import derelict.util.system;
-
-	static if (Derelict_OS_Windows)
-		enum libNames = "vulkan-1.dll";
-	//~ else static if(Derelict_OS_Mac)
-	//~ enum libNames = "libvulkan.dylib";
-	else static if(Derelict_OS_Posix)
-		enum libNames = "libvulkan.so,libvulkan.so.1";
-	else
-		static assert(0, "Need to implement vulkan libNames for this operating system.");
-}
-
-class DerelictVulkanLoader : SharedLibLoader {
-	protected {
-		override void loadSymbols() {
-			bindFunc(cast(void**)&vkAcquireNextImageKHR, "vkAcquireNextImageKHR");
-			bindFunc(cast(void**)&vkAllocateCommandBuffers, "vkAllocateCommandBuffers");
-			bindFunc(cast(void**)&vkAllocateDescriptorSets, "vkAllocateDescriptorSets");
-			bindFunc(cast(void**)&vkAllocateMemory, "vkAllocateMemory");
-			bindFunc(cast(void**)&vkBeginCommandBuffer, "vkBeginCommandBuffer");
-			bindFunc(cast(void**)&vkBindBufferMemory, "vkBindBufferMemory");
-			bindFunc(cast(void**)&vkBindImageMemory, "vkBindImageMemory");
-			bindFunc(cast(void**)&vkCmdBeginQuery, "vkCmdBeginQuery");
-			bindFunc(cast(void**)&vkCmdBeginRenderPass, "vkCmdBeginRenderPass");
-			bindFunc(cast(void**)&vkCmdBindDescriptorSets, "vkCmdBindDescriptorSets");
-			bindFunc(cast(void**)&vkCmdBindIndexBuffer, "vkCmdBindIndexBuffer");
-			bindFunc(cast(void**)&vkCmdBindPipeline, "vkCmdBindPipeline");
-			bindFunc(cast(void**)&vkCmdBindVertexBuffers, "vkCmdBindVertexBuffers");
-			bindFunc(cast(void**)&vkCmdBlitImage, "vkCmdBlitImage");
-			bindFunc(cast(void**)&vkCmdClearAttachments, "vkCmdClearAttachments");
-			bindFunc(cast(void**)&vkCmdClearColorImage, "vkCmdClearColorImage");
-			bindFunc(cast(void**)&vkCmdClearDepthStencilImage, "vkCmdClearDepthStencilImage");
-			bindFunc(cast(void**)&vkCmdCopyBuffer, "vkCmdCopyBuffer");
-			bindFunc(cast(void**)&vkCmdCopyBufferToImage, "vkCmdCopyBufferToImage");
-			bindFunc(cast(void**)&vkCmdCopyImage, "vkCmdCopyImage");
-			bindFunc(cast(void**)&vkCmdCopyImageToBuffer, "vkCmdCopyImageToBuffer");
-			bindFunc(cast(void**)&vkCmdCopyQueryPoolResults, "vkCmdCopyQueryPoolResults");
-			bindFunc(cast(void**)&vkCmdDispatch, "vkCmdDispatch");
-			bindFunc(cast(void**)&vkCmdDispatchIndirect, "vkCmdDispatchIndirect");
-			bindFunc(cast(void**)&vkCmdDraw, "vkCmdDraw");
-			bindFunc(cast(void**)&vkCmdDrawIndexed, "vkCmdDrawIndexed");
-			bindFunc(cast(void**)&vkCmdDrawIndexedIndirect, "vkCmdDrawIndexedIndirect");
-			bindFunc(cast(void**)&vkCmdDrawIndirect, "vkCmdDrawIndirect");
-			bindFunc(cast(void**)&vkCmdEndQuery, "vkCmdEndQuery");
-			bindFunc(cast(void**)&vkCmdEndRenderPass, "vkCmdEndRenderPass");
-			bindFunc(cast(void**)&vkCmdExecuteCommands, "vkCmdExecuteCommands");
-			bindFunc(cast(void**)&vkCmdFillBuffer, "vkCmdFillBuffer");
-			bindFunc(cast(void**)&vkCmdNextSubpass, "vkCmdNextSubpass");
-			bindFunc(cast(void**)&vkCmdPipelineBarrier, "vkCmdPipelineBarrier");
-			bindFunc(cast(void**)&vkCmdPushConstants, "vkCmdPushConstants");
-			bindFunc(cast(void**)&vkCmdResetEvent, "vkCmdResetEvent");
-			bindFunc(cast(void**)&vkCmdResetQueryPool, "vkCmdResetQueryPool");
-			bindFunc(cast(void**)&vkCmdResolveImage, "vkCmdResolveImage");
-			bindFunc(cast(void**)&vkCmdSetBlendConstants, "vkCmdSetBlendConstants");
-			bindFunc(cast(void**)&vkCmdSetDepthBias, "vkCmdSetDepthBias");
-			bindFunc(cast(void**)&vkCmdSetDepthBounds, "vkCmdSetDepthBounds");
-			bindFunc(cast(void**)&vkCmdSetEvent, "vkCmdSetEvent");
-			bindFunc(cast(void**)&vkCmdSetLineWidth, "vkCmdSetLineWidth");
-			bindFunc(cast(void**)&vkCmdSetScissor, "vkCmdSetScissor");
-			bindFunc(cast(void**)&vkCmdSetStencilCompareMask, "vkCmdSetStencilCompareMask");
-			bindFunc(cast(void**)&vkCmdSetStencilReference, "vkCmdSetStencilReference");
-			bindFunc(cast(void**)&vkCmdSetStencilWriteMask, "vkCmdSetStencilWriteMask");
-			bindFunc(cast(void**)&vkCmdSetViewport, "vkCmdSetViewport");
-			bindFunc(cast(void**)&vkCmdUpdateBuffer, "vkCmdUpdateBuffer");
-			bindFunc(cast(void**)&vkCmdWaitEvents, "vkCmdWaitEvents");
-			bindFunc(cast(void**)&vkCmdWriteTimestamp, "vkCmdWriteTimestamp");
-			bindFunc(cast(void**)&vkCreateBuffer, "vkCreateBuffer");
-			bindFunc(cast(void**)&vkCreateBufferView, "vkCreateBufferView");
-			bindFunc(cast(void**)&vkCreateCommandPool, "vkCreateCommandPool");
-			bindFunc(cast(void**)&vkCreateComputePipelines, "vkCreateComputePipelines");
-			bindFunc(cast(void**)&vkCreateDescriptorPool, "vkCreateDescriptorPool");
-			bindFunc(cast(void**)&vkCreateDescriptorSetLayout, "vkCreateDescriptorSetLayout");
-			bindFunc(cast(void**)&vkCreateDevice, "vkCreateDevice");
-			bindFunc(cast(void**)&vkCreateEvent, "vkCreateEvent");
-			bindFunc(cast(void**)&vkCreateFence, "vkCreateFence");
-			bindFunc(cast(void**)&vkCreateFramebuffer, "vkCreateFramebuffer");
-			bindFunc(cast(void**)&vkCreateGraphicsPipelines, "vkCreateGraphicsPipelines");
-			bindFunc(cast(void**)&vkCreateImage, "vkCreateImage");
-			bindFunc(cast(void**)&vkCreateImageView, "vkCreateImageView");
-			bindFunc(cast(void**)&vkCreateInstance, "vkCreateInstance");
-			bindFunc(cast(void**)&vkCreatePipelineCache, "vkCreatePipelineCache");
-			bindFunc(cast(void**)&vkCreatePipelineLayout, "vkCreatePipelineLayout");
-			bindFunc(cast(void**)&vkCreateQueryPool, "vkCreateQueryPool");
-			bindFunc(cast(void**)&vkCreateRenderPass, "vkCreateRenderPass");
-			bindFunc(cast(void**)&vkCreateSampler, "vkCreateSampler");
-			bindFunc(cast(void**)&vkCreateSemaphore, "vkCreateSemaphore");
-			bindFunc(cast(void**)&vkCreateShaderModule, "vkCreateShaderModule");
-			bindFunc(cast(void**)&vkCreateSwapchainKHR, "vkCreateSwapchainKHR");
-			bindFunc(cast(void**)&vkDestroyBuffer, "vkDestroyBuffer");
-			bindFunc(cast(void**)&vkDestroyBufferView, "vkDestroyBufferView");
-			bindFunc(cast(void**)&vkDestroyCommandPool, "vkDestroyCommandPool");
-			bindFunc(cast(void**)&vkDestroyDescriptorPool, "vkDestroyDescriptorPool");
-			bindFunc(cast(void**)&vkDestroyDescriptorSetLayout, "vkDestroyDescriptorSetLayout");
-			bindFunc(cast(void**)&vkDestroyDevice, "vkDestroyDevice");
-			bindFunc(cast(void**)&vkDestroyEvent, "vkDestroyEvent");
-			bindFunc(cast(void**)&vkDestroyFence, "vkDestroyFence");
-			bindFunc(cast(void**)&vkDestroyFramebuffer, "vkDestroyFramebuffer");
-			bindFunc(cast(void**)&vkDestroyImage, "vkDestroyImage");
-			bindFunc(cast(void**)&vkDestroyImageView, "vkDestroyImageView");
-			bindFunc(cast(void**)&vkDestroyInstance, "vkDestroyInstance");
-			bindFunc(cast(void**)&vkDestroyPipeline, "vkDestroyPipeline");
-			bindFunc(cast(void**)&vkDestroyPipelineCache, "vkDestroyPipelineCache");
-			bindFunc(cast(void**)&vkDestroyPipelineLayout, "vkDestroyPipelineLayout");
-			bindFunc(cast(void**)&vkDestroyQueryPool, "vkDestroyQueryPool");
-			bindFunc(cast(void**)&vkDestroyRenderPass, "vkDestroyRenderPass");
-			bindFunc(cast(void**)&vkDestroySampler, "vkDestroySampler");
-			bindFunc(cast(void**)&vkDestroySemaphore, "vkDestroySemaphore");
-			bindFunc(cast(void**)&vkDestroyShaderModule, "vkDestroyShaderModule");
-			bindFunc(cast(void**)&vkDestroySurfaceKHR, "vkDestroySurfaceKHR");
-			bindFunc(cast(void**)&vkDestroySwapchainKHR, "vkDestroySwapchainKHR");
-			bindFunc(cast(void**)&vkDeviceWaitIdle, "vkDeviceWaitIdle");
-			bindFunc(cast(void**)&vkEndCommandBuffer, "vkEndCommandBuffer");
-			bindFunc(cast(void**)&vkEnumerateDeviceExtensionProperties, "vkEnumerateDeviceExtensionProperties");
-			bindFunc(cast(void**)&vkEnumerateDeviceLayerProperties, "vkEnumerateDeviceLayerProperties");
-			bindFunc(cast(void**)&vkEnumerateInstanceExtensionProperties, "vkEnumerateInstanceExtensionProperties");
-			bindFunc(cast(void**)&vkEnumerateInstanceLayerProperties, "vkEnumerateInstanceLayerProperties");
-			bindFunc(cast(void**)&vkEnumeratePhysicalDevices, "vkEnumeratePhysicalDevices");
-			bindFunc(cast(void**)&vkFlushMappedMemoryRanges, "vkFlushMappedMemoryRanges");
-			bindFunc(cast(void**)&vkFreeCommandBuffers, "vkFreeCommandBuffers");
-			bindFunc(cast(void**)&vkFreeDescriptorSets, "vkFreeDescriptorSets");
-			bindFunc(cast(void**)&vkFreeMemory, "vkFreeMemory");
-			bindFunc(cast(void**)&vkGetBufferMemoryRequirements, "vkGetBufferMemoryRequirements");
-			bindFunc(cast(void**)&vkGetDeviceMemoryCommitment, "vkGetDeviceMemoryCommitment");
-			bindFunc(cast(void**)&vkGetDeviceProcAddr, "vkGetDeviceProcAddr");
-			bindFunc(cast(void**)&vkGetDeviceQueue, "vkGetDeviceQueue");
-			bindFunc(cast(void**)&vkGetEventStatus, "vkGetEventStatus");
-			bindFunc(cast(void**)&vkGetFenceStatus, "vkGetFenceStatus");
-			bindFunc(cast(void**)&vkGetImageMemoryRequirements, "vkGetImageMemoryRequirements");
-			bindFunc(cast(void**)&vkGetImageSparseMemoryRequirements, "vkGetImageSparseMemoryRequirements");
-			bindFunc(cast(void**)&vkGetImageSubresourceLayout, "vkGetImageSubresourceLayout");
-			bindFunc(cast(void**)&vkGetInstanceProcAddr, "vkGetInstanceProcAddr");
-			bindFunc(cast(void**)&vkGetPhysicalDeviceFeatures, "vkGetPhysicalDeviceFeatures");
-			bindFunc(cast(void**)&vkGetPhysicalDeviceFormatProperties, "vkGetPhysicalDeviceFormatProperties");
-			bindFunc(cast(void**)&vkGetPhysicalDeviceImageFormatProperties, "vkGetPhysicalDeviceImageFormatProperties");
-			bindFunc(cast(void**)&vkGetPhysicalDeviceMemoryProperties, "vkGetPhysicalDeviceMemoryProperties");
-			bindFunc(cast(void**)&vkGetPhysicalDeviceProperties, "vkGetPhysicalDeviceProperties");
-			bindFunc(cast(void**)&vkGetPhysicalDeviceQueueFamilyProperties, "vkGetPhysicalDeviceQueueFamilyProperties");
-			bindFunc(cast(void**)&vkGetPhysicalDeviceSparseImageFormatProperties, "vkGetPhysicalDeviceSparseImageFormatProperties");
-			bindFunc(cast(void**)&vkGetPhysicalDeviceSurfaceCapabilitiesKHR, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
-			bindFunc(cast(void**)&vkGetPhysicalDeviceSurfaceFormatsKHR, "vkGetPhysicalDeviceSurfaceFormatsKHR");
-			bindFunc(cast(void**)&vkGetPhysicalDeviceSurfacePresentModesKHR, "vkGetPhysicalDeviceSurfacePresentModesKHR");
-			bindFunc(cast(void**)&vkGetPhysicalDeviceSurfaceSupportKHR, "vkGetPhysicalDeviceSurfaceSupportKHR");
-			bindFunc(cast(void**)&vkGetPipelineCacheData, "vkGetPipelineCacheData");
-			bindFunc(cast(void**)&vkGetQueryPoolResults, "vkGetQueryPoolResults");
-			bindFunc(cast(void**)&vkGetRenderAreaGranularity, "vkGetRenderAreaGranularity");
-			bindFunc(cast(void**)&vkGetSwapchainImagesKHR, "vkGetSwapchainImagesKHR");
-			bindFunc(cast(void**)&vkInvalidateMappedMemoryRanges, "vkInvalidateMappedMemoryRanges");
-			bindFunc(cast(void**)&vkMapMemory, "vkMapMemory");
-			bindFunc(cast(void**)&vkMergePipelineCaches, "vkMergePipelineCaches");
-			bindFunc(cast(void**)&vkQueueBindSparse, "vkQueueBindSparse");
-			bindFunc(cast(void**)&vkQueuePresentKHR, "vkQueuePresentKHR");
-			bindFunc(cast(void**)&vkQueueSubmit, "vkQueueSubmit");
-			bindFunc(cast(void**)&vkQueueWaitIdle, "vkQueueWaitIdle");
-			bindFunc(cast(void**)&vkResetCommandBuffer, "vkResetCommandBuffer");
-			bindFunc(cast(void**)&vkResetCommandPool, "vkResetCommandPool");
-			bindFunc(cast(void**)&vkResetDescriptorPool, "vkResetDescriptorPool");
-			bindFunc(cast(void**)&vkResetEvent, "vkResetEvent");
-			bindFunc(cast(void**)&vkResetFences, "vkResetFences");
-			bindFunc(cast(void**)&vkSetEvent, "vkSetEvent");
-			bindFunc(cast(void**)&vkUnmapMemory, "vkUnmapMemory");
-			bindFunc(cast(void**)&vkUpdateDescriptorSets, "vkUpdateDescriptorSets");
-			bindFunc(cast(void**)&vkWaitForFences, "vkWaitForFences");
-
-			static if(Derelict_OS_Windows)
-			{
-				bindFunc(cast(void**)&vkCreateWin32SurfaceKHR, "vkCreateWin32SurfaceKHR");
-				bindFunc(cast(void**)&vkGetPhysicalDeviceWin32PresentationSupportKHR, "vkGetPhysicalDeviceWin32PresentationSupportKHR");
-			}
-		}
-	}
-	public {
-		this() {
-			super(libNames);
-		}
-	}
-}
-
-__gshared DerelictVulkanLoader DerelictVulkan;
-
-shared static this() {
-	DerelictVulkan = new DerelictVulkanLoader();
-}
-
-shared static ~this() {
-	DerelictVulkan.unload();
-}
+module derelict.vulkan.vulkan;
+public import derelict.vulkan;