mirror of
https://github.com/italicsjenga/portability.git
synced 2024-11-22 15:01:31 +11:00
Fix Makefile and mark implementations as inline
This commit is contained in:
parent
b919665a9b
commit
054678b7f5
4
Makefile
4
Makefile
|
@ -19,8 +19,8 @@ binding: $(BINDING)
|
||||||
$(BINDING): $(VULKAN_DIR)/vulkan/*.h
|
$(BINDING): $(VULKAN_DIR)/vulkan/*.h
|
||||||
bindgen --no-layout-tests --rustfmt-bindings $(VULKAN_DIR)/vulkan/vulkan.h -o $(BINDING)
|
bindgen --no-layout-tests --rustfmt-bindings $(VULKAN_DIR)/vulkan/vulkan.h -o $(BINDING)
|
||||||
|
|
||||||
$(LIBRARY): src/*.rs Cargo.toml $(wildcard Cargo.lock)
|
$(LIBRARY): libportability/src/*.rs libportability-gfx/src/*.rs Cargo.toml $(wildcard Cargo.lock)
|
||||||
cargo build
|
cargo build -p portability
|
||||||
mkdir -p target/native
|
mkdir -p target/native
|
||||||
|
|
||||||
$(NATIVE_DIR)/%.o: native/%.cpp $(DEPS) Makefile
|
$(NATIVE_DIR)/%.o: native/%.cpp $(DEPS) Makefile
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxCreateInstance(
|
pub extern fn gfxCreateInstance(
|
||||||
_pCreateInfo: *const VkInstanceCreateInfo,
|
_pCreateInfo: *const VkInstanceCreateInfo,
|
||||||
_pAllocator: *const VkAllocationCallbacks,
|
_pAllocator: *const VkAllocationCallbacks,
|
||||||
|
@ -12,6 +13,7 @@ pub extern fn gfxCreateInstance(
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxDestroyInstance(
|
pub extern fn gfxDestroyInstance(
|
||||||
instance: VkInstance,
|
instance: VkInstance,
|
||||||
_pAllocator: *const VkAllocationCallbacks,
|
_pAllocator: *const VkAllocationCallbacks,
|
||||||
|
@ -20,6 +22,7 @@ pub extern fn gfxDestroyInstance(
|
||||||
//let it drop
|
//let it drop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxEnumeratePhysicalDevices(
|
pub extern fn gfxEnumeratePhysicalDevices(
|
||||||
instance: VkInstance,
|
instance: VkInstance,
|
||||||
pPhysicalDeviceCount: *mut u32,
|
pPhysicalDeviceCount: *mut u32,
|
||||||
|
@ -37,6 +40,7 @@ pub extern fn gfxEnumeratePhysicalDevices(
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxGetPhysicalDeviceQueueFamilyProperties(
|
pub extern fn gfxGetPhysicalDeviceQueueFamilyProperties(
|
||||||
adapter: VkPhysicalDevice,
|
adapter: VkPhysicalDevice,
|
||||||
pQueueFamilyPropertyCount: *mut u32,
|
pQueueFamilyPropertyCount: *mut u32,
|
||||||
|
@ -111,6 +115,7 @@ extern "C" {
|
||||||
-> PFN_vkVoidFunction;
|
-> PFN_vkVoidFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxCreateDevice(
|
pub extern fn gfxCreateDevice(
|
||||||
adapter: VkPhysicalDevice,
|
adapter: VkPhysicalDevice,
|
||||||
pCreateInfo: *const VkDeviceCreateInfo,
|
pCreateInfo: *const VkDeviceCreateInfo,
|
||||||
|
@ -134,6 +139,7 @@ pub extern fn gfxCreateDevice(
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxDestroyDevice(
|
pub extern fn gfxDestroyDevice(
|
||||||
device: VkDevice,
|
device: VkDevice,
|
||||||
_pAllocator: *const VkAllocationCallbacks,
|
_pAllocator: *const VkAllocationCallbacks,
|
||||||
|
@ -160,6 +166,7 @@ lazy_static! {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxEnumerateInstanceExtensionProperties(
|
pub extern fn gfxEnumerateInstanceExtensionProperties(
|
||||||
pLayerName: *const ::std::os::raw::c_char,
|
pLayerName: *const ::std::os::raw::c_char,
|
||||||
pPropertyCount: *mut u32,
|
pPropertyCount: *mut u32,
|
||||||
|
@ -417,6 +424,7 @@ extern "C" {
|
||||||
*const VkImageSubresource,
|
*const VkImageSubresource,
|
||||||
pLayout: *mut VkSubresourceLayout);
|
pLayout: *mut VkSubresourceLayout);
|
||||||
}
|
}
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxCreateImageView(
|
pub extern fn gfxCreateImageView(
|
||||||
gpu: VkDevice,
|
gpu: VkDevice,
|
||||||
pCreateInfo: *const VkImageViewCreateInfo,
|
pCreateInfo: *const VkImageViewCreateInfo,
|
||||||
|
@ -446,6 +454,7 @@ pub extern fn gfxCreateImageView(
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxDestroyImageView(
|
pub extern fn gfxDestroyImageView(
|
||||||
gpu: VkDevice,
|
gpu: VkDevice,
|
||||||
imageView: VkImageView,
|
imageView: VkImageView,
|
||||||
|
@ -619,6 +628,7 @@ extern "C" {
|
||||||
pGranularity: *mut VkExtent2D);
|
pGranularity: *mut VkExtent2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxCreateCommandPool(
|
pub extern fn gfxCreateCommandPool(
|
||||||
gpu: VkDevice,
|
gpu: VkDevice,
|
||||||
pCreateInfo: *const VkCommandPoolCreateInfo,
|
pCreateInfo: *const VkCommandPoolCreateInfo,
|
||||||
|
@ -644,6 +654,7 @@ pub extern fn gfxCreateCommandPool(
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxDestroyCommandPool(
|
pub extern fn gfxDestroyCommandPool(
|
||||||
gpu: VkDevice,
|
gpu: VkDevice,
|
||||||
commandPool: VkCommandPool,
|
commandPool: VkCommandPool,
|
||||||
|
@ -652,6 +663,7 @@ pub extern fn gfxDestroyCommandPool(
|
||||||
gpu.device.destroy_command_pool(*commandPool.unwrap());
|
gpu.device.destroy_command_pool(*commandPool.unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxResetCommandPool(
|
pub extern fn gfxResetCommandPool(
|
||||||
_gpu: VkDevice,
|
_gpu: VkDevice,
|
||||||
mut commandPool: VkCommandPool,
|
mut commandPool: VkCommandPool,
|
||||||
|
@ -661,6 +673,7 @@ pub extern fn gfxResetCommandPool(
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxAllocateCommandBuffers(
|
pub extern fn gfxAllocateCommandBuffers(
|
||||||
_gpu: VkDevice,
|
_gpu: VkDevice,
|
||||||
pAllocateInfo: *const VkCommandBufferAllocateInfo,
|
pAllocateInfo: *const VkCommandBufferAllocateInfo,
|
||||||
|
@ -682,6 +695,7 @@ pub extern fn gfxAllocateCommandBuffers(
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxFreeCommandBuffers(
|
pub extern fn gfxFreeCommandBuffers(
|
||||||
_gpu: VkDevice,
|
_gpu: VkDevice,
|
||||||
mut commandPool: VkCommandPool,
|
mut commandPool: VkCommandPool,
|
||||||
|
@ -964,6 +978,7 @@ extern "C" {
|
||||||
pCommandBuffers: *const VkCommandBuffer);
|
pCommandBuffers: *const VkCommandBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxDestroySurfaceKHR(
|
pub extern fn gfxDestroySurfaceKHR(
|
||||||
_instance: VkInstance,
|
_instance: VkInstance,
|
||||||
surface: VkSurfaceKHR,
|
surface: VkSurfaceKHR,
|
||||||
|
@ -972,6 +987,7 @@ pub extern fn gfxDestroySurfaceKHR(
|
||||||
let _ = surface.unwrap(); //TODO
|
let _ = surface.unwrap(); //TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxGetPhysicalDeviceSurfaceSupportKHR(
|
pub extern fn gfxGetPhysicalDeviceSurfaceSupportKHR(
|
||||||
adapter: VkPhysicalDevice,
|
adapter: VkPhysicalDevice,
|
||||||
queueFamilyIndex: u32,
|
queueFamilyIndex: u32,
|
||||||
|
@ -984,6 +1000,7 @@ pub extern fn gfxGetPhysicalDeviceSurfaceSupportKHR(
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxGetPhysicalDeviceSurfaceCapabilitiesKHR(
|
pub extern fn gfxGetPhysicalDeviceSurfaceCapabilitiesKHR(
|
||||||
adapter: VkPhysicalDevice,
|
adapter: VkPhysicalDevice,
|
||||||
surface: VkSurfaceKHR,
|
surface: VkSurfaceKHR,
|
||||||
|
@ -1014,6 +1031,7 @@ pub extern fn gfxGetPhysicalDeviceSurfaceCapabilitiesKHR(
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxGetPhysicalDeviceSurfaceFormatsKHR(
|
pub extern fn gfxGetPhysicalDeviceSurfaceFormatsKHR(
|
||||||
adapter: VkPhysicalDevice,
|
adapter: VkPhysicalDevice,
|
||||||
surface: VkSurfaceKHR,
|
surface: VkSurfaceKHR,
|
||||||
|
@ -1036,6 +1054,7 @@ pub extern fn gfxGetPhysicalDeviceSurfaceFormatsKHR(
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxGetPhysicalDeviceSurfacePresentModesKHR(
|
pub extern fn gfxGetPhysicalDeviceSurfacePresentModesKHR(
|
||||||
_adapter: VkPhysicalDevice,
|
_adapter: VkPhysicalDevice,
|
||||||
_surface: VkSurfaceKHR,
|
_surface: VkSurfaceKHR,
|
||||||
|
@ -1055,6 +1074,7 @@ pub extern fn gfxGetPhysicalDeviceSurfacePresentModesKHR(
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxCreateSwapchainKHR(
|
pub extern fn gfxCreateSwapchainKHR(
|
||||||
gpu: VkDevice,
|
gpu: VkDevice,
|
||||||
pCreateInfo: *const VkSwapchainCreateInfoKHR,
|
pCreateInfo: *const VkSwapchainCreateInfoKHR,
|
||||||
|
@ -1090,6 +1110,7 @@ pub extern fn gfxCreateSwapchainKHR(
|
||||||
unsafe { *pSwapchain = Handle::new(swapchain) };
|
unsafe { *pSwapchain = Handle::new(swapchain) };
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxDestroySwapchainKHR(
|
pub extern fn gfxDestroySwapchainKHR(
|
||||||
device: VkDevice,
|
device: VkDevice,
|
||||||
mut swapchain: VkSwapchainKHR,
|
mut swapchain: VkSwapchainKHR,
|
||||||
|
@ -1100,6 +1121,7 @@ pub extern fn gfxDestroySwapchainKHR(
|
||||||
}
|
}
|
||||||
let _ = swapchain.unwrap();
|
let _ = swapchain.unwrap();
|
||||||
}
|
}
|
||||||
|
#[inline]
|
||||||
pub extern fn gfxGetSwapchainImagesKHR(
|
pub extern fn gfxGetSwapchainImagesKHR(
|
||||||
device: VkDevice,
|
device: VkDevice,
|
||||||
swapchain: VkSwapchainKHR,
|
swapchain: VkSwapchainKHR,
|
||||||
|
|
Loading…
Reference in a new issue