lava 0.4.9

Rust wrapper to manipulate Vulkan more conveniently than with bindings.
Documentation
// Generated by `scripts/generate.js`

use std::os::raw::c_char;
use std::ops::Deref;
use std::ptr;
use std::cmp;
use std::mem;
use utils::c_bindings::*;
use utils::vk_convert::*;
use utils::vk_null::*;
use utils::vk_ptr::*;
use utils::vk_traits::*;
use vulkan::vk::*;
use vulkan::vk::{VkStructureType,RawVkStructureType};
use vulkan::vk::{VkDescriptorPoolCreateFlags,RawVkDescriptorPoolCreateFlags};
use vulkan::vk::{VkDescriptorPoolSize,RawVkDescriptorPoolSize};

/// Wrapper for [VkDescriptorPoolCreateInfo](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorPoolCreateInfo.html).
#[derive(Debug, Clone)]
pub struct VkDescriptorPoolCreateInfo {
    pub flags: VkDescriptorPoolCreateFlags,
    pub max_sets: usize,
    pub pool_sizes: Vec<VkDescriptorPoolSize>,
}

#[doc(hidden)]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct RawVkDescriptorPoolCreateInfo {
    pub s_type: RawVkStructureType,
    pub next: *mut c_void,
    pub flags: RawVkDescriptorPoolCreateFlags,
    pub max_sets: u32,
    pub pool_size_count: u32,
    pub pool_sizes: *mut RawVkDescriptorPoolSize,
}

impl VkWrappedType<RawVkDescriptorPoolCreateInfo> for VkDescriptorPoolCreateInfo {
    fn vk_to_raw(src: &VkDescriptorPoolCreateInfo, dst: &mut RawVkDescriptorPoolCreateInfo) {
        dst.s_type = vk_to_raw_value(&VkStructureType::DescriptorPoolCreateInfo);
        dst.next = ptr::null_mut();
        dst.flags = vk_to_raw_value(&src.flags);
        dst.max_sets = vk_to_raw_value(&src.max_sets);
        dst.pool_size_count = src.pool_sizes.len() as u32;
        dst.pool_sizes = new_ptr_vk_array(&src.pool_sizes);
    }
}

impl VkRawType<VkDescriptorPoolCreateInfo> for RawVkDescriptorPoolCreateInfo {
    fn vk_to_wrapped(src: &RawVkDescriptorPoolCreateInfo) -> VkDescriptorPoolCreateInfo {
        VkDescriptorPoolCreateInfo {
            flags: RawVkDescriptorPoolCreateFlags::vk_to_wrapped(&src.flags),
            max_sets: u32::vk_to_wrapped(&src.max_sets),
            pool_sizes: new_vk_array(src.pool_size_count, src.pool_sizes),
        }
    }
}

impl Default for VkDescriptorPoolCreateInfo {
    fn default() -> VkDescriptorPoolCreateInfo {
        VkDescriptorPoolCreateInfo {
            flags: Default::default(),
            max_sets: 0,
            pool_sizes: Vec::new(),
        }
    }
}

impl VkSetup for VkDescriptorPoolCreateInfo {
    fn vk_setup(&mut self, fn_table: *mut VkFunctionTable) {
        
    }
}

impl VkFree for RawVkDescriptorPoolCreateInfo {
    fn vk_free(&self) {
        free_vk_ptr_array(self.pool_size_count as usize, self.pool_sizes);
    }
}