common

package
v0.0.0-...-0931f86 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 8 Imported by: 69

Documentation

Index

Constants

View Source
const (
	InternalAllocationTypeExecutable = C.VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE
)
View Source
const NoTimeout = time.Duration(^int64(0))

Variables

View Source
var ByteOrder = binary.LittleEndian

Functions

func AllocOptionSlice

func AllocOptionSlice[T any, O Options](allocator *cgoparam.Allocator, o []O) (*T, error)

func AllocOptions

func AllocOptions(allocator *cgoparam.Allocator, o Options, preallocatedPointer ...unsafe.Pointer) (unsafe.Pointer, error)

func AllocOutDataHeader

func AllocOutDataHeader(allocator *cgoparam.Allocator, o OutData, preallocatedPointer ...unsafe.Pointer) (unsafe.Pointer, error)

func AllocOutDataHeaderSlice

func AllocOutDataHeaderSlice[T any, O OutData](allocator *cgoparam.Allocator, o []O) (*T, error)

func AllocSlice

func AllocSlice[T any, A CAllocatable](allocator *cgoparam.Allocator, a []A) (*T, error)

func ConvertSlice

func ConvertSlice[T any, U any](values []T, mapping func(in T) U) []U

func OfType

func OfType[T any](values []any) (T, bool)

func PopulateOutData

func PopulateOutData(o OutData, cPointer unsafe.Pointer, helpers ...any) error

func PopulateOutDataSlice

func PopulateOutDataSlice[T any, O OutData](o []O, cSlicePointer unsafe.Pointer, helpers ...any) error

func TimeoutNanoseconds

func TimeoutNanoseconds(timeout time.Duration) uint64

Types

type APIVersion

type APIVersion uint32

func (APIVersion) IsAtLeast

func (v APIVersion) IsAtLeast(otherVersion APIVersion) bool

func (APIVersion) Major

func (v APIVersion) Major() uint32

func (APIVersion) MatchesMajorVersion

func (v APIVersion) MatchesMajorVersion(otherVersion APIVersion) bool

func (APIVersion) MatchesMinorVersion

func (v APIVersion) MatchesMinorVersion(otherVersion APIVersion) bool

func (APIVersion) Max

func (v APIVersion) Max(otherVersion APIVersion) APIVersion

func (APIVersion) Min

func (v APIVersion) Min(otherVersion APIVersion) APIVersion

func (APIVersion) Minor

func (v APIVersion) Minor() uint32

func (APIVersion) Patch

func (v APIVersion) Patch() uint32

func (APIVersion) String

func (v APIVersion) String() string

func (APIVersion) Variant

func (v APIVersion) Variant() uint32

type AllocationCallbackOptions

type AllocationCallbackOptions struct {
	UserData           any
	Allocation         AllocationFunction
	Reallocation       ReallocationFunction
	Free               FreeFunction
	InternalAllocation InternalAllocationNotification
	InternalFree       InternalFreeNotification
}

type AllocationFunction

type AllocationFunction func(userData any, size int, alignment int, allocationScope SystemAllocationScope) unsafe.Pointer

type CAllocatable

type CAllocatable interface {
	PopulateCPointer(allocator *cgoparam.Allocator, preallocatedPointer unsafe.Pointer) (unsafe.Pointer, error)
}

type FlagStringMapping

type FlagStringMapping[T flags] struct {
	// contains filtered or unexported fields
}

func NewFlagStringMapping

func NewFlagStringMapping[T flags]() FlagStringMapping[T]

func (FlagStringMapping[T]) FlagsToString

func (m FlagStringMapping[T]) FlagsToString(value T) string

func (FlagStringMapping[T]) Register

func (m FlagStringMapping[T]) Register(value T, str string)

type FreeFunction

type FreeFunction func(userData any, memory unsafe.Pointer)

type InternalAllocationNotification

type InternalAllocationNotification func(userData any, size int, allocationType InternalAllocationType, allocationScope SystemAllocationScope)

type InternalAllocationType

type InternalAllocationType int32

func (InternalAllocationType) Register

func (e InternalAllocationType) Register(str string)

func (InternalAllocationType) String

func (e InternalAllocationType) String() string

type InternalFreeNotification

type InternalFreeNotification func(userData any, size int, allocationType InternalAllocationType, allocationScope SystemAllocationScope)

type NextOptions

type NextOptions struct {
	Next Options
}

func (NextOptions) NextOptionsInChain

func (n NextOptions) NextOptionsInChain() Options

type NextOutData

type NextOutData struct {
	Next OutData
}

func (NextOutData) NextOutDataInChain

func (n NextOutData) NextOutDataInChain() OutData

type Options

type Options interface {
	PopulateCPointer(allocator *cgoparam.Allocator, preallocatedPointer unsafe.Pointer, next unsafe.Pointer) (unsafe.Pointer, error)

	NextOptionsInChain() Options
}

type OutData

type OutData interface {
	PopulateHeader(allocator *cgoparam.Allocator, preallocatedPointer unsafe.Pointer, next unsafe.Pointer) (unsafe.Pointer, error)
	PopulateOutData(cDataPointer unsafe.Pointer, helpers ...any) (next unsafe.Pointer, err error)

	NextOutDataInChain() OutData
}

type ReallocationFunction

type ReallocationFunction func(userData any, original unsafe.Pointer, size int, allignment int, allocationScope SystemAllocationScope) unsafe.Pointer

type SystemAllocationScope

type SystemAllocationScope int32

func (SystemAllocationScope) Register

func (e SystemAllocationScope) Register(str string)

func (SystemAllocationScope) String

func (e SystemAllocationScope) String() string

type Version

type Version uint32

func CreateVersion

func CreateVersion(major, minor, patch uint32) Version

func (Version) Major

func (v Version) Major() uint32

func (Version) Minor

func (v Version) Minor() uint32

func (Version) Patch

func (v Version) Patch() uint32

func (Version) String

func (v Version) String() string

type VkResult

type VkResult int

func (VkResult) Register

func (e VkResult) Register(str string)

func (VkResult) String

func (e VkResult) String() string

func (VkResult) ToError

func (e VkResult) ToError() error

type VkResultError

type VkResultError struct {
	// contains filtered or unexported fields
}

func (*VkResultError) Error

func (err *VkResultError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL