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::{VkDescriptorType,RawVkDescriptorType};
use vulkan::vk::{VkShaderStageFlags,RawVkShaderStageFlags};
use vulkan::vk::{VkSampler,RawVkSampler};

/// Wrapper for [VkDescriptorSetLayoutBinding](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorSetLayoutBinding.html).
#[derive(Debug, Clone)]
pub struct VkDescriptorSetLayoutBinding {
    pub binding: usize,
    pub descriptor_type: VkDescriptorType,
    pub descriptor_count: usize,
    pub stage_flags: VkShaderStageFlags,
    pub immutable_samplers: Option<Vec<VkSampler>>,
}

#[doc(hidden)]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct RawVkDescriptorSetLayoutBinding {
    pub binding: u32,
    pub descriptor_type: RawVkDescriptorType,
    pub descriptor_count: u32,
    pub stage_flags: RawVkShaderStageFlags,
    pub immutable_samplers: *mut RawVkSampler,
}

impl VkWrappedType<RawVkDescriptorSetLayoutBinding> for VkDescriptorSetLayoutBinding {
    fn vk_to_raw(src: &VkDescriptorSetLayoutBinding, dst: &mut RawVkDescriptorSetLayoutBinding) {
        dst.binding = vk_to_raw_value(&src.binding);
        dst.descriptor_type = vk_to_raw_value(&src.descriptor_type);
        dst.descriptor_count = vk_to_raw_value(&src.descriptor_count);
        dst.stage_flags = vk_to_raw_value(&src.stage_flags);
        dst.immutable_samplers = new_ptr_vk_array_checked(&src.immutable_samplers);
    }
}

impl VkRawType<VkDescriptorSetLayoutBinding> for RawVkDescriptorSetLayoutBinding {
    fn vk_to_wrapped(src: &RawVkDescriptorSetLayoutBinding) -> VkDescriptorSetLayoutBinding {
        VkDescriptorSetLayoutBinding {
            binding: u32::vk_to_wrapped(&src.binding),
            descriptor_type: RawVkDescriptorType::vk_to_wrapped(&src.descriptor_type),
            descriptor_count: u32::vk_to_wrapped(&src.descriptor_count),
            stage_flags: RawVkShaderStageFlags::vk_to_wrapped(&src.stage_flags),
            immutable_samplers: new_vk_array_checked(src.descriptor_count, src.immutable_samplers),
        }
    }
}

impl Default for VkDescriptorSetLayoutBinding {
    fn default() -> VkDescriptorSetLayoutBinding {
        VkDescriptorSetLayoutBinding {
            binding: 0,
            descriptor_type: Default::default(),
            descriptor_count: 0,
            stage_flags: Default::default(),
            immutable_samplers: None,
        }
    }
}

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

impl VkFree for RawVkDescriptorSetLayoutBinding {
    fn vk_free(&self) {
        free_ptr(self.immutable_samplers);
    }
}