Skip to content

Commit

Permalink
Re-gen.
Browse files Browse the repository at this point in the history
  • Loading branch information
xlab committed May 22, 2016
1 parent b27d488 commit 157aa16
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 27 deletions.
2 changes: 1 addition & 1 deletion cgo_helpers.c
@@ -1,6 +1,6 @@
// THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.

// WARNING: This file has automatically been generated on Mon, 23 May 2016 00:55:37 MSK.
// WARNING: This file has automatically been generated on Mon, 23 May 2016 01:15:17 MSK.
// By http://git.io/cgogen. DO NOT EDIT.

#include "_cgo_export.h"
Expand Down
181 changes: 180 additions & 1 deletion 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, 23 May 2016 00:55:37 MSK.
// WARNING: This file has automatically been generated on Mon, 23 May 2016 01:15:17 MSK.
// By http://git.io/cgogen. DO NOT EDIT.

package vulkan
Expand All @@ -10,6 +10,7 @@ package vulkan
#include "vulkan/vulkan.h"
#include "vulkan_wrapper.h"
#include "vulkan_bridge.h"
#include "android/native_window.h"
#include <stdlib.h>
#include "cgo_helpers.h"
*/
Expand Down Expand Up @@ -14614,6 +14615,10 @@ func (x *AndroidSurfaceCreateInfo) PassRef() (*C.VkAndroidSurfaceCreateInfoKHR,
refeca5c35c.flags, cflags_allocs = (C.VkAndroidSurfaceCreateFlagsKHR)(x.Flags), cgoAllocsUnknown
allocseca5c35c.Borrow(cflags_allocs)

var cwindow_allocs *cgoAllocMap
refeca5c35c.window, cwindow_allocs = *(**C.ANativeWindow)(unsafe.Pointer(&x.Window)), cgoAllocsUnknown
allocseca5c35c.Borrow(cwindow_allocs)

x.refeca5c35c = refeca5c35c
x.allocseca5c35c = allocseca5c35c
return refeca5c35c, allocseca5c35c
Expand All @@ -14637,6 +14642,7 @@ func (x *AndroidSurfaceCreateInfo) Deref() {
x.SType = (StructureType)(x.refeca5c35c.sType)
x.PNext = (unsafe.Pointer)(unsafe.Pointer(x.refeca5c35c.pNext))
x.Flags = (AndroidSurfaceCreateFlags)(x.refeca5c35c.flags)
x.Window = (*ANativeWindow)(unsafe.Pointer(x.refeca5c35c.window))
}

// PassRef returns a reference.
Expand Down Expand Up @@ -15181,6 +15187,179 @@ func (x *DebugMarkerMarkerInfo) Deref() {
x.Color = *(*[4]float32)(unsafe.Pointer(&x.ref234b91fd.color))
}

// Ref returns a reference.
func (x *ANativeWindow) Ref() *C.ANativeWindow {
if x == nil {
return nil
}
return (*C.ANativeWindow)(unsafe.Pointer(x))
}

// Free cleanups the memory using the free stdlib function on C side.
// Does nothing if object has no pointer.
func (x *ANativeWindow) Free() {
if x != nil {
C.free(unsafe.Pointer(x))
}
}

// NewANativeWindowRef initialises a new struct.
func NewANativeWindowRef(ref *C.ANativeWindow) *ANativeWindow {
return (*ANativeWindow)(unsafe.Pointer(ref))
}

// PassRef returns a reference and creates new object if no refernce yet.
func (x *ANativeWindow) PassRef() *C.ANativeWindow {
if x == nil {
x = new(ANativeWindow)
}
return (*C.ANativeWindow)(unsafe.Pointer(x))
}

// unpackArgSMappedMemoryRange transforms a sliced Go data structure into plain C format.
func unpackArgSMappedMemoryRange(x []MappedMemoryRange) (unpacked *C.VkMappedMemoryRange, allocs *cgoAllocMap) {
if x == nil {
return nil, nil
}
allocs = new(cgoAllocMap)
defer runtime.SetFinalizer(&unpacked, func(**C.VkMappedMemoryRange) {
go allocs.Free()
})

len0 := len(x)
mem0 := allocMappedMemoryRangeMemory(len0)
allocs.Add(mem0)
h0 := &sliceHeader{
Data: uintptr(mem0),
Cap: len0,
Len: len0,
}
v0 := *(*[]C.VkMappedMemoryRange)(unsafe.Pointer(h0))
for i0 := range x {
v0[i0], _ = x[i0].PassValue()
}
h := (*sliceHeader)(unsafe.Pointer(&v0))
unpacked = (*C.VkMappedMemoryRange)(unsafe.Pointer(h.Data))
return
}

// packSMappedMemoryRange reads sliced Go data structure out from plain C format.
func packSMappedMemoryRange(v []MappedMemoryRange, ptr0 *C.VkMappedMemoryRange) {
const m = 0x7fffffff
for i0 := range v {
ptr1 := (*(*[m / sizeOfMappedMemoryRangeValue]C.VkMappedMemoryRange)(unsafe.Pointer(ptr0)))[i0]
v[i0] = *NewMappedMemoryRangeRef(unsafe.Pointer(&ptr1))
}
}

// unpackArgSSparseImageMemoryRequirements transforms a sliced Go data structure into plain C format.
func unpackArgSSparseImageMemoryRequirements(x []SparseImageMemoryRequirements) (unpacked *C.VkSparseImageMemoryRequirements, allocs *cgoAllocMap) {
if x == nil {
return nil, nil
}
allocs = new(cgoAllocMap)
defer runtime.SetFinalizer(&unpacked, func(**C.VkSparseImageMemoryRequirements) {
go allocs.Free()
})

len0 := len(x)
mem0 := allocSparseImageMemoryRequirementsMemory(len0)
allocs.Add(mem0)
h0 := &sliceHeader{
Data: uintptr(mem0),
Cap: len0,
Len: len0,
}
v0 := *(*[]C.VkSparseImageMemoryRequirements)(unsafe.Pointer(h0))
for i0 := range x {
v0[i0], _ = x[i0].PassValue()
}
h := (*sliceHeader)(unsafe.Pointer(&v0))
unpacked = (*C.VkSparseImageMemoryRequirements)(unsafe.Pointer(h.Data))
return
}

// packSSparseImageMemoryRequirements reads sliced Go data structure out from plain C format.
func packSSparseImageMemoryRequirements(v []SparseImageMemoryRequirements, ptr0 *C.VkSparseImageMemoryRequirements) {
const m = 0x7fffffff
for i0 := range v {
ptr1 := (*(*[m / sizeOfSparseImageMemoryRequirementsValue]C.VkSparseImageMemoryRequirements)(unsafe.Pointer(ptr0)))[i0]
v[i0] = *NewSparseImageMemoryRequirementsRef(unsafe.Pointer(&ptr1))
}
}

// unpackArgSSparseImageFormatProperties transforms a sliced Go data structure into plain C format.
func unpackArgSSparseImageFormatProperties(x []SparseImageFormatProperties) (unpacked *C.VkSparseImageFormatProperties, allocs *cgoAllocMap) {
if x == nil {
return nil, nil
}
allocs = new(cgoAllocMap)
defer runtime.SetFinalizer(&unpacked, func(**C.VkSparseImageFormatProperties) {
go allocs.Free()
})

len0 := len(x)
mem0 := allocSparseImageFormatPropertiesMemory(len0)
allocs.Add(mem0)
h0 := &sliceHeader{
Data: uintptr(mem0),
Cap: len0,
Len: len0,
}
v0 := *(*[]C.VkSparseImageFormatProperties)(unsafe.Pointer(h0))
for i0 := range x {
v0[i0], _ = x[i0].PassValue()
}
h := (*sliceHeader)(unsafe.Pointer(&v0))
unpacked = (*C.VkSparseImageFormatProperties)(unsafe.Pointer(h.Data))
return
}

// packSSparseImageFormatProperties reads sliced Go data structure out from plain C format.
func packSSparseImageFormatProperties(v []SparseImageFormatProperties, ptr0 *C.VkSparseImageFormatProperties) {
const m = 0x7fffffff
for i0 := range v {
ptr1 := (*(*[m / sizeOfSparseImageFormatPropertiesValue]C.VkSparseImageFormatProperties)(unsafe.Pointer(ptr0)))[i0]
v[i0] = *NewSparseImageFormatPropertiesRef(unsafe.Pointer(&ptr1))
}
}

// unpackArgSBindSparseInfo transforms a sliced Go data structure into plain C format.
func unpackArgSBindSparseInfo(x []BindSparseInfo) (unpacked *C.VkBindSparseInfo, allocs *cgoAllocMap) {
if x == nil {
return nil, nil
}
allocs = new(cgoAllocMap)
defer runtime.SetFinalizer(&unpacked, func(**C.VkBindSparseInfo) {
go allocs.Free()
})

len0 := len(x)
mem0 := allocBindSparseInfoMemory(len0)
allocs.Add(mem0)
h0 := &sliceHeader{
Data: uintptr(mem0),
Cap: len0,
Len: len0,
}
v0 := *(*[]C.VkBindSparseInfo)(unsafe.Pointer(h0))
for i0 := range x {
v0[i0], _ = x[i0].PassValue()
}
h := (*sliceHeader)(unsafe.Pointer(&v0))
unpacked = (*C.VkBindSparseInfo)(unsafe.Pointer(h.Data))
return
}

// packSBindSparseInfo reads sliced Go data structure out from plain C format.
func packSBindSparseInfo(v []BindSparseInfo, ptr0 *C.VkBindSparseInfo) {
const m = 0x7fffffff
for i0 := range v {
ptr1 := (*(*[m / sizeOfBindSparseInfoValue]C.VkBindSparseInfo)(unsafe.Pointer(ptr0)))[i0]
v[i0] = *NewBindSparseInfoRef(unsafe.Pointer(&ptr1))
}
}

// unpackArgSGraphicsPipelineCreateInfo transforms a sliced Go data structure into plain C format.
func unpackArgSGraphicsPipelineCreateInfo(x []GraphicsPipelineCreateInfo) (unpacked *C.VkGraphicsPipelineCreateInfo, allocs *cgoAllocMap) {
if x == nil {
Expand Down
3 changes: 2 additions & 1 deletion cgo_helpers.h
@@ -1,11 +1,12 @@
// THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.

// WARNING: This file has automatically been generated on Mon, 23 May 2016 00:55:37 MSK.
// WARNING: This file has automatically been generated on Mon, 23 May 2016 01:15:17 MSK.
// By http://git.io/cgogen. DO NOT EDIT.

#include "vulkan/vulkan.h"
#include "vulkan_wrapper.h"
#include "vulkan_bridge.h"
#include "android/native_window.h"
#include <stdlib.h>
#pragma once

Expand Down
3 changes: 2 additions & 1 deletion 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, 23 May 2016 00:55:37 MSK.
// WARNING: This file has automatically been generated on Mon, 23 May 2016 01:15:17 MSK.
// By http://git.io/cgogen. DO NOT EDIT.

package vulkan
Expand All @@ -10,6 +10,7 @@ package vulkan
#include "vulkan/vulkan.h"
#include "vulkan_wrapper.h"
#include "vulkan_bridge.h"
#include "android/native_window.h"
#include <stdlib.h>
#include "cgo_helpers.h"
*/
Expand Down
2 changes: 1 addition & 1 deletion 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, 23 May 2016 00:55:37 MSK.
// WARNING: This file has automatically been generated on Mon, 23 May 2016 01:15:17 MSK.
// By http://git.io/cgogen. DO NOT EDIT.

/*
Expand Down
12 changes: 6 additions & 6 deletions errors.go
Expand Up @@ -41,17 +41,17 @@ func Error(result Result) error {
return errTooManyObjects
case ErrorFormatNotSupported:
return errFormatNotSupported
case ErrorSurfaceLostKhr:
case ErrorSurfaceLost:
return errSurfaceLostKHR
case ErrorNativeWindowInUseKhr:
case ErrorNativeWindowInUse:
return errNativeWindowInUseKHR
case SuboptimalKhr:
case Suboptimal:
return warnSuboptimalKHR
case ErrorOutOfDateKhr:
case ErrorOutOfDate:
return errOutOfDateKHR
case ErrorIncompatibleDisplayKhr:
case ErrorIncompatibleDisplay:
return errIncompatibleDisplayKHR
case ErrorValidationFailedExt:
case ErrorValidationFailed:
return errValidationFailedEXT
case ErrorInvalidShaderNv:
return errInvalidShaderNV
Expand Down
7 changes: 6 additions & 1 deletion 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, 23 May 2016 00:55:37 MSK.
// WARNING: This file has automatically been generated on Mon, 23 May 2016 01:15:17 MSK.
// By http://git.io/cgogen. DO NOT EDIT.

package vulkan
Expand All @@ -10,6 +10,7 @@ package vulkan
#include "vulkan/vulkan.h"
#include "vulkan_wrapper.h"
#include "vulkan_bridge.h"
#include "android/native_window.h"
#include <stdlib.h>
#include "cgo_helpers.h"
*/
Expand Down Expand Up @@ -1846,6 +1847,7 @@ type AndroidSurfaceCreateInfo struct {
SType StructureType
PNext unsafe.Pointer
Flags AndroidSurfaceCreateFlags
Window *ANativeWindow
refeca5c35c *C.VkAndroidSurfaceCreateInfoKHR
allocseca5c35c interface{}
}
Expand Down Expand Up @@ -1912,3 +1914,6 @@ type DebugMarkerMarkerInfo struct {
ref234b91fd *C.VkDebugMarkerMarkerInfoEXT
allocs234b91fd interface{}
}

// ANativeWindow as declared in android/native_window.h:36
type ANativeWindow C.ANativeWindow

0 comments on commit 157aa16

Please sign in to comment.