1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// Generated by `scripts/generate_vk.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 vk::vk_instance_function_table::*;
use vk::vk_instance::*;
use vk::vk_device::*;
use vk::vk_structure_type::*;
use vk::vk_semaphore::*;
use vk::vk_sparse_buffer_memory_bind_info::*;
use vk::vk_sparse_image_opaque_memory_bind_info::*;
use vk::vk_sparse_image_memory_bind_info::*;

#[repr(C)]
pub struct RawVkBindSparseInfo {
    s_type: RawVkStructureType,
    next: *const c_void,
    wait_semaphore_count: u32,
    wait_semaphores: *mut RawVkSemaphore,
    buffer_bind_count: u32,
    buffer_binds: *mut RawVkSparseBufferMemoryBindInfo,
    image_opaque_bind_count: u32,
    image_opaque_binds: *mut RawVkSparseImageOpaqueMemoryBindInfo,
    image_bind_count: u32,
    image_binds: *mut RawVkSparseImageMemoryBindInfo,
    signal_semaphore_count: u32,
    signal_semaphores: *mut RawVkSemaphore,
}

#[derive(Debug, Clone)]
pub struct VkBindSparseInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n>
    where
        'c: 'b,
        'd: 'b,
        'e: 'd,
        'g: 'f,
        'h: 'f,
        'i: 'h,
        'k: 'j,
        'l: 'j,
        'm: 'l,
{
    pub wait_semaphores: &'a [VkSemaphore],
    pub buffer_binds: &'b [VkSparseBufferMemoryBindInfo<'c, 'd, 'e>],
    pub image_opaque_binds: &'f [VkSparseImageOpaqueMemoryBindInfo<'g, 'h, 'i>],
    pub image_binds: &'j [VkSparseImageMemoryBindInfo<'k, 'l, 'm>],
    pub signal_semaphores: &'n [VkSemaphore],
}

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n> VkWrappedType<RawVkBindSparseInfo> for VkBindSparseInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n>
    where
        'c: 'b,
        'd: 'b,
        'e: 'd,
        'g: 'f,
        'h: 'f,
        'i: 'h,
        'k: 'j,
        'l: 'j,
        'm: 'l,
{
    fn vk_to_raw(src: &VkBindSparseInfo, dst: &mut RawVkBindSparseInfo) {
        dst.s_type = vk_to_raw_value(&VkStructureType::BindSparseInfo);
        dst.next = ptr::null();
        dst.wait_semaphore_count = src.wait_semaphores.len() as u32;
        dst.wait_semaphores = new_ptr_vk_array(src.wait_semaphores);
        dst.buffer_bind_count = src.buffer_binds.len() as u32;
        dst.buffer_binds = new_ptr_vk_array(src.buffer_binds);
        dst.image_opaque_bind_count = src.image_opaque_binds.len() as u32;
        dst.image_opaque_binds = new_ptr_vk_array(src.image_opaque_binds);
        dst.image_bind_count = src.image_binds.len() as u32;
        dst.image_binds = new_ptr_vk_array(src.image_binds);
        dst.signal_semaphore_count = src.signal_semaphores.len() as u32;
        dst.signal_semaphores = new_ptr_vk_array(src.signal_semaphores);
    }
}

impl Default for VkBindSparseInfo<'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static> {
    fn default() -> VkBindSparseInfo<'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static> {
        VkBindSparseInfo {
            wait_semaphores: &[],
            buffer_binds: &[],
            image_opaque_binds: &[],
            image_binds: &[],
            signal_semaphores: &[],
        }
    }
}

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n> VkSetup for VkBindSparseInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n>
    where
        'c: 'b,
        'd: 'b,
        'e: 'd,
        'g: 'f,
        'h: 'f,
        'i: 'h,
        'k: 'j,
        'l: 'j,
        'm: 'l,
{
    fn vk_setup(&mut self, fn_table: *mut VkInstanceFunctionTable, instance: RawVkInstance, device: RawVkDevice) {
        
    }
}

impl VkFree for RawVkBindSparseInfo {
    fn vk_free(&mut self) {
        free_ptr(self.wait_semaphores);
        free_vk_ptr_array(self.buffer_bind_count as usize, self.buffer_binds);
        free_vk_ptr_array(self.image_opaque_bind_count as usize, self.image_opaque_binds);
        free_vk_ptr_array(self.image_bind_count as usize, self.image_binds);
        free_ptr(self.signal_semaphores);
    }
}