From fc4636f5c6d297bd003a22dae31d89f6e95eb7e9 Mon Sep 17 00:00:00 2001 From: Wouter van der Linde Date: Tue, 5 Jan 2021 15:59:56 +0100 Subject: [PATCH] Re-gen bindings using https://github.com/xlab/c-for-go/commit/ddcfe2673053652b6566fa8fabe6d0966a6b4ed9 --- cgo_helpers.c | 4 +- cgo_helpers.go | 2955 ++++++++++++++++++++++++++++++++---------------- cgo_helpers.h | 4 +- const.go | 2 +- doc.go | 2 +- types.go | 66 +- vulkan.go | 1847 ++++++++++++++++++++---------- 7 files changed, 3243 insertions(+), 1637 deletions(-) diff --git a/cgo_helpers.c b/cgo_helpers.c index ee3da7a..af58f9f 100644 --- a/cgo_helpers.c +++ b/cgo_helpers.c @@ -1,12 +1,12 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Mon, 15 Oct 2018 01:04:16 +07. +// WARNING: This file has automatically been generated on Tue, 05 Jan 2021 15:58:04 CET. // Code generated by https://git.io/c-for-go. DO NOT EDIT. #include "_cgo_export.h" #include "cgo_helpers.h" -unsigned int PFN_vkDebugReportCallbackEXT_c918aac4(unsigned int flags, VkDebugReportObjectTypeEXT objectType, unsigned long long object, unsigned long int location, int messageCode, char* pLayerPrefix, char* pMessage, void* pUserData) { +unsigned int PFN_vkDebugReportCallbackEXT_c918aac4(unsigned int flags, VkDebugReportObjectTypeEXT objectType, unsigned long int object, unsigned long int location, int messageCode, char* pLayerPrefix, char* pMessage, void* pUserData) { return debugReportCallbackFuncC918AAC4(flags, objectType, object, location, messageCode, pLayerPrefix, pMessage, pUserData); } diff --git a/cgo_helpers.go b/cgo_helpers.go index 1adfb62..d558719 100644 --- a/cgo_helpers.go +++ b/cgo_helpers.go @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Mon, 15 Oct 2018 01:04:16 +07. +// WARNING: This file has automatically been generated on Tue, 05 Jan 2021 15:58:04 CET. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package vulkan @@ -15,6 +15,7 @@ package vulkan */ import "C" import ( + "fmt" "runtime" "sync" "unsafe" @@ -74,18 +75,24 @@ func (a *cgoAllocMap) Free() { // The caller is responsible for freeing the this memory via C.free. func allocApplicationInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfApplicationInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfApplicationInfoValue = unsafe.Sizeof([1]C.VkApplicationInfo{}) -// unpackPCharString represents the data from Go string as *C.char and avoids copying. +// unpackPCharString copies the data from Go string as *C.char. func unpackPCharString(str string) (*C.char, *cgoAllocMap) { - h := (*stringHeader)(unsafe.Pointer(&str)) - return (*C.char)(h.Data), cgoAllocsUnknown + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CString(str)) + allocs.Add(mem0) + return (*C.char)(mem0), allocs } type stringHeader struct { @@ -221,8 +228,8 @@ func (x *ApplicationInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocInstanceCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfInstanceCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -239,8 +246,8 @@ type sliceHeader struct { // The caller is responsible for freeing the this memory via C.free. func allocPCharMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPCharValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -255,8 +262,8 @@ func unpackSString(x []string) (unpacked **C.char, allocs *cgoAllocMap) { return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(***C.char) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -419,8 +426,8 @@ func NewAllocationCallbacks() *AllocationCallbacks { // The caller is responsible for freeing the this memory via C.free. func allocAllocationCallbacksMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfAllocationCallbacksValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -439,8 +446,8 @@ func (x *AllocationCallbacks) PassRef() *C.VkAllocationCallbacks { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -790,8 +797,8 @@ func (x *PhysicalDeviceFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocFormatPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFormatPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -881,8 +888,8 @@ func (x *FormatProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExtent3DMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExtent3DValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -972,8 +979,8 @@ func (x *Extent3D) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageFormatPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageFormatPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -1073,8 +1080,8 @@ func (x *ImageFormatProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceLimitsMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceLimitsValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -1633,7 +1640,7 @@ func (x *PhysicalDeviceLimits) Deref() { x.MaxViewportDimensions = *(*[2]uint32)(unsafe.Pointer(&x.ref7926795a.maxViewportDimensions)) x.ViewportBoundsRange = *(*[2]float32)(unsafe.Pointer(&x.ref7926795a.viewportBoundsRange)) x.ViewportSubPixelBits = (uint32)(x.ref7926795a.viewportSubPixelBits) - x.MinMemoryMapAlignment = (uint)(x.ref7926795a.minMemoryMapAlignment) + x.MinMemoryMapAlignment = (uint32)(x.ref7926795a.minMemoryMapAlignment) x.MinTexelBufferOffsetAlignment = (DeviceSize)(x.ref7926795a.minTexelBufferOffsetAlignment) x.MinUniformBufferOffsetAlignment = (DeviceSize)(x.ref7926795a.minUniformBufferOffsetAlignment) x.MinStorageBufferOffsetAlignment = (DeviceSize)(x.ref7926795a.minStorageBufferOffsetAlignment) @@ -1679,8 +1686,8 @@ func (x *PhysicalDeviceLimits) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceSparsePropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceSparsePropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -1780,8 +1787,8 @@ func (x *PhysicalDeviceSparseProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDevicePropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDevicePropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -1901,8 +1908,8 @@ func (x *PhysicalDeviceProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocQueueFamilyPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfQueueFamilyPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -1997,8 +2004,8 @@ func (x *QueueFamilyProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryTypeMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryTypeValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -2083,8 +2090,8 @@ func (x *MemoryType) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryHeapMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryHeapValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -2169,8 +2176,8 @@ func (x *MemoryHeap) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceMemoryPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceMemoryPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -2181,8 +2188,8 @@ const sizeOfPhysicalDeviceMemoryPropertiesValue = unsafe.Sizeof([1]C.VkPhysicalD // The caller is responsible for freeing the this memory via C.free. func allocA32MemoryTypeMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfA32MemoryTypeValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -2192,8 +2199,8 @@ const sizeOfA32MemoryTypeValue = unsafe.Sizeof([1][32]C.VkMemoryType{}) // unpackA32MemoryType transforms a sliced Go data structure into plain C format. func unpackA32MemoryType(x [32]MemoryType) (unpacked [32]C.VkMemoryType, allocs *cgoAllocMap) { allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(*[32]C.VkMemoryType) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) mem0 := allocA32MemoryTypeMemory(1) @@ -2212,8 +2219,8 @@ func unpackA32MemoryType(x [32]MemoryType) (unpacked [32]C.VkMemoryType, allocs // The caller is responsible for freeing the this memory via C.free. func allocA16MemoryHeapMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfA16MemoryHeapValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -2223,8 +2230,8 @@ const sizeOfA16MemoryHeapValue = unsafe.Sizeof([1][16]C.VkMemoryHeap{}) // unpackA16MemoryHeap transforms a sliced Go data structure into plain C format. func unpackA16MemoryHeap(x [16]MemoryHeap) (unpacked [16]C.VkMemoryHeap, allocs *cgoAllocMap) { allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(*[16]C.VkMemoryHeap) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) mem0 := allocA16MemoryHeapMemory(1) @@ -2343,14 +2350,43 @@ func (x *PhysicalDeviceMemoryProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceQueueCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceQueueCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfDeviceQueueCreateInfoValue = unsafe.Sizeof([1]C.VkDeviceQueueCreateInfo{}) +// copyPFloatBytes copies the data from Go slice as *C.float. +func copyPFloatBytes(slice *sliceHeader) (*C.float, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfFloatValue) * slice.Len, + Cap: int(sizeOfFloatValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.float)(mem0), allocs +} + +// allocFloatMemory allocates memory for type C.float in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFloatMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFloatValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFloatValue = unsafe.Sizeof([1]C.float{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *DeviceQueueCreateInfo) Ref() *C.VkDeviceQueueCreateInfo { if x == nil { @@ -2413,7 +2449,7 @@ func (x *DeviceQueueCreateInfo) PassRef() (*C.VkDeviceQueueCreateInfo, *cgoAlloc allocs6087b30d.Borrow(cqueueCount_allocs) var cpQueuePriorities_allocs *cgoAllocMap - ref6087b30d.pQueuePriorities, cpQueuePriorities_allocs = (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PQueuePriorities)).Data)), cgoAllocsUnknown + ref6087b30d.pQueuePriorities, cpQueuePriorities_allocs = copyPFloatBytes((*sliceHeader)(unsafe.Pointer(&x.PQueuePriorities))) allocs6087b30d.Borrow(cpQueuePriorities_allocs) x.ref6087b30d = ref6087b30d @@ -2453,8 +2489,8 @@ func (x *DeviceQueueCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -2467,8 +2503,8 @@ func unpackSDeviceQueueCreateInfo(x []DeviceQueueCreateInfo) (unpacked *C.VkDevi return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkDeviceQueueCreateInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -2496,8 +2532,8 @@ func unpackSPhysicalDeviceFeatures(x []PhysicalDeviceFeatures) (unpacked *C.VkPh return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkPhysicalDeviceFeatures) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -2655,8 +2691,8 @@ func (x *DeviceCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExtensionPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExtensionPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -2741,8 +2777,8 @@ func (x *ExtensionProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocLayerPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfLayerPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -2837,14 +2873,101 @@ func (x *LayerProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSubmitInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSubmitInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfSubmitInfoValue = unsafe.Sizeof([1]C.VkSubmitInfo{}) +// copyPSemaphoreBytes copies the data from Go slice as *C.VkSemaphore. +func copyPSemaphoreBytes(slice *sliceHeader) (*C.VkSemaphore, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfSemaphoreValue) * slice.Len, + Cap: int(sizeOfSemaphoreValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkSemaphore)(mem0), allocs +} + +// allocSemaphoreMemory allocates memory for type C.VkSemaphore in C. +// The caller is responsible for freeing the this memory via C.free. +func allocSemaphoreMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSemaphoreValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfSemaphoreValue = unsafe.Sizeof([1]C.VkSemaphore{}) + +// copyPPipelineStageFlagsBytes copies the data from Go slice as *C.VkPipelineStageFlags. +func copyPPipelineStageFlagsBytes(slice *sliceHeader) (*C.VkPipelineStageFlags, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfPipelineStageFlagsValue) * slice.Len, + Cap: int(sizeOfPipelineStageFlagsValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkPipelineStageFlags)(mem0), allocs +} + +// allocPipelineStageFlagsMemory allocates memory for type C.VkPipelineStageFlags in C. +// The caller is responsible for freeing the this memory via C.free. +func allocPipelineStageFlagsMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineStageFlagsValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfPipelineStageFlagsValue = unsafe.Sizeof([1]C.VkPipelineStageFlags{}) + +// copyPCommandBufferBytes copies the data from Go slice as *C.VkCommandBuffer. +func copyPCommandBufferBytes(slice *sliceHeader) (*C.VkCommandBuffer, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfCommandBufferValue) * slice.Len, + Cap: int(sizeOfCommandBufferValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkCommandBuffer)(mem0), allocs +} + +// allocCommandBufferMemory allocates memory for type C.VkCommandBuffer in C. +// The caller is responsible for freeing the this memory via C.free. +func allocCommandBufferMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCommandBufferValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfCommandBufferValue = unsafe.Sizeof([1]C.VkCommandBuffer{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *SubmitInfo) Ref() *C.VkSubmitInfo { if x == nil { @@ -2899,11 +3022,11 @@ func (x *SubmitInfo) PassRef() (*C.VkSubmitInfo, *cgoAllocMap) { allocs22884025.Borrow(cwaitSemaphoreCount_allocs) var cpWaitSemaphores_allocs *cgoAllocMap - ref22884025.pWaitSemaphores, cpWaitSemaphores_allocs = (*C.VkSemaphore)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PWaitSemaphores)).Data)), cgoAllocsUnknown + ref22884025.pWaitSemaphores, cpWaitSemaphores_allocs = copyPSemaphoreBytes((*sliceHeader)(unsafe.Pointer(&x.PWaitSemaphores))) allocs22884025.Borrow(cpWaitSemaphores_allocs) var cpWaitDstStageMask_allocs *cgoAllocMap - ref22884025.pWaitDstStageMask, cpWaitDstStageMask_allocs = (*C.VkPipelineStageFlags)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PWaitDstStageMask)).Data)), cgoAllocsUnknown + ref22884025.pWaitDstStageMask, cpWaitDstStageMask_allocs = copyPPipelineStageFlagsBytes((*sliceHeader)(unsafe.Pointer(&x.PWaitDstStageMask))) allocs22884025.Borrow(cpWaitDstStageMask_allocs) var ccommandBufferCount_allocs *cgoAllocMap @@ -2911,7 +3034,7 @@ func (x *SubmitInfo) PassRef() (*C.VkSubmitInfo, *cgoAllocMap) { allocs22884025.Borrow(ccommandBufferCount_allocs) var cpCommandBuffers_allocs *cgoAllocMap - ref22884025.pCommandBuffers, cpCommandBuffers_allocs = (*C.VkCommandBuffer)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PCommandBuffers)).Data)), cgoAllocsUnknown + ref22884025.pCommandBuffers, cpCommandBuffers_allocs = copyPCommandBufferBytes((*sliceHeader)(unsafe.Pointer(&x.PCommandBuffers))) allocs22884025.Borrow(cpCommandBuffers_allocs) var csignalSemaphoreCount_allocs *cgoAllocMap @@ -2919,7 +3042,7 @@ func (x *SubmitInfo) PassRef() (*C.VkSubmitInfo, *cgoAllocMap) { allocs22884025.Borrow(csignalSemaphoreCount_allocs) var cpSignalSemaphores_allocs *cgoAllocMap - ref22884025.pSignalSemaphores, cpSignalSemaphores_allocs = (*C.VkSemaphore)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PSignalSemaphores)).Data)), cgoAllocsUnknown + ref22884025.pSignalSemaphores, cpSignalSemaphores_allocs = copyPSemaphoreBytes((*sliceHeader)(unsafe.Pointer(&x.PSignalSemaphores))) allocs22884025.Borrow(cpSignalSemaphores_allocs) x.ref22884025 = ref22884025 @@ -2974,8 +3097,8 @@ func (x *SubmitInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryAllocateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryAllocateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -3070,8 +3193,8 @@ func (x *MemoryAllocateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMappedMemoryRangeMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMappedMemoryRangeValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -3171,8 +3294,8 @@ func (x *MappedMemoryRange) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryRequirementsMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryRequirementsValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -3262,8 +3385,8 @@ func (x *MemoryRequirements) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSparseImageFormatPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSparseImageFormatPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -3353,8 +3476,8 @@ func (x *SparseImageFormatProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSparseImageMemoryRequirementsMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSparseImageMemoryRequirementsValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -3454,8 +3577,8 @@ func (x *SparseImageMemoryRequirements) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSparseMemoryBindMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSparseMemoryBindValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -3555,8 +3678,8 @@ func (x *SparseMemoryBind) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSparseBufferMemoryBindInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSparseBufferMemoryBindInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -3569,8 +3692,8 @@ func unpackSSparseMemoryBind(x []SparseMemoryBind) (unpacked *C.VkSparseMemoryBi return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSparseMemoryBind) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -3684,8 +3807,8 @@ func (x *SparseBufferMemoryBindInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSparseImageOpaqueMemoryBindInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSparseImageOpaqueMemoryBindInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -3775,8 +3898,8 @@ func (x *SparseImageOpaqueMemoryBindInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageSubresourceMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageSubresourceValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -3866,8 +3989,8 @@ func (x *ImageSubresource) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocOffset3DMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfOffset3DValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -3957,8 +4080,8 @@ func (x *Offset3D) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSparseImageMemoryBindMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSparseImageMemoryBindValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -4063,8 +4186,8 @@ func (x *SparseImageMemoryBind) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSparseImageMemoryBindInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSparseImageMemoryBindInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -4077,8 +4200,8 @@ func unpackSSparseImageMemoryBind(x []SparseImageMemoryBind) (unpacked *C.VkSpar return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSparseImageMemoryBind) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -4192,8 +4315,8 @@ func (x *SparseImageMemoryBindInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBindSparseInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBindSparseInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -4206,8 +4329,8 @@ func unpackSSparseBufferMemoryBindInfo(x []SparseBufferMemoryBindInfo) (unpacked return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSparseBufferMemoryBindInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -4235,8 +4358,8 @@ func unpackSSparseImageOpaqueMemoryBindInfo(x []SparseImageOpaqueMemoryBindInfo) return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSparseImageOpaqueMemoryBindInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -4264,8 +4387,8 @@ func unpackSSparseImageMemoryBindInfo(x []SparseImageMemoryBindInfo) (unpacked * return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSparseImageMemoryBindInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -4368,7 +4491,7 @@ func (x *BindSparseInfo) PassRef() (*C.VkBindSparseInfo, *cgoAllocMap) { allocsb0cbe910.Borrow(cwaitSemaphoreCount_allocs) var cpWaitSemaphores_allocs *cgoAllocMap - refb0cbe910.pWaitSemaphores, cpWaitSemaphores_allocs = (*C.VkSemaphore)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PWaitSemaphores)).Data)), cgoAllocsUnknown + refb0cbe910.pWaitSemaphores, cpWaitSemaphores_allocs = copyPSemaphoreBytes((*sliceHeader)(unsafe.Pointer(&x.PWaitSemaphores))) allocsb0cbe910.Borrow(cpWaitSemaphores_allocs) var cbufferBindCount_allocs *cgoAllocMap @@ -4400,7 +4523,7 @@ func (x *BindSparseInfo) PassRef() (*C.VkBindSparseInfo, *cgoAllocMap) { allocsb0cbe910.Borrow(csignalSemaphoreCount_allocs) var cpSignalSemaphores_allocs *cgoAllocMap - refb0cbe910.pSignalSemaphores, cpSignalSemaphores_allocs = (*C.VkSemaphore)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PSignalSemaphores)).Data)), cgoAllocsUnknown + refb0cbe910.pSignalSemaphores, cpSignalSemaphores_allocs = copyPSemaphoreBytes((*sliceHeader)(unsafe.Pointer(&x.PSignalSemaphores))) allocsb0cbe910.Borrow(cpSignalSemaphores_allocs) x.refb0cbe910 = refb0cbe910 @@ -4450,8 +4573,8 @@ func (x *BindSparseInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocFenceCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFenceCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -4541,8 +4664,8 @@ func (x *FenceCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSemaphoreCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSemaphoreCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -4632,8 +4755,8 @@ func (x *SemaphoreCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocEventCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfEventCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -4723,8 +4846,8 @@ func (x *EventCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocQueryPoolCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfQueryPoolCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -4829,14 +4952,43 @@ func (x *QueryPoolCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBufferCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBufferCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfBufferCreateInfoValue = unsafe.Sizeof([1]C.VkBufferCreateInfo{}) +// copyPUint32_tBytes copies the data from Go slice as *C.uint32_t. +func copyPUint32_tBytes(slice *sliceHeader) (*C.uint32_t, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfUint32_tValue) * slice.Len, + Cap: int(sizeOfUint32_tValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.uint32_t)(mem0), allocs +} + +// allocUint32_tMemory allocates memory for type C.uint32_t in C. +// The caller is responsible for freeing the this memory via C.free. +func allocUint32_tMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfUint32_tValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfUint32_tValue = unsafe.Sizeof([1]C.uint32_t{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *BufferCreateInfo) Ref() *C.VkBufferCreateInfo { if x == nil { @@ -4907,7 +5059,7 @@ func (x *BufferCreateInfo) PassRef() (*C.VkBufferCreateInfo, *cgoAllocMap) { allocsfe19d2cd.Borrow(cqueueFamilyIndexCount_allocs) var cpQueueFamilyIndices_allocs *cgoAllocMap - reffe19d2cd.pQueueFamilyIndices, cpQueueFamilyIndices_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PQueueFamilyIndices)).Data)), cgoAllocsUnknown + reffe19d2cd.pQueueFamilyIndices, cpQueueFamilyIndices_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PQueueFamilyIndices))) allocsfe19d2cd.Borrow(cpQueueFamilyIndices_allocs) x.reffe19d2cd = reffe19d2cd @@ -4949,8 +5101,8 @@ func (x *BufferCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBufferViewCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBufferViewCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -5060,8 +5212,8 @@ func (x *BufferViewCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -5162,7 +5314,7 @@ func (x *ImageCreateInfo) PassRef() (*C.VkImageCreateInfo, *cgoAllocMap) { allocsfb587ba1.Borrow(cqueueFamilyIndexCount_allocs) var cpQueueFamilyIndices_allocs *cgoAllocMap - reffb587ba1.pQueueFamilyIndices, cpQueueFamilyIndices_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PQueueFamilyIndices)).Data)), cgoAllocsUnknown + reffb587ba1.pQueueFamilyIndices, cpQueueFamilyIndices_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PQueueFamilyIndices))) allocsfb587ba1.Borrow(cpQueueFamilyIndices_allocs) var cinitialLayout_allocs *cgoAllocMap @@ -5215,8 +5367,8 @@ func (x *ImageCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSubresourceLayoutMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSubresourceLayoutValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -5316,8 +5468,8 @@ func (x *SubresourceLayout) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocComponentMappingMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfComponentMappingValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -5412,8 +5564,8 @@ func (x *ComponentMapping) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageSubresourceRangeMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageSubresourceRangeValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -5513,8 +5665,8 @@ func (x *ImageSubresourceRange) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageViewCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageViewCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -5629,8 +5781,8 @@ func (x *ImageViewCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocShaderModuleCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfShaderModuleCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -5695,7 +5847,7 @@ func (x *ShaderModuleCreateInfo) PassRef() (*C.VkShaderModuleCreateInfo, *cgoAll allocsc663d23e.Borrow(ccodeSize_allocs) var cpCode_allocs *cgoAllocMap - refc663d23e.pCode, cpCode_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PCode)).Data)), cgoAllocsUnknown + refc663d23e.pCode, cpCode_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PCode))) allocsc663d23e.Borrow(cpCode_allocs) x.refc663d23e = refc663d23e @@ -5722,7 +5874,7 @@ func (x *ShaderModuleCreateInfo) Deref() { x.SType = (StructureType)(x.refc663d23e.sType) x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.refc663d23e.pNext)) x.Flags = (ShaderModuleCreateFlags)(x.refc663d23e.flags) - x.CodeSize = (uint)(x.refc663d23e.codeSize) + x.CodeSize = (uint32)(x.refc663d23e.codeSize) hxf65bf54 := (*sliceHeader)(unsafe.Pointer(&x.PCode)) hxf65bf54.Data = unsafe.Pointer(x.refc663d23e.pCode) hxf65bf54.Cap = 0x7fffffff @@ -5734,8 +5886,8 @@ func (x *ShaderModuleCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineCacheCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineCacheCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -5827,7 +5979,7 @@ func (x *PipelineCacheCreateInfo) Deref() { x.SType = (StructureType)(x.reff11e7dd1.sType) x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.reff11e7dd1.pNext)) x.Flags = (PipelineCacheCreateFlags)(x.reff11e7dd1.flags) - x.InitialDataSize = (uint)(x.reff11e7dd1.initialDataSize) + x.InitialDataSize = (uint32)(x.reff11e7dd1.initialDataSize) x.PInitialData = (unsafe.Pointer)(unsafe.Pointer(x.reff11e7dd1.pInitialData)) } @@ -5835,8 +5987,8 @@ func (x *PipelineCacheCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSpecializationMapEntryMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSpecializationMapEntryValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -5919,15 +6071,15 @@ func (x *SpecializationMapEntry) Deref() { } x.ConstantID = (uint32)(x.ref2fd815d1.constantID) x.Offset = (uint32)(x.ref2fd815d1.offset) - x.Size = (uint)(x.ref2fd815d1.size) + x.Size = (uint32)(x.ref2fd815d1.size) } // allocSpecializationInfoMemory allocates memory for type C.VkSpecializationInfo in C. // The caller is responsible for freeing the this memory via C.free. func allocSpecializationInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSpecializationInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -5940,8 +6092,8 @@ func unpackSSpecializationMapEntry(x []SpecializationMapEntry) (unpacked *C.VkSp return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSpecializationMapEntry) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -6052,7 +6204,7 @@ func (x *SpecializationInfo) Deref() { } x.MapEntryCount = (uint32)(x.ref6bc395a3.mapEntryCount) packSSpecializationMapEntry(x.PMapEntries, x.ref6bc395a3.pMapEntries) - x.DataSize = (uint)(x.ref6bc395a3.dataSize) + x.DataSize = (uint32)(x.ref6bc395a3.dataSize) x.PData = (unsafe.Pointer)(unsafe.Pointer(x.ref6bc395a3.pData)) } @@ -6060,8 +6212,8 @@ func (x *SpecializationInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineShaderStageCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineShaderStageCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -6074,8 +6226,8 @@ func unpackSSpecializationInfo(x []SpecializationInfo) (unpacked *C.VkSpecializa return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSpecializationInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -6209,8 +6361,8 @@ func (x *PipelineShaderStageCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocVertexInputBindingDescriptionMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfVertexInputBindingDescriptionValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -6300,8 +6452,8 @@ func (x *VertexInputBindingDescription) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocVertexInputAttributeDescriptionMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfVertexInputAttributeDescriptionValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -6396,8 +6548,8 @@ func (x *VertexInputAttributeDescription) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineVertexInputStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineVertexInputStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -6410,8 +6562,8 @@ func unpackSVertexInputBindingDescription(x []VertexInputBindingDescription) (un return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkVertexInputBindingDescription) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -6439,8 +6591,8 @@ func unpackSVertexInputAttributeDescription(x []VertexInputAttributeDescription) return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkVertexInputAttributeDescription) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -6583,8 +6735,8 @@ func (x *PipelineVertexInputStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineInputAssemblyStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineInputAssemblyStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -6684,8 +6836,8 @@ func (x *PipelineInputAssemblyStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineTessellationStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineTessellationStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -6780,8 +6932,8 @@ func (x *PipelineTessellationStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocViewportMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfViewportValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -6886,8 +7038,8 @@ func (x *Viewport) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocOffset2DMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfOffset2DValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -6972,8 +7124,8 @@ func (x *Offset2D) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExtent2DMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExtent2DValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -7058,8 +7210,8 @@ func (x *Extent2D) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocRect2DMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRect2DValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -7144,8 +7296,8 @@ func (x *Rect2D) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineViewportStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineViewportStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -7158,8 +7310,8 @@ func unpackSViewport(x []Viewport) (unpacked *C.VkViewport, allocs *cgoAllocMap) return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkViewport) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -7187,8 +7339,8 @@ func unpackSRect2D(x []Rect2D) (unpacked *C.VkRect2D, allocs *cgoAllocMap) { return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkRect2D) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -7331,8 +7483,8 @@ func (x *PipelineViewportStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineRasterizationStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineRasterizationStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -7472,14 +7624,43 @@ func (x *PipelineRasterizationStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineMultisampleStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineMultisampleStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfPipelineMultisampleStateCreateInfoValue = unsafe.Sizeof([1]C.VkPipelineMultisampleStateCreateInfo{}) +// copyPSampleMaskBytes copies the data from Go slice as *C.VkSampleMask. +func copyPSampleMaskBytes(slice *sliceHeader) (*C.VkSampleMask, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfSampleMaskValue) * slice.Len, + Cap: int(sizeOfSampleMaskValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkSampleMask)(mem0), allocs +} + +// allocSampleMaskMemory allocates memory for type C.VkSampleMask in C. +// The caller is responsible for freeing the this memory via C.free. +func allocSampleMaskMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSampleMaskValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfSampleMaskValue = unsafe.Sizeof([1]C.VkSampleMask{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *PipelineMultisampleStateCreateInfo) Ref() *C.VkPipelineMultisampleStateCreateInfo { if x == nil { @@ -7546,7 +7727,7 @@ func (x *PipelineMultisampleStateCreateInfo) PassRef() (*C.VkPipelineMultisample allocsb6538bfb.Borrow(cminSampleShading_allocs) var cpSampleMask_allocs *cgoAllocMap - refb6538bfb.pSampleMask, cpSampleMask_allocs = (*C.VkSampleMask)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PSampleMask)).Data)), cgoAllocsUnknown + refb6538bfb.pSampleMask, cpSampleMask_allocs = copyPSampleMaskBytes((*sliceHeader)(unsafe.Pointer(&x.PSampleMask))) allocsb6538bfb.Borrow(cpSampleMask_allocs) var calphaToCoverageEnable_allocs *cgoAllocMap @@ -7597,8 +7778,8 @@ func (x *PipelineMultisampleStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocStencilOpStateMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStencilOpStateValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -7708,8 +7889,8 @@ func (x *StencilOpState) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineDepthStencilStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineDepthStencilStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -7844,8 +8025,8 @@ func (x *PipelineDepthStencilStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineColorBlendAttachmentStateMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineColorBlendAttachmentStateValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -7960,8 +8141,8 @@ func (x *PipelineColorBlendAttachmentState) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineColorBlendStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineColorBlendStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -7974,8 +8155,8 @@ func unpackSPipelineColorBlendAttachmentState(x []PipelineColorBlendAttachmentSt return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkPipelineColorBlendAttachmentState) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -8114,14 +8295,43 @@ func (x *PipelineColorBlendStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineDynamicStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineDynamicStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfPipelineDynamicStateCreateInfoValue = unsafe.Sizeof([1]C.VkPipelineDynamicStateCreateInfo{}) +// copyPDynamicStateBytes copies the data from Go slice as *C.VkDynamicState. +func copyPDynamicStateBytes(slice *sliceHeader) (*C.VkDynamicState, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfDynamicStateValue) * slice.Len, + Cap: int(sizeOfDynamicStateValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkDynamicState)(mem0), allocs +} + +// allocDynamicStateMemory allocates memory for type C.VkDynamicState in C. +// The caller is responsible for freeing the this memory via C.free. +func allocDynamicStateMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDynamicStateValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfDynamicStateValue = unsafe.Sizeof([1]C.VkDynamicState{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *PipelineDynamicStateCreateInfo) Ref() *C.VkPipelineDynamicStateCreateInfo { if x == nil { @@ -8180,7 +8390,7 @@ func (x *PipelineDynamicStateCreateInfo) PassRef() (*C.VkPipelineDynamicStateCre allocs246d7bc8.Borrow(cdynamicStateCount_allocs) var cpDynamicStates_allocs *cgoAllocMap - ref246d7bc8.pDynamicStates, cpDynamicStates_allocs = (*C.VkDynamicState)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PDynamicStates)).Data)), cgoAllocsUnknown + ref246d7bc8.pDynamicStates, cpDynamicStates_allocs = copyPDynamicStateBytes((*sliceHeader)(unsafe.Pointer(&x.PDynamicStates))) allocs246d7bc8.Borrow(cpDynamicStates_allocs) x.ref246d7bc8 = ref246d7bc8 @@ -8219,8 +8429,8 @@ func (x *PipelineDynamicStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocGraphicsPipelineCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfGraphicsPipelineCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -8233,8 +8443,8 @@ func unpackSPipelineShaderStageCreateInfo(x []PipelineShaderStageCreateInfo) (un return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkPipelineShaderStageCreateInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -8428,8 +8638,8 @@ func (x *GraphicsPipelineCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocComputePipelineCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfComputePipelineCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -8539,8 +8749,8 @@ func (x *ComputePipelineCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPushConstantRangeMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPushConstantRangeValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -8630,22 +8840,51 @@ func (x *PushConstantRange) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineLayoutCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineLayoutCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfPipelineLayoutCreateInfoValue = unsafe.Sizeof([1]C.VkPipelineLayoutCreateInfo{}) +// copyPDescriptorSetLayoutBytes copies the data from Go slice as *C.VkDescriptorSetLayout. +func copyPDescriptorSetLayoutBytes(slice *sliceHeader) (*C.VkDescriptorSetLayout, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfDescriptorSetLayoutValue) * slice.Len, + Cap: int(sizeOfDescriptorSetLayoutValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkDescriptorSetLayout)(mem0), allocs +} + +// allocDescriptorSetLayoutMemory allocates memory for type C.VkDescriptorSetLayout in C. +// The caller is responsible for freeing the this memory via C.free. +func allocDescriptorSetLayoutMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorSetLayoutValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfDescriptorSetLayoutValue = unsafe.Sizeof([1]C.VkDescriptorSetLayout{}) + // unpackSPushConstantRange transforms a sliced Go data structure into plain C format. func unpackSPushConstantRange(x []PushConstantRange) (unpacked *C.VkPushConstantRange, allocs *cgoAllocMap) { if x == nil { return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkPushConstantRange) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -8734,7 +8973,7 @@ func (x *PipelineLayoutCreateInfo) PassRef() (*C.VkPipelineLayoutCreateInfo, *cg allocs64cc4eed.Borrow(csetLayoutCount_allocs) var cpSetLayouts_allocs *cgoAllocMap - ref64cc4eed.pSetLayouts, cpSetLayouts_allocs = (*C.VkDescriptorSetLayout)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PSetLayouts)).Data)), cgoAllocsUnknown + ref64cc4eed.pSetLayouts, cpSetLayouts_allocs = copyPDescriptorSetLayoutBytes((*sliceHeader)(unsafe.Pointer(&x.PSetLayouts))) allocs64cc4eed.Borrow(cpSetLayouts_allocs) var cpushConstantRangeCount_allocs *cgoAllocMap @@ -8783,8 +9022,8 @@ func (x *PipelineLayoutCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSamplerCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSamplerCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -8949,14 +9188,43 @@ func (x *SamplerCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorSetLayoutBindingMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorSetLayoutBindingValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfDescriptorSetLayoutBindingValue = unsafe.Sizeof([1]C.VkDescriptorSetLayoutBinding{}) +// copyPSamplerBytes copies the data from Go slice as *C.VkSampler. +func copyPSamplerBytes(slice *sliceHeader) (*C.VkSampler, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfSamplerValue) * slice.Len, + Cap: int(sizeOfSamplerValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkSampler)(mem0), allocs +} + +// allocSamplerMemory allocates memory for type C.VkSampler in C. +// The caller is responsible for freeing the this memory via C.free. +func allocSamplerMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSamplerValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfSamplerValue = unsafe.Sizeof([1]C.VkSampler{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *DescriptorSetLayoutBinding) Ref() *C.VkDescriptorSetLayoutBinding { if x == nil { @@ -9015,7 +9283,7 @@ func (x *DescriptorSetLayoutBinding) PassRef() (*C.VkDescriptorSetLayoutBinding, allocs8b50b4ec.Borrow(cstageFlags_allocs) var cpImmutableSamplers_allocs *cgoAllocMap - ref8b50b4ec.pImmutableSamplers, cpImmutableSamplers_allocs = (*C.VkSampler)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PImmutableSamplers)).Data)), cgoAllocsUnknown + ref8b50b4ec.pImmutableSamplers, cpImmutableSamplers_allocs = copyPSamplerBytes((*sliceHeader)(unsafe.Pointer(&x.PImmutableSamplers))) allocs8b50b4ec.Borrow(cpImmutableSamplers_allocs) x.ref8b50b4ec = ref8b50b4ec @@ -9054,8 +9322,8 @@ func (x *DescriptorSetLayoutBinding) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorSetLayoutCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorSetLayoutCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -9068,8 +9336,8 @@ func unpackSDescriptorSetLayoutBinding(x []DescriptorSetLayoutBinding) (unpacked return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkDescriptorSetLayoutBinding) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -9193,8 +9461,8 @@ func (x *DescriptorSetLayoutCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorPoolSizeMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorPoolSizeValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -9279,8 +9547,8 @@ func (x *DescriptorPoolSize) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorPoolCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorPoolCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -9293,8 +9561,8 @@ func unpackSDescriptorPoolSize(x []DescriptorPoolSize) (unpacked *C.VkDescriptor return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkDescriptorPoolSize) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -9423,8 +9691,8 @@ func (x *DescriptorPoolCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorSetAllocateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorSetAllocateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -9489,7 +9757,7 @@ func (x *DescriptorSetAllocateInfo) PassRef() (*C.VkDescriptorSetAllocateInfo, * allocs2dd6cc22.Borrow(cdescriptorSetCount_allocs) var cpSetLayouts_allocs *cgoAllocMap - ref2dd6cc22.pSetLayouts, cpSetLayouts_allocs = (*C.VkDescriptorSetLayout)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PSetLayouts)).Data)), cgoAllocsUnknown + ref2dd6cc22.pSetLayouts, cpSetLayouts_allocs = copyPDescriptorSetLayoutBytes((*sliceHeader)(unsafe.Pointer(&x.PSetLayouts))) allocs2dd6cc22.Borrow(cpSetLayouts_allocs) x.ref2dd6cc22 = ref2dd6cc22 @@ -9528,8 +9796,8 @@ func (x *DescriptorSetAllocateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorImageInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorImageInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -9619,8 +9887,8 @@ func (x *DescriptorImageInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorBufferInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorBufferInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -9710,8 +9978,8 @@ func (x *DescriptorBufferInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocWriteDescriptorSetMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfWriteDescriptorSetValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -9724,8 +9992,8 @@ func unpackSDescriptorImageInfo(x []DescriptorImageInfo) (unpacked *C.VkDescript return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkDescriptorImageInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -9753,8 +10021,8 @@ func unpackSDescriptorBufferInfo(x []DescriptorBufferInfo) (unpacked *C.VkDescri return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkDescriptorBufferInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -9776,6 +10044,35 @@ func unpackSDescriptorBufferInfo(x []DescriptorBufferInfo) (unpacked *C.VkDescri return } +// copyPBufferViewBytes copies the data from Go slice as *C.VkBufferView. +func copyPBufferViewBytes(slice *sliceHeader) (*C.VkBufferView, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfBufferViewValue) * slice.Len, + Cap: int(sizeOfBufferViewValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkBufferView)(mem0), allocs +} + +// allocBufferViewMemory allocates memory for type C.VkBufferView in C. +// The caller is responsible for freeing the this memory via C.free. +func allocBufferViewMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBufferViewValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfBufferViewValue = unsafe.Sizeof([1]C.VkBufferView{}) + // packSDescriptorImageInfo reads sliced Go data structure out from plain C format. func packSDescriptorImageInfo(v []DescriptorImageInfo, ptr0 *C.VkDescriptorImageInfo) { const m = 0x7fffffff @@ -9872,7 +10169,7 @@ func (x *WriteDescriptorSet) PassRef() (*C.VkWriteDescriptorSet, *cgoAllocMap) { allocs3cec3f3f.Borrow(cpBufferInfo_allocs) var cpTexelBufferView_allocs *cgoAllocMap - ref3cec3f3f.pTexelBufferView, cpTexelBufferView_allocs = (*C.VkBufferView)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PTexelBufferView)).Data)), cgoAllocsUnknown + ref3cec3f3f.pTexelBufferView, cpTexelBufferView_allocs = copyPBufferViewBytes((*sliceHeader)(unsafe.Pointer(&x.PTexelBufferView))) allocs3cec3f3f.Borrow(cpTexelBufferView_allocs) x.ref3cec3f3f = ref3cec3f3f @@ -9916,8 +10213,8 @@ func (x *WriteDescriptorSet) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCopyDescriptorSetMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCopyDescriptorSetValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -10037,14 +10334,43 @@ func (x *CopyDescriptorSet) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocFramebufferCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFramebufferCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfFramebufferCreateInfoValue = unsafe.Sizeof([1]C.VkFramebufferCreateInfo{}) +// copyPImageViewBytes copies the data from Go slice as *C.VkImageView. +func copyPImageViewBytes(slice *sliceHeader) (*C.VkImageView, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfImageViewValue) * slice.Len, + Cap: int(sizeOfImageViewValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkImageView)(mem0), allocs +} + +// allocImageViewMemory allocates memory for type C.VkImageView in C. +// The caller is responsible for freeing the this memory via C.free. +func allocImageViewMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageViewValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfImageViewValue = unsafe.Sizeof([1]C.VkImageView{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *FramebufferCreateInfo) Ref() *C.VkFramebufferCreateInfo { if x == nil { @@ -10107,7 +10433,7 @@ func (x *FramebufferCreateInfo) PassRef() (*C.VkFramebufferCreateInfo, *cgoAlloc allocsa3ad85cc.Borrow(cattachmentCount_allocs) var cpAttachments_allocs *cgoAllocMap - refa3ad85cc.pAttachments, cpAttachments_allocs = (*C.VkImageView)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PAttachments)).Data)), cgoAllocsUnknown + refa3ad85cc.pAttachments, cpAttachments_allocs = copyPImageViewBytes((*sliceHeader)(unsafe.Pointer(&x.PAttachments))) allocsa3ad85cc.Borrow(cpAttachments_allocs) var cwidth_allocs *cgoAllocMap @@ -10162,8 +10488,8 @@ func (x *FramebufferCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocAttachmentDescriptionMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfAttachmentDescriptionValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -10283,8 +10609,8 @@ func (x *AttachmentDescription) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocAttachmentReferenceMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfAttachmentReferenceValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -10369,8 +10695,8 @@ func (x *AttachmentReference) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSubpassDescriptionMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSubpassDescriptionValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -10383,8 +10709,8 @@ func unpackSAttachmentReference(x []AttachmentReference) (unpacked *C.VkAttachme return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkAttachmentReference) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -10493,7 +10819,7 @@ func (x *SubpassDescription) PassRef() (*C.VkSubpassDescription, *cgoAllocMap) { allocsc7bfeda.Borrow(cpreserveAttachmentCount_allocs) var cpPreserveAttachments_allocs *cgoAllocMap - refc7bfeda.pPreserveAttachments, cpPreserveAttachments_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PPreserveAttachments)).Data)), cgoAllocsUnknown + refc7bfeda.pPreserveAttachments, cpPreserveAttachments_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PPreserveAttachments))) allocsc7bfeda.Borrow(cpPreserveAttachments_allocs) x.refc7bfeda = refc7bfeda @@ -10537,8 +10863,8 @@ func (x *SubpassDescription) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSubpassDependencyMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSubpassDependencyValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -10648,8 +10974,8 @@ func (x *SubpassDependency) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocRenderPassCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRenderPassCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -10662,8 +10988,8 @@ func unpackSAttachmentDescription(x []AttachmentDescription) (unpacked *C.VkAtta return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkAttachmentDescription) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -10691,8 +11017,8 @@ func unpackSSubpassDescription(x []SubpassDescription) (unpacked *C.VkSubpassDes return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSubpassDescription) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -10720,8 +11046,8 @@ func unpackSSubpassDependency(x []SubpassDependency) (unpacked *C.VkSubpassDepen return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSubpassDependency) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -10883,8 +11209,8 @@ func (x *RenderPassCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCommandPoolCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCommandPoolCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -10979,8 +11305,8 @@ func (x *CommandPoolCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCommandBufferAllocateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCommandBufferAllocateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -11080,8 +11406,8 @@ func (x *CommandBufferAllocateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCommandBufferInheritanceInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCommandBufferInheritanceInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -11196,8 +11522,8 @@ func (x *CommandBufferInheritanceInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCommandBufferBeginInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCommandBufferBeginInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -11210,8 +11536,8 @@ func unpackSCommandBufferInheritanceInfo(x []CommandBufferInheritanceInfo) (unpa return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkCommandBufferInheritanceInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -11330,8 +11656,8 @@ func (x *CommandBufferBeginInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBufferCopyMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBufferCopyValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -11421,8 +11747,8 @@ func (x *BufferCopy) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageSubresourceLayersMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageSubresourceLayersValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -11517,8 +11843,8 @@ func (x *ImageSubresourceLayers) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageCopyMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageCopyValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -11618,8 +11944,8 @@ func (x *ImageCopy) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageBlitMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageBlitValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -11630,8 +11956,8 @@ const sizeOfImageBlitValue = unsafe.Sizeof([1]C.VkImageBlit{}) // The caller is responsible for freeing the this memory via C.free. func allocA2Offset3DMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfA2Offset3DValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -11641,8 +11967,8 @@ const sizeOfA2Offset3DValue = unsafe.Sizeof([1][2]C.VkOffset3D{}) // unpackA2Offset3D transforms a sliced Go data structure into plain C format. func unpackA2Offset3D(x [2]Offset3D) (unpacked [2]C.VkOffset3D, allocs *cgoAllocMap) { allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(*[2]C.VkOffset3D) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) mem0 := allocA2Offset3DMemory(1) @@ -11753,8 +12079,8 @@ func (x *ImageBlit) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBufferImageCopyMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBufferImageCopyValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -11859,8 +12185,8 @@ func (x *BufferImageCopy) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocClearDepthStencilValueMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfClearDepthStencilValueValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -11945,8 +12271,8 @@ func (x *ClearDepthStencilValue) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocClearAttachmentMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfClearAttachmentValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -12036,8 +12362,8 @@ func (x *ClearAttachment) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocClearRectMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfClearRectValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -12127,8 +12453,8 @@ func (x *ClearRect) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageResolveMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageResolveValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -12228,8 +12554,8 @@ func (x *ImageResolve) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryBarrierMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryBarrierValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -12324,8 +12650,8 @@ func (x *MemoryBarrier) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBufferMemoryBarrierMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBufferMemoryBarrierValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -12445,8 +12771,8 @@ func (x *BufferMemoryBarrier) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageMemoryBarrierMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageMemoryBarrierValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -12571,14 +12897,43 @@ func (x *ImageMemoryBarrier) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocRenderPassBeginInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRenderPassBeginInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfRenderPassBeginInfoValue = unsafe.Sizeof([1]C.VkRenderPassBeginInfo{}) +// copyPClearValueBytes copies the data from Go slice as *C.VkClearValue. +func copyPClearValueBytes(slice *sliceHeader) (*C.VkClearValue, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfClearValueValue) * slice.Len, + Cap: int(sizeOfClearValueValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkClearValue)(mem0), allocs +} + +// allocClearValueMemory allocates memory for type C.VkClearValue in C. +// The caller is responsible for freeing the this memory via C.free. +func allocClearValueMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfClearValueValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfClearValueValue = unsafe.Sizeof([1]C.VkClearValue{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *RenderPassBeginInfo) Ref() *C.VkRenderPassBeginInfo { if x == nil { @@ -12645,7 +13000,7 @@ func (x *RenderPassBeginInfo) PassRef() (*C.VkRenderPassBeginInfo, *cgoAllocMap) allocs3c3752c8.Borrow(cclearValueCount_allocs) var cpClearValues_allocs *cgoAllocMap - ref3c3752c8.pClearValues, cpClearValues_allocs = (*C.VkClearValue)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PClearValues)).Data)), cgoAllocsUnknown + ref3c3752c8.pClearValues, cpClearValues_allocs = copyPClearValueBytes((*sliceHeader)(unsafe.Pointer(&x.PClearValues))) allocs3c3752c8.Borrow(cpClearValues_allocs) x.ref3c3752c8 = ref3c3752c8 @@ -12686,8 +13041,8 @@ func (x *RenderPassBeginInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDispatchIndirectCommandMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDispatchIndirectCommandValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -12777,8 +13132,8 @@ func (x *DispatchIndirectCommand) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDrawIndexedIndirectCommandMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDrawIndexedIndirectCommandValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -12878,8 +13233,8 @@ func (x *DrawIndexedIndirectCommand) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDrawIndirectCommandMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDrawIndirectCommandValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -12974,8 +13329,8 @@ func (x *DrawIndirectCommand) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBaseOutStructureMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBaseOutStructureValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -12986,8 +13341,8 @@ const sizeOfBaseOutStructureValue = unsafe.Sizeof([1]C.VkBaseOutStructure{}) // The caller is responsible for freeing the this memory via C.free. func allocStruct_VkBaseOutStructureMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStruct_VkBaseOutStructureValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -13000,8 +13355,8 @@ func unpackSBaseOutStructure(x []BaseOutStructure) (unpacked *C.struct_VkBaseOut return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.struct_VkBaseOutStructure) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -13110,8 +13465,8 @@ func (x *BaseOutStructure) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBaseInStructureMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBaseInStructureValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -13122,8 +13477,8 @@ const sizeOfBaseInStructureValue = unsafe.Sizeof([1]C.VkBaseInStructure{}) // The caller is responsible for freeing the this memory via C.free. func allocStruct_VkBaseInStructureMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStruct_VkBaseInStructureValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -13136,8 +13491,8 @@ func unpackSBaseInStructure(x []BaseInStructure) (unpacked *C.struct_VkBaseInStr return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.struct_VkBaseInStructure) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -13246,8 +13601,8 @@ func (x *BaseInStructure) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceSubgroupPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceSubgroupPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -13352,8 +13707,8 @@ func (x *PhysicalDeviceSubgroupProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBindBufferMemoryInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBindBufferMemoryInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -13453,8 +13808,8 @@ func (x *BindBufferMemoryInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBindImageMemoryInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBindImageMemoryInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -13554,8 +13909,8 @@ func (x *BindImageMemoryInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDevice16BitStorageFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDevice16BitStorageFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -13660,8 +14015,8 @@ func (x *PhysicalDevice16BitStorageFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryDedicatedRequirementsMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryDedicatedRequirementsValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -13756,8 +14111,8 @@ func (x *MemoryDedicatedRequirements) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryDedicatedAllocateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryDedicatedAllocateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -13852,8 +14207,8 @@ func (x *MemoryDedicatedAllocateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryAllocateFlagsInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryAllocateFlagsInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -13948,8 +14303,8 @@ func (x *MemoryAllocateFlagsInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceGroupRenderPassBeginInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceGroupRenderPassBeginInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -14049,8 +14404,8 @@ func (x *DeviceGroupRenderPassBeginInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceGroupCommandBufferBeginInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceGroupCommandBufferBeginInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -14140,8 +14495,8 @@ func (x *DeviceGroupCommandBufferBeginInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceGroupSubmitInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceGroupSubmitInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -14202,7 +14557,7 @@ func (x *DeviceGroupSubmitInfo) PassRef() (*C.VkDeviceGroupSubmitInfo, *cgoAlloc allocsea4e7ce4.Borrow(cwaitSemaphoreCount_allocs) var cpWaitSemaphoreDeviceIndices_allocs *cgoAllocMap - refea4e7ce4.pWaitSemaphoreDeviceIndices, cpWaitSemaphoreDeviceIndices_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PWaitSemaphoreDeviceIndices)).Data)), cgoAllocsUnknown + refea4e7ce4.pWaitSemaphoreDeviceIndices, cpWaitSemaphoreDeviceIndices_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PWaitSemaphoreDeviceIndices))) allocsea4e7ce4.Borrow(cpWaitSemaphoreDeviceIndices_allocs) var ccommandBufferCount_allocs *cgoAllocMap @@ -14210,7 +14565,7 @@ func (x *DeviceGroupSubmitInfo) PassRef() (*C.VkDeviceGroupSubmitInfo, *cgoAlloc allocsea4e7ce4.Borrow(ccommandBufferCount_allocs) var cpCommandBufferDeviceMasks_allocs *cgoAllocMap - refea4e7ce4.pCommandBufferDeviceMasks, cpCommandBufferDeviceMasks_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PCommandBufferDeviceMasks)).Data)), cgoAllocsUnknown + refea4e7ce4.pCommandBufferDeviceMasks, cpCommandBufferDeviceMasks_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PCommandBufferDeviceMasks))) allocsea4e7ce4.Borrow(cpCommandBufferDeviceMasks_allocs) var csignalSemaphoreCount_allocs *cgoAllocMap @@ -14218,7 +14573,7 @@ func (x *DeviceGroupSubmitInfo) PassRef() (*C.VkDeviceGroupSubmitInfo, *cgoAlloc allocsea4e7ce4.Borrow(csignalSemaphoreCount_allocs) var cpSignalSemaphoreDeviceIndices_allocs *cgoAllocMap - refea4e7ce4.pSignalSemaphoreDeviceIndices, cpSignalSemaphoreDeviceIndices_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PSignalSemaphoreDeviceIndices)).Data)), cgoAllocsUnknown + refea4e7ce4.pSignalSemaphoreDeviceIndices, cpSignalSemaphoreDeviceIndices_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PSignalSemaphoreDeviceIndices))) allocsea4e7ce4.Borrow(cpSignalSemaphoreDeviceIndices_allocs) x.refea4e7ce4 = refea4e7ce4 @@ -14268,8 +14623,8 @@ func (x *DeviceGroupSubmitInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceGroupBindSparseInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceGroupBindSparseInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -14364,8 +14719,8 @@ func (x *DeviceGroupBindSparseInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBindBufferMemoryDeviceGroupInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBindBufferMemoryDeviceGroupInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -14426,7 +14781,7 @@ func (x *BindBufferMemoryDeviceGroupInfo) PassRef() (*C.VkBindBufferMemoryDevice allocsf136b64f.Borrow(cdeviceIndexCount_allocs) var cpDeviceIndices_allocs *cgoAllocMap - reff136b64f.pDeviceIndices, cpDeviceIndices_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PDeviceIndices)).Data)), cgoAllocsUnknown + reff136b64f.pDeviceIndices, cpDeviceIndices_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PDeviceIndices))) allocsf136b64f.Borrow(cpDeviceIndices_allocs) x.reff136b64f = reff136b64f @@ -14464,8 +14819,8 @@ func (x *BindBufferMemoryDeviceGroupInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBindImageMemoryDeviceGroupInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBindImageMemoryDeviceGroupInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -14526,7 +14881,7 @@ func (x *BindImageMemoryDeviceGroupInfo) PassRef() (*C.VkBindImageMemoryDeviceGr allocs24f026a5.Borrow(cdeviceIndexCount_allocs) var cpDeviceIndices_allocs *cgoAllocMap - ref24f026a5.pDeviceIndices, cpDeviceIndices_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PDeviceIndices)).Data)), cgoAllocsUnknown + ref24f026a5.pDeviceIndices, cpDeviceIndices_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PDeviceIndices))) allocs24f026a5.Borrow(cpDeviceIndices_allocs) var csplitInstanceBindRegionCount_allocs *cgoAllocMap @@ -14574,8 +14929,8 @@ func (x *BindImageMemoryDeviceGroupInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceGroupPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceGroupPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -14675,14 +15030,43 @@ func (x *PhysicalDeviceGroupProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceGroupDeviceCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceGroupDeviceCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfDeviceGroupDeviceCreateInfoValue = unsafe.Sizeof([1]C.VkDeviceGroupDeviceCreateInfo{}) +// copyPPhysicalDeviceBytes copies the data from Go slice as *C.VkPhysicalDevice. +func copyPPhysicalDeviceBytes(slice *sliceHeader) (*C.VkPhysicalDevice, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfPhysicalDeviceValue) * slice.Len, + Cap: int(sizeOfPhysicalDeviceValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkPhysicalDevice)(mem0), allocs +} + +// allocPhysicalDeviceMemory allocates memory for type C.VkPhysicalDevice in C. +// The caller is responsible for freeing the this memory via C.free. +func allocPhysicalDeviceMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfPhysicalDeviceValue = unsafe.Sizeof([1]C.VkPhysicalDevice{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *DeviceGroupDeviceCreateInfo) Ref() *C.VkDeviceGroupDeviceCreateInfo { if x == nil { @@ -14737,7 +15121,7 @@ func (x *DeviceGroupDeviceCreateInfo) PassRef() (*C.VkDeviceGroupDeviceCreateInf allocsb2275723.Borrow(cphysicalDeviceCount_allocs) var cpPhysicalDevices_allocs *cgoAllocMap - refb2275723.pPhysicalDevices, cpPhysicalDevices_allocs = (*C.VkPhysicalDevice)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PPhysicalDevices)).Data)), cgoAllocsUnknown + refb2275723.pPhysicalDevices, cpPhysicalDevices_allocs = copyPPhysicalDeviceBytes((*sliceHeader)(unsafe.Pointer(&x.PPhysicalDevices))) allocsb2275723.Borrow(cpPhysicalDevices_allocs) x.refb2275723 = refb2275723 @@ -14775,8 +15159,8 @@ func (x *DeviceGroupDeviceCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBufferMemoryRequirementsInfo2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBufferMemoryRequirementsInfo2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -14866,8 +15250,8 @@ func (x *BufferMemoryRequirementsInfo2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageMemoryRequirementsInfo2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageMemoryRequirementsInfo2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -14957,8 +15341,8 @@ func (x *ImageMemoryRequirementsInfo2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageSparseMemoryRequirementsInfo2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageSparseMemoryRequirementsInfo2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -15048,8 +15432,8 @@ func (x *ImageSparseMemoryRequirementsInfo2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryRequirements2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryRequirements2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -15139,8 +15523,8 @@ func (x *MemoryRequirements2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSparseImageMemoryRequirements2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSparseImageMemoryRequirements2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -15230,8 +15614,8 @@ func (x *SparseImageMemoryRequirements2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceFeatures2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceFeatures2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -15321,8 +15705,8 @@ func (x *PhysicalDeviceFeatures2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceProperties2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceProperties2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -15412,8 +15796,8 @@ func (x *PhysicalDeviceProperties2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocFormatProperties2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFormatProperties2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -15503,8 +15887,8 @@ func (x *FormatProperties2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageFormatProperties2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageFormatProperties2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -15594,8 +15978,8 @@ func (x *ImageFormatProperties2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceImageFormatInfo2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceImageFormatInfo2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -15705,8 +16089,8 @@ func (x *PhysicalDeviceImageFormatInfo2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocQueueFamilyProperties2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfQueueFamilyProperties2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -15796,8 +16180,8 @@ func (x *QueueFamilyProperties2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceMemoryProperties2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceMemoryProperties2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -15887,8 +16271,8 @@ func (x *PhysicalDeviceMemoryProperties2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSparseImageFormatProperties2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSparseImageFormatProperties2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -15978,8 +16362,8 @@ func (x *SparseImageFormatProperties2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceSparseImageFormatInfo2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceSparseImageFormatInfo2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -16089,8 +16473,8 @@ func (x *PhysicalDeviceSparseImageFormatInfo2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDevicePointClippingPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDevicePointClippingPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -16180,8 +16564,8 @@ func (x *PhysicalDevicePointClippingProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocInputAttachmentAspectReferenceMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfInputAttachmentAspectReferenceValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -16271,8 +16655,8 @@ func (x *InputAttachmentAspectReference) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocRenderPassInputAttachmentAspectCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRenderPassInputAttachmentAspectCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -16285,8 +16669,8 @@ func unpackSInputAttachmentAspectReference(x []InputAttachmentAspectReference) ( return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkInputAttachmentAspectReference) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -16405,8 +16789,8 @@ func (x *RenderPassInputAttachmentAspectCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageViewUsageCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageViewUsageCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -16496,8 +16880,8 @@ func (x *ImageViewUsageCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineTessellationDomainOriginStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineTessellationDomainOriginStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -16587,14 +16971,43 @@ func (x *PipelineTessellationDomainOriginStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocRenderPassMultiviewCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRenderPassMultiviewCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfRenderPassMultiviewCreateInfoValue = unsafe.Sizeof([1]C.VkRenderPassMultiviewCreateInfo{}) +// copyPInt32_tBytes copies the data from Go slice as *C.int32_t. +func copyPInt32_tBytes(slice *sliceHeader) (*C.int32_t, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfInt32_tValue) * slice.Len, + Cap: int(sizeOfInt32_tValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.int32_t)(mem0), allocs +} + +// allocInt32_tMemory allocates memory for type C.int32_t in C. +// The caller is responsible for freeing the this memory via C.free. +func allocInt32_tMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfInt32_tValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfInt32_tValue = unsafe.Sizeof([1]C.int32_t{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *RenderPassMultiviewCreateInfo) Ref() *C.VkRenderPassMultiviewCreateInfo { if x == nil { @@ -16649,7 +17062,7 @@ func (x *RenderPassMultiviewCreateInfo) PassRef() (*C.VkRenderPassMultiviewCreat allocsee413e05.Borrow(csubpassCount_allocs) var cpViewMasks_allocs *cgoAllocMap - refee413e05.pViewMasks, cpViewMasks_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PViewMasks)).Data)), cgoAllocsUnknown + refee413e05.pViewMasks, cpViewMasks_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PViewMasks))) allocsee413e05.Borrow(cpViewMasks_allocs) var cdependencyCount_allocs *cgoAllocMap @@ -16657,7 +17070,7 @@ func (x *RenderPassMultiviewCreateInfo) PassRef() (*C.VkRenderPassMultiviewCreat allocsee413e05.Borrow(cdependencyCount_allocs) var cpViewOffsets_allocs *cgoAllocMap - refee413e05.pViewOffsets, cpViewOffsets_allocs = (*C.int32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PViewOffsets)).Data)), cgoAllocsUnknown + refee413e05.pViewOffsets, cpViewOffsets_allocs = copyPInt32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PViewOffsets))) allocsee413e05.Borrow(cpViewOffsets_allocs) var ccorrelationMaskCount_allocs *cgoAllocMap @@ -16665,7 +17078,7 @@ func (x *RenderPassMultiviewCreateInfo) PassRef() (*C.VkRenderPassMultiviewCreat allocsee413e05.Borrow(ccorrelationMaskCount_allocs) var cpCorrelationMasks_allocs *cgoAllocMap - refee413e05.pCorrelationMasks, cpCorrelationMasks_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PCorrelationMasks)).Data)), cgoAllocsUnknown + refee413e05.pCorrelationMasks, cpCorrelationMasks_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PCorrelationMasks))) allocsee413e05.Borrow(cpCorrelationMasks_allocs) x.refee413e05 = refee413e05 @@ -16715,8 +17128,8 @@ func (x *RenderPassMultiviewCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceMultiviewFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceMultiviewFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -16816,8 +17229,8 @@ func (x *PhysicalDeviceMultiviewFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceMultiviewPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceMultiviewPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -16912,8 +17325,8 @@ func (x *PhysicalDeviceMultiviewProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceVariablePointerFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceVariablePointerFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -17008,8 +17421,8 @@ func (x *PhysicalDeviceVariablePointerFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceProtectedMemoryFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceProtectedMemoryFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -17099,8 +17512,8 @@ func (x *PhysicalDeviceProtectedMemoryFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceProtectedMemoryPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceProtectedMemoryPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -17190,8 +17603,8 @@ func (x *PhysicalDeviceProtectedMemoryProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceQueueInfo2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceQueueInfo2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -17291,8 +17704,8 @@ func (x *DeviceQueueInfo2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocProtectedSubmitInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfProtectedSubmitInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -17382,8 +17795,8 @@ func (x *ProtectedSubmitInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSamplerYcbcrConversionCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSamplerYcbcrConversionCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -17508,8 +17921,8 @@ func (x *SamplerYcbcrConversionCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSamplerYcbcrConversionInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSamplerYcbcrConversionInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -17599,8 +18012,8 @@ func (x *SamplerYcbcrConversionInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBindImagePlaneMemoryInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBindImagePlaneMemoryInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -17690,8 +18103,8 @@ func (x *BindImagePlaneMemoryInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImagePlaneMemoryRequirementsInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImagePlaneMemoryRequirementsInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -17781,8 +18194,8 @@ func (x *ImagePlaneMemoryRequirementsInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceSamplerYcbcrConversionFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceSamplerYcbcrConversionFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -17872,8 +18285,8 @@ func (x *PhysicalDeviceSamplerYcbcrConversionFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSamplerYcbcrConversionImageFormatPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSamplerYcbcrConversionImageFormatPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -17963,8 +18376,8 @@ func (x *SamplerYcbcrConversionImageFormatProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorUpdateTemplateEntryMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorUpdateTemplateEntryValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -18061,16 +18474,16 @@ func (x *DescriptorUpdateTemplateEntry) Deref() { x.DstArrayElement = (uint32)(x.refabf78fb7.dstArrayElement) x.DescriptorCount = (uint32)(x.refabf78fb7.descriptorCount) x.DescriptorType = (DescriptorType)(x.refabf78fb7.descriptorType) - x.Offset = (uint)(x.refabf78fb7.offset) - x.Stride = (uint)(x.refabf78fb7.stride) + x.Offset = (uint32)(x.refabf78fb7.offset) + x.Stride = (uint32)(x.refabf78fb7.stride) } // allocDescriptorUpdateTemplateCreateInfoMemory allocates memory for type C.VkDescriptorUpdateTemplateCreateInfo in C. // The caller is responsible for freeing the this memory via C.free. func allocDescriptorUpdateTemplateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorUpdateTemplateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -18083,8 +18496,8 @@ func unpackSDescriptorUpdateTemplateEntry(x []DescriptorUpdateTemplateEntry) (un return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkDescriptorUpdateTemplateEntry) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -18233,8 +18646,8 @@ func (x *DescriptorUpdateTemplateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExternalMemoryPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExternalMemoryPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -18324,8 +18737,8 @@ func (x *ExternalMemoryProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceExternalImageFormatInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceExternalImageFormatInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -18415,8 +18828,8 @@ func (x *PhysicalDeviceExternalImageFormatInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExternalImageFormatPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExternalImageFormatPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -18506,8 +18919,8 @@ func (x *ExternalImageFormatProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceExternalBufferInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceExternalBufferInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -18607,8 +19020,8 @@ func (x *PhysicalDeviceExternalBufferInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExternalBufferPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExternalBufferPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -18698,8 +19111,8 @@ func (x *ExternalBufferProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceIDPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceIDPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -18809,8 +19222,8 @@ func (x *PhysicalDeviceIDProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExternalMemoryImageCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExternalMemoryImageCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -18900,8 +19313,8 @@ func (x *ExternalMemoryImageCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExternalMemoryBufferCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExternalMemoryBufferCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -18991,8 +19404,8 @@ func (x *ExternalMemoryBufferCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExportMemoryAllocateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExportMemoryAllocateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -19082,8 +19495,8 @@ func (x *ExportMemoryAllocateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceExternalFenceInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceExternalFenceInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -19173,8 +19586,8 @@ func (x *PhysicalDeviceExternalFenceInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExternalFencePropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExternalFencePropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -19274,8 +19687,8 @@ func (x *ExternalFenceProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExportFenceCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExportFenceCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -19365,8 +19778,8 @@ func (x *ExportFenceCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExportSemaphoreCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExportSemaphoreCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -19456,8 +19869,8 @@ func (x *ExportSemaphoreCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceExternalSemaphoreInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceExternalSemaphoreInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -19547,8 +19960,8 @@ func (x *PhysicalDeviceExternalSemaphoreInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExternalSemaphorePropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExternalSemaphorePropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -19648,8 +20061,8 @@ func (x *ExternalSemaphoreProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceMaintenance3PropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceMaintenance3PropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -19744,8 +20157,8 @@ func (x *PhysicalDeviceMaintenance3Properties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorSetLayoutSupportMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorSetLayoutSupportValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -19835,8 +20248,8 @@ func (x *DescriptorSetLayoutSupport) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceShaderDrawParameterFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceShaderDrawParameterFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -19926,8 +20339,8 @@ func (x *PhysicalDeviceShaderDrawParameterFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSurfaceCapabilitiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSurfaceCapabilitiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -20052,8 +20465,8 @@ func (x *SurfaceCapabilities) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSurfaceFormatMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSurfaceFormatValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -20138,8 +20551,8 @@ func (x *SurfaceFormat) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSwapchainCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSwapchainCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -20236,7 +20649,7 @@ func (x *SwapchainCreateInfo) PassRef() (*C.VkSwapchainCreateInfoKHR, *cgoAllocM allocsdb619e1c.Borrow(cqueueFamilyIndexCount_allocs) var cpQueueFamilyIndices_allocs *cgoAllocMap - refdb619e1c.pQueueFamilyIndices, cpQueueFamilyIndices_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PQueueFamilyIndices)).Data)), cgoAllocsUnknown + refdb619e1c.pQueueFamilyIndices, cpQueueFamilyIndices_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PQueueFamilyIndices))) allocsdb619e1c.Borrow(cpQueueFamilyIndices_allocs) var cpreTransform_allocs *cgoAllocMap @@ -20308,14 +20721,72 @@ func (x *SwapchainCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPresentInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPresentInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfPresentInfoValue = unsafe.Sizeof([1]C.VkPresentInfoKHR{}) +// copyPSwapchainBytes copies the data from Go slice as *C.VkSwapchainKHR. +func copyPSwapchainBytes(slice *sliceHeader) (*C.VkSwapchainKHR, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfSwapchainValue) * slice.Len, + Cap: int(sizeOfSwapchainValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkSwapchainKHR)(mem0), allocs +} + +// allocSwapchainMemory allocates memory for type C.VkSwapchainKHR in C. +// The caller is responsible for freeing the this memory via C.free. +func allocSwapchainMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSwapchainValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfSwapchainValue = unsafe.Sizeof([1]C.VkSwapchainKHR{}) + +// copyPResultBytes copies the data from Go slice as *C.VkResult. +func copyPResultBytes(slice *sliceHeader) (*C.VkResult, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfResultValue) * slice.Len, + Cap: int(sizeOfResultValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkResult)(mem0), allocs +} + +// allocResultMemory allocates memory for type C.VkResult in C. +// The caller is responsible for freeing the this memory via C.free. +func allocResultMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfResultValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfResultValue = unsafe.Sizeof([1]C.VkResult{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *PresentInfo) Ref() *C.VkPresentInfoKHR { if x == nil { @@ -20370,7 +20841,7 @@ func (x *PresentInfo) PassRef() (*C.VkPresentInfoKHR, *cgoAllocMap) { allocs1d0e82d4.Borrow(cwaitSemaphoreCount_allocs) var cpWaitSemaphores_allocs *cgoAllocMap - ref1d0e82d4.pWaitSemaphores, cpWaitSemaphores_allocs = (*C.VkSemaphore)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PWaitSemaphores)).Data)), cgoAllocsUnknown + ref1d0e82d4.pWaitSemaphores, cpWaitSemaphores_allocs = copyPSemaphoreBytes((*sliceHeader)(unsafe.Pointer(&x.PWaitSemaphores))) allocs1d0e82d4.Borrow(cpWaitSemaphores_allocs) var cswapchainCount_allocs *cgoAllocMap @@ -20378,15 +20849,15 @@ func (x *PresentInfo) PassRef() (*C.VkPresentInfoKHR, *cgoAllocMap) { allocs1d0e82d4.Borrow(cswapchainCount_allocs) var cpSwapchains_allocs *cgoAllocMap - ref1d0e82d4.pSwapchains, cpSwapchains_allocs = (*C.VkSwapchainKHR)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PSwapchains)).Data)), cgoAllocsUnknown + ref1d0e82d4.pSwapchains, cpSwapchains_allocs = copyPSwapchainBytes((*sliceHeader)(unsafe.Pointer(&x.PSwapchains))) allocs1d0e82d4.Borrow(cpSwapchains_allocs) var cpImageIndices_allocs *cgoAllocMap - ref1d0e82d4.pImageIndices, cpImageIndices_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PImageIndices)).Data)), cgoAllocsUnknown + ref1d0e82d4.pImageIndices, cpImageIndices_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PImageIndices))) allocs1d0e82d4.Borrow(cpImageIndices_allocs) var cpResults_allocs *cgoAllocMap - ref1d0e82d4.pResults, cpResults_allocs = (*C.VkResult)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PResults)).Data)), cgoAllocsUnknown + ref1d0e82d4.pResults, cpResults_allocs = copyPResultBytes((*sliceHeader)(unsafe.Pointer(&x.PResults))) allocs1d0e82d4.Borrow(cpResults_allocs) x.ref1d0e82d4 = ref1d0e82d4 @@ -20440,8 +20911,8 @@ func (x *PresentInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageSwapchainCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageSwapchainCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -20531,8 +21002,8 @@ func (x *ImageSwapchainCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBindImageMemorySwapchainInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBindImageMemorySwapchainInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -20627,8 +21098,8 @@ func (x *BindImageMemorySwapchainInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocAcquireNextImageInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfAcquireNextImageInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -20728,7 +21199,7 @@ func (x *AcquireNextImageInfo) Deref() { x.SType = (StructureType)(x.ref588806a5.sType) x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.ref588806a5.pNext)) x.Swapchain = *(*Swapchain)(unsafe.Pointer(&x.ref588806a5.swapchain)) - x.Timeout = (uint64)(x.ref588806a5.timeout) + x.Timeout = (uint32)(x.ref588806a5.timeout) x.Semaphore = *(*Semaphore)(unsafe.Pointer(&x.ref588806a5.semaphore)) x.Fence = *(*Fence)(unsafe.Pointer(&x.ref588806a5.fence)) x.DeviceMask = (uint32)(x.ref588806a5.deviceMask) @@ -20738,8 +21209,8 @@ func (x *AcquireNextImageInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceGroupPresentCapabilitiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceGroupPresentCapabilitiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -20834,8 +21305,8 @@ func (x *DeviceGroupPresentCapabilities) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceGroupPresentInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceGroupPresentInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -20896,7 +21367,7 @@ func (x *DeviceGroupPresentInfo) PassRef() (*C.VkDeviceGroupPresentInfoKHR, *cgo allocsf6912d09.Borrow(cswapchainCount_allocs) var cpDeviceMasks_allocs *cgoAllocMap - reff6912d09.pDeviceMasks, cpDeviceMasks_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PDeviceMasks)).Data)), cgoAllocsUnknown + reff6912d09.pDeviceMasks, cpDeviceMasks_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PDeviceMasks))) allocsf6912d09.Borrow(cpDeviceMasks_allocs) var cmode_allocs *cgoAllocMap @@ -20939,8 +21410,8 @@ func (x *DeviceGroupPresentInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceGroupSwapchainCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceGroupSwapchainCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -21030,8 +21501,8 @@ func (x *DeviceGroupSwapchainCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -21141,8 +21612,8 @@ func (x *DisplayProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayModeParametersMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayModeParametersValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -21227,8 +21698,8 @@ func (x *DisplayModeParameters) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayModePropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayModePropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -21313,8 +21784,8 @@ func (x *DisplayModeProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayModeCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayModeCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -21409,8 +21880,8 @@ func (x *DisplayModeCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayPlaneCapabilitiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayPlaneCapabilitiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -21530,8 +22001,8 @@ func (x *DisplayPlaneCapabilities) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayPlanePropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayPlanePropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -21616,8 +22087,8 @@ func (x *DisplayPlaneProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplaySurfaceCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplaySurfaceCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -21742,8 +22213,8 @@ func (x *DisplaySurfaceCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayPresentInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayPresentInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -21843,8 +22314,8 @@ func (x *DisplayPresentInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImportMemoryFdInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImportMemoryFdInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -21939,8 +22410,8 @@ func (x *ImportMemoryFdInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryFdPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryFdPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -22030,8 +22501,8 @@ func (x *MemoryFdProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryGetFdInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryGetFdInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -22126,8 +22597,8 @@ func (x *MemoryGetFdInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImportSemaphoreFdInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImportSemaphoreFdInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -22232,8 +22703,8 @@ func (x *ImportSemaphoreFdInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSemaphoreGetFdInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSemaphoreGetFdInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -22328,8 +22799,8 @@ func (x *SemaphoreGetFdInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDevicePushDescriptorPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDevicePushDescriptorPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -22419,8 +22890,8 @@ func (x *PhysicalDevicePushDescriptorProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocRectLayerMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRectLayerValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -22510,8 +22981,8 @@ func (x *RectLayer) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPresentRegionMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPresentRegionValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -22524,8 +22995,8 @@ func unpackSRectLayer(x []RectLayer) (unpacked *C.VkRectLayerKHR, allocs *cgoAll return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkRectLayerKHR) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -22634,8 +23105,8 @@ func (x *PresentRegion) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPresentRegionsMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPresentRegionsValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -22648,8 +23119,8 @@ func unpackSPresentRegion(x []PresentRegion) (unpacked *C.VkPresentRegionKHR, al return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkPresentRegionKHR) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -22768,8 +23239,8 @@ func (x *PresentRegions) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocAttachmentDescription2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfAttachmentDescription2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -22899,8 +23370,8 @@ func (x *AttachmentDescription2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocAttachmentReference2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfAttachmentReference2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -23000,8 +23471,8 @@ func (x *AttachmentReference2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSubpassDescription2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSubpassDescription2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -23014,8 +23485,8 @@ func unpackSAttachmentReference2(x []AttachmentReference2) (unpacked *C.VkAttach return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkAttachmentReference2KHR) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -23136,7 +23607,7 @@ func (x *SubpassDescription2) PassRef() (*C.VkSubpassDescription2KHR, *cgoAllocM allocs89a293f3.Borrow(cpreserveAttachmentCount_allocs) var cpPreserveAttachments_allocs *cgoAllocMap - ref89a293f3.pPreserveAttachments, cpPreserveAttachments_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PPreserveAttachments)).Data)), cgoAllocsUnknown + ref89a293f3.pPreserveAttachments, cpPreserveAttachments_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PPreserveAttachments))) allocs89a293f3.Borrow(cpPreserveAttachments_allocs) x.ref89a293f3 = ref89a293f3 @@ -23183,8 +23654,8 @@ func (x *SubpassDescription2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSubpassDependency2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSubpassDependency2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -23309,8 +23780,8 @@ func (x *SubpassDependency2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocRenderPassCreateInfo2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRenderPassCreateInfo2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -23323,8 +23794,8 @@ func unpackSAttachmentDescription2(x []AttachmentDescription2) (unpacked *C.VkAt return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkAttachmentDescription2KHR) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -23352,8 +23823,8 @@ func unpackSSubpassDescription2(x []SubpassDescription2) (unpacked *C.VkSubpassD return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSubpassDescription2KHR) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -23381,8 +23852,8 @@ func unpackSSubpassDependency2(x []SubpassDependency2) (unpacked *C.VkSubpassDep return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSubpassDependency2KHR) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -23513,7 +23984,7 @@ func (x *RenderPassCreateInfo2) PassRef() (*C.VkRenderPassCreateInfo2KHR, *cgoAl allocs1d4774de.Borrow(ccorrelatedViewMaskCount_allocs) var cpCorrelatedViewMasks_allocs *cgoAllocMap - ref1d4774de.pCorrelatedViewMasks, cpCorrelatedViewMasks_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PCorrelatedViewMasks)).Data)), cgoAllocsUnknown + ref1d4774de.pCorrelatedViewMasks, cpCorrelatedViewMasks_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PCorrelatedViewMasks))) allocs1d4774de.Borrow(cpCorrelatedViewMasks_allocs) x.ref1d4774de = ref1d4774de @@ -23558,8 +24029,8 @@ func (x *RenderPassCreateInfo2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSubpassBeginInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSubpassBeginInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -23649,8 +24120,8 @@ func (x *SubpassBeginInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSubpassEndInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSubpassEndInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -23735,8 +24206,8 @@ func (x *SubpassEndInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSharedPresentSurfaceCapabilitiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSharedPresentSurfaceCapabilitiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -23826,8 +24297,8 @@ func (x *SharedPresentSurfaceCapabilities) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImportFenceFdInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImportFenceFdInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -23932,8 +24403,8 @@ func (x *ImportFenceFdInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocFenceGetFdInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFenceGetFdInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -24028,8 +24499,8 @@ func (x *FenceGetFdInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceSurfaceInfo2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceSurfaceInfo2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -24119,8 +24590,8 @@ func (x *PhysicalDeviceSurfaceInfo2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSurfaceCapabilities2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSurfaceCapabilities2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -24210,8 +24681,8 @@ func (x *SurfaceCapabilities2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSurfaceFormat2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSurfaceFormat2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -24301,8 +24772,8 @@ func (x *SurfaceFormat2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayProperties2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayProperties2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -24392,8 +24863,8 @@ func (x *DisplayProperties2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayPlaneProperties2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayPlaneProperties2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -24483,8 +24954,8 @@ func (x *DisplayPlaneProperties2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayModeProperties2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayModeProperties2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -24574,8 +25045,8 @@ func (x *DisplayModeProperties2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayPlaneInfo2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayPlaneInfo2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -24670,8 +25141,8 @@ func (x *DisplayPlaneInfo2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayPlaneCapabilities2Memory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayPlaneCapabilities2Value)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -24761,14 +25232,43 @@ func (x *DisplayPlaneCapabilities2) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageFormatListCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageFormatListCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfImageFormatListCreateInfoValue = unsafe.Sizeof([1]C.VkImageFormatListCreateInfoKHR{}) +// copyPFormatBytes copies the data from Go slice as *C.VkFormat. +func copyPFormatBytes(slice *sliceHeader) (*C.VkFormat, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfFormatValue) * slice.Len, + Cap: int(sizeOfFormatValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkFormat)(mem0), allocs +} + +// allocFormatMemory allocates memory for type C.VkFormat in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFormatMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFormatValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFormatValue = unsafe.Sizeof([1]C.VkFormat{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *ImageFormatListCreateInfo) Ref() *C.VkImageFormatListCreateInfoKHR { if x == nil { @@ -24823,7 +25323,7 @@ func (x *ImageFormatListCreateInfo) PassRef() (*C.VkImageFormatListCreateInfoKHR allocs815daf8c.Borrow(cviewFormatCount_allocs) var cpViewFormats_allocs *cgoAllocMap - ref815daf8c.pViewFormats, cpViewFormats_allocs = (*C.VkFormat)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PViewFormats)).Data)), cgoAllocsUnknown + ref815daf8c.pViewFormats, cpViewFormats_allocs = copyPFormatBytes((*sliceHeader)(unsafe.Pointer(&x.PViewFormats))) allocs815daf8c.Borrow(cpViewFormats_allocs) x.ref815daf8c = ref815daf8c @@ -24861,8 +25361,8 @@ func (x *ImageFormatListCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDevice8BitStorageFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDevice8BitStorageFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -24962,8 +25462,8 @@ func (x *PhysicalDevice8BitStorageFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceShaderAtomicInt64FeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceShaderAtomicInt64FeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -25058,8 +25558,8 @@ func (x *PhysicalDeviceShaderAtomicInt64Features) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocConformanceVersionMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfConformanceVersionValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -25154,8 +25654,8 @@ func (x *ConformanceVersion) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceDriverPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceDriverPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -25260,8 +25760,8 @@ func (x *PhysicalDeviceDriverProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceVulkanMemoryModelFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceVulkanMemoryModelFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -25381,8 +25881,8 @@ func debugReportCallbackFuncC918AAC4(cflags C.VkDebugReportFlagsEXT, cobjectType if debugReportCallbackFuncC918AAC4Func != nil { flagsc918aac4 := (DebugReportFlags)(cflags) objectTypec918aac4 := (DebugReportObjectType)(cobjectType) - objectc918aac4 := (uint64)(cobject) - locationc918aac4 := (uint)(clocation) + objectc918aac4 := (uint32)(cobject) + locationc918aac4 := (uint32)(clocation) messageCodec918aac4 := (int32)(cmessageCode) pLayerPrefixc918aac4 := packPCharString(cpLayerPrefix) pMessagec918aac4 := packPCharString(cpMessage) @@ -25400,8 +25900,8 @@ var debugReportCallbackFuncC918AAC4Func DebugReportCallbackFunc // The caller is responsible for freeing the this memory via C.free. func allocDebugReportCallbackCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDebugReportCallbackCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -25501,8 +26001,8 @@ func (x *DebugReportCallbackCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineRasterizationStateRasterizationOrderAMDMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineRasterizationStateRasterizationOrderAMDValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -25592,8 +26092,8 @@ func (x *PipelineRasterizationStateRasterizationOrderAMD) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDebugMarkerObjectNameInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDebugMarkerObjectNameInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -25685,7 +26185,7 @@ func (x *DebugMarkerObjectNameInfo) Deref() { x.SType = (StructureType)(x.refe4983fab.sType) x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.refe4983fab.pNext)) x.ObjectType = (DebugReportObjectType)(x.refe4983fab.objectType) - x.Object = (uint64)(x.refe4983fab.object) + x.Object = (uint32)(x.refe4983fab.object) x.PObjectName = packPCharString(x.refe4983fab.pObjectName) } @@ -25693,8 +26193,8 @@ func (x *DebugMarkerObjectNameInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDebugMarkerObjectTagInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDebugMarkerObjectTagInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -25794,9 +26294,9 @@ func (x *DebugMarkerObjectTagInfo) Deref() { x.SType = (StructureType)(x.refa41a5c3b.sType) x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.refa41a5c3b.pNext)) x.ObjectType = (DebugReportObjectType)(x.refa41a5c3b.objectType) - x.Object = (uint64)(x.refa41a5c3b.object) - x.TagName = (uint64)(x.refa41a5c3b.tagName) - x.TagSize = (uint)(x.refa41a5c3b.tagSize) + x.Object = (uint32)(x.refa41a5c3b.object) + x.TagName = (uint32)(x.refa41a5c3b.tagName) + x.TagSize = (uint32)(x.refa41a5c3b.tagSize) x.PTag = (unsafe.Pointer)(unsafe.Pointer(x.refa41a5c3b.pTag)) } @@ -25804,8 +26304,8 @@ func (x *DebugMarkerObjectTagInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDebugMarkerMarkerInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDebugMarkerMarkerInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -25900,8 +26400,8 @@ func (x *DebugMarkerMarkerInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDedicatedAllocationImageCreateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDedicatedAllocationImageCreateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -25991,8 +26491,8 @@ func (x *DedicatedAllocationImageCreateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDedicatedAllocationBufferCreateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDedicatedAllocationBufferCreateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -26082,8 +26582,8 @@ func (x *DedicatedAllocationBufferCreateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDedicatedAllocationMemoryAllocateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDedicatedAllocationMemoryAllocateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -26178,8 +26678,8 @@ func (x *DedicatedAllocationMemoryAllocateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceTransformFeedbackFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceTransformFeedbackFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -26274,8 +26774,8 @@ func (x *PhysicalDeviceTransformFeedbackFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceTransformFeedbackPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceTransformFeedbackPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -26410,8 +26910,8 @@ func (x *PhysicalDeviceTransformFeedbackProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineRasterizationStateStreamCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineRasterizationStateStreamCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -26506,8 +27006,8 @@ func (x *PipelineRasterizationStateStreamCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocTextureLODGatherFormatPropertiesAMDMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfTextureLODGatherFormatPropertiesAMDValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -26597,8 +27097,8 @@ func (x *TextureLODGatherFormatPropertiesAMD) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocShaderResourceUsageAMDMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfShaderResourceUsageAMDValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -26690,16 +27190,16 @@ func (x *ShaderResourceUsageAMD) Deref() { x.NumUsedVgprs = (uint32)(x.ref8a688131.numUsedVgprs) x.NumUsedSgprs = (uint32)(x.ref8a688131.numUsedSgprs) x.LdsSizePerLocalWorkGroup = (uint32)(x.ref8a688131.ldsSizePerLocalWorkGroup) - x.LdsUsageSizeInBytes = (uint)(x.ref8a688131.ldsUsageSizeInBytes) - x.ScratchMemUsageInBytes = (uint)(x.ref8a688131.scratchMemUsageInBytes) + x.LdsUsageSizeInBytes = (uint32)(x.ref8a688131.ldsUsageSizeInBytes) + x.ScratchMemUsageInBytes = (uint32)(x.ref8a688131.scratchMemUsageInBytes) } // allocShaderStatisticsInfoAMDMemory allocates memory for type C.VkShaderStatisticsInfoAMD in C. // The caller is responsible for freeing the this memory via C.free. func allocShaderStatisticsInfoAMDMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfShaderStatisticsInfoAMDValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -26809,8 +27309,8 @@ func (x *ShaderStatisticsInfoAMD) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceCornerSampledImageFeaturesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceCornerSampledImageFeaturesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -26900,8 +27400,8 @@ func (x *PhysicalDeviceCornerSampledImageFeaturesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExternalImageFormatPropertiesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExternalImageFormatPropertiesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -26996,8 +27496,8 @@ func (x *ExternalImageFormatPropertiesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExternalMemoryImageCreateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExternalMemoryImageCreateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -27087,8 +27587,8 @@ func (x *ExternalMemoryImageCreateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocExportMemoryAllocateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfExportMemoryAllocateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -27178,14 +27678,43 @@ func (x *ExportMemoryAllocateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocValidationFlagsMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfValidationFlagsValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfValidationFlagsValue = unsafe.Sizeof([1]C.VkValidationFlagsEXT{}) +// copyPValidationCheckBytes copies the data from Go slice as *C.VkValidationCheckEXT. +func copyPValidationCheckBytes(slice *sliceHeader) (*C.VkValidationCheckEXT, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfValidationCheckValue) * slice.Len, + Cap: int(sizeOfValidationCheckValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkValidationCheckEXT)(mem0), allocs +} + +// allocValidationCheckMemory allocates memory for type C.VkValidationCheckEXT in C. +// The caller is responsible for freeing the this memory via C.free. +func allocValidationCheckMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfValidationCheckValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfValidationCheckValue = unsafe.Sizeof([1]C.VkValidationCheckEXT{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *ValidationFlags) Ref() *C.VkValidationFlagsEXT { if x == nil { @@ -27240,7 +27769,7 @@ func (x *ValidationFlags) PassRef() (*C.VkValidationFlagsEXT, *cgoAllocMap) { allocsffe080ad.Borrow(cdisabledValidationCheckCount_allocs) var cpDisabledValidationChecks_allocs *cgoAllocMap - refffe080ad.pDisabledValidationChecks, cpDisabledValidationChecks_allocs = (*C.VkValidationCheckEXT)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PDisabledValidationChecks)).Data)), cgoAllocsUnknown + refffe080ad.pDisabledValidationChecks, cpDisabledValidationChecks_allocs = copyPValidationCheckBytes((*sliceHeader)(unsafe.Pointer(&x.PDisabledValidationChecks))) allocsffe080ad.Borrow(cpDisabledValidationChecks_allocs) x.refffe080ad = refffe080ad @@ -27278,8 +27807,8 @@ func (x *ValidationFlags) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageViewASTCDecodeModeMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageViewASTCDecodeModeValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -27369,8 +27898,8 @@ func (x *ImageViewASTCDecodeMode) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceASTCDecodeFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceASTCDecodeFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -27460,8 +27989,8 @@ func (x *PhysicalDeviceASTCDecodeFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocConditionalRenderingBeginInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfConditionalRenderingBeginInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -27561,8 +28090,8 @@ func (x *ConditionalRenderingBeginInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceConditionalRenderingFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceConditionalRenderingFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -27657,8 +28186,8 @@ func (x *PhysicalDeviceConditionalRenderingFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCommandBufferInheritanceConditionalRenderingInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCommandBufferInheritanceConditionalRenderingInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -27748,8 +28277,8 @@ func (x *CommandBufferInheritanceConditionalRenderingInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceGeneratedCommandsFeaturesNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceGeneratedCommandsFeaturesNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -27839,8 +28368,8 @@ func (x *DeviceGeneratedCommandsFeaturesNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceGeneratedCommandsLimitsNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceGeneratedCommandsLimitsNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -27950,8 +28479,8 @@ func (x *DeviceGeneratedCommandsLimitsNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocIndirectCommandsTokenNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfIndirectCommandsTokenNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -28041,8 +28570,8 @@ func (x *IndirectCommandsTokenNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocIndirectCommandsLayoutTokenNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfIndirectCommandsLayoutTokenNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -28137,8 +28666,8 @@ func (x *IndirectCommandsLayoutTokenNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocIndirectCommandsLayoutCreateInfoNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfIndirectCommandsLayoutCreateInfoNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -28151,8 +28680,8 @@ func unpackSIndirectCommandsLayoutTokenNVX(x []IndirectCommandsLayoutTokenNVX) ( return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkIndirectCommandsLayoutTokenNVX) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -28281,8 +28810,8 @@ func (x *IndirectCommandsLayoutCreateInfoNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCmdProcessCommandsInfoNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCmdProcessCommandsInfoNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -28295,8 +28824,8 @@ func unpackSIndirectCommandsTokenNVX(x []IndirectCommandsTokenNVX) (unpacked *C. return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkIndirectCommandsTokenNVX) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -28455,8 +28984,8 @@ func (x *CmdProcessCommandsInfoNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCmdReserveSpaceForCommandsInfoNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCmdReserveSpaceForCommandsInfoNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -28556,14 +29085,72 @@ func (x *CmdReserveSpaceForCommandsInfoNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocObjectTableCreateInfoNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfObjectTableCreateInfoNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfObjectTableCreateInfoNVXValue = unsafe.Sizeof([1]C.VkObjectTableCreateInfoNVX{}) +// copyPObjectEntryTypeNVXBytes copies the data from Go slice as *C.VkObjectEntryTypeNVX. +func copyPObjectEntryTypeNVXBytes(slice *sliceHeader) (*C.VkObjectEntryTypeNVX, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfObjectEntryTypeNVXValue) * slice.Len, + Cap: int(sizeOfObjectEntryTypeNVXValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkObjectEntryTypeNVX)(mem0), allocs +} + +// allocObjectEntryTypeNVXMemory allocates memory for type C.VkObjectEntryTypeNVX in C. +// The caller is responsible for freeing the this memory via C.free. +func allocObjectEntryTypeNVXMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfObjectEntryTypeNVXValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfObjectEntryTypeNVXValue = unsafe.Sizeof([1]C.VkObjectEntryTypeNVX{}) + +// copyPObjectEntryUsageFlagsNVXBytes copies the data from Go slice as *C.VkObjectEntryUsageFlagsNVX. +func copyPObjectEntryUsageFlagsNVXBytes(slice *sliceHeader) (*C.VkObjectEntryUsageFlagsNVX, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfObjectEntryUsageFlagsNVXValue) * slice.Len, + Cap: int(sizeOfObjectEntryUsageFlagsNVXValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkObjectEntryUsageFlagsNVX)(mem0), allocs +} + +// allocObjectEntryUsageFlagsNVXMemory allocates memory for type C.VkObjectEntryUsageFlagsNVX in C. +// The caller is responsible for freeing the this memory via C.free. +func allocObjectEntryUsageFlagsNVXMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfObjectEntryUsageFlagsNVXValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfObjectEntryUsageFlagsNVXValue = unsafe.Sizeof([1]C.VkObjectEntryUsageFlagsNVX{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *ObjectTableCreateInfoNVX) Ref() *C.VkObjectTableCreateInfoNVX { if x == nil { @@ -28618,15 +29205,15 @@ func (x *ObjectTableCreateInfoNVX) PassRef() (*C.VkObjectTableCreateInfoNVX, *cg allocsb4a6c9e1.Borrow(cobjectCount_allocs) var cpObjectEntryTypes_allocs *cgoAllocMap - refb4a6c9e1.pObjectEntryTypes, cpObjectEntryTypes_allocs = (*C.VkObjectEntryTypeNVX)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PObjectEntryTypes)).Data)), cgoAllocsUnknown + refb4a6c9e1.pObjectEntryTypes, cpObjectEntryTypes_allocs = copyPObjectEntryTypeNVXBytes((*sliceHeader)(unsafe.Pointer(&x.PObjectEntryTypes))) allocsb4a6c9e1.Borrow(cpObjectEntryTypes_allocs) var cpObjectEntryCounts_allocs *cgoAllocMap - refb4a6c9e1.pObjectEntryCounts, cpObjectEntryCounts_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PObjectEntryCounts)).Data)), cgoAllocsUnknown + refb4a6c9e1.pObjectEntryCounts, cpObjectEntryCounts_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PObjectEntryCounts))) allocsb4a6c9e1.Borrow(cpObjectEntryCounts_allocs) var cpObjectEntryUsageFlags_allocs *cgoAllocMap - refb4a6c9e1.pObjectEntryUsageFlags, cpObjectEntryUsageFlags_allocs = (*C.VkObjectEntryUsageFlagsNVX)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PObjectEntryUsageFlags)).Data)), cgoAllocsUnknown + refb4a6c9e1.pObjectEntryUsageFlags, cpObjectEntryUsageFlags_allocs = copyPObjectEntryUsageFlagsNVXBytes((*sliceHeader)(unsafe.Pointer(&x.PObjectEntryUsageFlags))) allocsb4a6c9e1.Borrow(cpObjectEntryUsageFlags_allocs) var cmaxUniformBuffersPerDescriptor_allocs *cgoAllocMap @@ -28699,8 +29286,8 @@ func (x *ObjectTableCreateInfoNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocObjectTableEntryNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfObjectTableEntryNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -28785,8 +29372,8 @@ func (x *ObjectTableEntryNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocObjectTablePipelineEntryNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfObjectTablePipelineEntryNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -28876,8 +29463,8 @@ func (x *ObjectTablePipelineEntryNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocObjectTableDescriptorSetEntryNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfObjectTableDescriptorSetEntryNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -28972,8 +29559,8 @@ func (x *ObjectTableDescriptorSetEntryNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocObjectTableVertexBufferEntryNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfObjectTableVertexBufferEntryNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -29063,8 +29650,8 @@ func (x *ObjectTableVertexBufferEntryNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocObjectTableIndexBufferEntryNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfObjectTableIndexBufferEntryNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -29159,8 +29746,8 @@ func (x *ObjectTableIndexBufferEntryNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocObjectTablePushConstantEntryNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfObjectTablePushConstantEntryNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -29255,8 +29842,8 @@ func (x *ObjectTablePushConstantEntryNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocViewportWScalingNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfViewportWScalingNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -29341,8 +29928,8 @@ func (x *ViewportWScalingNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineViewportWScalingStateCreateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineViewportWScalingStateCreateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -29355,8 +29942,8 @@ func unpackSViewportWScalingNV(x []ViewportWScalingNV) (unpacked *C.VkViewportWS return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkViewportWScalingNV) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -29480,8 +30067,8 @@ func (x *PipelineViewportWScalingStateCreateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayPowerInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayPowerInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -29571,8 +30158,8 @@ func (x *DisplayPowerInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceEventInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceEventInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -29662,8 +30249,8 @@ func (x *DeviceEventInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDisplayEventInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayEventInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -29753,8 +30340,8 @@ func (x *DisplayEventInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSwapchainCounterCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSwapchainCounterCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -29844,8 +30431,8 @@ func (x *SwapchainCounterCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocRefreshCycleDurationGOOGLEMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRefreshCycleDurationGOOGLEValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -29918,15 +30505,15 @@ func (x *RefreshCycleDurationGOOGLE) Deref() { if x.ref969cb55b == nil { return } - x.RefreshDuration = (uint64)(x.ref969cb55b.refreshDuration) + x.RefreshDuration = (uint32)(x.ref969cb55b.refreshDuration) } // allocPastPresentationTimingGOOGLEMemory allocates memory for type C.VkPastPresentationTimingGOOGLE in C. // The caller is responsible for freeing the this memory via C.free. func allocPastPresentationTimingGOOGLEMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPastPresentationTimingGOOGLEValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -30016,18 +30603,18 @@ func (x *PastPresentationTimingGOOGLE) Deref() { return } x.PresentID = (uint32)(x.refac8cf1d8.presentID) - x.DesiredPresentTime = (uint64)(x.refac8cf1d8.desiredPresentTime) - x.ActualPresentTime = (uint64)(x.refac8cf1d8.actualPresentTime) - x.EarliestPresentTime = (uint64)(x.refac8cf1d8.earliestPresentTime) - x.PresentMargin = (uint64)(x.refac8cf1d8.presentMargin) + x.DesiredPresentTime = (uint32)(x.refac8cf1d8.desiredPresentTime) + x.ActualPresentTime = (uint32)(x.refac8cf1d8.actualPresentTime) + x.EarliestPresentTime = (uint32)(x.refac8cf1d8.earliestPresentTime) + x.PresentMargin = (uint32)(x.refac8cf1d8.presentMargin) } // allocPresentTimeGOOGLEMemory allocates memory for type C.VkPresentTimeGOOGLE in C. // The caller is responsible for freeing the this memory via C.free. func allocPresentTimeGOOGLEMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPresentTimeGOOGLEValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -30105,15 +30692,15 @@ func (x *PresentTimeGOOGLE) Deref() { return } x.PresentID = (uint32)(x.ref9cd90ade.presentID) - x.DesiredPresentTime = (uint64)(x.ref9cd90ade.desiredPresentTime) + x.DesiredPresentTime = (uint32)(x.ref9cd90ade.desiredPresentTime) } // allocPresentTimesInfoGOOGLEMemory allocates memory for type C.VkPresentTimesInfoGOOGLE in C. // The caller is responsible for freeing the this memory via C.free. func allocPresentTimesInfoGOOGLEMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPresentTimesInfoGOOGLEValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -30126,8 +30713,8 @@ func unpackSPresentTimeGOOGLE(x []PresentTimeGOOGLE) (unpacked *C.VkPresentTimeG return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkPresentTimeGOOGLE) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -30246,8 +30833,8 @@ func (x *PresentTimesInfoGOOGLE) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceMultiviewPerViewAttributesPropertiesNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceMultiviewPerViewAttributesPropertiesNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -30337,8 +30924,8 @@ func (x *PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocViewportSwizzleNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfViewportSwizzleNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -30433,8 +31020,8 @@ func (x *ViewportSwizzleNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineViewportSwizzleStateCreateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineViewportSwizzleStateCreateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -30447,8 +31034,8 @@ func unpackSViewportSwizzleNV(x []ViewportSwizzleNV) (unpacked *C.VkViewportSwiz return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkViewportSwizzleNV) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -30572,8 +31159,8 @@ func (x *PipelineViewportSwizzleStateCreateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceDiscardRectanglePropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceDiscardRectanglePropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -30663,8 +31250,8 @@ func (x *PhysicalDeviceDiscardRectangleProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineDiscardRectangleStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineDiscardRectangleStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -30769,8 +31356,8 @@ func (x *PipelineDiscardRectangleStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceConservativeRasterizationPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceConservativeRasterizationPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -30900,8 +31487,8 @@ func (x *PhysicalDeviceConservativeRasterizationProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineRasterizationConservativeStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineRasterizationConservativeStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -31001,8 +31588,8 @@ func (x *PipelineRasterizationConservativeStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocXYColorMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfXYColorValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -31087,8 +31674,8 @@ func (x *XYColor) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocHdrMetadataMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfHdrMetadataValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -31213,8 +31800,8 @@ func (x *HdrMetadata) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDebugUtilsObjectNameInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDebugUtilsObjectNameInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -31306,7 +31893,7 @@ func (x *DebugUtilsObjectNameInfo) Deref() { x.SType = (StructureType)(x.ref5e73c2db.sType) x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.ref5e73c2db.pNext)) x.ObjectType = (ObjectType)(x.ref5e73c2db.objectType) - x.ObjectHandle = (uint64)(x.ref5e73c2db.objectHandle) + x.ObjectHandle = (uint32)(x.ref5e73c2db.objectHandle) x.PObjectName = packPCharString(x.ref5e73c2db.pObjectName) } @@ -31314,8 +31901,8 @@ func (x *DebugUtilsObjectNameInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDebugUtilsObjectTagInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDebugUtilsObjectTagInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -31415,9 +32002,9 @@ func (x *DebugUtilsObjectTagInfo) Deref() { x.SType = (StructureType)(x.ref9fd129cf.sType) x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.ref9fd129cf.pNext)) x.ObjectType = (ObjectType)(x.ref9fd129cf.objectType) - x.ObjectHandle = (uint64)(x.ref9fd129cf.objectHandle) - x.TagName = (uint64)(x.ref9fd129cf.tagName) - x.TagSize = (uint)(x.ref9fd129cf.tagSize) + x.ObjectHandle = (uint32)(x.ref9fd129cf.objectHandle) + x.TagName = (uint32)(x.ref9fd129cf.tagName) + x.TagSize = (uint32)(x.ref9fd129cf.tagSize) x.PTag = (unsafe.Pointer)(unsafe.Pointer(x.ref9fd129cf.pTag)) } @@ -31425,8 +32012,8 @@ func (x *DebugUtilsObjectTagInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDebugUtilsLabelMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDebugUtilsLabelValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -31521,8 +32108,8 @@ func (x *DebugUtilsLabel) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSamplerReductionModeCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSamplerReductionModeCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -31612,8 +32199,8 @@ func (x *SamplerReductionModeCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceSamplerFilterMinmaxPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceSamplerFilterMinmaxPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -31708,8 +32295,8 @@ func (x *PhysicalDeviceSamplerFilterMinmaxProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceInlineUniformBlockFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceInlineUniformBlockFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -31804,8 +32391,8 @@ func (x *PhysicalDeviceInlineUniformBlockFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceInlineUniformBlockPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceInlineUniformBlockPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -31915,8 +32502,8 @@ func (x *PhysicalDeviceInlineUniformBlockProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocWriteDescriptorSetInlineUniformBlockMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfWriteDescriptorSetInlineUniformBlockValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -32011,8 +32598,8 @@ func (x *WriteDescriptorSetInlineUniformBlock) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorPoolInlineUniformBlockCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorPoolInlineUniformBlockCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -32102,8 +32689,8 @@ func (x *DescriptorPoolInlineUniformBlockCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSampleLocationMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSampleLocationValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -32188,8 +32775,8 @@ func (x *SampleLocation) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSampleLocationsInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSampleLocationsInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -32202,8 +32789,8 @@ func unpackSSampleLocation(x []SampleLocation) (unpacked *C.VkSampleLocationEXT, return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSampleLocationEXT) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -32332,8 +32919,8 @@ func (x *SampleLocationsInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocAttachmentSampleLocationsMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfAttachmentSampleLocationsValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -32418,8 +33005,8 @@ func (x *AttachmentSampleLocations) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocSubpassSampleLocationsMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfSubpassSampleLocationsValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -32504,8 +33091,8 @@ func (x *SubpassSampleLocations) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocRenderPassSampleLocationsBeginInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRenderPassSampleLocationsBeginInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -32518,8 +33105,8 @@ func unpackSAttachmentSampleLocations(x []AttachmentSampleLocations) (unpacked * return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkAttachmentSampleLocationsEXT) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -32547,8 +33134,8 @@ func unpackSSubpassSampleLocations(x []SubpassSampleLocations) (unpacked *C.VkSu return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSubpassSampleLocationsEXT) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -32686,8 +33273,8 @@ func (x *RenderPassSampleLocationsBeginInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineSampleLocationsStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineSampleLocationsStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -32782,8 +33369,8 @@ func (x *PipelineSampleLocationsStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceSampleLocationsPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceSampleLocationsPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -32893,8 +33480,8 @@ func (x *PhysicalDeviceSampleLocationsProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMultisamplePropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMultisamplePropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -32984,8 +33571,8 @@ func (x *MultisampleProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceBlendOperationAdvancedFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceBlendOperationAdvancedFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -33075,8 +33662,8 @@ func (x *PhysicalDeviceBlendOperationAdvancedFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceBlendOperationAdvancedPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceBlendOperationAdvancedPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -33191,8 +33778,8 @@ func (x *PhysicalDeviceBlendOperationAdvancedProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineColorBlendAdvancedStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineColorBlendAdvancedStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -33292,8 +33879,8 @@ func (x *PipelineColorBlendAdvancedStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineCoverageToColorStateCreateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineCoverageToColorStateCreateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -33393,8 +33980,8 @@ func (x *PipelineCoverageToColorStateCreateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineCoverageModulationStateCreateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineCoverageModulationStateCreateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -33467,7 +34054,7 @@ func (x *PipelineCoverageModulationStateCreateInfoNV) PassRef() (*C.VkPipelineCo allocsa081b0ea.Borrow(ccoverageModulationTableCount_allocs) var cpCoverageModulationTable_allocs *cgoAllocMap - refa081b0ea.pCoverageModulationTable, cpCoverageModulationTable_allocs = (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PCoverageModulationTable)).Data)), cgoAllocsUnknown + refa081b0ea.pCoverageModulationTable, cpCoverageModulationTable_allocs = copyPFloatBytes((*sliceHeader)(unsafe.Pointer(&x.PCoverageModulationTable))) allocsa081b0ea.Borrow(cpCoverageModulationTable_allocs) x.refa081b0ea = refa081b0ea @@ -33508,8 +34095,8 @@ func (x *PipelineCoverageModulationStateCreateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDrmFormatModifierPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDrmFormatModifierPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -33590,7 +34177,7 @@ func (x *DrmFormatModifierProperties) Deref() { if x.ref7dcb7f85 == nil { return } - x.DrmFormatModifier = (uint64)(x.ref7dcb7f85.drmFormatModifier) + x.DrmFormatModifier = (uint32)(x.ref7dcb7f85.drmFormatModifier) x.DrmFormatModifierPlaneCount = (uint32)(x.ref7dcb7f85.drmFormatModifierPlaneCount) x.DrmFormatModifierTilingFeatures = (FormatFeatureFlags)(x.ref7dcb7f85.drmFormatModifierTilingFeatures) } @@ -33599,8 +34186,8 @@ func (x *DrmFormatModifierProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDrmFormatModifierPropertiesListMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDrmFormatModifierPropertiesListValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -33613,8 +34200,8 @@ func unpackSDrmFormatModifierProperties(x []DrmFormatModifierProperties) (unpack return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkDrmFormatModifierPropertiesEXT) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -33733,8 +34320,8 @@ func (x *DrmFormatModifierPropertiesList) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceImageDrmFormatModifierInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceImageDrmFormatModifierInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -33803,7 +34390,7 @@ func (x *PhysicalDeviceImageDrmFormatModifierInfo) PassRef() (*C.VkPhysicalDevic allocsd7abef44.Borrow(cqueueFamilyIndexCount_allocs) var cpQueueFamilyIndices_allocs *cgoAllocMap - refd7abef44.pQueueFamilyIndices, cpQueueFamilyIndices_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PQueueFamilyIndices)).Data)), cgoAllocsUnknown + refd7abef44.pQueueFamilyIndices, cpQueueFamilyIndices_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PQueueFamilyIndices))) allocsd7abef44.Borrow(cpQueueFamilyIndices_allocs) x.refd7abef44 = refd7abef44 @@ -33829,7 +34416,7 @@ func (x *PhysicalDeviceImageDrmFormatModifierInfo) Deref() { } x.SType = (StructureType)(x.refd7abef44.sType) x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.refd7abef44.pNext)) - x.DrmFormatModifier = (uint64)(x.refd7abef44.drmFormatModifier) + x.DrmFormatModifier = (uint32)(x.refd7abef44.drmFormatModifier) x.SharingMode = (SharingMode)(x.refd7abef44.sharingMode) x.QueueFamilyIndexCount = (uint32)(x.refd7abef44.queueFamilyIndexCount) hxf44d909 := (*sliceHeader)(unsafe.Pointer(&x.PQueueFamilyIndices)) @@ -33843,14 +34430,43 @@ func (x *PhysicalDeviceImageDrmFormatModifierInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageDrmFormatModifierListCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageDrmFormatModifierListCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfImageDrmFormatModifierListCreateInfoValue = unsafe.Sizeof([1]C.VkImageDrmFormatModifierListCreateInfoEXT{}) +// copyPUint64_tBytes copies the data from Go slice as *C.uint64_t. +func copyPUint64_tBytes(slice *sliceHeader) (*C.uint64_t, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfUint64_tValue) * slice.Len, + Cap: int(sizeOfUint64_tValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.uint64_t)(mem0), allocs +} + +// allocUint64_tMemory allocates memory for type C.uint64_t in C. +// The caller is responsible for freeing the this memory via C.free. +func allocUint64_tMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfUint64_tValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfUint64_tValue = unsafe.Sizeof([1]C.uint64_t{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *ImageDrmFormatModifierListCreateInfo) Ref() *C.VkImageDrmFormatModifierListCreateInfoEXT { if x == nil { @@ -33905,7 +34521,7 @@ func (x *ImageDrmFormatModifierListCreateInfo) PassRef() (*C.VkImageDrmFormatMod allocs544538ab.Borrow(cdrmFormatModifierCount_allocs) var cpDrmFormatModifiers_allocs *cgoAllocMap - ref544538ab.pDrmFormatModifiers, cpDrmFormatModifiers_allocs = (*C.uint64_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PDrmFormatModifiers)).Data)), cgoAllocsUnknown + ref544538ab.pDrmFormatModifiers, cpDrmFormatModifiers_allocs = copyPUint64_tBytes((*sliceHeader)(unsafe.Pointer(&x.PDrmFormatModifiers))) allocs544538ab.Borrow(cpDrmFormatModifiers_allocs) x.ref544538ab = ref544538ab @@ -33943,8 +34559,8 @@ func (x *ImageDrmFormatModifierListCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageDrmFormatModifierExplicitCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageDrmFormatModifierExplicitCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -33957,8 +34573,8 @@ func unpackSSubresourceLayout(x []SubresourceLayout) (unpacked *C.VkSubresourceL return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSubresourceLayout) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -34073,7 +34689,7 @@ func (x *ImageDrmFormatModifierExplicitCreateInfo) Deref() { } x.SType = (StructureType)(x.ref8fb45ca9.sType) x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.ref8fb45ca9.pNext)) - x.DrmFormatModifier = (uint64)(x.ref8fb45ca9.drmFormatModifier) + x.DrmFormatModifier = (uint32)(x.ref8fb45ca9.drmFormatModifier) x.DrmFormatModifierPlaneCount = (uint32)(x.ref8fb45ca9.drmFormatModifierPlaneCount) packSSubresourceLayout(x.PPlaneLayouts, x.ref8fb45ca9.pPlaneLayouts) } @@ -34082,8 +34698,8 @@ func (x *ImageDrmFormatModifierExplicitCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImageDrmFormatModifierPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageDrmFormatModifierPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -34166,15 +34782,15 @@ func (x *ImageDrmFormatModifierProperties) Deref() { } x.SType = (StructureType)(x.ref86a0f149.sType) x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.ref86a0f149.pNext)) - x.DrmFormatModifier = (uint64)(x.ref86a0f149.drmFormatModifier) + x.DrmFormatModifier = (uint32)(x.ref86a0f149.drmFormatModifier) } // allocValidationCacheCreateInfoMemory allocates memory for type C.VkValidationCacheCreateInfoEXT in C. // The caller is responsible for freeing the this memory via C.free. func allocValidationCacheCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfValidationCacheCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -34266,7 +34882,7 @@ func (x *ValidationCacheCreateInfo) Deref() { x.SType = (StructureType)(x.ref3d8ac8aa.sType) x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.ref3d8ac8aa.pNext)) x.Flags = (ValidationCacheCreateFlags)(x.ref3d8ac8aa.flags) - x.InitialDataSize = (uint)(x.ref3d8ac8aa.initialDataSize) + x.InitialDataSize = (uint32)(x.ref3d8ac8aa.initialDataSize) x.PInitialData = (unsafe.Pointer)(unsafe.Pointer(x.ref3d8ac8aa.pInitialData)) } @@ -34274,8 +34890,8 @@ func (x *ValidationCacheCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocShaderModuleValidationCacheCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfShaderModuleValidationCacheCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -34365,14 +34981,43 @@ func (x *ShaderModuleValidationCacheCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorSetLayoutBindingFlagsCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorSetLayoutBindingFlagsCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfDescriptorSetLayoutBindingFlagsCreateInfoValue = unsafe.Sizeof([1]C.VkDescriptorSetLayoutBindingFlagsCreateInfoEXT{}) +// copyPDescriptorBindingFlagsBytes copies the data from Go slice as *C.VkDescriptorBindingFlagsEXT. +func copyPDescriptorBindingFlagsBytes(slice *sliceHeader) (*C.VkDescriptorBindingFlagsEXT, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfDescriptorBindingFlagsValue) * slice.Len, + Cap: int(sizeOfDescriptorBindingFlagsValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkDescriptorBindingFlagsEXT)(mem0), allocs +} + +// allocDescriptorBindingFlagsMemory allocates memory for type C.VkDescriptorBindingFlagsEXT in C. +// The caller is responsible for freeing the this memory via C.free. +func allocDescriptorBindingFlagsMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorBindingFlagsValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfDescriptorBindingFlagsValue = unsafe.Sizeof([1]C.VkDescriptorBindingFlagsEXT{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *DescriptorSetLayoutBindingFlagsCreateInfo) Ref() *C.VkDescriptorSetLayoutBindingFlagsCreateInfoEXT { if x == nil { @@ -34427,7 +35072,7 @@ func (x *DescriptorSetLayoutBindingFlagsCreateInfo) PassRef() (*C.VkDescriptorSe allocscb1cf42.Borrow(cbindingCount_allocs) var cpBindingFlags_allocs *cgoAllocMap - refcb1cf42.pBindingFlags, cpBindingFlags_allocs = (*C.VkDescriptorBindingFlagsEXT)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PBindingFlags)).Data)), cgoAllocsUnknown + refcb1cf42.pBindingFlags, cpBindingFlags_allocs = copyPDescriptorBindingFlagsBytes((*sliceHeader)(unsafe.Pointer(&x.PBindingFlags))) allocscb1cf42.Borrow(cpBindingFlags_allocs) x.refcb1cf42 = refcb1cf42 @@ -34465,8 +35110,8 @@ func (x *DescriptorSetLayoutBindingFlagsCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceDescriptorIndexingFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceDescriptorIndexingFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -34651,8 +35296,8 @@ func (x *PhysicalDeviceDescriptorIndexingFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceDescriptorIndexingPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceDescriptorIndexingPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -34852,8 +35497,8 @@ func (x *PhysicalDeviceDescriptorIndexingProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorSetVariableDescriptorCountAllocateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorSetVariableDescriptorCountAllocateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -34914,7 +35559,7 @@ func (x *DescriptorSetVariableDescriptorCountAllocateInfo) PassRef() (*C.VkDescr allocs65152aef.Borrow(cdescriptorSetCount_allocs) var cpDescriptorCounts_allocs *cgoAllocMap - ref65152aef.pDescriptorCounts, cpDescriptorCounts_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PDescriptorCounts)).Data)), cgoAllocsUnknown + ref65152aef.pDescriptorCounts, cpDescriptorCounts_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PDescriptorCounts))) allocs65152aef.Borrow(cpDescriptorCounts_allocs) x.ref65152aef = ref65152aef @@ -34952,8 +35597,8 @@ func (x *DescriptorSetVariableDescriptorCountAllocateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorSetVariableDescriptorCountLayoutSupportMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorSetVariableDescriptorCountLayoutSupportValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -35043,14 +35688,43 @@ func (x *DescriptorSetVariableDescriptorCountLayoutSupport) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocShadingRatePaletteNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfShadingRatePaletteNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfShadingRatePaletteNVValue = unsafe.Sizeof([1]C.VkShadingRatePaletteNV{}) +// copyPShadingRatePaletteEntryNVBytes copies the data from Go slice as *C.VkShadingRatePaletteEntryNV. +func copyPShadingRatePaletteEntryNVBytes(slice *sliceHeader) (*C.VkShadingRatePaletteEntryNV, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfShadingRatePaletteEntryNVValue) * slice.Len, + Cap: int(sizeOfShadingRatePaletteEntryNVValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkShadingRatePaletteEntryNV)(mem0), allocs +} + +// allocShadingRatePaletteEntryNVMemory allocates memory for type C.VkShadingRatePaletteEntryNV in C. +// The caller is responsible for freeing the this memory via C.free. +func allocShadingRatePaletteEntryNVMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfShadingRatePaletteEntryNVValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfShadingRatePaletteEntryNVValue = unsafe.Sizeof([1]C.VkShadingRatePaletteEntryNV{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *ShadingRatePaletteNV) Ref() *C.VkShadingRatePaletteNV { if x == nil { @@ -35097,7 +35771,7 @@ func (x *ShadingRatePaletteNV) PassRef() (*C.VkShadingRatePaletteNV, *cgoAllocMa allocsa5c4ae3a.Borrow(cshadingRatePaletteEntryCount_allocs) var cpShadingRatePaletteEntries_allocs *cgoAllocMap - refa5c4ae3a.pShadingRatePaletteEntries, cpShadingRatePaletteEntries_allocs = (*C.VkShadingRatePaletteEntryNV)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PShadingRatePaletteEntries)).Data)), cgoAllocsUnknown + refa5c4ae3a.pShadingRatePaletteEntries, cpShadingRatePaletteEntries_allocs = copyPShadingRatePaletteEntryNVBytes((*sliceHeader)(unsafe.Pointer(&x.PShadingRatePaletteEntries))) allocsa5c4ae3a.Borrow(cpShadingRatePaletteEntries_allocs) x.refa5c4ae3a = refa5c4ae3a @@ -35133,8 +35807,8 @@ func (x *ShadingRatePaletteNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineViewportShadingRateImageStateCreateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineViewportShadingRateImageStateCreateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -35147,8 +35821,8 @@ func unpackSShadingRatePaletteNV(x []ShadingRatePaletteNV) (unpacked *C.VkShadin return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkShadingRatePaletteNV) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -35272,8 +35946,8 @@ func (x *PipelineViewportShadingRateImageStateCreateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceShadingRateImageFeaturesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceShadingRateImageFeaturesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -35368,8 +36042,8 @@ func (x *PhysicalDeviceShadingRateImageFeaturesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceShadingRateImagePropertiesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceShadingRateImagePropertiesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -35469,8 +36143,8 @@ func (x *PhysicalDeviceShadingRateImagePropertiesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCoarseSampleLocationNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCoarseSampleLocationNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -35560,8 +36234,8 @@ func (x *CoarseSampleLocationNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCoarseSampleOrderCustomNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCoarseSampleOrderCustomNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -35574,8 +36248,8 @@ func unpackSCoarseSampleLocationNV(x []CoarseSampleLocationNV) (unpacked *C.VkCo return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkCoarseSampleLocationNV) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -35694,8 +36368,8 @@ func (x *CoarseSampleOrderCustomNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineViewportCoarseSampleOrderStateCreateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineViewportCoarseSampleOrderStateCreateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -35708,8 +36382,8 @@ func unpackSCoarseSampleOrderCustomNV(x []CoarseSampleOrderCustomNV) (unpacked * return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkCoarseSampleOrderCustomNV) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -35833,8 +36507,8 @@ func (x *PipelineViewportCoarseSampleOrderStateCreateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocRaytracingPipelineCreateInfoNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRaytracingPipelineCreateInfoNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -35903,7 +36577,7 @@ func (x *RaytracingPipelineCreateInfoNVX) PassRef() (*C.VkRaytracingPipelineCrea allocs4d91852a.Borrow(cpStages_allocs) var cpGroupNumbers_allocs *cgoAllocMap - ref4d91852a.pGroupNumbers, cpGroupNumbers_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PGroupNumbers)).Data)), cgoAllocsUnknown + ref4d91852a.pGroupNumbers, cpGroupNumbers_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PGroupNumbers))) allocs4d91852a.Borrow(cpGroupNumbers_allocs) var cmaxRecursionDepth_allocs *cgoAllocMap @@ -35963,8 +36637,8 @@ func (x *RaytracingPipelineCreateInfoNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocGeometryTrianglesNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfGeometryTrianglesNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -36104,8 +36778,8 @@ func (x *GeometryTrianglesNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocGeometryAABBNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfGeometryAABBNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -36210,8 +36884,8 @@ func (x *GeometryAABBNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocGeometryDataNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfGeometryDataNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -36296,8 +36970,8 @@ func (x *GeometryDataNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocGeometryNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfGeometryNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -36397,8 +37071,8 @@ func (x *GeometryNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocAccelerationStructureCreateInfoNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfAccelerationStructureCreateInfoNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -36411,8 +37085,8 @@ func unpackSGeometryNVX(x []GeometryNVX) (unpacked *C.VkGeometryNVX, allocs *cgo return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkGeometryNVX) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -36551,8 +37225,8 @@ func (x *AccelerationStructureCreateInfoNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocBindAccelerationStructureMemoryInfoNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBindAccelerationStructureMemoryInfoNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -36625,7 +37299,7 @@ func (x *BindAccelerationStructureMemoryInfoNVX) PassRef() (*C.VkBindAcceleratio allocsb92eae10.Borrow(cdeviceIndexCount_allocs) var cpDeviceIndices_allocs *cgoAllocMap - refb92eae10.pDeviceIndices, cpDeviceIndices_allocs = (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PDeviceIndices)).Data)), cgoAllocsUnknown + refb92eae10.pDeviceIndices, cpDeviceIndices_allocs = copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&x.PDeviceIndices))) allocsb92eae10.Borrow(cpDeviceIndices_allocs) x.refb92eae10 = refb92eae10 @@ -36666,14 +37340,43 @@ func (x *BindAccelerationStructureMemoryInfoNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDescriptorAccelerationStructureInfoNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorAccelerationStructureInfoNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } const sizeOfDescriptorAccelerationStructureInfoNVXValue = unsafe.Sizeof([1]C.VkDescriptorAccelerationStructureInfoNVX{}) +// copyPAccelerationStructureNVXBytes copies the data from Go slice as *C.VkAccelerationStructureNVX. +func copyPAccelerationStructureNVXBytes(slice *sliceHeader) (*C.VkAccelerationStructureNVX, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfAccelerationStructureNVXValue) * slice.Len, + Cap: int(sizeOfAccelerationStructureNVXValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkAccelerationStructureNVX)(mem0), allocs +} + +// allocAccelerationStructureNVXMemory allocates memory for type C.VkAccelerationStructureNVX in C. +// The caller is responsible for freeing the this memory via C.free. +func allocAccelerationStructureNVXMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfAccelerationStructureNVXValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfAccelerationStructureNVXValue = unsafe.Sizeof([1]C.VkAccelerationStructureNVX{}) + // Ref returns the underlying reference to C object or nil if struct is nil. func (x *DescriptorAccelerationStructureInfoNVX) Ref() *C.VkDescriptorAccelerationStructureInfoNVX { if x == nil { @@ -36728,7 +37431,7 @@ func (x *DescriptorAccelerationStructureInfoNVX) PassRef() (*C.VkDescriptorAccel allocsde5f3ba5.Borrow(caccelerationStructureCount_allocs) var cpAccelerationStructures_allocs *cgoAllocMap - refde5f3ba5.pAccelerationStructures, cpAccelerationStructures_allocs = (*C.VkAccelerationStructureNVX)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&x.PAccelerationStructures)).Data)), cgoAllocsUnknown + refde5f3ba5.pAccelerationStructures, cpAccelerationStructures_allocs = copyPAccelerationStructureNVXBytes((*sliceHeader)(unsafe.Pointer(&x.PAccelerationStructures))) allocsde5f3ba5.Borrow(cpAccelerationStructures_allocs) x.refde5f3ba5 = refde5f3ba5 @@ -36766,8 +37469,8 @@ func (x *DescriptorAccelerationStructureInfoNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocAccelerationStructureMemoryRequirementsInfoNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfAccelerationStructureMemoryRequirementsInfoNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -36857,8 +37560,8 @@ func (x *AccelerationStructureMemoryRequirementsInfoNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceRaytracingPropertiesNVXMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceRaytracingPropertiesNVXValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -36958,8 +37661,8 @@ func (x *PhysicalDeviceRaytracingPropertiesNVX) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceRepresentativeFragmentTestFeaturesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceRepresentativeFragmentTestFeaturesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -37049,8 +37752,8 @@ func (x *PhysicalDeviceRepresentativeFragmentTestFeaturesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineRepresentativeFragmentTestStateCreateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineRepresentativeFragmentTestStateCreateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -37140,8 +37843,8 @@ func (x *PipelineRepresentativeFragmentTestStateCreateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDeviceQueueGlobalPriorityCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceQueueGlobalPriorityCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -37231,8 +37934,8 @@ func (x *DeviceQueueGlobalPriorityCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocImportMemoryHostPointerInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImportMemoryHostPointerInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -37327,8 +38030,8 @@ func (x *ImportMemoryHostPointerInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocMemoryHostPointerPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfMemoryHostPointerPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -37418,8 +38121,8 @@ func (x *MemoryHostPointerProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceExternalMemoryHostPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceExternalMemoryHostPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -37509,8 +38212,8 @@ func (x *PhysicalDeviceExternalMemoryHostProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCalibratedTimestampInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCalibratedTimestampInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -37600,8 +38303,8 @@ func (x *CalibratedTimestampInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceShaderCorePropertiesAMDMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceShaderCorePropertiesAMDValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -37756,8 +38459,8 @@ func (x *PhysicalDeviceShaderCorePropertiesAMD) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceVertexAttributeDivisorPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceVertexAttributeDivisorPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -37847,8 +38550,8 @@ func (x *PhysicalDeviceVertexAttributeDivisorProperties) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocVertexInputBindingDivisorDescriptionMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfVertexInputBindingDivisorDescriptionValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -37933,8 +38636,8 @@ func (x *VertexInputBindingDivisorDescription) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineVertexInputDivisorStateCreateInfoMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineVertexInputDivisorStateCreateInfoValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -37947,8 +38650,8 @@ func unpackSVertexInputBindingDivisorDescription(x []VertexInputBindingDivisorDe return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkVertexInputBindingDivisorDescriptionEXT) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -38067,8 +38770,8 @@ func (x *PipelineVertexInputDivisorStateCreateInfo) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceVertexAttributeDivisorFeaturesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceVertexAttributeDivisorFeaturesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -38163,8 +38866,8 @@ func (x *PhysicalDeviceVertexAttributeDivisorFeatures) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceComputeShaderDerivativesFeaturesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceComputeShaderDerivativesFeaturesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -38259,8 +38962,8 @@ func (x *PhysicalDeviceComputeShaderDerivativesFeaturesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceMeshShaderFeaturesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceMeshShaderFeaturesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -38355,8 +39058,8 @@ func (x *PhysicalDeviceMeshShaderFeaturesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceMeshShaderPropertiesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceMeshShaderPropertiesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -38506,8 +39209,8 @@ func (x *PhysicalDeviceMeshShaderPropertiesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocDrawMeshTasksIndirectCommandNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDrawMeshTasksIndirectCommandNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -38592,8 +39295,8 @@ func (x *DrawMeshTasksIndirectCommandNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceFragmentShaderBarycentricFeaturesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceFragmentShaderBarycentricFeaturesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -38683,8 +39386,8 @@ func (x *PhysicalDeviceFragmentShaderBarycentricFeaturesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceShaderImageFootprintFeaturesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceShaderImageFootprintFeaturesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -38774,8 +39477,8 @@ func (x *PhysicalDeviceShaderImageFootprintFeaturesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPipelineViewportExclusiveScissorStateCreateInfoNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineViewportExclusiveScissorStateCreateInfoNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -38870,8 +39573,8 @@ func (x *PipelineViewportExclusiveScissorStateCreateInfoNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDeviceExclusiveScissorFeaturesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDeviceExclusiveScissorFeaturesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -38961,8 +39664,8 @@ func (x *PhysicalDeviceExclusiveScissorFeaturesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocQueueFamilyCheckpointPropertiesNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfQueueFamilyCheckpointPropertiesNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -39052,8 +39755,8 @@ func (x *QueueFamilyCheckpointPropertiesNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocCheckpointDataNVMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfCheckpointDataNVValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -39148,8 +39851,8 @@ func (x *CheckpointDataNV) Deref() { // The caller is responsible for freeing the this memory via C.free. func allocPhysicalDevicePCIBusInfoPropertiesMemory(n int) unsafe.Pointer { mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPhysicalDevicePCIBusInfoPropertiesValue)) - if err != nil { - panic("memory alloc error: " + err.Error()) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) } return mem } @@ -39256,8 +39959,8 @@ func unpackArgSQueueFamilyProperties(x []QueueFamilyProperties) (unpacked *C.VkQ return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkQueueFamilyProperties) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39294,8 +39997,8 @@ func unpackArgSExtensionProperties(x []ExtensionProperties) (unpacked *C.VkExten return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkExtensionProperties) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39332,8 +40035,8 @@ func unpackArgSLayerProperties(x []LayerProperties) (unpacked *C.VkLayerProperti return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkLayerProperties) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39370,8 +40073,8 @@ func unpackArgSSubmitInfo(x []SubmitInfo) (unpacked *C.VkSubmitInfo, allocs *cgo return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSubmitInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39408,8 +40111,8 @@ func unpackArgSMappedMemoryRange(x []MappedMemoryRange) (unpacked *C.VkMappedMem return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkMappedMemoryRange) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39446,8 +40149,8 @@ func unpackArgSSparseImageMemoryRequirements(x []SparseImageMemoryRequirements) return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSparseImageMemoryRequirements) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39484,8 +40187,8 @@ func unpackArgSSparseImageFormatProperties(x []SparseImageFormatProperties) (unp return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSparseImageFormatProperties) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39522,8 +40225,8 @@ func unpackArgSBindSparseInfo(x []BindSparseInfo) (unpacked *C.VkBindSparseInfo, return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkBindSparseInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39554,14 +40257,72 @@ func packSBindSparseInfo(v []BindSparseInfo, ptr0 *C.VkBindSparseInfo) { } } +// copyPFenceBytes copies the data from Go slice as *C.VkFence. +func copyPFenceBytes(slice *sliceHeader) (*C.VkFence, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfFenceValue) * slice.Len, + Cap: int(sizeOfFenceValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkFence)(mem0), allocs +} + +// allocFenceMemory allocates memory for type C.VkFence in C. +// The caller is responsible for freeing the this memory via C.free. +func allocFenceMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfFenceValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfFenceValue = unsafe.Sizeof([1]C.VkFence{}) + +// copyPPipelineCacheBytes copies the data from Go slice as *C.VkPipelineCache. +func copyPPipelineCacheBytes(slice *sliceHeader) (*C.VkPipelineCache, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfPipelineCacheValue) * slice.Len, + Cap: int(sizeOfPipelineCacheValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkPipelineCache)(mem0), allocs +} + +// allocPipelineCacheMemory allocates memory for type C.VkPipelineCache in C. +// The caller is responsible for freeing the this memory via C.free. +func allocPipelineCacheMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineCacheValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfPipelineCacheValue = unsafe.Sizeof([1]C.VkPipelineCache{}) + // unpackArgSGraphicsPipelineCreateInfo transforms a sliced Go data structure into plain C format. func unpackArgSGraphicsPipelineCreateInfo(x []GraphicsPipelineCreateInfo) (unpacked *C.VkGraphicsPipelineCreateInfo, allocs *cgoAllocMap) { if x == nil { return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkGraphicsPipelineCreateInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39592,14 +40353,43 @@ func packSGraphicsPipelineCreateInfo(v []GraphicsPipelineCreateInfo, ptr0 *C.VkG } } +// copyPPipelineBytes copies the data from Go slice as *C.VkPipeline. +func copyPPipelineBytes(slice *sliceHeader) (*C.VkPipeline, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfPipelineValue) * slice.Len, + Cap: int(sizeOfPipelineValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkPipeline)(mem0), allocs +} + +// allocPipelineMemory allocates memory for type C.VkPipeline in C. +// The caller is responsible for freeing the this memory via C.free. +func allocPipelineMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPipelineValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfPipelineValue = unsafe.Sizeof([1]C.VkPipeline{}) + // unpackArgSComputePipelineCreateInfo transforms a sliced Go data structure into plain C format. func unpackArgSComputePipelineCreateInfo(x []ComputePipelineCreateInfo) (unpacked *C.VkComputePipelineCreateInfo, allocs *cgoAllocMap) { if x == nil { return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkComputePipelineCreateInfo) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39636,8 +40426,8 @@ func unpackArgSWriteDescriptorSet(x []WriteDescriptorSet) (unpacked *C.VkWriteDe return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkWriteDescriptorSet) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39674,8 +40464,8 @@ func unpackArgSCopyDescriptorSet(x []CopyDescriptorSet) (unpacked *C.VkCopyDescr return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkCopyDescriptorSet) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39712,8 +40502,8 @@ func unpackArgSViewport(x []Viewport) (unpacked *C.VkViewport, allocs *cgoAllocM return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkViewport) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39741,8 +40531,8 @@ func unpackArgSRect2D(x []Rect2D) (unpacked *C.VkRect2D, allocs *cgoAllocMap) { return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkRect2D) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39764,14 +40554,101 @@ func unpackArgSRect2D(x []Rect2D) (unpacked *C.VkRect2D, allocs *cgoAllocMap) { return } +// copyPDescriptorSetBytes copies the data from Go slice as *C.VkDescriptorSet. +func copyPDescriptorSetBytes(slice *sliceHeader) (*C.VkDescriptorSet, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfDescriptorSetValue) * slice.Len, + Cap: int(sizeOfDescriptorSetValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkDescriptorSet)(mem0), allocs +} + +// allocDescriptorSetMemory allocates memory for type C.VkDescriptorSet in C. +// The caller is responsible for freeing the this memory via C.free. +func allocDescriptorSetMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDescriptorSetValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfDescriptorSetValue = unsafe.Sizeof([1]C.VkDescriptorSet{}) + +// copyPBufferBytes copies the data from Go slice as *C.VkBuffer. +func copyPBufferBytes(slice *sliceHeader) (*C.VkBuffer, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfBufferValue) * slice.Len, + Cap: int(sizeOfBufferValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkBuffer)(mem0), allocs +} + +// allocBufferMemory allocates memory for type C.VkBuffer in C. +// The caller is responsible for freeing the this memory via C.free. +func allocBufferMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBufferValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfBufferValue = unsafe.Sizeof([1]C.VkBuffer{}) + +// copyPDeviceSizeBytes copies the data from Go slice as *C.VkDeviceSize. +func copyPDeviceSizeBytes(slice *sliceHeader) (*C.VkDeviceSize, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfDeviceSizeValue) * slice.Len, + Cap: int(sizeOfDeviceSizeValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkDeviceSize)(mem0), allocs +} + +// allocDeviceSizeMemory allocates memory for type C.VkDeviceSize in C. +// The caller is responsible for freeing the this memory via C.free. +func allocDeviceSizeMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDeviceSizeValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfDeviceSizeValue = unsafe.Sizeof([1]C.VkDeviceSize{}) + // unpackArgSBufferCopy transforms a sliced Go data structure into plain C format. func unpackArgSBufferCopy(x []BufferCopy) (unpacked *C.VkBufferCopy, allocs *cgoAllocMap) { if x == nil { return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkBufferCopy) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39808,8 +40685,8 @@ func unpackArgSImageCopy(x []ImageCopy) (unpacked *C.VkImageCopy, allocs *cgoAll return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkImageCopy) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39846,8 +40723,8 @@ func unpackArgSImageBlit(x []ImageBlit) (unpacked *C.VkImageBlit, allocs *cgoAll return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkImageBlit) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39884,8 +40761,8 @@ func unpackArgSBufferImageCopy(x []BufferImageCopy) (unpacked *C.VkBufferImageCo return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkBufferImageCopy) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39922,8 +40799,8 @@ func unpackArgSImageSubresourceRange(x []ImageSubresourceRange) (unpacked *C.VkI return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkImageSubresourceRange) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39960,8 +40837,8 @@ func unpackArgSClearAttachment(x []ClearAttachment) (unpacked *C.VkClearAttachme return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkClearAttachment) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -39998,8 +40875,8 @@ func unpackArgSClearRect(x []ClearRect) (unpacked *C.VkClearRect, allocs *cgoAll return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkClearRect) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -40036,8 +40913,8 @@ func unpackArgSImageResolve(x []ImageResolve) (unpacked *C.VkImageResolve, alloc return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkImageResolve) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -40068,14 +40945,43 @@ func packSImageResolve(v []ImageResolve, ptr0 *C.VkImageResolve) { } } +// copyPEventBytes copies the data from Go slice as *C.VkEvent. +func copyPEventBytes(slice *sliceHeader) (*C.VkEvent, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfEventValue) * slice.Len, + Cap: int(sizeOfEventValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkEvent)(mem0), allocs +} + +// allocEventMemory allocates memory for type C.VkEvent in C. +// The caller is responsible for freeing the this memory via C.free. +func allocEventMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfEventValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfEventValue = unsafe.Sizeof([1]C.VkEvent{}) + // unpackArgSMemoryBarrier transforms a sliced Go data structure into plain C format. func unpackArgSMemoryBarrier(x []MemoryBarrier) (unpacked *C.VkMemoryBarrier, allocs *cgoAllocMap) { if x == nil { return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkMemoryBarrier) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -40112,8 +41018,8 @@ func unpackArgSBufferMemoryBarrier(x []BufferMemoryBarrier) (unpacked *C.VkBuffe return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkBufferMemoryBarrier) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -40150,8 +41056,8 @@ func unpackArgSImageMemoryBarrier(x []ImageMemoryBarrier) (unpacked *C.VkImageMe return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkImageMemoryBarrier) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -40188,8 +41094,8 @@ func unpackArgSSurfaceFormat(x []SurfaceFormat) (unpacked *C.VkSurfaceFormatKHR, return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSurfaceFormatKHR) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -40220,14 +41126,72 @@ func packSSurfaceFormat(v []SurfaceFormat, ptr0 *C.VkSurfaceFormatKHR) { } } +// copyPPresentModeBytes copies the data from Go slice as *C.VkPresentModeKHR. +func copyPPresentModeBytes(slice *sliceHeader) (*C.VkPresentModeKHR, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfPresentModeValue) * slice.Len, + Cap: int(sizeOfPresentModeValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkPresentModeKHR)(mem0), allocs +} + +// allocPresentModeMemory allocates memory for type C.VkPresentModeKHR in C. +// The caller is responsible for freeing the this memory via C.free. +func allocPresentModeMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPresentModeValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfPresentModeValue = unsafe.Sizeof([1]C.VkPresentModeKHR{}) + +// copyPImageBytes copies the data from Go slice as *C.VkImage. +func copyPImageBytes(slice *sliceHeader) (*C.VkImage, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfImageValue) * slice.Len, + Cap: int(sizeOfImageValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkImage)(mem0), allocs +} + +// allocImageMemory allocates memory for type C.VkImage in C. +// The caller is responsible for freeing the this memory via C.free. +func allocImageMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfImageValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfImageValue = unsafe.Sizeof([1]C.VkImage{}) + // unpackArgSDisplayProperties transforms a sliced Go data structure into plain C format. func unpackArgSDisplayProperties(x []DisplayProperties) (unpacked *C.VkDisplayPropertiesKHR, allocs *cgoAllocMap) { if x == nil { return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkDisplayPropertiesKHR) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -40264,8 +41228,8 @@ func unpackArgSDisplayPlaneProperties(x []DisplayPlaneProperties) (unpacked *C.V return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkDisplayPlanePropertiesKHR) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -40296,14 +41260,43 @@ func packSDisplayPlaneProperties(v []DisplayPlaneProperties, ptr0 *C.VkDisplayPl } } +// copyPDisplayBytes copies the data from Go slice as *C.VkDisplayKHR. +func copyPDisplayBytes(slice *sliceHeader) (*C.VkDisplayKHR, *cgoAllocMap) { + allocs := new(cgoAllocMap) + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() + }) + + mem0 := unsafe.Pointer(C.CBytes(*(*[]byte)(unsafe.Pointer(&sliceHeader{ + Data: slice.Data, + Len: int(sizeOfDisplayValue) * slice.Len, + Cap: int(sizeOfDisplayValue) * slice.Len, + })))) + allocs.Add(mem0) + + return (*C.VkDisplayKHR)(mem0), allocs +} + +// allocDisplayMemory allocates memory for type C.VkDisplayKHR in C. +// The caller is responsible for freeing the this memory via C.free. +func allocDisplayMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDisplayValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfDisplayValue = unsafe.Sizeof([1]C.VkDisplayKHR{}) + // unpackArgSDisplayModeProperties transforms a sliced Go data structure into plain C format. func unpackArgSDisplayModeProperties(x []DisplayModeProperties) (unpacked *C.VkDisplayModePropertiesKHR, allocs *cgoAllocMap) { if x == nil { return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkDisplayModePropertiesKHR) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) @@ -40340,8 +41333,8 @@ func unpackArgSSwapchainCreateInfo(x []SwapchainCreateInfo) (unpacked *C.VkSwapc return nil, nil } allocs = new(cgoAllocMap) - defer runtime.SetFinalizer(&unpacked, func(**C.VkSwapchainCreateInfoKHR) { - go allocs.Free() + defer runtime.SetFinalizer(allocs, func(a *cgoAllocMap) { + go a.Free() }) len0 := len(x) diff --git a/cgo_helpers.h b/cgo_helpers.h index 78c2901..7f978cd 100644 --- a/cgo_helpers.h +++ b/cgo_helpers.h @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Mon, 15 Oct 2018 01:04:16 +07. +// WARNING: This file has automatically been generated on Tue, 05 Jan 2021 15:58:04 CET. // Code generated by https://git.io/c-for-go. DO NOT EDIT. #include "vulkan/vulkan.h" @@ -12,5 +12,5 @@ #define __CGOGEN 1 // PFN_vkDebugReportCallbackEXT_c918aac4 is a proxy for callback PFN_vkDebugReportCallbackEXT. -unsigned int PFN_vkDebugReportCallbackEXT_c918aac4(unsigned int flags, VkDebugReportObjectTypeEXT objectType, unsigned long long object, unsigned long int location, int messageCode, char* pLayerPrefix, char* pMessage, void* pUserData); +unsigned int PFN_vkDebugReportCallbackEXT_c918aac4(unsigned int flags, VkDebugReportObjectTypeEXT objectType, unsigned long int object, unsigned long int location, int messageCode, char* pLayerPrefix, char* pMessage, void* pUserData); diff --git a/const.go b/const.go index e48162e..7e511a4 100644 --- a/const.go +++ b/const.go @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Mon, 15 Oct 2018 01:04:16 +07. +// WARNING: This file has automatically been generated on Tue, 05 Jan 2021 15:58:04 CET. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package vulkan diff --git a/doc.go b/doc.go index 555e9be..cb24ecd 100644 --- a/doc.go +++ b/doc.go @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Mon, 15 Oct 2018 01:04:16 +07. +// WARNING: This file has automatically been generated on Tue, 05 Jan 2021 15:58:04 CET. // Code generated by https://git.io/c-for-go. DO NOT EDIT. /* diff --git a/types.go b/types.go index 7c83fae..1a5cd2d 100644 --- a/types.go +++ b/types.go @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Mon, 15 Oct 2018 01:04:16 +07. +// WARNING: This file has automatically been generated on Tue, 05 Jan 2021 15:58:04 CET. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package vulkan @@ -23,7 +23,7 @@ type Flags uint32 type Bool32 uint32 // DeviceSize type as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/VkDeviceSize.html -type DeviceSize uint64 +type DeviceSize uint32 // SampleMask type as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/VkSampleMask.html type SampleMask uint32 @@ -465,7 +465,7 @@ type PhysicalDeviceLimits struct { MaxViewportDimensions [2]uint32 ViewportBoundsRange [2]float32 ViewportSubPixelBits uint32 - MinMemoryMapAlignment uint + MinMemoryMapAlignment uint32 MinTexelBufferOffsetAlignment DeviceSize MinUniformBufferOffsetAlignment DeviceSize MinStorageBufferOffsetAlignment DeviceSize @@ -906,7 +906,7 @@ type ShaderModuleCreateInfo struct { SType StructureType PNext unsafe.Pointer Flags ShaderModuleCreateFlags - CodeSize uint + CodeSize uint32 PCode []uint32 refc663d23e *C.VkShaderModuleCreateInfo allocsc663d23e interface{} @@ -917,7 +917,7 @@ type PipelineCacheCreateInfo struct { SType StructureType PNext unsafe.Pointer Flags PipelineCacheCreateFlags - InitialDataSize uint + InitialDataSize uint32 PInitialData unsafe.Pointer reff11e7dd1 *C.VkPipelineCacheCreateInfo allocsf11e7dd1 interface{} @@ -927,7 +927,7 @@ type PipelineCacheCreateInfo struct { type SpecializationMapEntry struct { ConstantID uint32 Offset uint32 - Size uint + Size uint32 ref2fd815d1 *C.VkSpecializationMapEntry allocs2fd815d1 interface{} } @@ -936,7 +936,7 @@ type SpecializationMapEntry struct { type SpecializationInfo struct { MapEntryCount uint32 PMapEntries []SpecializationMapEntry - DataSize uint + DataSize uint32 PData unsafe.Pointer ref6bc395a3 *C.VkSpecializationInfo allocs6bc395a3 interface{} @@ -2211,8 +2211,8 @@ type DescriptorUpdateTemplateEntry struct { DstArrayElement uint32 DescriptorCount uint32 DescriptorType DescriptorType - Offset uint - Stride uint + Offset uint32 + Stride uint32 refabf78fb7 *C.VkDescriptorUpdateTemplateEntry allocsabf78fb7 interface{} } @@ -2510,7 +2510,7 @@ type AcquireNextImageInfo struct { SType StructureType PNext unsafe.Pointer Swapchain Swapchain - Timeout uint64 + Timeout uint32 Semaphore Semaphore Fence Fence DeviceMask uint32 @@ -3010,7 +3010,7 @@ type DebugReportCallback C.VkDebugReportCallbackEXT type DebugReportFlags uint32 // DebugReportCallbackFunc type as declared in vulkan/vulkan_core.h:6207 -type DebugReportCallbackFunc func(flags DebugReportFlags, objectType DebugReportObjectType, object uint64, location uint, messageCode int32, pLayerPrefix string, pMessage string, pUserData unsafe.Pointer) Bool32 +type DebugReportCallbackFunc func(flags DebugReportFlags, objectType DebugReportObjectType, object uint32, location uint32, messageCode int32, pLayerPrefix string, pMessage string, pUserData unsafe.Pointer) Bool32 // DebugReportCallbackCreateInfo as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/VkDebugReportCallbackCreateInfoEXT.html type DebugReportCallbackCreateInfo struct { @@ -3037,7 +3037,7 @@ type DebugMarkerObjectNameInfo struct { SType StructureType PNext unsafe.Pointer ObjectType DebugReportObjectType - Object uint64 + Object uint32 PObjectName string refe4983fab *C.VkDebugMarkerObjectNameInfoEXT allocse4983fab interface{} @@ -3048,9 +3048,9 @@ type DebugMarkerObjectTagInfo struct { SType StructureType PNext unsafe.Pointer ObjectType DebugReportObjectType - Object uint64 - TagName uint64 - TagSize uint + Object uint32 + TagName uint32 + TagSize uint32 PTag unsafe.Pointer refa41a5c3b *C.VkDebugMarkerObjectTagInfoEXT allocsa41a5c3b interface{} @@ -3149,8 +3149,8 @@ type ShaderResourceUsageAMD struct { NumUsedVgprs uint32 NumUsedSgprs uint32 LdsSizePerLocalWorkGroup uint32 - LdsUsageSizeInBytes uint - ScratchMemUsageInBytes uint + LdsUsageSizeInBytes uint32 + ScratchMemUsageInBytes uint32 ref8a688131 *C.VkShaderResourceUsageAMD allocs8a688131 interface{} } @@ -3499,7 +3499,7 @@ type SwapchainCounterCreateInfo struct { // RefreshCycleDurationGOOGLE as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/VkRefreshCycleDurationGOOGLE.html type RefreshCycleDurationGOOGLE struct { - RefreshDuration uint64 + RefreshDuration uint32 ref969cb55b *C.VkRefreshCycleDurationGOOGLE allocs969cb55b interface{} } @@ -3507,10 +3507,10 @@ type RefreshCycleDurationGOOGLE struct { // PastPresentationTimingGOOGLE as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/VkPastPresentationTimingGOOGLE.html type PastPresentationTimingGOOGLE struct { PresentID uint32 - DesiredPresentTime uint64 - ActualPresentTime uint64 - EarliestPresentTime uint64 - PresentMargin uint64 + DesiredPresentTime uint32 + ActualPresentTime uint32 + EarliestPresentTime uint32 + PresentMargin uint32 refac8cf1d8 *C.VkPastPresentationTimingGOOGLE allocsac8cf1d8 interface{} } @@ -3518,7 +3518,7 @@ type PastPresentationTimingGOOGLE struct { // PresentTimeGOOGLE as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/VkPresentTimeGOOGLE.html type PresentTimeGOOGLE struct { PresentID uint32 - DesiredPresentTime uint64 + DesiredPresentTime uint32 ref9cd90ade *C.VkPresentTimeGOOGLE allocs9cd90ade interface{} } @@ -3656,7 +3656,7 @@ type DebugUtilsObjectNameInfo struct { SType StructureType PNext unsafe.Pointer ObjectType ObjectType - ObjectHandle uint64 + ObjectHandle uint32 PObjectName string ref5e73c2db *C.VkDebugUtilsObjectNameInfoEXT allocs5e73c2db interface{} @@ -3667,9 +3667,9 @@ type DebugUtilsObjectTagInfo struct { SType StructureType PNext unsafe.Pointer ObjectType ObjectType - ObjectHandle uint64 - TagName uint64 - TagSize uint + ObjectHandle uint32 + TagName uint32 + TagSize uint32 PTag unsafe.Pointer ref9fd129cf *C.VkDebugUtilsObjectTagInfoEXT allocs9fd129cf interface{} @@ -3892,7 +3892,7 @@ type PipelineCoverageModulationStateCreateInfoNV struct { // DrmFormatModifierProperties as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/VkDrmFormatModifierPropertiesEXT.html type DrmFormatModifierProperties struct { - DrmFormatModifier uint64 + DrmFormatModifier uint32 DrmFormatModifierPlaneCount uint32 DrmFormatModifierTilingFeatures FormatFeatureFlags ref7dcb7f85 *C.VkDrmFormatModifierPropertiesEXT @@ -3913,7 +3913,7 @@ type DrmFormatModifierPropertiesList struct { type PhysicalDeviceImageDrmFormatModifierInfo struct { SType StructureType PNext unsafe.Pointer - DrmFormatModifier uint64 + DrmFormatModifier uint32 SharingMode SharingMode QueueFamilyIndexCount uint32 PQueueFamilyIndices []uint32 @@ -3926,7 +3926,7 @@ type ImageDrmFormatModifierListCreateInfo struct { SType StructureType PNext unsafe.Pointer DrmFormatModifierCount uint32 - PDrmFormatModifiers []uint64 + PDrmFormatModifiers []uint32 ref544538ab *C.VkImageDrmFormatModifierListCreateInfoEXT allocs544538ab interface{} } @@ -3935,7 +3935,7 @@ type ImageDrmFormatModifierListCreateInfo struct { type ImageDrmFormatModifierExplicitCreateInfo struct { SType StructureType PNext unsafe.Pointer - DrmFormatModifier uint64 + DrmFormatModifier uint32 DrmFormatModifierPlaneCount uint32 PPlaneLayouts []SubresourceLayout ref8fb45ca9 *C.VkImageDrmFormatModifierExplicitCreateInfoEXT @@ -3946,7 +3946,7 @@ type ImageDrmFormatModifierExplicitCreateInfo struct { type ImageDrmFormatModifierProperties struct { SType StructureType PNext unsafe.Pointer - DrmFormatModifier uint64 + DrmFormatModifier uint32 ref86a0f149 *C.VkImageDrmFormatModifierPropertiesEXT allocs86a0f149 interface{} } @@ -3962,7 +3962,7 @@ type ValidationCacheCreateInfo struct { SType StructureType PNext unsafe.Pointer Flags ValidationCacheCreateFlags - InitialDataSize uint + InitialDataSize uint32 PInitialData unsafe.Pointer ref3d8ac8aa *C.VkValidationCacheCreateInfoEXT allocs3d8ac8aa interface{} diff --git a/vulkan.go b/vulkan.go index a25c62f..881292e 100644 --- a/vulkan.go +++ b/vulkan.go @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Mon, 15 Oct 2018 01:04:16 +07. +// WARNING: This file has automatically been generated on Tue, 05 Jan 2021 15:58:04 CET. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package vulkan @@ -14,1588 +14,2201 @@ package vulkan #include "cgo_helpers.h" */ import "C" -import "unsafe" +import ( + "runtime" + "unsafe" +) // CreateInstance function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateInstance.html func CreateInstance(pCreateInfo *InstanceCreateInfo, pAllocator *AllocationCallbacks, pInstance *Instance) Result { - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpInstance, _ := (*C.VkInstance)(unsafe.Pointer(pInstance)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpInstance, cpInstanceAllocMap := (*C.VkInstance)(unsafe.Pointer(pInstance)), cgoAllocsUnknown __ret := C.callVkCreateInstance(cpCreateInfo, cpAllocator, cpInstance) + runtime.KeepAlive(cpInstanceAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) __v := (Result)(__ret) return __v } // DestroyInstance function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyInstance.html func DestroyInstance(instance Instance, pAllocator *AllocationCallbacks) { - cinstance, _ := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cinstance, cinstanceAllocMap := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyInstance(cinstance, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cinstanceAllocMap) } // EnumeratePhysicalDevices function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkEnumeratePhysicalDevices.html func EnumeratePhysicalDevices(instance Instance, pPhysicalDeviceCount *uint32, pPhysicalDevices []PhysicalDevice) Result { - cinstance, _ := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown - cpPhysicalDeviceCount, _ := (*C.uint32_t)(unsafe.Pointer(pPhysicalDeviceCount)), cgoAllocsUnknown - cpPhysicalDevices, _ := (*C.VkPhysicalDevice)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pPhysicalDevices)).Data)), cgoAllocsUnknown + cinstance, cinstanceAllocMap := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown + cpPhysicalDeviceCount, cpPhysicalDeviceCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pPhysicalDeviceCount)), cgoAllocsUnknown + cpPhysicalDevices, cpPhysicalDevicesAllocMap := copyPPhysicalDeviceBytes((*sliceHeader)(unsafe.Pointer(&pPhysicalDevices))) __ret := C.callVkEnumeratePhysicalDevices(cinstance, cpPhysicalDeviceCount, cpPhysicalDevices) + runtime.KeepAlive(cpPhysicalDevicesAllocMap) + runtime.KeepAlive(cpPhysicalDeviceCountAllocMap) + runtime.KeepAlive(cinstanceAllocMap) __v := (Result)(__ret) return __v } // GetPhysicalDeviceFeatures function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetPhysicalDeviceFeatures.html func GetPhysicalDeviceFeatures(physicalDevice PhysicalDevice, pFeatures *PhysicalDeviceFeatures) { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cpFeatures, _ := pFeatures.PassRef() + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cpFeatures, cpFeaturesAllocMap := pFeatures.PassRef() C.callVkGetPhysicalDeviceFeatures(cphysicalDevice, cpFeatures) + runtime.KeepAlive(cpFeaturesAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) } // GetPhysicalDeviceFormatProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetPhysicalDeviceFormatProperties.html func GetPhysicalDeviceFormatProperties(physicalDevice PhysicalDevice, format Format, pFormatProperties *FormatProperties) { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cformat, _ := (C.VkFormat)(format), cgoAllocsUnknown - cpFormatProperties, _ := pFormatProperties.PassRef() + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cformat, cformatAllocMap := (C.VkFormat)(format), cgoAllocsUnknown + cpFormatProperties, cpFormatPropertiesAllocMap := pFormatProperties.PassRef() C.callVkGetPhysicalDeviceFormatProperties(cphysicalDevice, cformat, cpFormatProperties) + runtime.KeepAlive(cpFormatPropertiesAllocMap) + runtime.KeepAlive(cformatAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) } // GetPhysicalDeviceImageFormatProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetPhysicalDeviceImageFormatProperties.html func GetPhysicalDeviceImageFormatProperties(physicalDevice PhysicalDevice, format Format, kind ImageType, tiling ImageTiling, usage ImageUsageFlags, flags ImageCreateFlags, pImageFormatProperties *ImageFormatProperties) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cformat, _ := (C.VkFormat)(format), cgoAllocsUnknown - ckind, _ := (C.VkImageType)(kind), cgoAllocsUnknown - ctiling, _ := (C.VkImageTiling)(tiling), cgoAllocsUnknown - cusage, _ := (C.VkImageUsageFlags)(usage), cgoAllocsUnknown - cflags, _ := (C.VkImageCreateFlags)(flags), cgoAllocsUnknown - cpImageFormatProperties, _ := pImageFormatProperties.PassRef() + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cformat, cformatAllocMap := (C.VkFormat)(format), cgoAllocsUnknown + ckind, ckindAllocMap := (C.VkImageType)(kind), cgoAllocsUnknown + ctiling, ctilingAllocMap := (C.VkImageTiling)(tiling), cgoAllocsUnknown + cusage, cusageAllocMap := (C.VkImageUsageFlags)(usage), cgoAllocsUnknown + cflags, cflagsAllocMap := (C.VkImageCreateFlags)(flags), cgoAllocsUnknown + cpImageFormatProperties, cpImageFormatPropertiesAllocMap := pImageFormatProperties.PassRef() __ret := C.callVkGetPhysicalDeviceImageFormatProperties(cphysicalDevice, cformat, ckind, ctiling, cusage, cflags, cpImageFormatProperties) + runtime.KeepAlive(cpImageFormatPropertiesAllocMap) + runtime.KeepAlive(cflagsAllocMap) + runtime.KeepAlive(cusageAllocMap) + runtime.KeepAlive(ctilingAllocMap) + runtime.KeepAlive(ckindAllocMap) + runtime.KeepAlive(cformatAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // GetPhysicalDeviceProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetPhysicalDeviceProperties.html func GetPhysicalDeviceProperties(physicalDevice PhysicalDevice, pProperties *PhysicalDeviceProperties) { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cpProperties, _ := pProperties.PassRef() + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cpProperties, cpPropertiesAllocMap := pProperties.PassRef() C.callVkGetPhysicalDeviceProperties(cphysicalDevice, cpProperties) + runtime.KeepAlive(cpPropertiesAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) } // GetPhysicalDeviceQueueFamilyProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetPhysicalDeviceQueueFamilyProperties.html func GetPhysicalDeviceQueueFamilyProperties(physicalDevice PhysicalDevice, pQueueFamilyPropertyCount *uint32, pQueueFamilyProperties []QueueFamilyProperties) { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cpQueueFamilyPropertyCount, _ := (*C.uint32_t)(unsafe.Pointer(pQueueFamilyPropertyCount)), cgoAllocsUnknown - cpQueueFamilyProperties, _ := unpackArgSQueueFamilyProperties(pQueueFamilyProperties) + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cpQueueFamilyPropertyCount, cpQueueFamilyPropertyCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pQueueFamilyPropertyCount)), cgoAllocsUnknown + cpQueueFamilyProperties, cpQueueFamilyPropertiesAllocMap := unpackArgSQueueFamilyProperties(pQueueFamilyProperties) C.callVkGetPhysicalDeviceQueueFamilyProperties(cphysicalDevice, cpQueueFamilyPropertyCount, cpQueueFamilyProperties) packSQueueFamilyProperties(pQueueFamilyProperties, cpQueueFamilyProperties) + runtime.KeepAlive(cpQueueFamilyPropertiesAllocMap) + runtime.KeepAlive(cpQueueFamilyPropertyCountAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) } // GetPhysicalDeviceMemoryProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetPhysicalDeviceMemoryProperties.html func GetPhysicalDeviceMemoryProperties(physicalDevice PhysicalDevice, pMemoryProperties *PhysicalDeviceMemoryProperties) { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cpMemoryProperties, _ := pMemoryProperties.PassRef() + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cpMemoryProperties, cpMemoryPropertiesAllocMap := pMemoryProperties.PassRef() C.callVkGetPhysicalDeviceMemoryProperties(cphysicalDevice, cpMemoryProperties) + runtime.KeepAlive(cpMemoryPropertiesAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) } // CreateDevice function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateDevice.html func CreateDevice(physicalDevice PhysicalDevice, pCreateInfo *DeviceCreateInfo, pAllocator *AllocationCallbacks, pDevice *Device) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpDevice, _ := (*C.VkDevice)(unsafe.Pointer(pDevice)), cgoAllocsUnknown + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpDevice, cpDeviceAllocMap := (*C.VkDevice)(unsafe.Pointer(pDevice)), cgoAllocsUnknown __ret := C.callVkCreateDevice(cphysicalDevice, cpCreateInfo, cpAllocator, cpDevice) + runtime.KeepAlive(cpDeviceAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyDevice function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyDevice.html func DestroyDevice(device Device, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyDevice(cdevice, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // EnumerateInstanceExtensionProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkEnumerateInstanceExtensionProperties.html func EnumerateInstanceExtensionProperties(pLayerName string, pPropertyCount *uint32, pProperties []ExtensionProperties) Result { - cpLayerName, _ := unpackPCharString(pLayerName) - cpPropertyCount, _ := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown - cpProperties, _ := unpackArgSExtensionProperties(pProperties) + cpLayerName, cpLayerNameAllocMap := unpackPCharString(pLayerName) + cpPropertyCount, cpPropertyCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown + cpProperties, cpPropertiesAllocMap := unpackArgSExtensionProperties(pProperties) __ret := C.callVkEnumerateInstanceExtensionProperties(cpLayerName, cpPropertyCount, cpProperties) packSExtensionProperties(pProperties, cpProperties) + runtime.KeepAlive(cpPropertiesAllocMap) + runtime.KeepAlive(cpPropertyCountAllocMap) + runtime.KeepAlive(cpLayerNameAllocMap) __v := (Result)(__ret) return __v } // EnumerateDeviceExtensionProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkEnumerateDeviceExtensionProperties.html func EnumerateDeviceExtensionProperties(physicalDevice PhysicalDevice, pLayerName string, pPropertyCount *uint32, pProperties []ExtensionProperties) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cpLayerName, _ := unpackPCharString(pLayerName) - cpPropertyCount, _ := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown - cpProperties, _ := unpackArgSExtensionProperties(pProperties) + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cpLayerName, cpLayerNameAllocMap := unpackPCharString(pLayerName) + cpPropertyCount, cpPropertyCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown + cpProperties, cpPropertiesAllocMap := unpackArgSExtensionProperties(pProperties) __ret := C.callVkEnumerateDeviceExtensionProperties(cphysicalDevice, cpLayerName, cpPropertyCount, cpProperties) packSExtensionProperties(pProperties, cpProperties) + runtime.KeepAlive(cpPropertiesAllocMap) + runtime.KeepAlive(cpPropertyCountAllocMap) + runtime.KeepAlive(cpLayerNameAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // EnumerateInstanceLayerProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkEnumerateInstanceLayerProperties.html func EnumerateInstanceLayerProperties(pPropertyCount *uint32, pProperties []LayerProperties) Result { - cpPropertyCount, _ := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown - cpProperties, _ := unpackArgSLayerProperties(pProperties) + cpPropertyCount, cpPropertyCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown + cpProperties, cpPropertiesAllocMap := unpackArgSLayerProperties(pProperties) __ret := C.callVkEnumerateInstanceLayerProperties(cpPropertyCount, cpProperties) packSLayerProperties(pProperties, cpProperties) + runtime.KeepAlive(cpPropertiesAllocMap) + runtime.KeepAlive(cpPropertyCountAllocMap) __v := (Result)(__ret) return __v } // EnumerateDeviceLayerProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkEnumerateDeviceLayerProperties.html func EnumerateDeviceLayerProperties(physicalDevice PhysicalDevice, pPropertyCount *uint32, pProperties []LayerProperties) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cpPropertyCount, _ := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown - cpProperties, _ := unpackArgSLayerProperties(pProperties) + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cpPropertyCount, cpPropertyCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown + cpProperties, cpPropertiesAllocMap := unpackArgSLayerProperties(pProperties) __ret := C.callVkEnumerateDeviceLayerProperties(cphysicalDevice, cpPropertyCount, cpProperties) packSLayerProperties(pProperties, cpProperties) + runtime.KeepAlive(cpPropertiesAllocMap) + runtime.KeepAlive(cpPropertyCountAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // GetDeviceQueue function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetDeviceQueue.html func GetDeviceQueue(device Device, queueFamilyIndex uint32, queueIndex uint32, pQueue *Queue) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cqueueFamilyIndex, _ := (C.uint32_t)(queueFamilyIndex), cgoAllocsUnknown - cqueueIndex, _ := (C.uint32_t)(queueIndex), cgoAllocsUnknown - cpQueue, _ := (*C.VkQueue)(unsafe.Pointer(pQueue)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cqueueFamilyIndex, cqueueFamilyIndexAllocMap := (C.uint32_t)(queueFamilyIndex), cgoAllocsUnknown + cqueueIndex, cqueueIndexAllocMap := (C.uint32_t)(queueIndex), cgoAllocsUnknown + cpQueue, cpQueueAllocMap := (*C.VkQueue)(unsafe.Pointer(pQueue)), cgoAllocsUnknown C.callVkGetDeviceQueue(cdevice, cqueueFamilyIndex, cqueueIndex, cpQueue) + runtime.KeepAlive(cpQueueAllocMap) + runtime.KeepAlive(cqueueIndexAllocMap) + runtime.KeepAlive(cqueueFamilyIndexAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // QueueSubmit function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkQueueSubmit.html func QueueSubmit(queue Queue, submitCount uint32, pSubmits []SubmitInfo, fence Fence) Result { - cqueue, _ := *(*C.VkQueue)(unsafe.Pointer(&queue)), cgoAllocsUnknown - csubmitCount, _ := (C.uint32_t)(submitCount), cgoAllocsUnknown - cpSubmits, _ := unpackArgSSubmitInfo(pSubmits) - cfence, _ := *(*C.VkFence)(unsafe.Pointer(&fence)), cgoAllocsUnknown + cqueue, cqueueAllocMap := *(*C.VkQueue)(unsafe.Pointer(&queue)), cgoAllocsUnknown + csubmitCount, csubmitCountAllocMap := (C.uint32_t)(submitCount), cgoAllocsUnknown + cpSubmits, cpSubmitsAllocMap := unpackArgSSubmitInfo(pSubmits) + cfence, cfenceAllocMap := *(*C.VkFence)(unsafe.Pointer(&fence)), cgoAllocsUnknown __ret := C.callVkQueueSubmit(cqueue, csubmitCount, cpSubmits, cfence) + runtime.KeepAlive(cfenceAllocMap) packSSubmitInfo(pSubmits, cpSubmits) + runtime.KeepAlive(cpSubmitsAllocMap) + runtime.KeepAlive(csubmitCountAllocMap) + runtime.KeepAlive(cqueueAllocMap) __v := (Result)(__ret) return __v } // QueueWaitIdle function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkQueueWaitIdle.html func QueueWaitIdle(queue Queue) Result { - cqueue, _ := *(*C.VkQueue)(unsafe.Pointer(&queue)), cgoAllocsUnknown + cqueue, cqueueAllocMap := *(*C.VkQueue)(unsafe.Pointer(&queue)), cgoAllocsUnknown __ret := C.callVkQueueWaitIdle(cqueue) + runtime.KeepAlive(cqueueAllocMap) __v := (Result)(__ret) return __v } // DeviceWaitIdle function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDeviceWaitIdle.html func DeviceWaitIdle(device Device) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown __ret := C.callVkDeviceWaitIdle(cdevice) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // AllocateMemory function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkAllocateMemory.html func AllocateMemory(device Device, pAllocateInfo *MemoryAllocateInfo, pAllocator *AllocationCallbacks, pMemory *DeviceMemory) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpAllocateInfo, _ := pAllocateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpMemory, _ := (*C.VkDeviceMemory)(unsafe.Pointer(pMemory)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpAllocateInfo, cpAllocateInfoAllocMap := pAllocateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpMemory, cpMemoryAllocMap := (*C.VkDeviceMemory)(unsafe.Pointer(pMemory)), cgoAllocsUnknown __ret := C.callVkAllocateMemory(cdevice, cpAllocateInfo, cpAllocator, cpMemory) + runtime.KeepAlive(cpMemoryAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpAllocateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // FreeMemory function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkFreeMemory.html func FreeMemory(device Device, memory DeviceMemory, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cmemory, _ := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cmemory, cmemoryAllocMap := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkFreeMemory(cdevice, cmemory, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cmemoryAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // MapMemory function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkMapMemory.html func MapMemory(device Device, memory DeviceMemory, offset DeviceSize, size DeviceSize, flags MemoryMapFlags, ppData *unsafe.Pointer) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cmemory, _ := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown - coffset, _ := (C.VkDeviceSize)(offset), cgoAllocsUnknown - csize, _ := (C.VkDeviceSize)(size), cgoAllocsUnknown - cflags, _ := (C.VkMemoryMapFlags)(flags), cgoAllocsUnknown - cppData, _ := ppData, cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cmemory, cmemoryAllocMap := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown + coffset, coffsetAllocMap := (C.VkDeviceSize)(offset), cgoAllocsUnknown + csize, csizeAllocMap := (C.VkDeviceSize)(size), cgoAllocsUnknown + cflags, cflagsAllocMap := (C.VkMemoryMapFlags)(flags), cgoAllocsUnknown + cppData, cppDataAllocMap := ppData, cgoAllocsUnknown __ret := C.callVkMapMemory(cdevice, cmemory, coffset, csize, cflags, cppData) + runtime.KeepAlive(cppDataAllocMap) + runtime.KeepAlive(cflagsAllocMap) + runtime.KeepAlive(csizeAllocMap) + runtime.KeepAlive(coffsetAllocMap) + runtime.KeepAlive(cmemoryAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // UnmapMemory function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkUnmapMemory.html func UnmapMemory(device Device, memory DeviceMemory) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cmemory, _ := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cmemory, cmemoryAllocMap := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown C.callVkUnmapMemory(cdevice, cmemory) + runtime.KeepAlive(cmemoryAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // FlushMappedMemoryRanges function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkFlushMappedMemoryRanges.html func FlushMappedMemoryRanges(device Device, memoryRangeCount uint32, pMemoryRanges []MappedMemoryRange) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cmemoryRangeCount, _ := (C.uint32_t)(memoryRangeCount), cgoAllocsUnknown - cpMemoryRanges, _ := unpackArgSMappedMemoryRange(pMemoryRanges) + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cmemoryRangeCount, cmemoryRangeCountAllocMap := (C.uint32_t)(memoryRangeCount), cgoAllocsUnknown + cpMemoryRanges, cpMemoryRangesAllocMap := unpackArgSMappedMemoryRange(pMemoryRanges) __ret := C.callVkFlushMappedMemoryRanges(cdevice, cmemoryRangeCount, cpMemoryRanges) packSMappedMemoryRange(pMemoryRanges, cpMemoryRanges) + runtime.KeepAlive(cpMemoryRangesAllocMap) + runtime.KeepAlive(cmemoryRangeCountAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // InvalidateMappedMemoryRanges function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkInvalidateMappedMemoryRanges.html func InvalidateMappedMemoryRanges(device Device, memoryRangeCount uint32, pMemoryRanges []MappedMemoryRange) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cmemoryRangeCount, _ := (C.uint32_t)(memoryRangeCount), cgoAllocsUnknown - cpMemoryRanges, _ := unpackArgSMappedMemoryRange(pMemoryRanges) + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cmemoryRangeCount, cmemoryRangeCountAllocMap := (C.uint32_t)(memoryRangeCount), cgoAllocsUnknown + cpMemoryRanges, cpMemoryRangesAllocMap := unpackArgSMappedMemoryRange(pMemoryRanges) __ret := C.callVkInvalidateMappedMemoryRanges(cdevice, cmemoryRangeCount, cpMemoryRanges) packSMappedMemoryRange(pMemoryRanges, cpMemoryRanges) + runtime.KeepAlive(cpMemoryRangesAllocMap) + runtime.KeepAlive(cmemoryRangeCountAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // GetDeviceMemoryCommitment function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetDeviceMemoryCommitment.html func GetDeviceMemoryCommitment(device Device, memory DeviceMemory, pCommittedMemoryInBytes *DeviceSize) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cmemory, _ := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown - cpCommittedMemoryInBytes, _ := (*C.VkDeviceSize)(unsafe.Pointer(pCommittedMemoryInBytes)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cmemory, cmemoryAllocMap := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown + cpCommittedMemoryInBytes, cpCommittedMemoryInBytesAllocMap := (*C.VkDeviceSize)(unsafe.Pointer(pCommittedMemoryInBytes)), cgoAllocsUnknown C.callVkGetDeviceMemoryCommitment(cdevice, cmemory, cpCommittedMemoryInBytes) + runtime.KeepAlive(cpCommittedMemoryInBytesAllocMap) + runtime.KeepAlive(cmemoryAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // BindBufferMemory function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkBindBufferMemory.html func BindBufferMemory(device Device, buffer Buffer, memory DeviceMemory, memoryOffset DeviceSize) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cbuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown - cmemory, _ := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown - cmemoryOffset, _ := (C.VkDeviceSize)(memoryOffset), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cbuffer, cbufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown + cmemory, cmemoryAllocMap := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown + cmemoryOffset, cmemoryOffsetAllocMap := (C.VkDeviceSize)(memoryOffset), cgoAllocsUnknown __ret := C.callVkBindBufferMemory(cdevice, cbuffer, cmemory, cmemoryOffset) + runtime.KeepAlive(cmemoryOffsetAllocMap) + runtime.KeepAlive(cmemoryAllocMap) + runtime.KeepAlive(cbufferAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // BindImageMemory function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkBindImageMemory.html func BindImageMemory(device Device, image Image, memory DeviceMemory, memoryOffset DeviceSize) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cimage, _ := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown - cmemory, _ := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown - cmemoryOffset, _ := (C.VkDeviceSize)(memoryOffset), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cimage, cimageAllocMap := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown + cmemory, cmemoryAllocMap := *(*C.VkDeviceMemory)(unsafe.Pointer(&memory)), cgoAllocsUnknown + cmemoryOffset, cmemoryOffsetAllocMap := (C.VkDeviceSize)(memoryOffset), cgoAllocsUnknown __ret := C.callVkBindImageMemory(cdevice, cimage, cmemory, cmemoryOffset) + runtime.KeepAlive(cmemoryOffsetAllocMap) + runtime.KeepAlive(cmemoryAllocMap) + runtime.KeepAlive(cimageAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // GetBufferMemoryRequirements function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetBufferMemoryRequirements.html func GetBufferMemoryRequirements(device Device, buffer Buffer, pMemoryRequirements *MemoryRequirements) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cbuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown - cpMemoryRequirements, _ := pMemoryRequirements.PassRef() + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cbuffer, cbufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown + cpMemoryRequirements, cpMemoryRequirementsAllocMap := pMemoryRequirements.PassRef() C.callVkGetBufferMemoryRequirements(cdevice, cbuffer, cpMemoryRequirements) + runtime.KeepAlive(cpMemoryRequirementsAllocMap) + runtime.KeepAlive(cbufferAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // GetImageMemoryRequirements function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetImageMemoryRequirements.html func GetImageMemoryRequirements(device Device, image Image, pMemoryRequirements *MemoryRequirements) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cimage, _ := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown - cpMemoryRequirements, _ := pMemoryRequirements.PassRef() + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cimage, cimageAllocMap := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown + cpMemoryRequirements, cpMemoryRequirementsAllocMap := pMemoryRequirements.PassRef() C.callVkGetImageMemoryRequirements(cdevice, cimage, cpMemoryRequirements) + runtime.KeepAlive(cpMemoryRequirementsAllocMap) + runtime.KeepAlive(cimageAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // GetImageSparseMemoryRequirements function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetImageSparseMemoryRequirements.html func GetImageSparseMemoryRequirements(device Device, image Image, pSparseMemoryRequirementCount []uint32, pSparseMemoryRequirements []SparseImageMemoryRequirements) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cimage, _ := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown - cpSparseMemoryRequirementCount, _ := (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pSparseMemoryRequirementCount)).Data)), cgoAllocsUnknown - cpSparseMemoryRequirements, _ := unpackArgSSparseImageMemoryRequirements(pSparseMemoryRequirements) + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cimage, cimageAllocMap := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown + cpSparseMemoryRequirementCount, cpSparseMemoryRequirementCountAllocMap := copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&pSparseMemoryRequirementCount))) + cpSparseMemoryRequirements, cpSparseMemoryRequirementsAllocMap := unpackArgSSparseImageMemoryRequirements(pSparseMemoryRequirements) C.callVkGetImageSparseMemoryRequirements(cdevice, cimage, cpSparseMemoryRequirementCount, cpSparseMemoryRequirements) packSSparseImageMemoryRequirements(pSparseMemoryRequirements, cpSparseMemoryRequirements) + runtime.KeepAlive(cpSparseMemoryRequirementsAllocMap) + runtime.KeepAlive(cpSparseMemoryRequirementCountAllocMap) + runtime.KeepAlive(cimageAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // GetPhysicalDeviceSparseImageFormatProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetPhysicalDeviceSparseImageFormatProperties.html func GetPhysicalDeviceSparseImageFormatProperties(physicalDevice PhysicalDevice, format Format, kind ImageType, samples SampleCountFlagBits, usage ImageUsageFlags, tiling ImageTiling, pPropertyCount []uint32, pProperties []SparseImageFormatProperties) { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cformat, _ := (C.VkFormat)(format), cgoAllocsUnknown - ckind, _ := (C.VkImageType)(kind), cgoAllocsUnknown - csamples, _ := (C.VkSampleCountFlagBits)(samples), cgoAllocsUnknown - cusage, _ := (C.VkImageUsageFlags)(usage), cgoAllocsUnknown - ctiling, _ := (C.VkImageTiling)(tiling), cgoAllocsUnknown - cpPropertyCount, _ := (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pPropertyCount)).Data)), cgoAllocsUnknown - cpProperties, _ := unpackArgSSparseImageFormatProperties(pProperties) + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cformat, cformatAllocMap := (C.VkFormat)(format), cgoAllocsUnknown + ckind, ckindAllocMap := (C.VkImageType)(kind), cgoAllocsUnknown + csamples, csamplesAllocMap := (C.VkSampleCountFlagBits)(samples), cgoAllocsUnknown + cusage, cusageAllocMap := (C.VkImageUsageFlags)(usage), cgoAllocsUnknown + ctiling, ctilingAllocMap := (C.VkImageTiling)(tiling), cgoAllocsUnknown + cpPropertyCount, cpPropertyCountAllocMap := copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&pPropertyCount))) + cpProperties, cpPropertiesAllocMap := unpackArgSSparseImageFormatProperties(pProperties) C.callVkGetPhysicalDeviceSparseImageFormatProperties(cphysicalDevice, cformat, ckind, csamples, cusage, ctiling, cpPropertyCount, cpProperties) packSSparseImageFormatProperties(pProperties, cpProperties) + runtime.KeepAlive(cpPropertiesAllocMap) + runtime.KeepAlive(cpPropertyCountAllocMap) + runtime.KeepAlive(ctilingAllocMap) + runtime.KeepAlive(cusageAllocMap) + runtime.KeepAlive(csamplesAllocMap) + runtime.KeepAlive(ckindAllocMap) + runtime.KeepAlive(cformatAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) } // QueueBindSparse function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkQueueBindSparse.html func QueueBindSparse(queue Queue, bindInfoCount uint32, pBindInfo []BindSparseInfo, fence Fence) Result { - cqueue, _ := *(*C.VkQueue)(unsafe.Pointer(&queue)), cgoAllocsUnknown - cbindInfoCount, _ := (C.uint32_t)(bindInfoCount), cgoAllocsUnknown - cpBindInfo, _ := unpackArgSBindSparseInfo(pBindInfo) - cfence, _ := *(*C.VkFence)(unsafe.Pointer(&fence)), cgoAllocsUnknown + cqueue, cqueueAllocMap := *(*C.VkQueue)(unsafe.Pointer(&queue)), cgoAllocsUnknown + cbindInfoCount, cbindInfoCountAllocMap := (C.uint32_t)(bindInfoCount), cgoAllocsUnknown + cpBindInfo, cpBindInfoAllocMap := unpackArgSBindSparseInfo(pBindInfo) + cfence, cfenceAllocMap := *(*C.VkFence)(unsafe.Pointer(&fence)), cgoAllocsUnknown __ret := C.callVkQueueBindSparse(cqueue, cbindInfoCount, cpBindInfo, cfence) + runtime.KeepAlive(cfenceAllocMap) packSBindSparseInfo(pBindInfo, cpBindInfo) + runtime.KeepAlive(cpBindInfoAllocMap) + runtime.KeepAlive(cbindInfoCountAllocMap) + runtime.KeepAlive(cqueueAllocMap) __v := (Result)(__ret) return __v } // CreateFence function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateFence.html func CreateFence(device Device, pCreateInfo *FenceCreateInfo, pAllocator *AllocationCallbacks, pFence *Fence) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpFence, _ := (*C.VkFence)(unsafe.Pointer(pFence)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpFence, cpFenceAllocMap := (*C.VkFence)(unsafe.Pointer(pFence)), cgoAllocsUnknown __ret := C.callVkCreateFence(cdevice, cpCreateInfo, cpAllocator, cpFence) + runtime.KeepAlive(cpFenceAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyFence function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyFence.html func DestroyFence(device Device, fence Fence, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cfence, _ := *(*C.VkFence)(unsafe.Pointer(&fence)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cfence, cfenceAllocMap := *(*C.VkFence)(unsafe.Pointer(&fence)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyFence(cdevice, cfence, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cfenceAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // ResetFences function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkResetFences.html func ResetFences(device Device, fenceCount uint32, pFences []Fence) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cfenceCount, _ := (C.uint32_t)(fenceCount), cgoAllocsUnknown - cpFences, _ := (*C.VkFence)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pFences)).Data)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cfenceCount, cfenceCountAllocMap := (C.uint32_t)(fenceCount), cgoAllocsUnknown + cpFences, cpFencesAllocMap := copyPFenceBytes((*sliceHeader)(unsafe.Pointer(&pFences))) __ret := C.callVkResetFences(cdevice, cfenceCount, cpFences) + runtime.KeepAlive(cpFencesAllocMap) + runtime.KeepAlive(cfenceCountAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // GetFenceStatus function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetFenceStatus.html func GetFenceStatus(device Device, fence Fence) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cfence, _ := *(*C.VkFence)(unsafe.Pointer(&fence)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cfence, cfenceAllocMap := *(*C.VkFence)(unsafe.Pointer(&fence)), cgoAllocsUnknown __ret := C.callVkGetFenceStatus(cdevice, cfence) + runtime.KeepAlive(cfenceAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // WaitForFences function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkWaitForFences.html -func WaitForFences(device Device, fenceCount uint32, pFences []Fence, waitAll Bool32, timeout uint64) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cfenceCount, _ := (C.uint32_t)(fenceCount), cgoAllocsUnknown - cpFences, _ := (*C.VkFence)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pFences)).Data)), cgoAllocsUnknown - cwaitAll, _ := (C.VkBool32)(waitAll), cgoAllocsUnknown - ctimeout, _ := (C.uint64_t)(timeout), cgoAllocsUnknown +func WaitForFences(device Device, fenceCount uint32, pFences []Fence, waitAll Bool32, timeout uint32) Result { + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cfenceCount, cfenceCountAllocMap := (C.uint32_t)(fenceCount), cgoAllocsUnknown + cpFences, cpFencesAllocMap := copyPFenceBytes((*sliceHeader)(unsafe.Pointer(&pFences))) + cwaitAll, cwaitAllAllocMap := (C.VkBool32)(waitAll), cgoAllocsUnknown + ctimeout, ctimeoutAllocMap := (C.uint64_t)(timeout), cgoAllocsUnknown __ret := C.callVkWaitForFences(cdevice, cfenceCount, cpFences, cwaitAll, ctimeout) + runtime.KeepAlive(ctimeoutAllocMap) + runtime.KeepAlive(cwaitAllAllocMap) + runtime.KeepAlive(cpFencesAllocMap) + runtime.KeepAlive(cfenceCountAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // CreateSemaphore function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateSemaphore.html func CreateSemaphore(device Device, pCreateInfo *SemaphoreCreateInfo, pAllocator *AllocationCallbacks, pSemaphore *Semaphore) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpSemaphore, _ := (*C.VkSemaphore)(unsafe.Pointer(pSemaphore)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpSemaphore, cpSemaphoreAllocMap := (*C.VkSemaphore)(unsafe.Pointer(pSemaphore)), cgoAllocsUnknown __ret := C.callVkCreateSemaphore(cdevice, cpCreateInfo, cpAllocator, cpSemaphore) + runtime.KeepAlive(cpSemaphoreAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroySemaphore function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroySemaphore.html func DestroySemaphore(device Device, semaphore Semaphore, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - csemaphore, _ := *(*C.VkSemaphore)(unsafe.Pointer(&semaphore)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + csemaphore, csemaphoreAllocMap := *(*C.VkSemaphore)(unsafe.Pointer(&semaphore)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroySemaphore(cdevice, csemaphore, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(csemaphoreAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreateEvent function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateEvent.html func CreateEvent(device Device, pCreateInfo *EventCreateInfo, pAllocator *AllocationCallbacks, pEvent *Event) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpEvent, _ := (*C.VkEvent)(unsafe.Pointer(pEvent)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpEvent, cpEventAllocMap := (*C.VkEvent)(unsafe.Pointer(pEvent)), cgoAllocsUnknown __ret := C.callVkCreateEvent(cdevice, cpCreateInfo, cpAllocator, cpEvent) + runtime.KeepAlive(cpEventAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyEvent function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyEvent.html func DestroyEvent(device Device, event Event, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cevent, _ := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cevent, ceventAllocMap := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyEvent(cdevice, cevent, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(ceventAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // GetEventStatus function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetEventStatus.html func GetEventStatus(device Device, event Event) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cevent, _ := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cevent, ceventAllocMap := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown __ret := C.callVkGetEventStatus(cdevice, cevent) + runtime.KeepAlive(ceventAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // SetEvent function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkSetEvent.html func SetEvent(device Device, event Event) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cevent, _ := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cevent, ceventAllocMap := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown __ret := C.callVkSetEvent(cdevice, cevent) + runtime.KeepAlive(ceventAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // ResetEvent function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkResetEvent.html func ResetEvent(device Device, event Event) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cevent, _ := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cevent, ceventAllocMap := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown __ret := C.callVkResetEvent(cdevice, cevent) + runtime.KeepAlive(ceventAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // CreateQueryPool function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateQueryPool.html func CreateQueryPool(device Device, pCreateInfo *QueryPoolCreateInfo, pAllocator *AllocationCallbacks, pQueryPool *QueryPool) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpQueryPool, _ := (*C.VkQueryPool)(unsafe.Pointer(pQueryPool)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpQueryPool, cpQueryPoolAllocMap := (*C.VkQueryPool)(unsafe.Pointer(pQueryPool)), cgoAllocsUnknown __ret := C.callVkCreateQueryPool(cdevice, cpCreateInfo, cpAllocator, cpQueryPool) + runtime.KeepAlive(cpQueryPoolAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyQueryPool function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyQueryPool.html func DestroyQueryPool(device Device, queryPool QueryPool, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cqueryPool, _ := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cqueryPool, cqueryPoolAllocMap := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyQueryPool(cdevice, cqueryPool, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cqueryPoolAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // GetQueryPoolResults function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetQueryPoolResults.html -func GetQueryPoolResults(device Device, queryPool QueryPool, firstQuery uint32, queryCount uint32, dataSize uint, pData unsafe.Pointer, stride DeviceSize, flags QueryResultFlags) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cqueryPool, _ := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown - cfirstQuery, _ := (C.uint32_t)(firstQuery), cgoAllocsUnknown - cqueryCount, _ := (C.uint32_t)(queryCount), cgoAllocsUnknown - cdataSize, _ := (C.size_t)(dataSize), cgoAllocsUnknown - cpData, _ := pData, cgoAllocsUnknown - cstride, _ := (C.VkDeviceSize)(stride), cgoAllocsUnknown - cflags, _ := (C.VkQueryResultFlags)(flags), cgoAllocsUnknown +func GetQueryPoolResults(device Device, queryPool QueryPool, firstQuery uint32, queryCount uint32, dataSize uint32, pData unsafe.Pointer, stride DeviceSize, flags QueryResultFlags) Result { + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cqueryPool, cqueryPoolAllocMap := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown + cfirstQuery, cfirstQueryAllocMap := (C.uint32_t)(firstQuery), cgoAllocsUnknown + cqueryCount, cqueryCountAllocMap := (C.uint32_t)(queryCount), cgoAllocsUnknown + cdataSize, cdataSizeAllocMap := (C.size_t)(dataSize), cgoAllocsUnknown + cpData, cpDataAllocMap := pData, cgoAllocsUnknown + cstride, cstrideAllocMap := (C.VkDeviceSize)(stride), cgoAllocsUnknown + cflags, cflagsAllocMap := (C.VkQueryResultFlags)(flags), cgoAllocsUnknown __ret := C.callVkGetQueryPoolResults(cdevice, cqueryPool, cfirstQuery, cqueryCount, cdataSize, cpData, cstride, cflags) + runtime.KeepAlive(cflagsAllocMap) + runtime.KeepAlive(cstrideAllocMap) + runtime.KeepAlive(cpDataAllocMap) + runtime.KeepAlive(cdataSizeAllocMap) + runtime.KeepAlive(cqueryCountAllocMap) + runtime.KeepAlive(cfirstQueryAllocMap) + runtime.KeepAlive(cqueryPoolAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // CreateBuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateBuffer.html func CreateBuffer(device Device, pCreateInfo *BufferCreateInfo, pAllocator *AllocationCallbacks, pBuffer *Buffer) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpBuffer, _ := (*C.VkBuffer)(unsafe.Pointer(pBuffer)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpBuffer, cpBufferAllocMap := (*C.VkBuffer)(unsafe.Pointer(pBuffer)), cgoAllocsUnknown __ret := C.callVkCreateBuffer(cdevice, cpCreateInfo, cpAllocator, cpBuffer) + runtime.KeepAlive(cpBufferAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyBuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyBuffer.html func DestroyBuffer(device Device, buffer Buffer, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cbuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cbuffer, cbufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyBuffer(cdevice, cbuffer, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cbufferAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreateBufferView function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateBufferView.html func CreateBufferView(device Device, pCreateInfo *BufferViewCreateInfo, pAllocator *AllocationCallbacks, pView *BufferView) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpView, _ := (*C.VkBufferView)(unsafe.Pointer(pView)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpView, cpViewAllocMap := (*C.VkBufferView)(unsafe.Pointer(pView)), cgoAllocsUnknown __ret := C.callVkCreateBufferView(cdevice, cpCreateInfo, cpAllocator, cpView) + runtime.KeepAlive(cpViewAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyBufferView function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyBufferView.html func DestroyBufferView(device Device, bufferView BufferView, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cbufferView, _ := *(*C.VkBufferView)(unsafe.Pointer(&bufferView)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cbufferView, cbufferViewAllocMap := *(*C.VkBufferView)(unsafe.Pointer(&bufferView)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyBufferView(cdevice, cbufferView, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cbufferViewAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreateImage function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateImage.html func CreateImage(device Device, pCreateInfo *ImageCreateInfo, pAllocator *AllocationCallbacks, pImage *Image) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpImage, _ := (*C.VkImage)(unsafe.Pointer(pImage)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpImage, cpImageAllocMap := (*C.VkImage)(unsafe.Pointer(pImage)), cgoAllocsUnknown __ret := C.callVkCreateImage(cdevice, cpCreateInfo, cpAllocator, cpImage) + runtime.KeepAlive(cpImageAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyImage function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyImage.html func DestroyImage(device Device, image Image, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cimage, _ := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cimage, cimageAllocMap := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyImage(cdevice, cimage, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cimageAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // GetImageSubresourceLayout function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetImageSubresourceLayout.html func GetImageSubresourceLayout(device Device, image Image, pSubresource *ImageSubresource, pLayout *SubresourceLayout) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cimage, _ := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown - cpSubresource, _ := pSubresource.PassRef() - cpLayout, _ := pLayout.PassRef() + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cimage, cimageAllocMap := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown + cpSubresource, cpSubresourceAllocMap := pSubresource.PassRef() + cpLayout, cpLayoutAllocMap := pLayout.PassRef() C.callVkGetImageSubresourceLayout(cdevice, cimage, cpSubresource, cpLayout) + runtime.KeepAlive(cpLayoutAllocMap) + runtime.KeepAlive(cpSubresourceAllocMap) + runtime.KeepAlive(cimageAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreateImageView function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateImageView.html func CreateImageView(device Device, pCreateInfo *ImageViewCreateInfo, pAllocator *AllocationCallbacks, pView *ImageView) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpView, _ := (*C.VkImageView)(unsafe.Pointer(pView)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpView, cpViewAllocMap := (*C.VkImageView)(unsafe.Pointer(pView)), cgoAllocsUnknown __ret := C.callVkCreateImageView(cdevice, cpCreateInfo, cpAllocator, cpView) + runtime.KeepAlive(cpViewAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyImageView function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyImageView.html func DestroyImageView(device Device, imageView ImageView, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cimageView, _ := *(*C.VkImageView)(unsafe.Pointer(&imageView)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cimageView, cimageViewAllocMap := *(*C.VkImageView)(unsafe.Pointer(&imageView)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyImageView(cdevice, cimageView, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cimageViewAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreateShaderModule function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateShaderModule.html func CreateShaderModule(device Device, pCreateInfo *ShaderModuleCreateInfo, pAllocator *AllocationCallbacks, pShaderModule *ShaderModule) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpShaderModule, _ := (*C.VkShaderModule)(unsafe.Pointer(pShaderModule)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpShaderModule, cpShaderModuleAllocMap := (*C.VkShaderModule)(unsafe.Pointer(pShaderModule)), cgoAllocsUnknown __ret := C.callVkCreateShaderModule(cdevice, cpCreateInfo, cpAllocator, cpShaderModule) + runtime.KeepAlive(cpShaderModuleAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyShaderModule function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyShaderModule.html func DestroyShaderModule(device Device, shaderModule ShaderModule, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cshaderModule, _ := *(*C.VkShaderModule)(unsafe.Pointer(&shaderModule)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cshaderModule, cshaderModuleAllocMap := *(*C.VkShaderModule)(unsafe.Pointer(&shaderModule)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyShaderModule(cdevice, cshaderModule, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cshaderModuleAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreatePipelineCache function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreatePipelineCache.html func CreatePipelineCache(device Device, pCreateInfo *PipelineCacheCreateInfo, pAllocator *AllocationCallbacks, pPipelineCache *PipelineCache) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpPipelineCache, _ := (*C.VkPipelineCache)(unsafe.Pointer(pPipelineCache)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpPipelineCache, cpPipelineCacheAllocMap := (*C.VkPipelineCache)(unsafe.Pointer(pPipelineCache)), cgoAllocsUnknown __ret := C.callVkCreatePipelineCache(cdevice, cpCreateInfo, cpAllocator, cpPipelineCache) + runtime.KeepAlive(cpPipelineCacheAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyPipelineCache function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyPipelineCache.html func DestroyPipelineCache(device Device, pipelineCache PipelineCache, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpipelineCache, _ := *(*C.VkPipelineCache)(unsafe.Pointer(&pipelineCache)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpipelineCache, cpipelineCacheAllocMap := *(*C.VkPipelineCache)(unsafe.Pointer(&pipelineCache)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyPipelineCache(cdevice, cpipelineCache, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpipelineCacheAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // GetPipelineCacheData function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetPipelineCacheData.html -func GetPipelineCacheData(device Device, pipelineCache PipelineCache, pDataSize *uint, pData unsafe.Pointer) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpipelineCache, _ := *(*C.VkPipelineCache)(unsafe.Pointer(&pipelineCache)), cgoAllocsUnknown - cpDataSize, _ := (*C.size_t)(unsafe.Pointer(pDataSize)), cgoAllocsUnknown - cpData, _ := pData, cgoAllocsUnknown +func GetPipelineCacheData(device Device, pipelineCache PipelineCache, pDataSize *uint32, pData unsafe.Pointer) Result { + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpipelineCache, cpipelineCacheAllocMap := *(*C.VkPipelineCache)(unsafe.Pointer(&pipelineCache)), cgoAllocsUnknown + cpDataSize, cpDataSizeAllocMap := (*C.size_t)(unsafe.Pointer(pDataSize)), cgoAllocsUnknown + cpData, cpDataAllocMap := pData, cgoAllocsUnknown __ret := C.callVkGetPipelineCacheData(cdevice, cpipelineCache, cpDataSize, cpData) + runtime.KeepAlive(cpDataAllocMap) + runtime.KeepAlive(cpDataSizeAllocMap) + runtime.KeepAlive(cpipelineCacheAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // MergePipelineCaches function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkMergePipelineCaches.html func MergePipelineCaches(device Device, dstCache PipelineCache, srcCacheCount uint32, pSrcCaches []PipelineCache) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cdstCache, _ := *(*C.VkPipelineCache)(unsafe.Pointer(&dstCache)), cgoAllocsUnknown - csrcCacheCount, _ := (C.uint32_t)(srcCacheCount), cgoAllocsUnknown - cpSrcCaches, _ := (*C.VkPipelineCache)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pSrcCaches)).Data)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cdstCache, cdstCacheAllocMap := *(*C.VkPipelineCache)(unsafe.Pointer(&dstCache)), cgoAllocsUnknown + csrcCacheCount, csrcCacheCountAllocMap := (C.uint32_t)(srcCacheCount), cgoAllocsUnknown + cpSrcCaches, cpSrcCachesAllocMap := copyPPipelineCacheBytes((*sliceHeader)(unsafe.Pointer(&pSrcCaches))) __ret := C.callVkMergePipelineCaches(cdevice, cdstCache, csrcCacheCount, cpSrcCaches) + runtime.KeepAlive(cpSrcCachesAllocMap) + runtime.KeepAlive(csrcCacheCountAllocMap) + runtime.KeepAlive(cdstCacheAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // CreateGraphicsPipelines function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateGraphicsPipelines.html func CreateGraphicsPipelines(device Device, pipelineCache PipelineCache, createInfoCount uint32, pCreateInfos []GraphicsPipelineCreateInfo, pAllocator *AllocationCallbacks, pPipelines []Pipeline) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpipelineCache, _ := *(*C.VkPipelineCache)(unsafe.Pointer(&pipelineCache)), cgoAllocsUnknown - ccreateInfoCount, _ := (C.uint32_t)(createInfoCount), cgoAllocsUnknown - cpCreateInfos, _ := unpackArgSGraphicsPipelineCreateInfo(pCreateInfos) - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpPipelines, _ := (*C.VkPipeline)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pPipelines)).Data)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpipelineCache, cpipelineCacheAllocMap := *(*C.VkPipelineCache)(unsafe.Pointer(&pipelineCache)), cgoAllocsUnknown + ccreateInfoCount, ccreateInfoCountAllocMap := (C.uint32_t)(createInfoCount), cgoAllocsUnknown + cpCreateInfos, cpCreateInfosAllocMap := unpackArgSGraphicsPipelineCreateInfo(pCreateInfos) + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpPipelines, cpPipelinesAllocMap := copyPPipelineBytes((*sliceHeader)(unsafe.Pointer(&pPipelines))) __ret := C.callVkCreateGraphicsPipelines(cdevice, cpipelineCache, ccreateInfoCount, cpCreateInfos, cpAllocator, cpPipelines) + runtime.KeepAlive(cpPipelinesAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) packSGraphicsPipelineCreateInfo(pCreateInfos, cpCreateInfos) + runtime.KeepAlive(cpCreateInfosAllocMap) + runtime.KeepAlive(ccreateInfoCountAllocMap) + runtime.KeepAlive(cpipelineCacheAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // CreateComputePipelines function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateComputePipelines.html func CreateComputePipelines(device Device, pipelineCache PipelineCache, createInfoCount uint32, pCreateInfos []ComputePipelineCreateInfo, pAllocator *AllocationCallbacks, pPipelines []Pipeline) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpipelineCache, _ := *(*C.VkPipelineCache)(unsafe.Pointer(&pipelineCache)), cgoAllocsUnknown - ccreateInfoCount, _ := (C.uint32_t)(createInfoCount), cgoAllocsUnknown - cpCreateInfos, _ := unpackArgSComputePipelineCreateInfo(pCreateInfos) - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpPipelines, _ := (*C.VkPipeline)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pPipelines)).Data)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpipelineCache, cpipelineCacheAllocMap := *(*C.VkPipelineCache)(unsafe.Pointer(&pipelineCache)), cgoAllocsUnknown + ccreateInfoCount, ccreateInfoCountAllocMap := (C.uint32_t)(createInfoCount), cgoAllocsUnknown + cpCreateInfos, cpCreateInfosAllocMap := unpackArgSComputePipelineCreateInfo(pCreateInfos) + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpPipelines, cpPipelinesAllocMap := copyPPipelineBytes((*sliceHeader)(unsafe.Pointer(&pPipelines))) __ret := C.callVkCreateComputePipelines(cdevice, cpipelineCache, ccreateInfoCount, cpCreateInfos, cpAllocator, cpPipelines) + runtime.KeepAlive(cpPipelinesAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) packSComputePipelineCreateInfo(pCreateInfos, cpCreateInfos) + runtime.KeepAlive(cpCreateInfosAllocMap) + runtime.KeepAlive(ccreateInfoCountAllocMap) + runtime.KeepAlive(cpipelineCacheAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyPipeline function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyPipeline.html func DestroyPipeline(device Device, pipeline Pipeline, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpipeline, _ := *(*C.VkPipeline)(unsafe.Pointer(&pipeline)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpipeline, cpipelineAllocMap := *(*C.VkPipeline)(unsafe.Pointer(&pipeline)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyPipeline(cdevice, cpipeline, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpipelineAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreatePipelineLayout function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreatePipelineLayout.html func CreatePipelineLayout(device Device, pCreateInfo *PipelineLayoutCreateInfo, pAllocator *AllocationCallbacks, pPipelineLayout *PipelineLayout) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpPipelineLayout, _ := (*C.VkPipelineLayout)(unsafe.Pointer(pPipelineLayout)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpPipelineLayout, cpPipelineLayoutAllocMap := (*C.VkPipelineLayout)(unsafe.Pointer(pPipelineLayout)), cgoAllocsUnknown __ret := C.callVkCreatePipelineLayout(cdevice, cpCreateInfo, cpAllocator, cpPipelineLayout) + runtime.KeepAlive(cpPipelineLayoutAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyPipelineLayout function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyPipelineLayout.html func DestroyPipelineLayout(device Device, pipelineLayout PipelineLayout, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpipelineLayout, _ := *(*C.VkPipelineLayout)(unsafe.Pointer(&pipelineLayout)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpipelineLayout, cpipelineLayoutAllocMap := *(*C.VkPipelineLayout)(unsafe.Pointer(&pipelineLayout)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyPipelineLayout(cdevice, cpipelineLayout, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpipelineLayoutAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreateSampler function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateSampler.html func CreateSampler(device Device, pCreateInfo *SamplerCreateInfo, pAllocator *AllocationCallbacks, pSampler *Sampler) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpSampler, _ := (*C.VkSampler)(unsafe.Pointer(pSampler)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpSampler, cpSamplerAllocMap := (*C.VkSampler)(unsafe.Pointer(pSampler)), cgoAllocsUnknown __ret := C.callVkCreateSampler(cdevice, cpCreateInfo, cpAllocator, cpSampler) + runtime.KeepAlive(cpSamplerAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroySampler function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroySampler.html func DestroySampler(device Device, sampler Sampler, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - csampler, _ := *(*C.VkSampler)(unsafe.Pointer(&sampler)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + csampler, csamplerAllocMap := *(*C.VkSampler)(unsafe.Pointer(&sampler)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroySampler(cdevice, csampler, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(csamplerAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreateDescriptorSetLayout function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateDescriptorSetLayout.html func CreateDescriptorSetLayout(device Device, pCreateInfo *DescriptorSetLayoutCreateInfo, pAllocator *AllocationCallbacks, pSetLayout *DescriptorSetLayout) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpSetLayout, _ := (*C.VkDescriptorSetLayout)(unsafe.Pointer(pSetLayout)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpSetLayout, cpSetLayoutAllocMap := (*C.VkDescriptorSetLayout)(unsafe.Pointer(pSetLayout)), cgoAllocsUnknown __ret := C.callVkCreateDescriptorSetLayout(cdevice, cpCreateInfo, cpAllocator, cpSetLayout) + runtime.KeepAlive(cpSetLayoutAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyDescriptorSetLayout function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyDescriptorSetLayout.html func DestroyDescriptorSetLayout(device Device, descriptorSetLayout DescriptorSetLayout, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cdescriptorSetLayout, _ := *(*C.VkDescriptorSetLayout)(unsafe.Pointer(&descriptorSetLayout)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cdescriptorSetLayout, cdescriptorSetLayoutAllocMap := *(*C.VkDescriptorSetLayout)(unsafe.Pointer(&descriptorSetLayout)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyDescriptorSetLayout(cdevice, cdescriptorSetLayout, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cdescriptorSetLayoutAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreateDescriptorPool function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateDescriptorPool.html func CreateDescriptorPool(device Device, pCreateInfo *DescriptorPoolCreateInfo, pAllocator *AllocationCallbacks, pDescriptorPool *DescriptorPool) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpDescriptorPool, _ := (*C.VkDescriptorPool)(unsafe.Pointer(pDescriptorPool)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpDescriptorPool, cpDescriptorPoolAllocMap := (*C.VkDescriptorPool)(unsafe.Pointer(pDescriptorPool)), cgoAllocsUnknown __ret := C.callVkCreateDescriptorPool(cdevice, cpCreateInfo, cpAllocator, cpDescriptorPool) + runtime.KeepAlive(cpDescriptorPoolAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyDescriptorPool function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyDescriptorPool.html func DestroyDescriptorPool(device Device, descriptorPool DescriptorPool, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cdescriptorPool, _ := *(*C.VkDescriptorPool)(unsafe.Pointer(&descriptorPool)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cdescriptorPool, cdescriptorPoolAllocMap := *(*C.VkDescriptorPool)(unsafe.Pointer(&descriptorPool)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyDescriptorPool(cdevice, cdescriptorPool, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cdescriptorPoolAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // ResetDescriptorPool function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkResetDescriptorPool.html func ResetDescriptorPool(device Device, descriptorPool DescriptorPool, flags DescriptorPoolResetFlags) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cdescriptorPool, _ := *(*C.VkDescriptorPool)(unsafe.Pointer(&descriptorPool)), cgoAllocsUnknown - cflags, _ := (C.VkDescriptorPoolResetFlags)(flags), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cdescriptorPool, cdescriptorPoolAllocMap := *(*C.VkDescriptorPool)(unsafe.Pointer(&descriptorPool)), cgoAllocsUnknown + cflags, cflagsAllocMap := (C.VkDescriptorPoolResetFlags)(flags), cgoAllocsUnknown __ret := C.callVkResetDescriptorPool(cdevice, cdescriptorPool, cflags) + runtime.KeepAlive(cflagsAllocMap) + runtime.KeepAlive(cdescriptorPoolAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // AllocateDescriptorSets function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkAllocateDescriptorSets.html func AllocateDescriptorSets(device Device, pAllocateInfo *DescriptorSetAllocateInfo, pDescriptorSets *DescriptorSet) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpAllocateInfo, _ := pAllocateInfo.PassRef() - cpDescriptorSets, _ := (*C.VkDescriptorSet)(unsafe.Pointer(pDescriptorSets)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpAllocateInfo, cpAllocateInfoAllocMap := pAllocateInfo.PassRef() + cpDescriptorSets, cpDescriptorSetsAllocMap := (*C.VkDescriptorSet)(unsafe.Pointer(pDescriptorSets)), cgoAllocsUnknown __ret := C.callVkAllocateDescriptorSets(cdevice, cpAllocateInfo, cpDescriptorSets) + runtime.KeepAlive(cpDescriptorSetsAllocMap) + runtime.KeepAlive(cpAllocateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // FreeDescriptorSets function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkFreeDescriptorSets.html func FreeDescriptorSets(device Device, descriptorPool DescriptorPool, descriptorSetCount uint32, pDescriptorSets *DescriptorSet) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cdescriptorPool, _ := *(*C.VkDescriptorPool)(unsafe.Pointer(&descriptorPool)), cgoAllocsUnknown - cdescriptorSetCount, _ := (C.uint32_t)(descriptorSetCount), cgoAllocsUnknown - cpDescriptorSets, _ := (*C.VkDescriptorSet)(unsafe.Pointer(pDescriptorSets)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cdescriptorPool, cdescriptorPoolAllocMap := *(*C.VkDescriptorPool)(unsafe.Pointer(&descriptorPool)), cgoAllocsUnknown + cdescriptorSetCount, cdescriptorSetCountAllocMap := (C.uint32_t)(descriptorSetCount), cgoAllocsUnknown + cpDescriptorSets, cpDescriptorSetsAllocMap := (*C.VkDescriptorSet)(unsafe.Pointer(pDescriptorSets)), cgoAllocsUnknown __ret := C.callVkFreeDescriptorSets(cdevice, cdescriptorPool, cdescriptorSetCount, cpDescriptorSets) + runtime.KeepAlive(cpDescriptorSetsAllocMap) + runtime.KeepAlive(cdescriptorSetCountAllocMap) + runtime.KeepAlive(cdescriptorPoolAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // UpdateDescriptorSets function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkUpdateDescriptorSets.html func UpdateDescriptorSets(device Device, descriptorWriteCount uint32, pDescriptorWrites []WriteDescriptorSet, descriptorCopyCount uint32, pDescriptorCopies []CopyDescriptorSet) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cdescriptorWriteCount, _ := (C.uint32_t)(descriptorWriteCount), cgoAllocsUnknown - cpDescriptorWrites, _ := unpackArgSWriteDescriptorSet(pDescriptorWrites) - cdescriptorCopyCount, _ := (C.uint32_t)(descriptorCopyCount), cgoAllocsUnknown - cpDescriptorCopies, _ := unpackArgSCopyDescriptorSet(pDescriptorCopies) + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cdescriptorWriteCount, cdescriptorWriteCountAllocMap := (C.uint32_t)(descriptorWriteCount), cgoAllocsUnknown + cpDescriptorWrites, cpDescriptorWritesAllocMap := unpackArgSWriteDescriptorSet(pDescriptorWrites) + cdescriptorCopyCount, cdescriptorCopyCountAllocMap := (C.uint32_t)(descriptorCopyCount), cgoAllocsUnknown + cpDescriptorCopies, cpDescriptorCopiesAllocMap := unpackArgSCopyDescriptorSet(pDescriptorCopies) C.callVkUpdateDescriptorSets(cdevice, cdescriptorWriteCount, cpDescriptorWrites, cdescriptorCopyCount, cpDescriptorCopies) packSCopyDescriptorSet(pDescriptorCopies, cpDescriptorCopies) + runtime.KeepAlive(cpDescriptorCopiesAllocMap) + runtime.KeepAlive(cdescriptorCopyCountAllocMap) packSWriteDescriptorSet(pDescriptorWrites, cpDescriptorWrites) + runtime.KeepAlive(cpDescriptorWritesAllocMap) + runtime.KeepAlive(cdescriptorWriteCountAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreateFramebuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateFramebuffer.html func CreateFramebuffer(device Device, pCreateInfo *FramebufferCreateInfo, pAllocator *AllocationCallbacks, pFramebuffer *Framebuffer) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpFramebuffer, _ := (*C.VkFramebuffer)(unsafe.Pointer(pFramebuffer)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpFramebuffer, cpFramebufferAllocMap := (*C.VkFramebuffer)(unsafe.Pointer(pFramebuffer)), cgoAllocsUnknown __ret := C.callVkCreateFramebuffer(cdevice, cpCreateInfo, cpAllocator, cpFramebuffer) + runtime.KeepAlive(cpFramebufferAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyFramebuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyFramebuffer.html func DestroyFramebuffer(device Device, framebuffer Framebuffer, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cframebuffer, _ := *(*C.VkFramebuffer)(unsafe.Pointer(&framebuffer)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cframebuffer, cframebufferAllocMap := *(*C.VkFramebuffer)(unsafe.Pointer(&framebuffer)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyFramebuffer(cdevice, cframebuffer, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cframebufferAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreateRenderPass function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateRenderPass.html func CreateRenderPass(device Device, pCreateInfo *RenderPassCreateInfo, pAllocator *AllocationCallbacks, pRenderPass *RenderPass) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpRenderPass, _ := (*C.VkRenderPass)(unsafe.Pointer(pRenderPass)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpRenderPass, cpRenderPassAllocMap := (*C.VkRenderPass)(unsafe.Pointer(pRenderPass)), cgoAllocsUnknown __ret := C.callVkCreateRenderPass(cdevice, cpCreateInfo, cpAllocator, cpRenderPass) + runtime.KeepAlive(cpRenderPassAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyRenderPass function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyRenderPass.html func DestroyRenderPass(device Device, renderPass RenderPass, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - crenderPass, _ := *(*C.VkRenderPass)(unsafe.Pointer(&renderPass)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + crenderPass, crenderPassAllocMap := *(*C.VkRenderPass)(unsafe.Pointer(&renderPass)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyRenderPass(cdevice, crenderPass, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(crenderPassAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // GetRenderAreaGranularity function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetRenderAreaGranularity.html func GetRenderAreaGranularity(device Device, renderPass RenderPass, pGranularity *Extent2D) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - crenderPass, _ := *(*C.VkRenderPass)(unsafe.Pointer(&renderPass)), cgoAllocsUnknown - cpGranularity, _ := pGranularity.PassRef() + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + crenderPass, crenderPassAllocMap := *(*C.VkRenderPass)(unsafe.Pointer(&renderPass)), cgoAllocsUnknown + cpGranularity, cpGranularityAllocMap := pGranularity.PassRef() C.callVkGetRenderAreaGranularity(cdevice, crenderPass, cpGranularity) + runtime.KeepAlive(cpGranularityAllocMap) + runtime.KeepAlive(crenderPassAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // CreateCommandPool function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateCommandPool.html func CreateCommandPool(device Device, pCreateInfo *CommandPoolCreateInfo, pAllocator *AllocationCallbacks, pCommandPool *CommandPool) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpCommandPool, _ := (*C.VkCommandPool)(unsafe.Pointer(pCommandPool)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpCommandPool, cpCommandPoolAllocMap := (*C.VkCommandPool)(unsafe.Pointer(pCommandPool)), cgoAllocsUnknown __ret := C.callVkCreateCommandPool(cdevice, cpCreateInfo, cpAllocator, cpCommandPool) + runtime.KeepAlive(cpCommandPoolAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroyCommandPool function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyCommandPool.html func DestroyCommandPool(device Device, commandPool CommandPool, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - ccommandPool, _ := *(*C.VkCommandPool)(unsafe.Pointer(&commandPool)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + ccommandPool, ccommandPoolAllocMap := *(*C.VkCommandPool)(unsafe.Pointer(&commandPool)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyCommandPool(cdevice, ccommandPool, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(ccommandPoolAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // ResetCommandPool function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkResetCommandPool.html func ResetCommandPool(device Device, commandPool CommandPool, flags CommandPoolResetFlags) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - ccommandPool, _ := *(*C.VkCommandPool)(unsafe.Pointer(&commandPool)), cgoAllocsUnknown - cflags, _ := (C.VkCommandPoolResetFlags)(flags), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + ccommandPool, ccommandPoolAllocMap := *(*C.VkCommandPool)(unsafe.Pointer(&commandPool)), cgoAllocsUnknown + cflags, cflagsAllocMap := (C.VkCommandPoolResetFlags)(flags), cgoAllocsUnknown __ret := C.callVkResetCommandPool(cdevice, ccommandPool, cflags) + runtime.KeepAlive(cflagsAllocMap) + runtime.KeepAlive(ccommandPoolAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // AllocateCommandBuffers function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkAllocateCommandBuffers.html func AllocateCommandBuffers(device Device, pAllocateInfo *CommandBufferAllocateInfo, pCommandBuffers []CommandBuffer) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpAllocateInfo, _ := pAllocateInfo.PassRef() - cpCommandBuffers, _ := (*C.VkCommandBuffer)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pCommandBuffers)).Data)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpAllocateInfo, cpAllocateInfoAllocMap := pAllocateInfo.PassRef() + cpCommandBuffers, cpCommandBuffersAllocMap := copyPCommandBufferBytes((*sliceHeader)(unsafe.Pointer(&pCommandBuffers))) __ret := C.callVkAllocateCommandBuffers(cdevice, cpAllocateInfo, cpCommandBuffers) + runtime.KeepAlive(cpCommandBuffersAllocMap) + runtime.KeepAlive(cpAllocateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // FreeCommandBuffers function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkFreeCommandBuffers.html func FreeCommandBuffers(device Device, commandPool CommandPool, commandBufferCount uint32, pCommandBuffers []CommandBuffer) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - ccommandPool, _ := *(*C.VkCommandPool)(unsafe.Pointer(&commandPool)), cgoAllocsUnknown - ccommandBufferCount, _ := (C.uint32_t)(commandBufferCount), cgoAllocsUnknown - cpCommandBuffers, _ := (*C.VkCommandBuffer)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pCommandBuffers)).Data)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + ccommandPool, ccommandPoolAllocMap := *(*C.VkCommandPool)(unsafe.Pointer(&commandPool)), cgoAllocsUnknown + ccommandBufferCount, ccommandBufferCountAllocMap := (C.uint32_t)(commandBufferCount), cgoAllocsUnknown + cpCommandBuffers, cpCommandBuffersAllocMap := copyPCommandBufferBytes((*sliceHeader)(unsafe.Pointer(&pCommandBuffers))) C.callVkFreeCommandBuffers(cdevice, ccommandPool, ccommandBufferCount, cpCommandBuffers) + runtime.KeepAlive(cpCommandBuffersAllocMap) + runtime.KeepAlive(ccommandBufferCountAllocMap) + runtime.KeepAlive(ccommandPoolAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // BeginCommandBuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkBeginCommandBuffer.html func BeginCommandBuffer(commandBuffer CommandBuffer, pBeginInfo *CommandBufferBeginInfo) Result { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cpBeginInfo, _ := pBeginInfo.PassRef() + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cpBeginInfo, cpBeginInfoAllocMap := pBeginInfo.PassRef() __ret := C.callVkBeginCommandBuffer(ccommandBuffer, cpBeginInfo) + runtime.KeepAlive(cpBeginInfoAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) __v := (Result)(__ret) return __v } // EndCommandBuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkEndCommandBuffer.html func EndCommandBuffer(commandBuffer CommandBuffer) Result { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown __ret := C.callVkEndCommandBuffer(ccommandBuffer) + runtime.KeepAlive(ccommandBufferAllocMap) __v := (Result)(__ret) return __v } // ResetCommandBuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkResetCommandBuffer.html func ResetCommandBuffer(commandBuffer CommandBuffer, flags CommandBufferResetFlags) Result { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cflags, _ := (C.VkCommandBufferResetFlags)(flags), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cflags, cflagsAllocMap := (C.VkCommandBufferResetFlags)(flags), cgoAllocsUnknown __ret := C.callVkResetCommandBuffer(ccommandBuffer, cflags) + runtime.KeepAlive(cflagsAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) __v := (Result)(__ret) return __v } // CmdBindPipeline function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdBindPipeline.html func CmdBindPipeline(commandBuffer CommandBuffer, pipelineBindPoint PipelineBindPoint, pipeline Pipeline) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cpipelineBindPoint, _ := (C.VkPipelineBindPoint)(pipelineBindPoint), cgoAllocsUnknown - cpipeline, _ := *(*C.VkPipeline)(unsafe.Pointer(&pipeline)), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cpipelineBindPoint, cpipelineBindPointAllocMap := (C.VkPipelineBindPoint)(pipelineBindPoint), cgoAllocsUnknown + cpipeline, cpipelineAllocMap := *(*C.VkPipeline)(unsafe.Pointer(&pipeline)), cgoAllocsUnknown C.callVkCmdBindPipeline(ccommandBuffer, cpipelineBindPoint, cpipeline) + runtime.KeepAlive(cpipelineAllocMap) + runtime.KeepAlive(cpipelineBindPointAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdSetViewport function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdSetViewport.html func CmdSetViewport(commandBuffer CommandBuffer, firstViewport uint32, viewportCount uint32, pViewports []Viewport) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cfirstViewport, _ := (C.uint32_t)(firstViewport), cgoAllocsUnknown - cviewportCount, _ := (C.uint32_t)(viewportCount), cgoAllocsUnknown - cpViewports, _ := unpackArgSViewport(pViewports) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cfirstViewport, cfirstViewportAllocMap := (C.uint32_t)(firstViewport), cgoAllocsUnknown + cviewportCount, cviewportCountAllocMap := (C.uint32_t)(viewportCount), cgoAllocsUnknown + cpViewports, cpViewportsAllocMap := unpackArgSViewport(pViewports) C.callVkCmdSetViewport(ccommandBuffer, cfirstViewport, cviewportCount, cpViewports) packSViewport(pViewports, cpViewports) + runtime.KeepAlive(cpViewportsAllocMap) + runtime.KeepAlive(cviewportCountAllocMap) + runtime.KeepAlive(cfirstViewportAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdSetScissor function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdSetScissor.html func CmdSetScissor(commandBuffer CommandBuffer, firstScissor uint32, scissorCount uint32, pScissors []Rect2D) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cfirstScissor, _ := (C.uint32_t)(firstScissor), cgoAllocsUnknown - cscissorCount, _ := (C.uint32_t)(scissorCount), cgoAllocsUnknown - cpScissors, _ := unpackArgSRect2D(pScissors) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cfirstScissor, cfirstScissorAllocMap := (C.uint32_t)(firstScissor), cgoAllocsUnknown + cscissorCount, cscissorCountAllocMap := (C.uint32_t)(scissorCount), cgoAllocsUnknown + cpScissors, cpScissorsAllocMap := unpackArgSRect2D(pScissors) C.callVkCmdSetScissor(ccommandBuffer, cfirstScissor, cscissorCount, cpScissors) packSRect2D(pScissors, cpScissors) + runtime.KeepAlive(cpScissorsAllocMap) + runtime.KeepAlive(cscissorCountAllocMap) + runtime.KeepAlive(cfirstScissorAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdSetLineWidth function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdSetLineWidth.html func CmdSetLineWidth(commandBuffer CommandBuffer, lineWidth float32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - clineWidth, _ := (C.float)(lineWidth), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + clineWidth, clineWidthAllocMap := (C.float)(lineWidth), cgoAllocsUnknown C.callVkCmdSetLineWidth(ccommandBuffer, clineWidth) + runtime.KeepAlive(clineWidthAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdSetDepthBias function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdSetDepthBias.html func CmdSetDepthBias(commandBuffer CommandBuffer, depthBiasConstantFactor float32, depthBiasClamp float32, depthBiasSlopeFactor float32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cdepthBiasConstantFactor, _ := (C.float)(depthBiasConstantFactor), cgoAllocsUnknown - cdepthBiasClamp, _ := (C.float)(depthBiasClamp), cgoAllocsUnknown - cdepthBiasSlopeFactor, _ := (C.float)(depthBiasSlopeFactor), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cdepthBiasConstantFactor, cdepthBiasConstantFactorAllocMap := (C.float)(depthBiasConstantFactor), cgoAllocsUnknown + cdepthBiasClamp, cdepthBiasClampAllocMap := (C.float)(depthBiasClamp), cgoAllocsUnknown + cdepthBiasSlopeFactor, cdepthBiasSlopeFactorAllocMap := (C.float)(depthBiasSlopeFactor), cgoAllocsUnknown C.callVkCmdSetDepthBias(ccommandBuffer, cdepthBiasConstantFactor, cdepthBiasClamp, cdepthBiasSlopeFactor) + runtime.KeepAlive(cdepthBiasSlopeFactorAllocMap) + runtime.KeepAlive(cdepthBiasClampAllocMap) + runtime.KeepAlive(cdepthBiasConstantFactorAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdSetBlendConstants function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdSetBlendConstants.html func CmdSetBlendConstants(commandBuffer CommandBuffer, blendConstants *[4]float32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cblendConstants, _ := *(**C.float)(unsafe.Pointer(&blendConstants)), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cblendConstants, cblendConstantsAllocMap := *(**C.float)(unsafe.Pointer(&blendConstants)), cgoAllocsUnknown C.callVkCmdSetBlendConstants(ccommandBuffer, cblendConstants) + runtime.KeepAlive(cblendConstantsAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdSetDepthBounds function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdSetDepthBounds.html func CmdSetDepthBounds(commandBuffer CommandBuffer, minDepthBounds float32, maxDepthBounds float32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cminDepthBounds, _ := (C.float)(minDepthBounds), cgoAllocsUnknown - cmaxDepthBounds, _ := (C.float)(maxDepthBounds), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cminDepthBounds, cminDepthBoundsAllocMap := (C.float)(minDepthBounds), cgoAllocsUnknown + cmaxDepthBounds, cmaxDepthBoundsAllocMap := (C.float)(maxDepthBounds), cgoAllocsUnknown C.callVkCmdSetDepthBounds(ccommandBuffer, cminDepthBounds, cmaxDepthBounds) + runtime.KeepAlive(cmaxDepthBoundsAllocMap) + runtime.KeepAlive(cminDepthBoundsAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdSetStencilCompareMask function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdSetStencilCompareMask.html func CmdSetStencilCompareMask(commandBuffer CommandBuffer, faceMask StencilFaceFlags, compareMask uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cfaceMask, _ := (C.VkStencilFaceFlags)(faceMask), cgoAllocsUnknown - ccompareMask, _ := (C.uint32_t)(compareMask), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cfaceMask, cfaceMaskAllocMap := (C.VkStencilFaceFlags)(faceMask), cgoAllocsUnknown + ccompareMask, ccompareMaskAllocMap := (C.uint32_t)(compareMask), cgoAllocsUnknown C.callVkCmdSetStencilCompareMask(ccommandBuffer, cfaceMask, ccompareMask) + runtime.KeepAlive(ccompareMaskAllocMap) + runtime.KeepAlive(cfaceMaskAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdSetStencilWriteMask function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdSetStencilWriteMask.html func CmdSetStencilWriteMask(commandBuffer CommandBuffer, faceMask StencilFaceFlags, writeMask uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cfaceMask, _ := (C.VkStencilFaceFlags)(faceMask), cgoAllocsUnknown - cwriteMask, _ := (C.uint32_t)(writeMask), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cfaceMask, cfaceMaskAllocMap := (C.VkStencilFaceFlags)(faceMask), cgoAllocsUnknown + cwriteMask, cwriteMaskAllocMap := (C.uint32_t)(writeMask), cgoAllocsUnknown C.callVkCmdSetStencilWriteMask(ccommandBuffer, cfaceMask, cwriteMask) + runtime.KeepAlive(cwriteMaskAllocMap) + runtime.KeepAlive(cfaceMaskAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdSetStencilReference function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdSetStencilReference.html func CmdSetStencilReference(commandBuffer CommandBuffer, faceMask StencilFaceFlags, reference uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cfaceMask, _ := (C.VkStencilFaceFlags)(faceMask), cgoAllocsUnknown - creference, _ := (C.uint32_t)(reference), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cfaceMask, cfaceMaskAllocMap := (C.VkStencilFaceFlags)(faceMask), cgoAllocsUnknown + creference, creferenceAllocMap := (C.uint32_t)(reference), cgoAllocsUnknown C.callVkCmdSetStencilReference(ccommandBuffer, cfaceMask, creference) + runtime.KeepAlive(creferenceAllocMap) + runtime.KeepAlive(cfaceMaskAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdBindDescriptorSets function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdBindDescriptorSets.html func CmdBindDescriptorSets(commandBuffer CommandBuffer, pipelineBindPoint PipelineBindPoint, layout PipelineLayout, firstSet uint32, descriptorSetCount uint32, pDescriptorSets []DescriptorSet, dynamicOffsetCount uint32, pDynamicOffsets []uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cpipelineBindPoint, _ := (C.VkPipelineBindPoint)(pipelineBindPoint), cgoAllocsUnknown - clayout, _ := *(*C.VkPipelineLayout)(unsafe.Pointer(&layout)), cgoAllocsUnknown - cfirstSet, _ := (C.uint32_t)(firstSet), cgoAllocsUnknown - cdescriptorSetCount, _ := (C.uint32_t)(descriptorSetCount), cgoAllocsUnknown - cpDescriptorSets, _ := (*C.VkDescriptorSet)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pDescriptorSets)).Data)), cgoAllocsUnknown - cdynamicOffsetCount, _ := (C.uint32_t)(dynamicOffsetCount), cgoAllocsUnknown - cpDynamicOffsets, _ := (*C.uint32_t)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pDynamicOffsets)).Data)), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cpipelineBindPoint, cpipelineBindPointAllocMap := (C.VkPipelineBindPoint)(pipelineBindPoint), cgoAllocsUnknown + clayout, clayoutAllocMap := *(*C.VkPipelineLayout)(unsafe.Pointer(&layout)), cgoAllocsUnknown + cfirstSet, cfirstSetAllocMap := (C.uint32_t)(firstSet), cgoAllocsUnknown + cdescriptorSetCount, cdescriptorSetCountAllocMap := (C.uint32_t)(descriptorSetCount), cgoAllocsUnknown + cpDescriptorSets, cpDescriptorSetsAllocMap := copyPDescriptorSetBytes((*sliceHeader)(unsafe.Pointer(&pDescriptorSets))) + cdynamicOffsetCount, cdynamicOffsetCountAllocMap := (C.uint32_t)(dynamicOffsetCount), cgoAllocsUnknown + cpDynamicOffsets, cpDynamicOffsetsAllocMap := copyPUint32_tBytes((*sliceHeader)(unsafe.Pointer(&pDynamicOffsets))) C.callVkCmdBindDescriptorSets(ccommandBuffer, cpipelineBindPoint, clayout, cfirstSet, cdescriptorSetCount, cpDescriptorSets, cdynamicOffsetCount, cpDynamicOffsets) + runtime.KeepAlive(cpDynamicOffsetsAllocMap) + runtime.KeepAlive(cdynamicOffsetCountAllocMap) + runtime.KeepAlive(cpDescriptorSetsAllocMap) + runtime.KeepAlive(cdescriptorSetCountAllocMap) + runtime.KeepAlive(cfirstSetAllocMap) + runtime.KeepAlive(clayoutAllocMap) + runtime.KeepAlive(cpipelineBindPointAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdBindIndexBuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdBindIndexBuffer.html func CmdBindIndexBuffer(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, indexType IndexType) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cbuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown - coffset, _ := (C.VkDeviceSize)(offset), cgoAllocsUnknown - cindexType, _ := (C.VkIndexType)(indexType), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cbuffer, cbufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown + coffset, coffsetAllocMap := (C.VkDeviceSize)(offset), cgoAllocsUnknown + cindexType, cindexTypeAllocMap := (C.VkIndexType)(indexType), cgoAllocsUnknown C.callVkCmdBindIndexBuffer(ccommandBuffer, cbuffer, coffset, cindexType) + runtime.KeepAlive(cindexTypeAllocMap) + runtime.KeepAlive(coffsetAllocMap) + runtime.KeepAlive(cbufferAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdBindVertexBuffers function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdBindVertexBuffers.html func CmdBindVertexBuffers(commandBuffer CommandBuffer, firstBinding uint32, bindingCount uint32, pBuffers []Buffer, pOffsets []DeviceSize) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cfirstBinding, _ := (C.uint32_t)(firstBinding), cgoAllocsUnknown - cbindingCount, _ := (C.uint32_t)(bindingCount), cgoAllocsUnknown - cpBuffers, _ := (*C.VkBuffer)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pBuffers)).Data)), cgoAllocsUnknown - cpOffsets, _ := (*C.VkDeviceSize)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pOffsets)).Data)), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cfirstBinding, cfirstBindingAllocMap := (C.uint32_t)(firstBinding), cgoAllocsUnknown + cbindingCount, cbindingCountAllocMap := (C.uint32_t)(bindingCount), cgoAllocsUnknown + cpBuffers, cpBuffersAllocMap := copyPBufferBytes((*sliceHeader)(unsafe.Pointer(&pBuffers))) + cpOffsets, cpOffsetsAllocMap := copyPDeviceSizeBytes((*sliceHeader)(unsafe.Pointer(&pOffsets))) C.callVkCmdBindVertexBuffers(ccommandBuffer, cfirstBinding, cbindingCount, cpBuffers, cpOffsets) + runtime.KeepAlive(cpOffsetsAllocMap) + runtime.KeepAlive(cpBuffersAllocMap) + runtime.KeepAlive(cbindingCountAllocMap) + runtime.KeepAlive(cfirstBindingAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdDraw function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdDraw.html func CmdDraw(commandBuffer CommandBuffer, vertexCount uint32, instanceCount uint32, firstVertex uint32, firstInstance uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cvertexCount, _ := (C.uint32_t)(vertexCount), cgoAllocsUnknown - cinstanceCount, _ := (C.uint32_t)(instanceCount), cgoAllocsUnknown - cfirstVertex, _ := (C.uint32_t)(firstVertex), cgoAllocsUnknown - cfirstInstance, _ := (C.uint32_t)(firstInstance), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cvertexCount, cvertexCountAllocMap := (C.uint32_t)(vertexCount), cgoAllocsUnknown + cinstanceCount, cinstanceCountAllocMap := (C.uint32_t)(instanceCount), cgoAllocsUnknown + cfirstVertex, cfirstVertexAllocMap := (C.uint32_t)(firstVertex), cgoAllocsUnknown + cfirstInstance, cfirstInstanceAllocMap := (C.uint32_t)(firstInstance), cgoAllocsUnknown C.callVkCmdDraw(ccommandBuffer, cvertexCount, cinstanceCount, cfirstVertex, cfirstInstance) + runtime.KeepAlive(cfirstInstanceAllocMap) + runtime.KeepAlive(cfirstVertexAllocMap) + runtime.KeepAlive(cinstanceCountAllocMap) + runtime.KeepAlive(cvertexCountAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdDrawIndexed function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdDrawIndexed.html func CmdDrawIndexed(commandBuffer CommandBuffer, indexCount uint32, instanceCount uint32, firstIndex uint32, vertexOffset int32, firstInstance uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cindexCount, _ := (C.uint32_t)(indexCount), cgoAllocsUnknown - cinstanceCount, _ := (C.uint32_t)(instanceCount), cgoAllocsUnknown - cfirstIndex, _ := (C.uint32_t)(firstIndex), cgoAllocsUnknown - cvertexOffset, _ := (C.int32_t)(vertexOffset), cgoAllocsUnknown - cfirstInstance, _ := (C.uint32_t)(firstInstance), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cindexCount, cindexCountAllocMap := (C.uint32_t)(indexCount), cgoAllocsUnknown + cinstanceCount, cinstanceCountAllocMap := (C.uint32_t)(instanceCount), cgoAllocsUnknown + cfirstIndex, cfirstIndexAllocMap := (C.uint32_t)(firstIndex), cgoAllocsUnknown + cvertexOffset, cvertexOffsetAllocMap := (C.int32_t)(vertexOffset), cgoAllocsUnknown + cfirstInstance, cfirstInstanceAllocMap := (C.uint32_t)(firstInstance), cgoAllocsUnknown C.callVkCmdDrawIndexed(ccommandBuffer, cindexCount, cinstanceCount, cfirstIndex, cvertexOffset, cfirstInstance) + runtime.KeepAlive(cfirstInstanceAllocMap) + runtime.KeepAlive(cvertexOffsetAllocMap) + runtime.KeepAlive(cfirstIndexAllocMap) + runtime.KeepAlive(cinstanceCountAllocMap) + runtime.KeepAlive(cindexCountAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdDrawIndirect function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdDrawIndirect.html func CmdDrawIndirect(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, drawCount uint32, stride uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cbuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown - coffset, _ := (C.VkDeviceSize)(offset), cgoAllocsUnknown - cdrawCount, _ := (C.uint32_t)(drawCount), cgoAllocsUnknown - cstride, _ := (C.uint32_t)(stride), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cbuffer, cbufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown + coffset, coffsetAllocMap := (C.VkDeviceSize)(offset), cgoAllocsUnknown + cdrawCount, cdrawCountAllocMap := (C.uint32_t)(drawCount), cgoAllocsUnknown + cstride, cstrideAllocMap := (C.uint32_t)(stride), cgoAllocsUnknown C.callVkCmdDrawIndirect(ccommandBuffer, cbuffer, coffset, cdrawCount, cstride) + runtime.KeepAlive(cstrideAllocMap) + runtime.KeepAlive(cdrawCountAllocMap) + runtime.KeepAlive(coffsetAllocMap) + runtime.KeepAlive(cbufferAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdDrawIndexedIndirect function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdDrawIndexedIndirect.html func CmdDrawIndexedIndirect(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, drawCount uint32, stride uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cbuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown - coffset, _ := (C.VkDeviceSize)(offset), cgoAllocsUnknown - cdrawCount, _ := (C.uint32_t)(drawCount), cgoAllocsUnknown - cstride, _ := (C.uint32_t)(stride), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cbuffer, cbufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown + coffset, coffsetAllocMap := (C.VkDeviceSize)(offset), cgoAllocsUnknown + cdrawCount, cdrawCountAllocMap := (C.uint32_t)(drawCount), cgoAllocsUnknown + cstride, cstrideAllocMap := (C.uint32_t)(stride), cgoAllocsUnknown C.callVkCmdDrawIndexedIndirect(ccommandBuffer, cbuffer, coffset, cdrawCount, cstride) + runtime.KeepAlive(cstrideAllocMap) + runtime.KeepAlive(cdrawCountAllocMap) + runtime.KeepAlive(coffsetAllocMap) + runtime.KeepAlive(cbufferAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdDispatch function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdDispatch.html func CmdDispatch(commandBuffer CommandBuffer, x uint32, y uint32, z uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cx, _ := (C.uint32_t)(x), cgoAllocsUnknown - cy, _ := (C.uint32_t)(y), cgoAllocsUnknown - cz, _ := (C.uint32_t)(z), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cx, cxAllocMap := (C.uint32_t)(x), cgoAllocsUnknown + cy, cyAllocMap := (C.uint32_t)(y), cgoAllocsUnknown + cz, czAllocMap := (C.uint32_t)(z), cgoAllocsUnknown C.callVkCmdDispatch(ccommandBuffer, cx, cy, cz) + runtime.KeepAlive(czAllocMap) + runtime.KeepAlive(cyAllocMap) + runtime.KeepAlive(cxAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdDispatchIndirect function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdDispatchIndirect.html func CmdDispatchIndirect(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cbuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown - coffset, _ := (C.VkDeviceSize)(offset), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cbuffer, cbufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&buffer)), cgoAllocsUnknown + coffset, coffsetAllocMap := (C.VkDeviceSize)(offset), cgoAllocsUnknown C.callVkCmdDispatchIndirect(ccommandBuffer, cbuffer, coffset) + runtime.KeepAlive(coffsetAllocMap) + runtime.KeepAlive(cbufferAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdCopyBuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdCopyBuffer.html func CmdCopyBuffer(commandBuffer CommandBuffer, srcBuffer Buffer, dstBuffer Buffer, regionCount uint32, pRegions []BufferCopy) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - csrcBuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&srcBuffer)), cgoAllocsUnknown - cdstBuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&dstBuffer)), cgoAllocsUnknown - cregionCount, _ := (C.uint32_t)(regionCount), cgoAllocsUnknown - cpRegions, _ := unpackArgSBufferCopy(pRegions) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + csrcBuffer, csrcBufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&srcBuffer)), cgoAllocsUnknown + cdstBuffer, cdstBufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&dstBuffer)), cgoAllocsUnknown + cregionCount, cregionCountAllocMap := (C.uint32_t)(regionCount), cgoAllocsUnknown + cpRegions, cpRegionsAllocMap := unpackArgSBufferCopy(pRegions) C.callVkCmdCopyBuffer(ccommandBuffer, csrcBuffer, cdstBuffer, cregionCount, cpRegions) packSBufferCopy(pRegions, cpRegions) + runtime.KeepAlive(cpRegionsAllocMap) + runtime.KeepAlive(cregionCountAllocMap) + runtime.KeepAlive(cdstBufferAllocMap) + runtime.KeepAlive(csrcBufferAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdCopyImage function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdCopyImage.html func CmdCopyImage(commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, dstImage Image, dstImageLayout ImageLayout, regionCount uint32, pRegions []ImageCopy) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - csrcImage, _ := *(*C.VkImage)(unsafe.Pointer(&srcImage)), cgoAllocsUnknown - csrcImageLayout, _ := (C.VkImageLayout)(srcImageLayout), cgoAllocsUnknown - cdstImage, _ := *(*C.VkImage)(unsafe.Pointer(&dstImage)), cgoAllocsUnknown - cdstImageLayout, _ := (C.VkImageLayout)(dstImageLayout), cgoAllocsUnknown - cregionCount, _ := (C.uint32_t)(regionCount), cgoAllocsUnknown - cpRegions, _ := unpackArgSImageCopy(pRegions) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + csrcImage, csrcImageAllocMap := *(*C.VkImage)(unsafe.Pointer(&srcImage)), cgoAllocsUnknown + csrcImageLayout, csrcImageLayoutAllocMap := (C.VkImageLayout)(srcImageLayout), cgoAllocsUnknown + cdstImage, cdstImageAllocMap := *(*C.VkImage)(unsafe.Pointer(&dstImage)), cgoAllocsUnknown + cdstImageLayout, cdstImageLayoutAllocMap := (C.VkImageLayout)(dstImageLayout), cgoAllocsUnknown + cregionCount, cregionCountAllocMap := (C.uint32_t)(regionCount), cgoAllocsUnknown + cpRegions, cpRegionsAllocMap := unpackArgSImageCopy(pRegions) C.callVkCmdCopyImage(ccommandBuffer, csrcImage, csrcImageLayout, cdstImage, cdstImageLayout, cregionCount, cpRegions) packSImageCopy(pRegions, cpRegions) + runtime.KeepAlive(cpRegionsAllocMap) + runtime.KeepAlive(cregionCountAllocMap) + runtime.KeepAlive(cdstImageLayoutAllocMap) + runtime.KeepAlive(cdstImageAllocMap) + runtime.KeepAlive(csrcImageLayoutAllocMap) + runtime.KeepAlive(csrcImageAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdBlitImage function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdBlitImage.html func CmdBlitImage(commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, dstImage Image, dstImageLayout ImageLayout, regionCount uint32, pRegions []ImageBlit, filter Filter) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - csrcImage, _ := *(*C.VkImage)(unsafe.Pointer(&srcImage)), cgoAllocsUnknown - csrcImageLayout, _ := (C.VkImageLayout)(srcImageLayout), cgoAllocsUnknown - cdstImage, _ := *(*C.VkImage)(unsafe.Pointer(&dstImage)), cgoAllocsUnknown - cdstImageLayout, _ := (C.VkImageLayout)(dstImageLayout), cgoAllocsUnknown - cregionCount, _ := (C.uint32_t)(regionCount), cgoAllocsUnknown - cpRegions, _ := unpackArgSImageBlit(pRegions) - cfilter, _ := (C.VkFilter)(filter), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + csrcImage, csrcImageAllocMap := *(*C.VkImage)(unsafe.Pointer(&srcImage)), cgoAllocsUnknown + csrcImageLayout, csrcImageLayoutAllocMap := (C.VkImageLayout)(srcImageLayout), cgoAllocsUnknown + cdstImage, cdstImageAllocMap := *(*C.VkImage)(unsafe.Pointer(&dstImage)), cgoAllocsUnknown + cdstImageLayout, cdstImageLayoutAllocMap := (C.VkImageLayout)(dstImageLayout), cgoAllocsUnknown + cregionCount, cregionCountAllocMap := (C.uint32_t)(regionCount), cgoAllocsUnknown + cpRegions, cpRegionsAllocMap := unpackArgSImageBlit(pRegions) + cfilter, cfilterAllocMap := (C.VkFilter)(filter), cgoAllocsUnknown C.callVkCmdBlitImage(ccommandBuffer, csrcImage, csrcImageLayout, cdstImage, cdstImageLayout, cregionCount, cpRegions, cfilter) + runtime.KeepAlive(cfilterAllocMap) packSImageBlit(pRegions, cpRegions) + runtime.KeepAlive(cpRegionsAllocMap) + runtime.KeepAlive(cregionCountAllocMap) + runtime.KeepAlive(cdstImageLayoutAllocMap) + runtime.KeepAlive(cdstImageAllocMap) + runtime.KeepAlive(csrcImageLayoutAllocMap) + runtime.KeepAlive(csrcImageAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdCopyBufferToImage function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdCopyBufferToImage.html func CmdCopyBufferToImage(commandBuffer CommandBuffer, srcBuffer Buffer, dstImage Image, dstImageLayout ImageLayout, regionCount uint32, pRegions []BufferImageCopy) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - csrcBuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&srcBuffer)), cgoAllocsUnknown - cdstImage, _ := *(*C.VkImage)(unsafe.Pointer(&dstImage)), cgoAllocsUnknown - cdstImageLayout, _ := (C.VkImageLayout)(dstImageLayout), cgoAllocsUnknown - cregionCount, _ := (C.uint32_t)(regionCount), cgoAllocsUnknown - cpRegions, _ := unpackArgSBufferImageCopy(pRegions) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + csrcBuffer, csrcBufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&srcBuffer)), cgoAllocsUnknown + cdstImage, cdstImageAllocMap := *(*C.VkImage)(unsafe.Pointer(&dstImage)), cgoAllocsUnknown + cdstImageLayout, cdstImageLayoutAllocMap := (C.VkImageLayout)(dstImageLayout), cgoAllocsUnknown + cregionCount, cregionCountAllocMap := (C.uint32_t)(regionCount), cgoAllocsUnknown + cpRegions, cpRegionsAllocMap := unpackArgSBufferImageCopy(pRegions) C.callVkCmdCopyBufferToImage(ccommandBuffer, csrcBuffer, cdstImage, cdstImageLayout, cregionCount, cpRegions) packSBufferImageCopy(pRegions, cpRegions) + runtime.KeepAlive(cpRegionsAllocMap) + runtime.KeepAlive(cregionCountAllocMap) + runtime.KeepAlive(cdstImageLayoutAllocMap) + runtime.KeepAlive(cdstImageAllocMap) + runtime.KeepAlive(csrcBufferAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdCopyImageToBuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdCopyImageToBuffer.html func CmdCopyImageToBuffer(commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, dstBuffer Buffer, regionCount uint32, pRegions []BufferImageCopy) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - csrcImage, _ := *(*C.VkImage)(unsafe.Pointer(&srcImage)), cgoAllocsUnknown - csrcImageLayout, _ := (C.VkImageLayout)(srcImageLayout), cgoAllocsUnknown - cdstBuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&dstBuffer)), cgoAllocsUnknown - cregionCount, _ := (C.uint32_t)(regionCount), cgoAllocsUnknown - cpRegions, _ := unpackArgSBufferImageCopy(pRegions) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + csrcImage, csrcImageAllocMap := *(*C.VkImage)(unsafe.Pointer(&srcImage)), cgoAllocsUnknown + csrcImageLayout, csrcImageLayoutAllocMap := (C.VkImageLayout)(srcImageLayout), cgoAllocsUnknown + cdstBuffer, cdstBufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&dstBuffer)), cgoAllocsUnknown + cregionCount, cregionCountAllocMap := (C.uint32_t)(regionCount), cgoAllocsUnknown + cpRegions, cpRegionsAllocMap := unpackArgSBufferImageCopy(pRegions) C.callVkCmdCopyImageToBuffer(ccommandBuffer, csrcImage, csrcImageLayout, cdstBuffer, cregionCount, cpRegions) packSBufferImageCopy(pRegions, cpRegions) + runtime.KeepAlive(cpRegionsAllocMap) + runtime.KeepAlive(cregionCountAllocMap) + runtime.KeepAlive(cdstBufferAllocMap) + runtime.KeepAlive(csrcImageLayoutAllocMap) + runtime.KeepAlive(csrcImageAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdUpdateBuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdUpdateBuffer.html func CmdUpdateBuffer(commandBuffer CommandBuffer, dstBuffer Buffer, dstOffset DeviceSize, dataSize DeviceSize, pData *uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cdstBuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&dstBuffer)), cgoAllocsUnknown - cdstOffset, _ := (C.VkDeviceSize)(dstOffset), cgoAllocsUnknown - cdataSize, _ := (C.VkDeviceSize)(dataSize), cgoAllocsUnknown - cpData, _ := (*C.uint32_t)(unsafe.Pointer(pData)), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cdstBuffer, cdstBufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&dstBuffer)), cgoAllocsUnknown + cdstOffset, cdstOffsetAllocMap := (C.VkDeviceSize)(dstOffset), cgoAllocsUnknown + cdataSize, cdataSizeAllocMap := (C.VkDeviceSize)(dataSize), cgoAllocsUnknown + cpData, cpDataAllocMap := (*C.uint32_t)(unsafe.Pointer(pData)), cgoAllocsUnknown C.callVkCmdUpdateBuffer(ccommandBuffer, cdstBuffer, cdstOffset, cdataSize, cpData) + runtime.KeepAlive(cpDataAllocMap) + runtime.KeepAlive(cdataSizeAllocMap) + runtime.KeepAlive(cdstOffsetAllocMap) + runtime.KeepAlive(cdstBufferAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdFillBuffer function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdFillBuffer.html func CmdFillBuffer(commandBuffer CommandBuffer, dstBuffer Buffer, dstOffset DeviceSize, size DeviceSize, data uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cdstBuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&dstBuffer)), cgoAllocsUnknown - cdstOffset, _ := (C.VkDeviceSize)(dstOffset), cgoAllocsUnknown - csize, _ := (C.VkDeviceSize)(size), cgoAllocsUnknown - cdata, _ := (C.uint32_t)(data), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cdstBuffer, cdstBufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&dstBuffer)), cgoAllocsUnknown + cdstOffset, cdstOffsetAllocMap := (C.VkDeviceSize)(dstOffset), cgoAllocsUnknown + csize, csizeAllocMap := (C.VkDeviceSize)(size), cgoAllocsUnknown + cdata, cdataAllocMap := (C.uint32_t)(data), cgoAllocsUnknown C.callVkCmdFillBuffer(ccommandBuffer, cdstBuffer, cdstOffset, csize, cdata) + runtime.KeepAlive(cdataAllocMap) + runtime.KeepAlive(csizeAllocMap) + runtime.KeepAlive(cdstOffsetAllocMap) + runtime.KeepAlive(cdstBufferAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdClearColorImage function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdClearColorImage.html func CmdClearColorImage(commandBuffer CommandBuffer, image Image, imageLayout ImageLayout, pColor *ClearColorValue, rangeCount uint32, pRanges []ImageSubresourceRange) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cimage, _ := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown - cimageLayout, _ := (C.VkImageLayout)(imageLayout), cgoAllocsUnknown - cpColor, _ := (*C.VkClearColorValue)(unsafe.Pointer(pColor)), cgoAllocsUnknown - crangeCount, _ := (C.uint32_t)(rangeCount), cgoAllocsUnknown - cpRanges, _ := unpackArgSImageSubresourceRange(pRanges) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cimage, cimageAllocMap := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown + cimageLayout, cimageLayoutAllocMap := (C.VkImageLayout)(imageLayout), cgoAllocsUnknown + cpColor, cpColorAllocMap := (*C.VkClearColorValue)(unsafe.Pointer(pColor)), cgoAllocsUnknown + crangeCount, crangeCountAllocMap := (C.uint32_t)(rangeCount), cgoAllocsUnknown + cpRanges, cpRangesAllocMap := unpackArgSImageSubresourceRange(pRanges) C.callVkCmdClearColorImage(ccommandBuffer, cimage, cimageLayout, cpColor, crangeCount, cpRanges) packSImageSubresourceRange(pRanges, cpRanges) + runtime.KeepAlive(cpRangesAllocMap) + runtime.KeepAlive(crangeCountAllocMap) + runtime.KeepAlive(cpColorAllocMap) + runtime.KeepAlive(cimageLayoutAllocMap) + runtime.KeepAlive(cimageAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdClearDepthStencilImage function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdClearDepthStencilImage.html func CmdClearDepthStencilImage(commandBuffer CommandBuffer, image Image, imageLayout ImageLayout, pDepthStencil *ClearDepthStencilValue, rangeCount uint32, pRanges []ImageSubresourceRange) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cimage, _ := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown - cimageLayout, _ := (C.VkImageLayout)(imageLayout), cgoAllocsUnknown - cpDepthStencil, _ := pDepthStencil.PassRef() - crangeCount, _ := (C.uint32_t)(rangeCount), cgoAllocsUnknown - cpRanges, _ := unpackArgSImageSubresourceRange(pRanges) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cimage, cimageAllocMap := *(*C.VkImage)(unsafe.Pointer(&image)), cgoAllocsUnknown + cimageLayout, cimageLayoutAllocMap := (C.VkImageLayout)(imageLayout), cgoAllocsUnknown + cpDepthStencil, cpDepthStencilAllocMap := pDepthStencil.PassRef() + crangeCount, crangeCountAllocMap := (C.uint32_t)(rangeCount), cgoAllocsUnknown + cpRanges, cpRangesAllocMap := unpackArgSImageSubresourceRange(pRanges) C.callVkCmdClearDepthStencilImage(ccommandBuffer, cimage, cimageLayout, cpDepthStencil, crangeCount, cpRanges) packSImageSubresourceRange(pRanges, cpRanges) + runtime.KeepAlive(cpRangesAllocMap) + runtime.KeepAlive(crangeCountAllocMap) + runtime.KeepAlive(cpDepthStencilAllocMap) + runtime.KeepAlive(cimageLayoutAllocMap) + runtime.KeepAlive(cimageAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdClearAttachments function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdClearAttachments.html func CmdClearAttachments(commandBuffer CommandBuffer, attachmentCount uint32, pAttachments []ClearAttachment, rectCount uint32, pRects []ClearRect) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cattachmentCount, _ := (C.uint32_t)(attachmentCount), cgoAllocsUnknown - cpAttachments, _ := unpackArgSClearAttachment(pAttachments) - crectCount, _ := (C.uint32_t)(rectCount), cgoAllocsUnknown - cpRects, _ := unpackArgSClearRect(pRects) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cattachmentCount, cattachmentCountAllocMap := (C.uint32_t)(attachmentCount), cgoAllocsUnknown + cpAttachments, cpAttachmentsAllocMap := unpackArgSClearAttachment(pAttachments) + crectCount, crectCountAllocMap := (C.uint32_t)(rectCount), cgoAllocsUnknown + cpRects, cpRectsAllocMap := unpackArgSClearRect(pRects) C.callVkCmdClearAttachments(ccommandBuffer, cattachmentCount, cpAttachments, crectCount, cpRects) packSClearRect(pRects, cpRects) + runtime.KeepAlive(cpRectsAllocMap) + runtime.KeepAlive(crectCountAllocMap) packSClearAttachment(pAttachments, cpAttachments) + runtime.KeepAlive(cpAttachmentsAllocMap) + runtime.KeepAlive(cattachmentCountAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdResolveImage function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdResolveImage.html func CmdResolveImage(commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, dstImage Image, dstImageLayout ImageLayout, regionCount uint32, pRegions []ImageResolve) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - csrcImage, _ := *(*C.VkImage)(unsafe.Pointer(&srcImage)), cgoAllocsUnknown - csrcImageLayout, _ := (C.VkImageLayout)(srcImageLayout), cgoAllocsUnknown - cdstImage, _ := *(*C.VkImage)(unsafe.Pointer(&dstImage)), cgoAllocsUnknown - cdstImageLayout, _ := (C.VkImageLayout)(dstImageLayout), cgoAllocsUnknown - cregionCount, _ := (C.uint32_t)(regionCount), cgoAllocsUnknown - cpRegions, _ := unpackArgSImageResolve(pRegions) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + csrcImage, csrcImageAllocMap := *(*C.VkImage)(unsafe.Pointer(&srcImage)), cgoAllocsUnknown + csrcImageLayout, csrcImageLayoutAllocMap := (C.VkImageLayout)(srcImageLayout), cgoAllocsUnknown + cdstImage, cdstImageAllocMap := *(*C.VkImage)(unsafe.Pointer(&dstImage)), cgoAllocsUnknown + cdstImageLayout, cdstImageLayoutAllocMap := (C.VkImageLayout)(dstImageLayout), cgoAllocsUnknown + cregionCount, cregionCountAllocMap := (C.uint32_t)(regionCount), cgoAllocsUnknown + cpRegions, cpRegionsAllocMap := unpackArgSImageResolve(pRegions) C.callVkCmdResolveImage(ccommandBuffer, csrcImage, csrcImageLayout, cdstImage, cdstImageLayout, cregionCount, cpRegions) packSImageResolve(pRegions, cpRegions) + runtime.KeepAlive(cpRegionsAllocMap) + runtime.KeepAlive(cregionCountAllocMap) + runtime.KeepAlive(cdstImageLayoutAllocMap) + runtime.KeepAlive(cdstImageAllocMap) + runtime.KeepAlive(csrcImageLayoutAllocMap) + runtime.KeepAlive(csrcImageAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdSetEvent function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdSetEvent.html func CmdSetEvent(commandBuffer CommandBuffer, event Event, stageMask PipelineStageFlags) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cevent, _ := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown - cstageMask, _ := (C.VkPipelineStageFlags)(stageMask), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cevent, ceventAllocMap := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown + cstageMask, cstageMaskAllocMap := (C.VkPipelineStageFlags)(stageMask), cgoAllocsUnknown C.callVkCmdSetEvent(ccommandBuffer, cevent, cstageMask) + runtime.KeepAlive(cstageMaskAllocMap) + runtime.KeepAlive(ceventAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdResetEvent function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdResetEvent.html func CmdResetEvent(commandBuffer CommandBuffer, event Event, stageMask PipelineStageFlags) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cevent, _ := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown - cstageMask, _ := (C.VkPipelineStageFlags)(stageMask), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cevent, ceventAllocMap := *(*C.VkEvent)(unsafe.Pointer(&event)), cgoAllocsUnknown + cstageMask, cstageMaskAllocMap := (C.VkPipelineStageFlags)(stageMask), cgoAllocsUnknown C.callVkCmdResetEvent(ccommandBuffer, cevent, cstageMask) + runtime.KeepAlive(cstageMaskAllocMap) + runtime.KeepAlive(ceventAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdWaitEvents function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdWaitEvents.html func CmdWaitEvents(commandBuffer CommandBuffer, eventCount uint32, pEvents []Event, srcStageMask PipelineStageFlags, dstStageMask PipelineStageFlags, memoryBarrierCount uint32, pMemoryBarriers []MemoryBarrier, bufferMemoryBarrierCount uint32, pBufferMemoryBarriers []BufferMemoryBarrier, imageMemoryBarrierCount uint32, pImageMemoryBarriers []ImageMemoryBarrier) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - ceventCount, _ := (C.uint32_t)(eventCount), cgoAllocsUnknown - cpEvents, _ := (*C.VkEvent)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pEvents)).Data)), cgoAllocsUnknown - csrcStageMask, _ := (C.VkPipelineStageFlags)(srcStageMask), cgoAllocsUnknown - cdstStageMask, _ := (C.VkPipelineStageFlags)(dstStageMask), cgoAllocsUnknown - cmemoryBarrierCount, _ := (C.uint32_t)(memoryBarrierCount), cgoAllocsUnknown - cpMemoryBarriers, _ := unpackArgSMemoryBarrier(pMemoryBarriers) - cbufferMemoryBarrierCount, _ := (C.uint32_t)(bufferMemoryBarrierCount), cgoAllocsUnknown - cpBufferMemoryBarriers, _ := unpackArgSBufferMemoryBarrier(pBufferMemoryBarriers) - cimageMemoryBarrierCount, _ := (C.uint32_t)(imageMemoryBarrierCount), cgoAllocsUnknown - cpImageMemoryBarriers, _ := unpackArgSImageMemoryBarrier(pImageMemoryBarriers) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + ceventCount, ceventCountAllocMap := (C.uint32_t)(eventCount), cgoAllocsUnknown + cpEvents, cpEventsAllocMap := copyPEventBytes((*sliceHeader)(unsafe.Pointer(&pEvents))) + csrcStageMask, csrcStageMaskAllocMap := (C.VkPipelineStageFlags)(srcStageMask), cgoAllocsUnknown + cdstStageMask, cdstStageMaskAllocMap := (C.VkPipelineStageFlags)(dstStageMask), cgoAllocsUnknown + cmemoryBarrierCount, cmemoryBarrierCountAllocMap := (C.uint32_t)(memoryBarrierCount), cgoAllocsUnknown + cpMemoryBarriers, cpMemoryBarriersAllocMap := unpackArgSMemoryBarrier(pMemoryBarriers) + cbufferMemoryBarrierCount, cbufferMemoryBarrierCountAllocMap := (C.uint32_t)(bufferMemoryBarrierCount), cgoAllocsUnknown + cpBufferMemoryBarriers, cpBufferMemoryBarriersAllocMap := unpackArgSBufferMemoryBarrier(pBufferMemoryBarriers) + cimageMemoryBarrierCount, cimageMemoryBarrierCountAllocMap := (C.uint32_t)(imageMemoryBarrierCount), cgoAllocsUnknown + cpImageMemoryBarriers, cpImageMemoryBarriersAllocMap := unpackArgSImageMemoryBarrier(pImageMemoryBarriers) C.callVkCmdWaitEvents(ccommandBuffer, ceventCount, cpEvents, csrcStageMask, cdstStageMask, cmemoryBarrierCount, cpMemoryBarriers, cbufferMemoryBarrierCount, cpBufferMemoryBarriers, cimageMemoryBarrierCount, cpImageMemoryBarriers) packSImageMemoryBarrier(pImageMemoryBarriers, cpImageMemoryBarriers) + runtime.KeepAlive(cpImageMemoryBarriersAllocMap) + runtime.KeepAlive(cimageMemoryBarrierCountAllocMap) packSBufferMemoryBarrier(pBufferMemoryBarriers, cpBufferMemoryBarriers) + runtime.KeepAlive(cpBufferMemoryBarriersAllocMap) + runtime.KeepAlive(cbufferMemoryBarrierCountAllocMap) packSMemoryBarrier(pMemoryBarriers, cpMemoryBarriers) + runtime.KeepAlive(cpMemoryBarriersAllocMap) + runtime.KeepAlive(cmemoryBarrierCountAllocMap) + runtime.KeepAlive(cdstStageMaskAllocMap) + runtime.KeepAlive(csrcStageMaskAllocMap) + runtime.KeepAlive(cpEventsAllocMap) + runtime.KeepAlive(ceventCountAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdPipelineBarrier function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdPipelineBarrier.html func CmdPipelineBarrier(commandBuffer CommandBuffer, srcStageMask PipelineStageFlags, dstStageMask PipelineStageFlags, dependencyFlags DependencyFlags, memoryBarrierCount uint32, pMemoryBarriers []MemoryBarrier, bufferMemoryBarrierCount uint32, pBufferMemoryBarriers []BufferMemoryBarrier, imageMemoryBarrierCount uint32, pImageMemoryBarriers []ImageMemoryBarrier) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - csrcStageMask, _ := (C.VkPipelineStageFlags)(srcStageMask), cgoAllocsUnknown - cdstStageMask, _ := (C.VkPipelineStageFlags)(dstStageMask), cgoAllocsUnknown - cdependencyFlags, _ := (C.VkDependencyFlags)(dependencyFlags), cgoAllocsUnknown - cmemoryBarrierCount, _ := (C.uint32_t)(memoryBarrierCount), cgoAllocsUnknown - cpMemoryBarriers, _ := unpackArgSMemoryBarrier(pMemoryBarriers) - cbufferMemoryBarrierCount, _ := (C.uint32_t)(bufferMemoryBarrierCount), cgoAllocsUnknown - cpBufferMemoryBarriers, _ := unpackArgSBufferMemoryBarrier(pBufferMemoryBarriers) - cimageMemoryBarrierCount, _ := (C.uint32_t)(imageMemoryBarrierCount), cgoAllocsUnknown - cpImageMemoryBarriers, _ := unpackArgSImageMemoryBarrier(pImageMemoryBarriers) + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + csrcStageMask, csrcStageMaskAllocMap := (C.VkPipelineStageFlags)(srcStageMask), cgoAllocsUnknown + cdstStageMask, cdstStageMaskAllocMap := (C.VkPipelineStageFlags)(dstStageMask), cgoAllocsUnknown + cdependencyFlags, cdependencyFlagsAllocMap := (C.VkDependencyFlags)(dependencyFlags), cgoAllocsUnknown + cmemoryBarrierCount, cmemoryBarrierCountAllocMap := (C.uint32_t)(memoryBarrierCount), cgoAllocsUnknown + cpMemoryBarriers, cpMemoryBarriersAllocMap := unpackArgSMemoryBarrier(pMemoryBarriers) + cbufferMemoryBarrierCount, cbufferMemoryBarrierCountAllocMap := (C.uint32_t)(bufferMemoryBarrierCount), cgoAllocsUnknown + cpBufferMemoryBarriers, cpBufferMemoryBarriersAllocMap := unpackArgSBufferMemoryBarrier(pBufferMemoryBarriers) + cimageMemoryBarrierCount, cimageMemoryBarrierCountAllocMap := (C.uint32_t)(imageMemoryBarrierCount), cgoAllocsUnknown + cpImageMemoryBarriers, cpImageMemoryBarriersAllocMap := unpackArgSImageMemoryBarrier(pImageMemoryBarriers) C.callVkCmdPipelineBarrier(ccommandBuffer, csrcStageMask, cdstStageMask, cdependencyFlags, cmemoryBarrierCount, cpMemoryBarriers, cbufferMemoryBarrierCount, cpBufferMemoryBarriers, cimageMemoryBarrierCount, cpImageMemoryBarriers) packSImageMemoryBarrier(pImageMemoryBarriers, cpImageMemoryBarriers) + runtime.KeepAlive(cpImageMemoryBarriersAllocMap) + runtime.KeepAlive(cimageMemoryBarrierCountAllocMap) packSBufferMemoryBarrier(pBufferMemoryBarriers, cpBufferMemoryBarriers) + runtime.KeepAlive(cpBufferMemoryBarriersAllocMap) + runtime.KeepAlive(cbufferMemoryBarrierCountAllocMap) packSMemoryBarrier(pMemoryBarriers, cpMemoryBarriers) + runtime.KeepAlive(cpMemoryBarriersAllocMap) + runtime.KeepAlive(cmemoryBarrierCountAllocMap) + runtime.KeepAlive(cdependencyFlagsAllocMap) + runtime.KeepAlive(cdstStageMaskAllocMap) + runtime.KeepAlive(csrcStageMaskAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdBeginQuery function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdBeginQuery.html func CmdBeginQuery(commandBuffer CommandBuffer, queryPool QueryPool, query uint32, flags QueryControlFlags) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cqueryPool, _ := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown - cquery, _ := (C.uint32_t)(query), cgoAllocsUnknown - cflags, _ := (C.VkQueryControlFlags)(flags), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cqueryPool, cqueryPoolAllocMap := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown + cquery, cqueryAllocMap := (C.uint32_t)(query), cgoAllocsUnknown + cflags, cflagsAllocMap := (C.VkQueryControlFlags)(flags), cgoAllocsUnknown C.callVkCmdBeginQuery(ccommandBuffer, cqueryPool, cquery, cflags) + runtime.KeepAlive(cflagsAllocMap) + runtime.KeepAlive(cqueryAllocMap) + runtime.KeepAlive(cqueryPoolAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdEndQuery function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdEndQuery.html func CmdEndQuery(commandBuffer CommandBuffer, queryPool QueryPool, query uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cqueryPool, _ := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown - cquery, _ := (C.uint32_t)(query), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cqueryPool, cqueryPoolAllocMap := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown + cquery, cqueryAllocMap := (C.uint32_t)(query), cgoAllocsUnknown C.callVkCmdEndQuery(ccommandBuffer, cqueryPool, cquery) + runtime.KeepAlive(cqueryAllocMap) + runtime.KeepAlive(cqueryPoolAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdResetQueryPool function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdResetQueryPool.html func CmdResetQueryPool(commandBuffer CommandBuffer, queryPool QueryPool, firstQuery uint32, queryCount uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cqueryPool, _ := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown - cfirstQuery, _ := (C.uint32_t)(firstQuery), cgoAllocsUnknown - cqueryCount, _ := (C.uint32_t)(queryCount), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cqueryPool, cqueryPoolAllocMap := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown + cfirstQuery, cfirstQueryAllocMap := (C.uint32_t)(firstQuery), cgoAllocsUnknown + cqueryCount, cqueryCountAllocMap := (C.uint32_t)(queryCount), cgoAllocsUnknown C.callVkCmdResetQueryPool(ccommandBuffer, cqueryPool, cfirstQuery, cqueryCount) + runtime.KeepAlive(cqueryCountAllocMap) + runtime.KeepAlive(cfirstQueryAllocMap) + runtime.KeepAlive(cqueryPoolAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdWriteTimestamp function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdWriteTimestamp.html func CmdWriteTimestamp(commandBuffer CommandBuffer, pipelineStage PipelineStageFlagBits, queryPool QueryPool, query uint32) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cpipelineStage, _ := (C.VkPipelineStageFlagBits)(pipelineStage), cgoAllocsUnknown - cqueryPool, _ := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown - cquery, _ := (C.uint32_t)(query), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cpipelineStage, cpipelineStageAllocMap := (C.VkPipelineStageFlagBits)(pipelineStage), cgoAllocsUnknown + cqueryPool, cqueryPoolAllocMap := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown + cquery, cqueryAllocMap := (C.uint32_t)(query), cgoAllocsUnknown C.callVkCmdWriteTimestamp(ccommandBuffer, cpipelineStage, cqueryPool, cquery) + runtime.KeepAlive(cqueryAllocMap) + runtime.KeepAlive(cqueryPoolAllocMap) + runtime.KeepAlive(cpipelineStageAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdCopyQueryPoolResults function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdCopyQueryPoolResults.html func CmdCopyQueryPoolResults(commandBuffer CommandBuffer, queryPool QueryPool, firstQuery uint32, queryCount uint32, dstBuffer Buffer, dstOffset DeviceSize, stride DeviceSize, flags QueryResultFlags) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cqueryPool, _ := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown - cfirstQuery, _ := (C.uint32_t)(firstQuery), cgoAllocsUnknown - cqueryCount, _ := (C.uint32_t)(queryCount), cgoAllocsUnknown - cdstBuffer, _ := *(*C.VkBuffer)(unsafe.Pointer(&dstBuffer)), cgoAllocsUnknown - cdstOffset, _ := (C.VkDeviceSize)(dstOffset), cgoAllocsUnknown - cstride, _ := (C.VkDeviceSize)(stride), cgoAllocsUnknown - cflags, _ := (C.VkQueryResultFlags)(flags), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cqueryPool, cqueryPoolAllocMap := *(*C.VkQueryPool)(unsafe.Pointer(&queryPool)), cgoAllocsUnknown + cfirstQuery, cfirstQueryAllocMap := (C.uint32_t)(firstQuery), cgoAllocsUnknown + cqueryCount, cqueryCountAllocMap := (C.uint32_t)(queryCount), cgoAllocsUnknown + cdstBuffer, cdstBufferAllocMap := *(*C.VkBuffer)(unsafe.Pointer(&dstBuffer)), cgoAllocsUnknown + cdstOffset, cdstOffsetAllocMap := (C.VkDeviceSize)(dstOffset), cgoAllocsUnknown + cstride, cstrideAllocMap := (C.VkDeviceSize)(stride), cgoAllocsUnknown + cflags, cflagsAllocMap := (C.VkQueryResultFlags)(flags), cgoAllocsUnknown C.callVkCmdCopyQueryPoolResults(ccommandBuffer, cqueryPool, cfirstQuery, cqueryCount, cdstBuffer, cdstOffset, cstride, cflags) + runtime.KeepAlive(cflagsAllocMap) + runtime.KeepAlive(cstrideAllocMap) + runtime.KeepAlive(cdstOffsetAllocMap) + runtime.KeepAlive(cdstBufferAllocMap) + runtime.KeepAlive(cqueryCountAllocMap) + runtime.KeepAlive(cfirstQueryAllocMap) + runtime.KeepAlive(cqueryPoolAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdPushConstants function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdPushConstants.html func CmdPushConstants(commandBuffer CommandBuffer, layout PipelineLayout, stageFlags ShaderStageFlags, offset uint32, size uint32, pValues unsafe.Pointer) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - clayout, _ := *(*C.VkPipelineLayout)(unsafe.Pointer(&layout)), cgoAllocsUnknown - cstageFlags, _ := (C.VkShaderStageFlags)(stageFlags), cgoAllocsUnknown - coffset, _ := (C.uint32_t)(offset), cgoAllocsUnknown - csize, _ := (C.uint32_t)(size), cgoAllocsUnknown - cpValues, _ := pValues, cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + clayout, clayoutAllocMap := *(*C.VkPipelineLayout)(unsafe.Pointer(&layout)), cgoAllocsUnknown + cstageFlags, cstageFlagsAllocMap := (C.VkShaderStageFlags)(stageFlags), cgoAllocsUnknown + coffset, coffsetAllocMap := (C.uint32_t)(offset), cgoAllocsUnknown + csize, csizeAllocMap := (C.uint32_t)(size), cgoAllocsUnknown + cpValues, cpValuesAllocMap := pValues, cgoAllocsUnknown C.callVkCmdPushConstants(ccommandBuffer, clayout, cstageFlags, coffset, csize, cpValues) + runtime.KeepAlive(cpValuesAllocMap) + runtime.KeepAlive(csizeAllocMap) + runtime.KeepAlive(coffsetAllocMap) + runtime.KeepAlive(cstageFlagsAllocMap) + runtime.KeepAlive(clayoutAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdBeginRenderPass function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdBeginRenderPass.html func CmdBeginRenderPass(commandBuffer CommandBuffer, pRenderPassBegin *RenderPassBeginInfo, contents SubpassContents) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - cpRenderPassBegin, _ := pRenderPassBegin.PassRef() - ccontents, _ := (C.VkSubpassContents)(contents), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + cpRenderPassBegin, cpRenderPassBeginAllocMap := pRenderPassBegin.PassRef() + ccontents, ccontentsAllocMap := (C.VkSubpassContents)(contents), cgoAllocsUnknown C.callVkCmdBeginRenderPass(ccommandBuffer, cpRenderPassBegin, ccontents) + runtime.KeepAlive(ccontentsAllocMap) + runtime.KeepAlive(cpRenderPassBeginAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdNextSubpass function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdNextSubpass.html func CmdNextSubpass(commandBuffer CommandBuffer, contents SubpassContents) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - ccontents, _ := (C.VkSubpassContents)(contents), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + ccontents, ccontentsAllocMap := (C.VkSubpassContents)(contents), cgoAllocsUnknown C.callVkCmdNextSubpass(ccommandBuffer, ccontents) + runtime.KeepAlive(ccontentsAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdEndRenderPass function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdEndRenderPass.html func CmdEndRenderPass(commandBuffer CommandBuffer) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown C.callVkCmdEndRenderPass(ccommandBuffer) + runtime.KeepAlive(ccommandBufferAllocMap) } // CmdExecuteCommands function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCmdExecuteCommands.html func CmdExecuteCommands(commandBuffer CommandBuffer, commandBufferCount uint32, pCommandBuffers []CommandBuffer) { - ccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown - ccommandBufferCount, _ := (C.uint32_t)(commandBufferCount), cgoAllocsUnknown - cpCommandBuffers, _ := (*C.VkCommandBuffer)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pCommandBuffers)).Data)), cgoAllocsUnknown + ccommandBuffer, ccommandBufferAllocMap := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown + ccommandBufferCount, ccommandBufferCountAllocMap := (C.uint32_t)(commandBufferCount), cgoAllocsUnknown + cpCommandBuffers, cpCommandBuffersAllocMap := copyPCommandBufferBytes((*sliceHeader)(unsafe.Pointer(&pCommandBuffers))) C.callVkCmdExecuteCommands(ccommandBuffer, ccommandBufferCount, cpCommandBuffers) + runtime.KeepAlive(cpCommandBuffersAllocMap) + runtime.KeepAlive(ccommandBufferCountAllocMap) + runtime.KeepAlive(ccommandBufferAllocMap) } // DestroySurface function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkDestroySurfaceKHR func DestroySurface(instance Instance, surface Surface, pAllocator *AllocationCallbacks) { - cinstance, _ := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown - csurface, _ := *(*C.VkSurfaceKHR)(unsafe.Pointer(&surface)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cinstance, cinstanceAllocMap := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown + csurface, csurfaceAllocMap := *(*C.VkSurfaceKHR)(unsafe.Pointer(&surface)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroySurfaceKHR(cinstance, csurface, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(csurfaceAllocMap) + runtime.KeepAlive(cinstanceAllocMap) } // GetPhysicalDeviceSurfaceSupport function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkGetPhysicalDeviceSurfaceSupportKHR func GetPhysicalDeviceSurfaceSupport(physicalDevice PhysicalDevice, queueFamilyIndex uint32, surface Surface, pSupported *Bool32) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cqueueFamilyIndex, _ := (C.uint32_t)(queueFamilyIndex), cgoAllocsUnknown - csurface, _ := *(*C.VkSurfaceKHR)(unsafe.Pointer(&surface)), cgoAllocsUnknown - cpSupported, _ := (*C.VkBool32)(unsafe.Pointer(pSupported)), cgoAllocsUnknown + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cqueueFamilyIndex, cqueueFamilyIndexAllocMap := (C.uint32_t)(queueFamilyIndex), cgoAllocsUnknown + csurface, csurfaceAllocMap := *(*C.VkSurfaceKHR)(unsafe.Pointer(&surface)), cgoAllocsUnknown + cpSupported, cpSupportedAllocMap := (*C.VkBool32)(unsafe.Pointer(pSupported)), cgoAllocsUnknown __ret := C.callVkGetPhysicalDeviceSurfaceSupportKHR(cphysicalDevice, cqueueFamilyIndex, csurface, cpSupported) + runtime.KeepAlive(cpSupportedAllocMap) + runtime.KeepAlive(csurfaceAllocMap) + runtime.KeepAlive(cqueueFamilyIndexAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // GetPhysicalDeviceSurfaceCapabilities function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkGetPhysicalDeviceSurfaceCapabilitiesKHR func GetPhysicalDeviceSurfaceCapabilities(physicalDevice PhysicalDevice, surface Surface, pSurfaceCapabilities *SurfaceCapabilities) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - csurface, _ := *(*C.VkSurfaceKHR)(unsafe.Pointer(&surface)), cgoAllocsUnknown - cpSurfaceCapabilities, _ := pSurfaceCapabilities.PassRef() + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + csurface, csurfaceAllocMap := *(*C.VkSurfaceKHR)(unsafe.Pointer(&surface)), cgoAllocsUnknown + cpSurfaceCapabilities, cpSurfaceCapabilitiesAllocMap := pSurfaceCapabilities.PassRef() __ret := C.callVkGetPhysicalDeviceSurfaceCapabilitiesKHR(cphysicalDevice, csurface, cpSurfaceCapabilities) + runtime.KeepAlive(cpSurfaceCapabilitiesAllocMap) + runtime.KeepAlive(csurfaceAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // GetPhysicalDeviceSurfaceFormats function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkGetPhysicalDeviceSurfaceFormatsKHR func GetPhysicalDeviceSurfaceFormats(physicalDevice PhysicalDevice, surface Surface, pSurfaceFormatCount *uint32, pSurfaceFormats []SurfaceFormat) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - csurface, _ := *(*C.VkSurfaceKHR)(unsafe.Pointer(&surface)), cgoAllocsUnknown - cpSurfaceFormatCount, _ := (*C.uint32_t)(unsafe.Pointer(pSurfaceFormatCount)), cgoAllocsUnknown - cpSurfaceFormats, _ := unpackArgSSurfaceFormat(pSurfaceFormats) + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + csurface, csurfaceAllocMap := *(*C.VkSurfaceKHR)(unsafe.Pointer(&surface)), cgoAllocsUnknown + cpSurfaceFormatCount, cpSurfaceFormatCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pSurfaceFormatCount)), cgoAllocsUnknown + cpSurfaceFormats, cpSurfaceFormatsAllocMap := unpackArgSSurfaceFormat(pSurfaceFormats) __ret := C.callVkGetPhysicalDeviceSurfaceFormatsKHR(cphysicalDevice, csurface, cpSurfaceFormatCount, cpSurfaceFormats) packSSurfaceFormat(pSurfaceFormats, cpSurfaceFormats) + runtime.KeepAlive(cpSurfaceFormatsAllocMap) + runtime.KeepAlive(cpSurfaceFormatCountAllocMap) + runtime.KeepAlive(csurfaceAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // GetPhysicalDeviceSurfacePresentModes function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkGetPhysicalDeviceSurfacePresentModesKHR func GetPhysicalDeviceSurfacePresentModes(physicalDevice PhysicalDevice, surface Surface, pPresentModeCount *uint32, pPresentModes []PresentMode) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - csurface, _ := *(*C.VkSurfaceKHR)(unsafe.Pointer(&surface)), cgoAllocsUnknown - cpPresentModeCount, _ := (*C.uint32_t)(unsafe.Pointer(pPresentModeCount)), cgoAllocsUnknown - cpPresentModes, _ := (*C.VkPresentModeKHR)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pPresentModes)).Data)), cgoAllocsUnknown + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + csurface, csurfaceAllocMap := *(*C.VkSurfaceKHR)(unsafe.Pointer(&surface)), cgoAllocsUnknown + cpPresentModeCount, cpPresentModeCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pPresentModeCount)), cgoAllocsUnknown + cpPresentModes, cpPresentModesAllocMap := copyPPresentModeBytes((*sliceHeader)(unsafe.Pointer(&pPresentModes))) __ret := C.callVkGetPhysicalDeviceSurfacePresentModesKHR(cphysicalDevice, csurface, cpPresentModeCount, cpPresentModes) + runtime.KeepAlive(cpPresentModesAllocMap) + runtime.KeepAlive(cpPresentModeCountAllocMap) + runtime.KeepAlive(csurfaceAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // CreateSwapchain function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkCreateSwapchainKHR func CreateSwapchain(device Device, pCreateInfo *SwapchainCreateInfo, pAllocator *AllocationCallbacks, pSwapchain *Swapchain) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpSwapchain, _ := (*C.VkSwapchainKHR)(unsafe.Pointer(pSwapchain)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpSwapchain, cpSwapchainAllocMap := (*C.VkSwapchainKHR)(unsafe.Pointer(pSwapchain)), cgoAllocsUnknown __ret := C.callVkCreateSwapchainKHR(cdevice, cpCreateInfo, cpAllocator, cpSwapchain) + runtime.KeepAlive(cpSwapchainAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // DestroySwapchain function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkDestroySwapchainKHR func DestroySwapchain(device Device, swapchain Swapchain, pAllocator *AllocationCallbacks) { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cswapchain, _ := *(*C.VkSwapchainKHR)(unsafe.Pointer(&swapchain)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cswapchain, cswapchainAllocMap := *(*C.VkSwapchainKHR)(unsafe.Pointer(&swapchain)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroySwapchainKHR(cdevice, cswapchain, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cswapchainAllocMap) + runtime.KeepAlive(cdeviceAllocMap) } // GetSwapchainImages function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkGetSwapchainImagesKHR func GetSwapchainImages(device Device, swapchain Swapchain, pSwapchainImageCount *uint32, pSwapchainImages []Image) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cswapchain, _ := *(*C.VkSwapchainKHR)(unsafe.Pointer(&swapchain)), cgoAllocsUnknown - cpSwapchainImageCount, _ := (*C.uint32_t)(unsafe.Pointer(pSwapchainImageCount)), cgoAllocsUnknown - cpSwapchainImages, _ := (*C.VkImage)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pSwapchainImages)).Data)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cswapchain, cswapchainAllocMap := *(*C.VkSwapchainKHR)(unsafe.Pointer(&swapchain)), cgoAllocsUnknown + cpSwapchainImageCount, cpSwapchainImageCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pSwapchainImageCount)), cgoAllocsUnknown + cpSwapchainImages, cpSwapchainImagesAllocMap := copyPImageBytes((*sliceHeader)(unsafe.Pointer(&pSwapchainImages))) __ret := C.callVkGetSwapchainImagesKHR(cdevice, cswapchain, cpSwapchainImageCount, cpSwapchainImages) + runtime.KeepAlive(cpSwapchainImagesAllocMap) + runtime.KeepAlive(cpSwapchainImageCountAllocMap) + runtime.KeepAlive(cswapchainAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // AcquireNextImage function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkAcquireNextImageKHR -func AcquireNextImage(device Device, swapchain Swapchain, timeout uint64, semaphore Semaphore, fence Fence, pImageIndex *uint32) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cswapchain, _ := *(*C.VkSwapchainKHR)(unsafe.Pointer(&swapchain)), cgoAllocsUnknown - ctimeout, _ := (C.uint64_t)(timeout), cgoAllocsUnknown - csemaphore, _ := *(*C.VkSemaphore)(unsafe.Pointer(&semaphore)), cgoAllocsUnknown - cfence, _ := *(*C.VkFence)(unsafe.Pointer(&fence)), cgoAllocsUnknown - cpImageIndex, _ := (*C.uint32_t)(unsafe.Pointer(pImageIndex)), cgoAllocsUnknown +func AcquireNextImage(device Device, swapchain Swapchain, timeout uint32, semaphore Semaphore, fence Fence, pImageIndex *uint32) Result { + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cswapchain, cswapchainAllocMap := *(*C.VkSwapchainKHR)(unsafe.Pointer(&swapchain)), cgoAllocsUnknown + ctimeout, ctimeoutAllocMap := (C.uint64_t)(timeout), cgoAllocsUnknown + csemaphore, csemaphoreAllocMap := *(*C.VkSemaphore)(unsafe.Pointer(&semaphore)), cgoAllocsUnknown + cfence, cfenceAllocMap := *(*C.VkFence)(unsafe.Pointer(&fence)), cgoAllocsUnknown + cpImageIndex, cpImageIndexAllocMap := (*C.uint32_t)(unsafe.Pointer(pImageIndex)), cgoAllocsUnknown __ret := C.callVkAcquireNextImageKHR(cdevice, cswapchain, ctimeout, csemaphore, cfence, cpImageIndex) + runtime.KeepAlive(cpImageIndexAllocMap) + runtime.KeepAlive(cfenceAllocMap) + runtime.KeepAlive(csemaphoreAllocMap) + runtime.KeepAlive(ctimeoutAllocMap) + runtime.KeepAlive(cswapchainAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // QueuePresent function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkQueuePresentKHR func QueuePresent(queue Queue, pPresentInfo *PresentInfo) Result { - cqueue, _ := *(*C.VkQueue)(unsafe.Pointer(&queue)), cgoAllocsUnknown - cpPresentInfo, _ := pPresentInfo.PassRef() + cqueue, cqueueAllocMap := *(*C.VkQueue)(unsafe.Pointer(&queue)), cgoAllocsUnknown + cpPresentInfo, cpPresentInfoAllocMap := pPresentInfo.PassRef() __ret := C.callVkQueuePresentKHR(cqueue, cpPresentInfo) + runtime.KeepAlive(cpPresentInfoAllocMap) + runtime.KeepAlive(cqueueAllocMap) __v := (Result)(__ret) return __v } // GetPhysicalDeviceDisplayProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkGetPhysicalDeviceDisplayPropertiesKHR func GetPhysicalDeviceDisplayProperties(physicalDevice PhysicalDevice, pPropertyCount *uint32, pProperties []DisplayProperties) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cpPropertyCount, _ := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown - cpProperties, _ := unpackArgSDisplayProperties(pProperties) + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cpPropertyCount, cpPropertyCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown + cpProperties, cpPropertiesAllocMap := unpackArgSDisplayProperties(pProperties) __ret := C.callVkGetPhysicalDeviceDisplayPropertiesKHR(cphysicalDevice, cpPropertyCount, cpProperties) packSDisplayProperties(pProperties, cpProperties) + runtime.KeepAlive(cpPropertiesAllocMap) + runtime.KeepAlive(cpPropertyCountAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // GetPhysicalDeviceDisplayPlaneProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkGetPhysicalDeviceDisplayPlanePropertiesKHR func GetPhysicalDeviceDisplayPlaneProperties(physicalDevice PhysicalDevice, pPropertyCount *uint32, pProperties []DisplayPlaneProperties) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cpPropertyCount, _ := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown - cpProperties, _ := unpackArgSDisplayPlaneProperties(pProperties) + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cpPropertyCount, cpPropertyCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown + cpProperties, cpPropertiesAllocMap := unpackArgSDisplayPlaneProperties(pProperties) __ret := C.callVkGetPhysicalDeviceDisplayPlanePropertiesKHR(cphysicalDevice, cpPropertyCount, cpProperties) packSDisplayPlaneProperties(pProperties, cpProperties) + runtime.KeepAlive(cpPropertiesAllocMap) + runtime.KeepAlive(cpPropertyCountAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // GetDisplayPlaneSupportedDisplays function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkGetDisplayPlaneSupportedDisplaysKHR func GetDisplayPlaneSupportedDisplays(physicalDevice PhysicalDevice, planeIndex uint32, pDisplayCount *uint32, pDisplays []Display) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cplaneIndex, _ := (C.uint32_t)(planeIndex), cgoAllocsUnknown - cpDisplayCount, _ := (*C.uint32_t)(unsafe.Pointer(pDisplayCount)), cgoAllocsUnknown - cpDisplays, _ := (*C.VkDisplayKHR)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&pDisplays)).Data)), cgoAllocsUnknown + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cplaneIndex, cplaneIndexAllocMap := (C.uint32_t)(planeIndex), cgoAllocsUnknown + cpDisplayCount, cpDisplayCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pDisplayCount)), cgoAllocsUnknown + cpDisplays, cpDisplaysAllocMap := copyPDisplayBytes((*sliceHeader)(unsafe.Pointer(&pDisplays))) __ret := C.callVkGetDisplayPlaneSupportedDisplaysKHR(cphysicalDevice, cplaneIndex, cpDisplayCount, cpDisplays) + runtime.KeepAlive(cpDisplaysAllocMap) + runtime.KeepAlive(cpDisplayCountAllocMap) + runtime.KeepAlive(cplaneIndexAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // GetDisplayModeProperties function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkGetDisplayModePropertiesKHR func GetDisplayModeProperties(physicalDevice PhysicalDevice, display Display, pPropertyCount *uint32, pProperties []DisplayModeProperties) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cdisplay, _ := *(*C.VkDisplayKHR)(unsafe.Pointer(&display)), cgoAllocsUnknown - cpPropertyCount, _ := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown - cpProperties, _ := unpackArgSDisplayModeProperties(pProperties) + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cdisplay, cdisplayAllocMap := *(*C.VkDisplayKHR)(unsafe.Pointer(&display)), cgoAllocsUnknown + cpPropertyCount, cpPropertyCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pPropertyCount)), cgoAllocsUnknown + cpProperties, cpPropertiesAllocMap := unpackArgSDisplayModeProperties(pProperties) __ret := C.callVkGetDisplayModePropertiesKHR(cphysicalDevice, cdisplay, cpPropertyCount, cpProperties) packSDisplayModeProperties(pProperties, cpProperties) + runtime.KeepAlive(cpPropertiesAllocMap) + runtime.KeepAlive(cpPropertyCountAllocMap) + runtime.KeepAlive(cdisplayAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // CreateDisplayMode function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkCreateDisplayModeKHR func CreateDisplayMode(physicalDevice PhysicalDevice, display Display, pCreateInfo *DisplayModeCreateInfo, pAllocator *AllocationCallbacks, pMode *DisplayMode) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cdisplay, _ := *(*C.VkDisplayKHR)(unsafe.Pointer(&display)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpMode, _ := (*C.VkDisplayModeKHR)(unsafe.Pointer(pMode)), cgoAllocsUnknown + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cdisplay, cdisplayAllocMap := *(*C.VkDisplayKHR)(unsafe.Pointer(&display)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpMode, cpModeAllocMap := (*C.VkDisplayModeKHR)(unsafe.Pointer(pMode)), cgoAllocsUnknown __ret := C.callVkCreateDisplayModeKHR(cphysicalDevice, cdisplay, cpCreateInfo, cpAllocator, cpMode) + runtime.KeepAlive(cpModeAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cdisplayAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // GetDisplayPlaneCapabilities function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkGetDisplayPlaneCapabilitiesKHR func GetDisplayPlaneCapabilities(physicalDevice PhysicalDevice, mode DisplayMode, planeIndex uint32, pCapabilities *DisplayPlaneCapabilities) Result { - cphysicalDevice, _ := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown - cmode, _ := *(*C.VkDisplayModeKHR)(unsafe.Pointer(&mode)), cgoAllocsUnknown - cplaneIndex, _ := (C.uint32_t)(planeIndex), cgoAllocsUnknown - cpCapabilities, _ := pCapabilities.PassRef() + cphysicalDevice, cphysicalDeviceAllocMap := *(*C.VkPhysicalDevice)(unsafe.Pointer(&physicalDevice)), cgoAllocsUnknown + cmode, cmodeAllocMap := *(*C.VkDisplayModeKHR)(unsafe.Pointer(&mode)), cgoAllocsUnknown + cplaneIndex, cplaneIndexAllocMap := (C.uint32_t)(planeIndex), cgoAllocsUnknown + cpCapabilities, cpCapabilitiesAllocMap := pCapabilities.PassRef() __ret := C.callVkGetDisplayPlaneCapabilitiesKHR(cphysicalDevice, cmode, cplaneIndex, cpCapabilities) + runtime.KeepAlive(cpCapabilitiesAllocMap) + runtime.KeepAlive(cplaneIndexAllocMap) + runtime.KeepAlive(cmodeAllocMap) + runtime.KeepAlive(cphysicalDeviceAllocMap) __v := (Result)(__ret) return __v } // CreateDisplayPlaneSurface function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkCreateDisplayPlaneSurfaceKHR func CreateDisplayPlaneSurface(instance Instance, pCreateInfo *DisplaySurfaceCreateInfo, pAllocator *AllocationCallbacks, pSurface *Surface) Result { - cinstance, _ := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpSurface, _ := (*C.VkSurfaceKHR)(unsafe.Pointer(pSurface)), cgoAllocsUnknown + cinstance, cinstanceAllocMap := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpSurface, cpSurfaceAllocMap := (*C.VkSurfaceKHR)(unsafe.Pointer(pSurface)), cgoAllocsUnknown __ret := C.callVkCreateDisplayPlaneSurfaceKHR(cinstance, cpCreateInfo, cpAllocator, cpSurface) + runtime.KeepAlive(cpSurfaceAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cinstanceAllocMap) __v := (Result)(__ret) return __v } // CreateSharedSwapchains function as declared in https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#VkCreateSharedSwapchainsKHR func CreateSharedSwapchains(device Device, swapchainCount uint32, pCreateInfos []SwapchainCreateInfo, pAllocator *AllocationCallbacks, pSwapchains *Swapchain) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cswapchainCount, _ := (C.uint32_t)(swapchainCount), cgoAllocsUnknown - cpCreateInfos, _ := unpackArgSSwapchainCreateInfo(pCreateInfos) - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpSwapchains, _ := (*C.VkSwapchainKHR)(unsafe.Pointer(pSwapchains)), cgoAllocsUnknown + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cswapchainCount, cswapchainCountAllocMap := (C.uint32_t)(swapchainCount), cgoAllocsUnknown + cpCreateInfos, cpCreateInfosAllocMap := unpackArgSSwapchainCreateInfo(pCreateInfos) + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpSwapchains, cpSwapchainsAllocMap := (*C.VkSwapchainKHR)(unsafe.Pointer(pSwapchains)), cgoAllocsUnknown __ret := C.callVkCreateSharedSwapchainsKHR(cdevice, cswapchainCount, cpCreateInfos, cpAllocator, cpSwapchains) + runtime.KeepAlive(cpSwapchainsAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) packSSwapchainCreateInfo(pCreateInfos, cpCreateInfos) + runtime.KeepAlive(cpCreateInfosAllocMap) + runtime.KeepAlive(cswapchainCountAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // CreateDebugReportCallback function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCreateDebugReportCallbackEXT.html func CreateDebugReportCallback(instance Instance, pCreateInfo *DebugReportCallbackCreateInfo, pAllocator *AllocationCallbacks, pCallback *DebugReportCallback) Result { - cinstance, _ := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown - cpCreateInfo, _ := pCreateInfo.PassRef() - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown - cpCallback, _ := (*C.VkDebugReportCallbackEXT)(unsafe.Pointer(pCallback)), cgoAllocsUnknown + cinstance, cinstanceAllocMap := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown + cpCreateInfo, cpCreateInfoAllocMap := pCreateInfo.PassRef() + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cpCallback, cpCallbackAllocMap := (*C.VkDebugReportCallbackEXT)(unsafe.Pointer(pCallback)), cgoAllocsUnknown __ret := C.callVkCreateDebugReportCallbackEXT(cinstance, cpCreateInfo, cpAllocator, cpCallback) + runtime.KeepAlive(cpCallbackAllocMap) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(cpCreateInfoAllocMap) + runtime.KeepAlive(cinstanceAllocMap) __v := (Result)(__ret) return __v } // DestroyDebugReportCallback function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDestroyDebugReportCallbackEXT.html func DestroyDebugReportCallback(instance Instance, callback DebugReportCallback, pAllocator *AllocationCallbacks) { - cinstance, _ := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown - ccallback, _ := *(*C.VkDebugReportCallbackEXT)(unsafe.Pointer(&callback)), cgoAllocsUnknown - cpAllocator, _ := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown + cinstance, cinstanceAllocMap := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown + ccallback, ccallbackAllocMap := *(*C.VkDebugReportCallbackEXT)(unsafe.Pointer(&callback)), cgoAllocsUnknown + cpAllocator, cpAllocatorAllocMap := (*C.VkAllocationCallbacks)(unsafe.Pointer(pAllocator)), cgoAllocsUnknown C.callVkDestroyDebugReportCallbackEXT(cinstance, ccallback, cpAllocator) + runtime.KeepAlive(cpAllocatorAllocMap) + runtime.KeepAlive(ccallbackAllocMap) + runtime.KeepAlive(cinstanceAllocMap) } // DebugReportMessage function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkDebugReportMessageEXT.html -func DebugReportMessage(instance Instance, flags DebugReportFlags, objectType DebugReportObjectType, object uint64, location uint, messageCode int32, pLayerPrefix string, pMessage string) { - cinstance, _ := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown - cflags, _ := (C.VkDebugReportFlagsEXT)(flags), cgoAllocsUnknown - cobjectType, _ := (C.VkDebugReportObjectTypeEXT)(objectType), cgoAllocsUnknown - cobject, _ := (C.uint64_t)(object), cgoAllocsUnknown - clocation, _ := (C.size_t)(location), cgoAllocsUnknown - cmessageCode, _ := (C.int32_t)(messageCode), cgoAllocsUnknown - cpLayerPrefix, _ := unpackPCharString(pLayerPrefix) - cpMessage, _ := unpackPCharString(pMessage) +func DebugReportMessage(instance Instance, flags DebugReportFlags, objectType DebugReportObjectType, object uint32, location uint32, messageCode int32, pLayerPrefix string, pMessage string) { + cinstance, cinstanceAllocMap := *(*C.VkInstance)(unsafe.Pointer(&instance)), cgoAllocsUnknown + cflags, cflagsAllocMap := (C.VkDebugReportFlagsEXT)(flags), cgoAllocsUnknown + cobjectType, cobjectTypeAllocMap := (C.VkDebugReportObjectTypeEXT)(objectType), cgoAllocsUnknown + cobject, cobjectAllocMap := (C.uint64_t)(object), cgoAllocsUnknown + clocation, clocationAllocMap := (C.size_t)(location), cgoAllocsUnknown + cmessageCode, cmessageCodeAllocMap := (C.int32_t)(messageCode), cgoAllocsUnknown + cpLayerPrefix, cpLayerPrefixAllocMap := unpackPCharString(pLayerPrefix) + cpMessage, cpMessageAllocMap := unpackPCharString(pMessage) C.callVkDebugReportMessageEXT(cinstance, cflags, cobjectType, cobject, clocation, cmessageCode, cpLayerPrefix, cpMessage) + runtime.KeepAlive(cpMessageAllocMap) + runtime.KeepAlive(cpLayerPrefixAllocMap) + runtime.KeepAlive(cmessageCodeAllocMap) + runtime.KeepAlive(clocationAllocMap) + runtime.KeepAlive(cobjectAllocMap) + runtime.KeepAlive(cobjectTypeAllocMap) + runtime.KeepAlive(cflagsAllocMap) + runtime.KeepAlive(cinstanceAllocMap) } // GetRefreshCycleDurationGOOGLE function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetRefreshCycleDurationGOOGLE.html func GetRefreshCycleDurationGOOGLE(device Device, swapchain Swapchain, pDisplayTimingProperties *RefreshCycleDurationGOOGLE) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cswapchain, _ := *(*C.VkSwapchainKHR)(unsafe.Pointer(&swapchain)), cgoAllocsUnknown - cpDisplayTimingProperties, _ := pDisplayTimingProperties.PassRef() + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cswapchain, cswapchainAllocMap := *(*C.VkSwapchainKHR)(unsafe.Pointer(&swapchain)), cgoAllocsUnknown + cpDisplayTimingProperties, cpDisplayTimingPropertiesAllocMap := pDisplayTimingProperties.PassRef() __ret := C.callVkGetRefreshCycleDurationGOOGLE(cdevice, cswapchain, cpDisplayTimingProperties) + runtime.KeepAlive(cpDisplayTimingPropertiesAllocMap) + runtime.KeepAlive(cswapchainAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v } // GetPastPresentationTimingGOOGLE function as declared in https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetPastPresentationTimingGOOGLE.html func GetPastPresentationTimingGOOGLE(device Device, swapchain Swapchain, pPresentationTimingCount *uint32, pPresentationTimings *PastPresentationTimingGOOGLE) Result { - cdevice, _ := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown - cswapchain, _ := *(*C.VkSwapchainKHR)(unsafe.Pointer(&swapchain)), cgoAllocsUnknown - cpPresentationTimingCount, _ := (*C.uint32_t)(unsafe.Pointer(pPresentationTimingCount)), cgoAllocsUnknown - cpPresentationTimings, _ := pPresentationTimings.PassRef() + cdevice, cdeviceAllocMap := *(*C.VkDevice)(unsafe.Pointer(&device)), cgoAllocsUnknown + cswapchain, cswapchainAllocMap := *(*C.VkSwapchainKHR)(unsafe.Pointer(&swapchain)), cgoAllocsUnknown + cpPresentationTimingCount, cpPresentationTimingCountAllocMap := (*C.uint32_t)(unsafe.Pointer(pPresentationTimingCount)), cgoAllocsUnknown + cpPresentationTimings, cpPresentationTimingsAllocMap := pPresentationTimings.PassRef() __ret := C.callVkGetPastPresentationTimingGOOGLE(cdevice, cswapchain, cpPresentationTimingCount, cpPresentationTimings) + runtime.KeepAlive(cpPresentationTimingsAllocMap) + runtime.KeepAlive(cpPresentationTimingCountAllocMap) + runtime.KeepAlive(cswapchainAllocMap) + runtime.KeepAlive(cdeviceAllocMap) __v := (Result)(__ret) return __v }