type safe flags + default
This commit is contained in:
parent
0a31776136
commit
6879f42957
5 changed files with 668 additions and 1204 deletions
1085
ash/src/device.rs
1085
ash/src/device.rs
File diff suppressed because it is too large
Load diff
|
@ -12,7 +12,9 @@ use std::path::Path;
|
|||
use vk_loader2 as vk;
|
||||
// use feature;
|
||||
use load;
|
||||
use device::Device;
|
||||
use shared_library::dynamic_library::DynamicLibrary;
|
||||
|
||||
type VkResult<T> = Result<T, vk::Result>;
|
||||
|
||||
#[cfg(windows)]
|
||||
|
@ -30,12 +32,6 @@ fn get_path() -> &'static Path {
|
|||
Path::new("libvulkan.so")
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Instance<'r> {
|
||||
handle: vk::Instance,
|
||||
instance_fn: vk::InstanceFn,
|
||||
_lifetime: ::std::marker::PhantomData<&'r i32>,
|
||||
}
|
||||
|
||||
pub struct Entry {
|
||||
lib: DynamicLibrary,
|
||||
|
@ -136,590 +132,12 @@ impl Entry {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct Device {
|
||||
handle: vk::Device,
|
||||
device_fn: vk::DeviceFn,
|
||||
#[derive(Debug)]
|
||||
pub struct Instance<'r> {
|
||||
handle: vk::Instance,
|
||||
instance_fn: vk::InstanceFn,
|
||||
_lifetime: ::std::marker::PhantomData<&'r i32>,
|
||||
}
|
||||
impl Device {
|
||||
pub fn destroy_device(&self) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_device(self.handle, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn free_memory(&self, memory: vk::DeviceMemory) {
|
||||
unsafe {
|
||||
self.device_fn.free_memory(self.handle, memory, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_fence(&self, fence: vk::Fence) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_fence(self.handle, fence, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_image(&self, image: vk::Image) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_image(self.handle, image, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_command_pool(&self, pool: vk::CommandPool) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_command_pool(self.handle, pool, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_swapchain_khr(&self, swapchain: vk::SwapchainKHR) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_swapchain_khr(self.handle, swapchain, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_image_view(&self, image_view: vk::ImageView) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_image_view(self.handle, image_view, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_render_pass(&self, renderpass: vk::RenderPass) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_render_pass(self.handle, renderpass, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_framebuffer(&self, framebuffer: vk::Framebuffer) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_framebuffer(self.handle, framebuffer, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_pipeline_layout(&self, pipeline_layout: vk::PipelineLayout) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_pipeline_layout(self.handle, pipeline_layout, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_buffer(&self, buffer: vk::Buffer) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_buffer(self.handle, buffer, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_shader_module(&self, shader: vk::ShaderModule) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_shader_module(self.handle, shader, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_pipeline(&self, pipeline: vk::Pipeline) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_pipeline(self.handle, pipeline, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destroy_semaphore(&self, semaphore: vk::Semaphore) {
|
||||
unsafe {
|
||||
self.device_fn.destroy_semaphore(self.handle, semaphore, ptr::null());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cmd_begin_render_pass(&self,
|
||||
command_buffer: vk::CommandBuffer,
|
||||
create_info: &vk::RenderPassBeginInfo,
|
||||
contents: vk::SubpassContents) {
|
||||
unsafe {
|
||||
self.device_fn.cmd_begin_render_pass(command_buffer, create_info, contents);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cmd_bind_pipeline(&self,
|
||||
command_buffer: vk::CommandBuffer,
|
||||
pipeline_bind_point: vk::PipelineBindPoint,
|
||||
pipeline: vk::Pipeline) {
|
||||
unsafe {
|
||||
self.device_fn.cmd_bind_pipeline(command_buffer, pipeline_bind_point, pipeline);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cmd_set_scissor(&self, command_buffer: vk::CommandBuffer, scissors: &[vk::Rect2D]) {
|
||||
unsafe {
|
||||
self.device_fn
|
||||
.cmd_set_scissor(command_buffer, 0, scissors.len() as u32, scissors.as_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cmd_bind_vertex_buffers(&self,
|
||||
command_buffer: vk::CommandBuffer,
|
||||
buffers: &[vk::Buffer],
|
||||
offsets: &vk::DeviceSize) {
|
||||
unsafe {
|
||||
self.device_fn.cmd_bind_vertex_buffers(command_buffer,
|
||||
0,
|
||||
buffers.len() as u32,
|
||||
buffers.as_ptr(),
|
||||
offsets);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cmd_end_render_pass(&self, command_buffer: vk::CommandBuffer) {
|
||||
unsafe {
|
||||
self.device_fn.cmd_end_render_pass(command_buffer);
|
||||
}
|
||||
}
|
||||
pub fn cmd_draw(&self,
|
||||
command_buffer: vk::CommandBuffer,
|
||||
vertex_count: u32,
|
||||
instance_count: u32,
|
||||
first_vertex: u32,
|
||||
first_instance: u32) {
|
||||
unsafe {
|
||||
self.device_fn.cmd_draw(command_buffer,
|
||||
vertex_count,
|
||||
instance_count,
|
||||
first_vertex,
|
||||
first_instance);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cmd_set_viewport(&self, command_buffer: vk::CommandBuffer, viewports: &[vk::Viewport]) {
|
||||
unsafe {
|
||||
self.device_fn.cmd_set_viewport(command_buffer,
|
||||
0,
|
||||
viewports.len() as u32,
|
||||
viewports.as_ptr());
|
||||
}
|
||||
}
|
||||
pub fn acquire_next_image_khr(&self,
|
||||
swapchain: vk::SwapchainKHR,
|
||||
timeout: u64,
|
||||
semaphore: vk::Semaphore,
|
||||
fence: vk::Fence)
|
||||
-> VkResult<u32> {
|
||||
unsafe {
|
||||
let mut index = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.acquire_next_image_khr(self.handle,
|
||||
swapchain,
|
||||
timeout,
|
||||
semaphore,
|
||||
fence,
|
||||
&mut index);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(index),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn create_semaphore(&self,
|
||||
create_info: &vk::SemaphoreCreateInfo)
|
||||
-> VkResult<vk::Semaphore> {
|
||||
unsafe {
|
||||
let mut semaphore = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.create_semaphore(self.handle, create_info, ptr::null(), &mut semaphore);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(semaphore),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_graphics_pipelines(&self,
|
||||
pipeline_cache: vk::PipelineCache,
|
||||
create_infos: &[vk::GraphicsPipelineCreateInfo])
|
||||
-> VkResult<Vec<vk::Pipeline>> {
|
||||
unsafe {
|
||||
let mut pipelines = Vec::with_capacity(create_infos.len());
|
||||
let err_code = self.device_fn
|
||||
.create_graphics_pipelines(self.handle,
|
||||
pipeline_cache,
|
||||
create_infos.len() as u32,
|
||||
create_infos.as_ptr(),
|
||||
ptr::null(),
|
||||
pipelines.as_mut_ptr());
|
||||
pipelines.set_len(create_infos.len());
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(pipelines),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn create_buffer(&self, create_info: &vk::BufferCreateInfo) -> VkResult<vk::Buffer> {
|
||||
unsafe {
|
||||
let mut buffer = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.create_buffer(self.handle, create_info, ptr::null(), &mut buffer);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(buffer),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_pipeline_layout(&self,
|
||||
create_info: &vk::PipelineLayoutCreateInfo)
|
||||
-> VkResult<vk::PipelineLayout> {
|
||||
unsafe {
|
||||
let mut pipeline_layout = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.create_pipeline_layout(self.handle,
|
||||
create_info,
|
||||
ptr::null(),
|
||||
&mut pipeline_layout);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(pipeline_layout),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn map_memory<T>(&self,
|
||||
memory: vk::DeviceMemory,
|
||||
offset: vk::DeviceSize,
|
||||
size: vk::DeviceSize,
|
||||
flags: vk::MemoryMapFlags)
|
||||
-> VkResult<&mut [T]> {
|
||||
|
||||
unsafe {
|
||||
let mut data: *mut () = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.map_memory(self.handle, memory, offset, size, flags, &mut data);
|
||||
let x: *mut T = data as *mut T;
|
||||
match err_code {
|
||||
vk::Result::Success => {
|
||||
Ok(::std::slice::from_raw_parts_mut(x, size as usize / mem::size_of::<T>()))
|
||||
}
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn unmap_memory(&self, memory: vk::DeviceMemory) {
|
||||
unsafe {
|
||||
self.device_fn.unmap_memory(self.handle, memory);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_framebuffer(&self,
|
||||
create_info: &vk::FramebufferCreateInfo)
|
||||
-> VkResult<vk::Framebuffer> {
|
||||
unsafe {
|
||||
let mut framebuffer = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.create_framebuffer(self.handle, create_info, ptr::null(), &mut framebuffer);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(framebuffer),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_device_queue(&self, queue_family_index: u32, queue_index: u32) -> vk::Queue {
|
||||
unsafe {
|
||||
let mut queue = mem::uninitialized();
|
||||
self.device_fn
|
||||
.get_device_queue(self.handle, queue_family_index, queue_index, &mut queue);
|
||||
queue
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cmd_pipeline_barrier(&self,
|
||||
command_buffer: vk::CommandBuffer,
|
||||
src_stage_mask: vk::PipelineStageFlags,
|
||||
dst_stage_mask: vk::PipelineStageFlags,
|
||||
dependency_flags: vk::DependencyFlags,
|
||||
memory_barriers: &[vk::MemoryBarrier],
|
||||
buffer_memory_barriers: &[vk::BufferMemoryBarrier],
|
||||
image_memory_barriers: &[vk::ImageMemoryBarrier]) {
|
||||
unsafe {
|
||||
self.device_fn.cmd_pipeline_barrier(command_buffer,
|
||||
src_stage_mask,
|
||||
dst_stage_mask,
|
||||
dependency_flags,
|
||||
memory_barriers.len() as u32,
|
||||
memory_barriers.as_ptr(),
|
||||
buffer_memory_barriers.len() as u32,
|
||||
buffer_memory_barriers.as_ptr(),
|
||||
image_memory_barriers.len() as u32,
|
||||
image_memory_barriers.as_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_render_pass(&self,
|
||||
create_info: &vk::RenderPassCreateInfo)
|
||||
-> VkResult<vk::RenderPass> {
|
||||
unsafe {
|
||||
let mut renderpass = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.create_render_pass(self.handle, create_info, ptr::null(), &mut renderpass);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(renderpass),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn begin_command_buffer(&self,
|
||||
command_buffer: vk::CommandBuffer,
|
||||
create_info: &vk::CommandBufferBeginInfo)
|
||||
-> VkResult<()> {
|
||||
unsafe {
|
||||
let err_code = self.device_fn
|
||||
.begin_command_buffer(command_buffer, create_info);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(()),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn end_command_buffer(&self, command_buffer: vk::CommandBuffer) -> VkResult<()> {
|
||||
unsafe {
|
||||
let err_code = self.device_fn
|
||||
.end_command_buffer(command_buffer);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(()),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn wait_for_fences(&self,
|
||||
fences: &[vk::Fence],
|
||||
wait_all: bool,
|
||||
timeout: u64)
|
||||
-> VkResult<()> {
|
||||
unsafe {
|
||||
let err_code = self.device_fn
|
||||
.wait_for_fences(self.handle,
|
||||
fences.len() as u32,
|
||||
fences.as_ptr(),
|
||||
wait_all as u32,
|
||||
timeout);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(()),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn queue_wait_idle(&self, queue: vk::Queue) -> VkResult<()> {
|
||||
unsafe {
|
||||
let err_code = self.device_fn.queue_wait_idle(queue);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(()),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn queue_present_khr(&self,
|
||||
queue: vk::Queue,
|
||||
create_info: &vk::PresentInfoKHR)
|
||||
-> VkResult<()> {
|
||||
unsafe {
|
||||
let err_code = self.device_fn
|
||||
.queue_present_khr(queue, create_info);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(()),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn queue_submit(&self,
|
||||
queue: vk::Queue,
|
||||
submits: &[vk::SubmitInfo],
|
||||
fence: vk::Fence)
|
||||
-> VkResult<()> {
|
||||
unsafe {
|
||||
let err_code = self.device_fn
|
||||
.queue_submit(queue, submits.len() as u32, submits.as_ptr(), fence);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(()),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_image_view(&self,
|
||||
create_info: &vk::ImageViewCreateInfo)
|
||||
-> VkResult<vk::ImageView> {
|
||||
unsafe {
|
||||
let mut image_view = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.create_image_view(self.handle, create_info, ptr::null(), &mut image_view);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(image_view),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn get_swapchain_images_khr(&self,
|
||||
swapchain: vk::SwapchainKHR)
|
||||
-> VkResult<Vec<vk::Image>> {
|
||||
unsafe {
|
||||
let mut count = 0;
|
||||
self.device_fn
|
||||
.get_swapchain_images_khr(self.handle, swapchain, &mut count, ptr::null_mut());
|
||||
|
||||
let mut v = Vec::with_capacity(count as usize);
|
||||
let err_code = self.device_fn
|
||||
.get_swapchain_images_khr(self.handle, swapchain, &mut count, v.as_mut_ptr());
|
||||
v.set_len(count as usize);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(v),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn allocate_command_buffers<I: Into<vk::CommandBufferAllocateInfo>>
|
||||
(&self,
|
||||
i: I)
|
||||
-> VkResult<Vec<vk::CommandBuffer>> {
|
||||
let create_info = i.into();
|
||||
unsafe {
|
||||
let mut buffers = Vec::with_capacity(create_info.command_buffer_count as usize);
|
||||
let err_code = self.device_fn
|
||||
.allocate_command_buffers(self.handle, &create_info, buffers.as_mut_ptr());
|
||||
buffers.set_len(create_info.command_buffer_count as usize);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(buffers),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn create_command_pool<I: Into<vk::CommandPoolCreateInfo>>(&self,
|
||||
i: I)
|
||||
-> VkResult<vk::CommandPool> {
|
||||
let create_info = i.into();
|
||||
unsafe {
|
||||
let mut pool = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.create_command_pool(self.handle, &create_info, ptr::null(), &mut pool);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(pool),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn create_swapchain_khr<I: Into<vk::SwapchainCreateInfoKHR>>
|
||||
(&self,
|
||||
i: I)
|
||||
-> VkResult<vk::SwapchainKHR> {
|
||||
let create_info = i.into();
|
||||
unsafe {
|
||||
let mut swapchain = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.create_swapchain_khr(self.handle, &create_info, ptr::null(), &mut swapchain);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(swapchain),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_image(&self, create_info: &vk::ImageCreateInfo) -> VkResult<vk::Image> {
|
||||
unsafe {
|
||||
let mut image = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.create_image(self.handle, create_info, ptr::null(), &mut image);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(image),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_image_memory_requirements(&self, image: vk::Image) -> vk::MemoryRequirements {
|
||||
unsafe {
|
||||
let mut mem_req = mem::uninitialized();
|
||||
self.device_fn
|
||||
.get_image_memory_requirements(self.handle, image, &mut mem_req);
|
||||
mem_req
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_buffer_memory_requirements(&self, buffer: vk::Buffer) -> vk::MemoryRequirements {
|
||||
unsafe {
|
||||
let mut mem_req = mem::uninitialized();
|
||||
self.device_fn
|
||||
.get_buffer_memory_requirements(self.handle, buffer, &mut mem_req);
|
||||
mem_req
|
||||
}
|
||||
}
|
||||
|
||||
pub fn allocate_memory(&self,
|
||||
create_info: &vk::MemoryAllocateInfo)
|
||||
-> VkResult<vk::DeviceMemory> {
|
||||
unsafe {
|
||||
let mut memory = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.allocate_memory(self.handle, create_info, ptr::null(), &mut memory);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(memory),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_shader_module(&self,
|
||||
create_info: &vk::ShaderModuleCreateInfo)
|
||||
-> VkResult<vk::ShaderModule> {
|
||||
unsafe {
|
||||
let mut shader = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.create_shader_module(self.handle, create_info, ptr::null(), &mut shader);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(shader),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_fence(&self, create_info: &vk::FenceCreateInfo) -> VkResult<vk::Fence> {
|
||||
unsafe {
|
||||
let mut fence = mem::uninitialized();
|
||||
let err_code = self.device_fn
|
||||
.create_fence(self.handle, create_info, ptr::null(), &mut fence);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(fence),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn bind_buffer_memory(&self,
|
||||
buffer: vk::Buffer,
|
||||
device_memory: vk::DeviceMemory,
|
||||
offset: vk::DeviceSize)
|
||||
-> VkResult<()> {
|
||||
unsafe {
|
||||
let err_code = self.device_fn
|
||||
.bind_buffer_memory(self.handle, buffer, device_memory, offset);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(()),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn bind_image_memory(&self,
|
||||
image: vk::Image,
|
||||
device_memory: vk::DeviceMemory,
|
||||
offset: vk::DeviceSize)
|
||||
-> VkResult<()> {
|
||||
unsafe {
|
||||
let err_code = self.device_fn
|
||||
.bind_image_memory(self.handle, image, device_memory, offset);
|
||||
match err_code {
|
||||
vk::Result::Success => Ok(()),
|
||||
_ => Err(err_code),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'r> Instance<'r> {
|
||||
pub fn destroy_instance(&self) {
|
||||
unsafe {
|
||||
|
@ -874,10 +292,7 @@ impl<'r> Instance<'r> {
|
|||
mem::transmute(self.instance_fn.get_device_proc_addr(device, name.as_ptr()))
|
||||
})
|
||||
.unwrap();
|
||||
Ok(Device {
|
||||
handle: device,
|
||||
device_fn: device_fn,
|
||||
})
|
||||
Ok(Device::from_raw(device, device_fn))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
extern crate lazy_static;
|
||||
extern crate shared_library;
|
||||
extern crate vk_loader;
|
||||
#[macro_use]
|
||||
extern crate vk_loader2;
|
||||
extern crate glfw;
|
||||
#[macro_use]
|
||||
|
@ -12,7 +13,7 @@ pub mod load;
|
|||
//pub mod surface;
|
||||
pub mod instance;
|
||||
//pub mod feature;
|
||||
//pub mod device;
|
||||
pub mod device;
|
||||
//pub mod commandpool;
|
||||
//pub mod fence;
|
||||
//pub mod buffer;
|
||||
|
|
|
@ -2,11 +2,14 @@
|
|||
#![allow(dead_code)]
|
||||
extern crate owning_ref;
|
||||
extern crate ash;
|
||||
|
||||
extern crate vk_loader2 as vk;
|
||||
extern crate glfw;
|
||||
|
||||
use std::default::Default;
|
||||
use glfw::*;
|
||||
use ash::instance::{Entry, Instance};
|
||||
use ash::device::Device;
|
||||
use std::ptr;
|
||||
use std::ffi::{CStr, CString};
|
||||
use std::mem;
|
||||
|
@ -14,17 +17,14 @@ use std::path::Path;
|
|||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
use std::os::raw::c_void;
|
||||
macro_rules! printlndb{
|
||||
($arg: tt) => {
|
||||
println!("{:?}", $arg);
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_window_event(window: &mut glfw::Window, event: glfw::WindowEvent) {
|
||||
match event {
|
||||
glfw::WindowEvent::Key(Key::Escape, _, Action::Press, _) => window.set_should_close(true),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn find_memorytype_index(memory_req: &vk::MemoryRequirements,
|
||||
memory_prop: &vk::PhysicalDeviceMemoryProperties,
|
||||
flags: vk::MemoryPropertyFlags)
|
||||
|
@ -91,7 +91,7 @@ fn main() {
|
|||
enabled_layer_count: layers_names_raw.len() as u32,
|
||||
pp_enabled_extension_names: extension_names_raw.as_ptr(),
|
||||
enabled_extension_count: extension_names_raw.len() as u32,
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
};
|
||||
let instance = entry.create_instance(create_info).expect("Instance creation error");
|
||||
let x11_display = window.glfw.get_x11_display();
|
||||
|
@ -99,7 +99,7 @@ fn main() {
|
|||
let x11_create_info = vk::XlibSurfaceCreateInfoKHR {
|
||||
s_type: vk::StructureType::XlibSurfaceCreateInfoKhr,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
window: x11_window as vk::Window,
|
||||
dpy: x11_display as *mut vk::Display,
|
||||
};
|
||||
|
@ -136,7 +136,7 @@ fn main() {
|
|||
let queue_info = vk::DeviceQueueCreateInfo {
|
||||
s_type: vk::StructureType::DeviceQueueCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
queue_family_index: queue_family_index as u32,
|
||||
p_queue_priorities: priorities.as_ptr(),
|
||||
queue_count: priorities.len() as u32,
|
||||
|
@ -144,7 +144,7 @@ fn main() {
|
|||
let device_create_info = vk::DeviceCreateInfo {
|
||||
s_type: vk::StructureType::DeviceCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
queue_create_info_count: 1,
|
||||
p_queue_create_infos: &queue_info,
|
||||
enabled_layer_count: 0,
|
||||
|
@ -153,7 +153,7 @@ fn main() {
|
|||
pp_enabled_extension_names: device_extension_names_raw.as_ptr(),
|
||||
p_enabled_features: &features,
|
||||
};
|
||||
let device: ash::instance::Device = instance.create_device(pdevice, device_create_info)
|
||||
let device: Device = instance.create_device(pdevice, device_create_info)
|
||||
.unwrap();
|
||||
let present_queue = device.get_device_queue(queue_family_index as u32, 0);
|
||||
|
||||
|
@ -204,7 +204,7 @@ fn main() {
|
|||
let swapchain_create_info = vk::SwapchainCreateInfoKHR {
|
||||
s_type: vk::StructureType::SwapchainCreateInfoKhr,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
surface: surface,
|
||||
min_image_count: desired_image_count,
|
||||
image_color_space: surface_format.color_space,
|
||||
|
@ -249,7 +249,7 @@ fn main() {
|
|||
let create_view_info = vk::ImageViewCreateInfo {
|
||||
s_type: vk::StructureType::ImageViewCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
view_type: vk::ImageViewType::Type2d,
|
||||
format: surface_format.format,
|
||||
components: vk::ComponentMapping {
|
||||
|
@ -367,7 +367,7 @@ fn main() {
|
|||
let depth_image_view_info = vk::ImageViewCreateInfo {
|
||||
s_type: vk::StructureType::ImageViewCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
view_type: vk::ImageViewType::Type2d,
|
||||
format: depth_image_create_info.format,
|
||||
components: vk::ComponentMapping {
|
||||
|
@ -422,7 +422,7 @@ fn main() {
|
|||
p_color_attachments: &color_attachment_ref,
|
||||
p_depth_stencil_attachment: &depth_attachment_ref,
|
||||
// TODO: Why is there no wrapper?
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
pipeline_bind_point: vk::PipelineBindPoint::Graphics,
|
||||
input_attachment_count: 0,
|
||||
p_input_attachments: ptr::null(),
|
||||
|
@ -432,7 +432,7 @@ fn main() {
|
|||
};
|
||||
let renderpass_create_info = vk::RenderPassCreateInfo {
|
||||
s_type: vk::StructureType::RenderPassCreateInfo,
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
p_next: ptr::null(),
|
||||
attachment_count: renderpass_attachments.len() as u32,
|
||||
p_attachments: renderpass_attachments.as_ptr(),
|
||||
|
@ -448,7 +448,7 @@ fn main() {
|
|||
let frame_buffer_create_info = vk::FramebufferCreateInfo {
|
||||
s_type: vk::StructureType::FramebufferCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
render_pass: renderpass,
|
||||
attachment_count: framebuffer_attachments.len() as u32,
|
||||
p_attachments: framebuffer_attachments.as_ptr(),
|
||||
|
@ -487,7 +487,7 @@ fn main() {
|
|||
let slice = device.map_memory::<Vertex>(vertex_input_buffer_memory,
|
||||
0,
|
||||
vertex_input_buffer_info.size,
|
||||
0)
|
||||
vk::MemoryMapFlags::empty())
|
||||
.unwrap();
|
||||
let vertices = [Vertex {
|
||||
x: -1.0,
|
||||
|
@ -518,7 +518,7 @@ fn main() {
|
|||
let vertex_shader_info = vk::ShaderModuleCreateInfo {
|
||||
s_type: vk::StructureType::ShaderModuleCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
code_size: vertex_bytes.len(),
|
||||
p_code: vertex_bytes.as_ptr() as *const u32,
|
||||
};
|
||||
|
@ -526,7 +526,7 @@ fn main() {
|
|||
let frag_shader_info = vk::ShaderModuleCreateInfo {
|
||||
s_type: vk::StructureType::ShaderModuleCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
code_size: frag_bytes.len(),
|
||||
p_code: frag_bytes.as_ptr() as *const u32,
|
||||
};
|
||||
|
@ -539,7 +539,7 @@ fn main() {
|
|||
let layout_create_info = vk::PipelineLayoutCreateInfo {
|
||||
s_type: vk::StructureType::PipelineLayoutCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
set_layout_count: 0,
|
||||
p_set_layouts: ptr::null(),
|
||||
push_constant_range_count: 0,
|
||||
|
@ -552,7 +552,7 @@ fn main() {
|
|||
let shader_stage_create_infos = [vk::PipelineShaderStageCreateInfo {
|
||||
s_type: vk::StructureType::PipelineShaderStageCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
module: vertex_shader_module,
|
||||
p_name: shader_entry_name.as_ptr(),
|
||||
p_specialization_info: ptr::null(),
|
||||
|
@ -561,7 +561,7 @@ fn main() {
|
|||
vk::PipelineShaderStageCreateInfo {
|
||||
s_type: vk::StructureType::PipelineShaderStageCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
module: fragment_shader_module,
|
||||
p_name: shader_entry_name.as_ptr(),
|
||||
p_specialization_info: ptr::null(),
|
||||
|
@ -581,7 +581,7 @@ fn main() {
|
|||
let vertex_input_state_info = vk::PipelineVertexInputStateCreateInfo {
|
||||
s_type: vk::StructureType::PipelineVertexInputStateCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
vertex_attribute_description_count: vertex_input_attribute_descriptions.len() as u32,
|
||||
p_vertex_attribute_descriptions: vertex_input_attribute_descriptions.as_ptr(),
|
||||
vertex_binding_description_count: vertex_input_binding_descriptions.len() as u32,
|
||||
|
@ -589,7 +589,7 @@ fn main() {
|
|||
};
|
||||
let vertex_input_assembly_state_info = vk::PipelineInputAssemblyStateCreateInfo {
|
||||
s_type: vk::StructureType::PipelineInputAssemblyStateCreateInfo,
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
p_next: ptr::null(),
|
||||
primitive_restart_enable: 0,
|
||||
topology: vk::PrimitiveTopology::TriangleList,
|
||||
|
@ -609,7 +609,7 @@ fn main() {
|
|||
let viewport_state_info = vk::PipelineViewportStateCreateInfo {
|
||||
s_type: vk::StructureType::PipelineViewportStateCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
scissor_count: scissors.len() as u32,
|
||||
p_scissors: scissors.as_ptr(),
|
||||
viewport_count: viewports.len() as u32,
|
||||
|
@ -618,7 +618,7 @@ fn main() {
|
|||
let rasterization_info = vk::PipelineRasterizationStateCreateInfo {
|
||||
s_type: vk::StructureType::PipelineRasterizationStateCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
cull_mode: vk::CULL_MODE_NONE,
|
||||
depth_bias_clamp: 0.0,
|
||||
depth_bias_constant_factor: 0.0,
|
||||
|
@ -632,7 +632,7 @@ fn main() {
|
|||
};
|
||||
let multisample_state_info = vk::PipelineMultisampleStateCreateInfo {
|
||||
s_type: vk::StructureType::PipelineMultisampleStateCreateInfo,
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
p_next: ptr::null(),
|
||||
rasterization_samples: vk::SAMPLE_COUNT_1_BIT,
|
||||
sample_shading_enable: 0,
|
||||
|
@ -653,7 +653,7 @@ fn main() {
|
|||
let depth_state_info = vk::PipelineDepthStencilStateCreateInfo {
|
||||
s_type: vk::StructureType::PipelineDepthStencilStateCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
depth_test_enable: 1,
|
||||
depth_write_enable: 1,
|
||||
depth_compare_op: vk::CompareOp::LessOrEqual,
|
||||
|
@ -679,7 +679,7 @@ fn main() {
|
|||
let color_blend_state = vk::PipelineColorBlendStateCreateInfo {
|
||||
s_type: vk::StructureType::PipelineColorBlendStateCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
logic_op_enable: 0,
|
||||
logic_op: vk::LogicOp::Clear,
|
||||
attachment_count: color_blend_attachment_states.len() as u32,
|
||||
|
@ -690,7 +690,7 @@ fn main() {
|
|||
let dynamic_state_info = vk::PipelineDynamicStateCreateInfo {
|
||||
s_type: vk::StructureType::PipelineDynamicStateCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
dynamic_state_count: dynamic_state.len() as u32,
|
||||
p_dynamic_states: dynamic_state.as_ptr(),
|
||||
};
|
||||
|
@ -725,7 +725,7 @@ fn main() {
|
|||
let semaphore_create_info = vk::SemaphoreCreateInfo {
|
||||
s_type: vk::StructureType::SemaphoreCreateInfo,
|
||||
p_next: ptr::null(),
|
||||
flags: 0,
|
||||
flags: Default::default(),
|
||||
};
|
||||
let present_complete_semaphore = device.create_semaphore(&semaphore_create_info).unwrap();
|
||||
let rendering_complete_semaphore = device.create_semaphore(&semaphore_create_info).unwrap();
|
||||
|
@ -822,7 +822,7 @@ fn main() {
|
|||
&[],
|
||||
&[],
|
||||
&[pre_present_barrier]);
|
||||
device.end_command_buffer(draw_command_buffer);
|
||||
device.end_command_buffer(draw_command_buffer).unwrap();
|
||||
let wait_render_mask = [vk::PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT];
|
||||
let submit_info = vk::SubmitInfo {
|
||||
s_type: vk::StructureType::SubmitInfo,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
pub use std::os::raw::c_ulonglong;
|
||||
pub use self::types::*;
|
||||
pub use self::cmds::*;
|
||||
use std::default::Default;
|
||||
|
||||
#[doc(hidden)]
|
||||
#[allow(dead_code)]
|
||||
|
@ -39,6 +40,11 @@ macro_rules! vk_bitflags_wrapped {
|
|||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct $name {flags: $flag_type}
|
||||
|
||||
impl Default for $name{
|
||||
fn default() -> $name {
|
||||
$name {flags: 0}
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for $name {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> ::std::result::Result<(), fmt::Error> {
|
||||
write!(f, "{}({:b})", stringify!($name), self.flags)
|
||||
|
@ -222,47 +228,86 @@ pub type ANativeWindow = *const ();
|
|||
pub type wl_display = *const ();
|
||||
pub type wl_surface = *const ();
|
||||
|
||||
pub type InstanceCreateFlags = Flags;
|
||||
pub type Flags = uint32_t;
|
||||
pub type Bool32 = uint32_t;
|
||||
pub type DeviceSize = uint64_t;
|
||||
pub type DeviceCreateFlags = Flags;
|
||||
pub type DeviceQueueCreateFlags = Flags;
|
||||
pub type MemoryMapFlags = Flags;
|
||||
pub type SemaphoreCreateFlags = Flags;
|
||||
pub type EventCreateFlags = Flags;
|
||||
pub type QueryPoolCreateFlags = Flags;
|
||||
pub type BufferViewCreateFlags = Flags;
|
||||
pub type ImageViewCreateFlags = Flags;
|
||||
pub type ShaderModuleCreateFlags = Flags;
|
||||
pub type PipelineCacheCreateFlags = Flags;
|
||||
pub type PipelineShaderStageCreateFlags = Flags;
|
||||
pub type PipelineVertexInputStateCreateFlags = Flags;
|
||||
pub type PipelineInputAssemblyStateCreateFlags = Flags;
|
||||
pub type PipelineTessellationStateCreateFlags = Flags;
|
||||
pub type PipelineViewportStateCreateFlags = Flags;
|
||||
pub type PipelineRasterizationStateCreateFlags = Flags;
|
||||
pub type PipelineMultisampleStateCreateFlags = Flags;
|
||||
pub type SampleMask = uint32_t;
|
||||
pub type PipelineDepthStencilStateCreateFlags = Flags;
|
||||
pub type PipelineColorBlendStateCreateFlags = Flags;
|
||||
pub type PipelineDynamicStateCreateFlags = Flags;
|
||||
pub type PipelineLayoutCreateFlags = Flags;
|
||||
pub type SamplerCreateFlags = Flags;
|
||||
pub type DescriptorSetLayoutCreateFlags = Flags;
|
||||
pub type DescriptorPoolResetFlags = Flags;
|
||||
pub type FramebufferCreateFlags = Flags;
|
||||
pub type RenderPassCreateFlags = Flags;
|
||||
pub type SubpassDescriptionFlags = Flags;
|
||||
pub type XlibSurfaceCreateFlagsKHR = Flags;
|
||||
pub type XcbSurfaceCreateFlagsKHR = Flags;
|
||||
pub type MirSurfaceCreateFlagsKHR = Flags;
|
||||
pub type Win32SurfaceCreateFlagsKHR = Flags;
|
||||
pub type AndroidSurfaceCreateFlagsKHR = Flags;
|
||||
pub type WaylandSurfaceCreateFlagsKHR = Flags;
|
||||
pub type SwapchainCreateFlagsKHR = Flags;
|
||||
pub type DisplayModeCreateFlagsKHR = Flags;
|
||||
pub type DisplaySurfaceCreateFlagsKHR = Flags;
|
||||
|
||||
//pub type InstanceCreateFlags = Flags;
|
||||
//pub type DeviceCreateFlags = Flags;
|
||||
//pub type DeviceQueueCreateFlags = Flags;
|
||||
//pub type MemoryMapFlags = Flags;
|
||||
//pub type SemaphoreCreateFlags = Flags;
|
||||
//pub type EventCreateFlags = Flags;
|
||||
//pub type QueryPoolCreateFlags = Flags;
|
||||
//pub type BufferViewCreateFlags = Flags;
|
||||
//pub type ImageViewCreateFlags = Flags;
|
||||
//pub type ShaderModuleCreateFlags = Flags;
|
||||
//pub type PipelineCacheCreateFlags = Flags;
|
||||
//pub type PipelineShaderStageCreateFlags = Flags;
|
||||
//pub type PipelineVertexInputStateCreateFlags = Flags;
|
||||
//pub type PipelineInputAssemblyStateCreateFlags = Flags;
|
||||
//pub type PipelineTessellationStateCreateFlags = Flags;
|
||||
//pub type PipelineViewportStateCreateFlags = Flags;
|
||||
//pub type PipelineRasterizationStateCreateFlags = Flags;
|
||||
//pub type PipelineMultisampleStateCreateFlags = Flags;
|
||||
//pub type PipelineDepthStencilStateCreateFlags = Flags;
|
||||
//pub type PipelineColorBlendStateCreateFlags = Flags;
|
||||
//pub type PipelineDynamicStateCreateFlags = Flags;
|
||||
//pub type PipelineLayoutCreateFlags = Flags;
|
||||
//pub type SamplerCreateFlags = Flags;
|
||||
//pub type DescriptorSetLayoutCreateFlags = Flags;
|
||||
//pub type DescriptorPoolResetFlags = Flags;
|
||||
//pub type FramebufferCreateFlags = Flags;
|
||||
//pub type RenderPassCreateFlags = Flags;
|
||||
//pub type SubpassDescriptionFlags = Flags;
|
||||
//pub type XlibSurfaceCreateFlagsKHR = Flags;
|
||||
//pub type XcbSurfaceCreateFlagsKHR = Flags;
|
||||
//pub type MirSurfaceCreateFlagsKHR = Flags;
|
||||
//pub type Win32SurfaceCreateFlagsKHR = Flags;
|
||||
//pub type AndroidSurfaceCreateFlagsKHR = Flags;
|
||||
//pub type WaylandSurfaceCreateFlagsKHR = Flags;
|
||||
//pub type SwapchainCreateFlagsKHR = Flags;
|
||||
//pub type DisplayModeCreateFlagsKHR = Flags;
|
||||
//pub type DisplaySurfaceCreateFlagsKHR = Flags;
|
||||
//vk_bitflags_wrapped!(FormatFeatureFlags, 0b1111111111111, Flags);
|
||||
vk_bitflags_wrapped!(InstanceCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(DeviceCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(DeviceQueueCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(MemoryMapFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(SemaphoreCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(EventCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(QueryPoolCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(BufferViewCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(ImageViewCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(ShaderModuleCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineCacheCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineShaderStageCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineVertexInputStateCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineInputAssemblyStateCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineTessellationStateCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineViewportStateCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineRasterizationStateCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineMultisampleStateCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineDepthStencilStateCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineColorBlendStateCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineDynamicStateCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(PipelineLayoutCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(SamplerCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(DescriptorSetLayoutCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(DescriptorPoolResetFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(FramebufferCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(RenderPassCreateFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(SubpassDescriptionFlags, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(XlibSurfaceCreateFlagsKHR, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(XcbSurfaceCreateFlagsKHR, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(MirSurfaceCreateFlagsKHR, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(Win32SurfaceCreateFlagsKHR, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(AndroidSurfaceCreateFlagsKHR, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(WaylandSurfaceCreateFlagsKHR, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(SwapchainCreateFlagsKHR, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(DisplayModeCreateFlagsKHR, 0b1, Flags);
|
||||
vk_bitflags_wrapped!(DisplaySurfaceCreateFlagsKHR, 0b1, Flags);
|
||||
|
||||
pub const VK_MAX_PHYSICAL_DEVICE_NAME_SIZE: size_t = 256;
|
||||
pub const VK_UUID_SIZE: size_t = 16;
|
||||
|
|
Loading…
Add table
Reference in a new issue