Restructure project for ICD implementation

This commit is contained in:
msiglreith 2017-12-08 13:11:54 +01:00
parent 1797c73f8b
commit 428899f237
10 changed files with 1484 additions and 1266 deletions

View file

@ -1,22 +1,6 @@
[package]
name = "portability"
version = "0.1.0"
authors = ["Dzmitry Malyshau <kvark@mozilla.com>"]
[lib]
name = "portability"
crate-type = ["staticlib"]
[dependencies]
winit = "0.7"
[dependencies.gfx-hal]
#path = "../gfx/src/hal"
git = "https://github.com/kvark/gfx-rs"
branch = "portable"
[dependencies.gfx-backend-vulkan]
#path = "../gfx/src/backend/vulkan"
git = "https://github.com/kvark/gfx-rs"
branch = "portable"
features = ["portable"]
[workspace]
members = [
"libportability",
"libportability-gfx",
"libportability-icd",
]

View file

@ -0,0 +1,18 @@
[package]
name = "portability-gfx"
version = "0.1.0"
authors = ["Dzmitry Malyshau <kvark@mozilla.com>"]
[lib]
name = "portability_gfx"
[dependencies.gfx-hal]
#path = "../gfx/src/hal"
git = "https://github.com/kvark/gfx-rs"
branch = "portable"
[dependencies.gfx-backend-vulkan]
#path = "../gfx/src/backend/vulkan"
git = "https://github.com/kvark/gfx-rs"
branch = "portable"
features = ["portable"]

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
[package]
name = "portability-icd"
version = "0.1.0"
authors = ["Dzmitry Malyshau <kvark@mozilla.com>"]
[lib]
name = "portability_icd"
crate-type = ["dylib"]
[dependencies]
portability-gfx = { path = "../libportability-gfx" }

View file

@ -0,0 +1,3 @@
extern crate portability_gfx;
use portability_gfx::*;

11
libportability/Cargo.toml Normal file
View file

@ -0,0 +1,11 @@
[package]
name = "portability"
version = "0.1.0"
authors = ["Dzmitry Malyshau <kvark@mozilla.com>"]
[lib]
name = "portability"
crate-type = ["staticlib"]
[dependencies]
portability-gfx = { path = "../libportability-gfx" }

208
libportability/src/lib.rs Normal file
View file

@ -0,0 +1,208 @@
#![allow(non_snake_case)]
extern crate portability_gfx;
use portability_gfx::*;
#[no_mangle]
pub extern fn vkCreateInstance(
pCreateInfo: *const VkInstanceCreateInfo,
pAllocator: *const VkAllocationCallbacks,
pInstance: *mut VkInstance,
) -> VkResult {
gfxCreateInstance(pCreateInfo, pAllocator, pInstance)
}
#[no_mangle]
pub extern fn vkDestroyInstance(
instance: VkInstance,
pAllocator: *const VkAllocationCallbacks,
) {
gfxDestroyInstance(instance, pAllocator)
}
#[no_mangle]
pub extern fn vkEnumeratePhysicalDevices(
instance: VkInstance,
pPhysicalDeviceCount: *mut u32,
pPhysicalDevices: *mut VkPhysicalDevice,
) -> VkResult {
gfxEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices)
}
#[no_mangle]
pub extern fn vkGetPhysicalDeviceQueueFamilyProperties(
adapter: VkPhysicalDevice,
pQueueFamilyPropertyCount: *mut u32,
pQueueFamilyProperties: *mut VkQueueFamilyProperties,
) {
gfxGetPhysicalDeviceQueueFamilyProperties(adapter, pQueueFamilyPropertyCount, pQueueFamilyProperties)
}
#[no_mangle]
pub extern fn vkCreateDevice(
adapter: VkPhysicalDevice,
pCreateInfo: *const VkDeviceCreateInfo,
pAllocator: *const VkAllocationCallbacks,
pDevice: *mut VkDevice,
) -> VkResult {
gfxCreateDevice(adapter, pCreateInfo, pAllocator, pDevice)
}
#[no_mangle]
pub extern fn vkDestroyDevice(
device: VkDevice,
pAllocator: *const VkAllocationCallbacks,
) {
gfxDestroyDevice(device, pAllocator)
}
#[no_mangle]
pub extern fn vkCreateImageView(
device: VkDevice,
pCreateInfo: *const VkImageViewCreateInfo,
pAllocator: *const VkAllocationCallbacks,
pView: *mut VkImageView,
) -> VkResult {
gfxCreateImageView(device, pCreateInfo, pAllocator, pView)
}
#[no_mangle]
pub extern fn vkDestroyImageView(
device: VkDevice,
imageView: VkImageView,
pAllocator: *const VkAllocationCallbacks,
) {
gfxDestroyImageView(device, imageView, pAllocator)
}
#[no_mangle]
pub extern fn vkCreateCommandPool(
device: VkDevice,
pCreateInfo: *const VkCommandPoolCreateInfo,
pAllocator: *const VkAllocationCallbacks,
pCommandPool: *mut VkCommandPool,
) -> VkResult {
gfxCreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool)
}
#[no_mangle]
pub extern fn vkDestroyCommandPool(
device: VkDevice,
commandPool: VkCommandPool,
pAllocator: *const VkAllocationCallbacks,
) {
gfxDestroyCommandPool(device, commandPool, pAllocator)
}
#[no_mangle]
pub extern fn vkResetCommandPool(
device: VkDevice,
commandPool: VkCommandPool,
flags: VkCommandPoolResetFlags,
) -> VkResult {
gfxResetCommandPool(device, commandPool, flags)
}
#[no_mangle]
pub extern fn vkAllocateCommandBuffers(
device: VkDevice,
pAllocateInfo: *const VkCommandBufferAllocateInfo,
pCommandBuffers: *mut VkCommandBuffer,
) -> VkResult {
gfxAllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers)
}
#[no_mangle]
pub extern fn vkFreeCommandBuffers(
device: VkDevice,
commandPool: VkCommandPool,
commandBufferCount: u32,
pCommandBuffers: *const VkCommandBuffer,
) {
gfxFreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers)
}
#[no_mangle]
pub extern fn vkDestroySurfaceKHR(
instance: VkInstance,
surface: VkSurfaceKHR,
pAllocator: *const VkAllocationCallbacks,
) {
gfxDestroySurfaceKHR(instance, surface, pAllocator)
}
#[no_mangle]
pub extern fn vkGetPhysicalDeviceSurfaceSupportKHR(
adapter: VkPhysicalDevice,
queueFamilyIndex: u32,
surface: VkSurfaceKHR,
pSupported: *mut VkBool32,
) -> VkResult {
gfxGetPhysicalDeviceSurfaceSupportKHR(adapter, queueFamilyIndex, surface, pSupported)
}
#[no_mangle]
pub extern fn vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
adapter: VkPhysicalDevice,
surface: VkSurfaceKHR,
pSurfaceCapabilities: *mut VkSurfaceCapabilitiesKHR,
) -> VkResult {
gfxGetPhysicalDeviceSurfaceCapabilitiesKHR(adapter, surface, pSurfaceCapabilities)
}
#[no_mangle]
pub extern fn vkGetPhysicalDeviceSurfaceFormatsKHR(
adapter: VkPhysicalDevice,
surface: VkSurfaceKHR,
pSurfaceFormatCount: *mut u32,
pSurfaceFormats: *mut VkSurfaceFormatKHR,
) -> VkResult {
gfxGetPhysicalDeviceSurfaceFormatsKHR(adapter, surface, pSurfaceFormatCount, pSurfaceFormats)
}
#[no_mangle]
pub extern fn vkGetPhysicalDeviceSurfacePresentModesKHR(
adapter: VkPhysicalDevice,
surface: VkSurfaceKHR,
pPresentModeCount: *mut u32,
pPresentModes: *mut VkPresentModeKHR,
) -> VkResult {
gfxGetPhysicalDeviceSurfacePresentModesKHR(adapter, surface, pPresentModeCount, pPresentModes)
}
#[no_mangle]
pub extern fn vkCreateSwapchainKHR(
device: VkDevice,
pCreateInfo: *const VkSwapchainCreateInfoKHR,
pAllocator: *const VkAllocationCallbacks,
pSwapchain: *mut VkSwapchainKHR,
) -> VkResult {
gfxCreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain)
}
#[no_mangle]
pub extern fn vkDestroySwapchainKHR(
device: VkDevice,
swapchain: VkSwapchainKHR,
pAllocator: *const VkAllocationCallbacks,
) {
gfxDestroySwapchainKHR(device, swapchain, pAllocator)
}
#[no_mangle]
pub extern fn vkGetSwapchainImagesKHR(
device: VkDevice,
swapchain: VkSwapchainKHR,
pSwapchainImageCount: *mut u32,
pSwapchainImages: *mut VkImage,
) -> VkResult {
gfxGetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages)
}
#[no_mangle]
pub extern fn vkCreateWin32SurfaceKHR(
instance: VkInstance,
pCreateInfos: *const VkWin32SurfaceCreateInfoKHR,
pAllocator: *const VkAllocationCallbacks,
pSurface: *mut VkSurfaceKHR,
) -> VkResult {
gfxCreateWin32SurfaceKHR(instance, pCreateInfos, pAllocator, pSurface)
}