Documentation
¶
Overview ¶
Package vulkan provides a type-safe Go interface to the Vulkan 1.3+ graphics and compute APIs.
It is designed to be used as a library for other Go projects that need low-level graphics and compute functionality, bridging the gap between Go and the underlying C Vulkan API (libvulkan).
Overview ¶
This library features:
- Full core Vulkan 1.3 API coverage needed for most 3D and compute applications.
- Dynamic Rendering (VK_KHR_dynamic_rendering) out of the box.
- Enhanced synchronization with Synchronization2 (VK_KHR_synchronization2).
- Explicit memory management with LeakTracker integration for safe resource tracking.
- Compute shader capabilities suitable for AI/ML and parallel tasks.
- Hardware-accelerated video decoding/encoding through Vulkan Video extensions.
Initializing Vulkan ¶
The first step in any Vulkan application is initializing the library by creating an Instance:
appInfo := &vulkan.ApplicationInfo{
ApplicationName: "My First Vulkan App",
ApplicationVersion: vulkan.MakeVersion(1, 0, 0),
EngineName: "No Engine",
EngineVersion: vulkan.MakeVersion(1, 0, 0),
APIVersion: vulkan.Version13, // Target Vulkan 1.3
}
createInfo := &vulkan.InstanceCreateInfo{
ApplicationInfo: appInfo,
}
instance, err := vulkan.CreateInstance(createInfo)
if err != nil {
log.Fatalf("Failed to create Vulkan instance: %v", err)
}
defer vulkan.DestroyInstance(instance)
Selecting a Device ¶
After initialization, you must select a physical device (GPU) and create a logical device interface:
physicalDevices, err := vulkan.EnumeratePhysicalDevices(instance)
if err != nil || len(physicalDevices) == 0 {
log.Fatal("Failed to find GPUs with Vulkan support")
}
deviceCreateInfo := &vulkan.DeviceCreateInfo{
// configure queue create infos, features, and extensions
}
device, err := vulkan.CreateDevice(physicalDevices[0], deviceCreateInfo)
if err != nil {
log.Fatalf("Failed to create logical device: %v", err)
}
defer vulkan.DestroyDevice(device)
Error Handling ¶
This package uses two main error types:
- ValidationError: Indicates that API detected invalid input (e.g., nil pointers) before calling the Vulkan C API.
- VulkanError: Indicates that the underlying Vulkan C API call failed.
You can inspect the error with errors.As or functions like IsVulkanError(). Transient errors like VK_ERROR_DEVICE_LOST or VK_ERROR_OUT_OF_DATE_KHR can be handled by rebuilding the context or swapchain.
Thread Safety ¶
The package is largely thread-safe for reading. Functions that create or destroy Vulkan objects are thread-safe with respect to the parent Instance/Device. However, modifying the same Vulkan object concurrently from multiple goroutines (e.g., recording to the same CommandBuffer simultaneously) requires explicit external synchronization (e.g. sync.Mutex). Note that video extension loading functions (LoadVideoDeviceFunctions, LoadVideoInstanceFunctions) must be executed from a single thread.
Index ¶
- Constants
- Variables
- func AcquireNextImage(device Device, swapchain Swapchain, timeout uint64, semaphore Semaphore, ...) (uint32, bool, error)
- func BeginCommandBuffer(commandBuffer CommandBuffer, beginInfo *CommandBufferBeginInfo) error
- func BindBufferMemory(device Device, buffer Buffer, memory DeviceMemory, memoryOffset DeviceSize) error
- func BindImageMemory(device Device, image Image, memory DeviceMemory, memoryOffset DeviceSize) error
- func BindVideoSessionMemory(device Device, videoSession VideoSession, bindInfos []VideoBindMemoryInfo) error
- func ClearLeaks()
- func CmdBeginDebugUtilsLabelEXT(commandBuffer CommandBuffer, labelInfo *DebugUtilsLabel)
- func CmdBeginQuery(commandBuffer CommandBuffer, queryPool QueryPool, query uint32, ...)
- func CmdBeginRenderPass(commandBuffer CommandBuffer, beginInfo *RenderPassBeginInfo, ...)
- func CmdBeginRendering(commandBuffer CommandBuffer, renderingInfo *RenderingInfo)
- func CmdBeginVideoCoding(commandBuffer CommandBuffer, beginInfo *VideoBeginCodingInfo) error
- func CmdBindDescriptorSets(commandBuffer CommandBuffer, pipelineBindPoint PipelineBindPoint, ...)
- func CmdBindIndexBuffer(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, ...)
- func CmdBindPipeline(commandBuffer CommandBuffer, pipelineBindPoint PipelineBindPoint, ...)
- func CmdBindVertexBuffers(commandBuffer CommandBuffer, firstBinding uint32, buffers []Buffer, ...)
- func CmdBindVertexBuffers2(commandBuffer CommandBuffer, firstBinding uint32, buffers []Buffer, ...)
- func CmdBlitImage(commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, ...)
- func CmdBuildAccelerationStructuresKHR(commandBuffer CommandBuffer, infos []AccelerationStructureBuildGeometryInfoKHR)
- func CmdClearAttachments(commandBuffer CommandBuffer, attachments []ClearAttachment, rects []ClearRect)
- func CmdClearColorImage(commandBuffer CommandBuffer, image Image, imageLayout ImageLayout, ...)
- func CmdClearDepthStencilImage(commandBuffer CommandBuffer, image Image, imageLayout ImageLayout, ...)
- func CmdControlVideoCoding(commandBuffer CommandBuffer, controlInfo *VideoCodingControlInfo) error
- func CmdControlVideoCodingReset(commandBuffer CommandBuffer) error
- func CmdCopyBuffer(commandBuffer CommandBuffer, srcBuffer, dstBuffer Buffer, regions []BufferCopy)
- func CmdCopyBufferToImage(commandBuffer CommandBuffer, srcBuffer Buffer, dstImage Image, ...)
- func CmdCopyImage(commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, ...)
- func CmdCopyImageToBuffer(commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, ...)
- func CmdCopyQueryPoolResults(commandBuffer CommandBuffer, queryPool QueryPool, ...)
- func CmdDecodeVideo(commandBuffer CommandBuffer, decodeInfo *VideoDecodeInfo) error
- func CmdDispatch(commandBuffer CommandBuffer, groupCountX, groupCountY, groupCountZ uint32)
- func CmdDispatchIndirect(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize)
- func CmdDraw(commandBuffer CommandBuffer, ...)
- func CmdDrawIndexed(commandBuffer CommandBuffer, indexCount, instanceCount, firstIndex uint32, ...)
- func CmdDrawIndexedIndirect(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, ...)
- func CmdDrawIndexedIndirectCount(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, ...)
- func CmdDrawIndirect(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, ...)
- func CmdDrawIndirectCount(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, ...)
- func CmdDrawMeshTasksEXT(commandBuffer CommandBuffer, groupCountX, groupCountY, groupCountZ uint32)
- func CmdDrawMeshTasksIndirectCountEXT(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, ...)
- func CmdDrawMeshTasksIndirectEXT(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, ...)
- func CmdEncodeVideo(commandBuffer CommandBuffer, encodeInfo *VideoEncodeInfo) error
- func CmdEndDebugUtilsLabelEXT(commandBuffer CommandBuffer)
- func CmdEndQuery(commandBuffer CommandBuffer, queryPool QueryPool, query uint32)
- func CmdEndRenderPass(commandBuffer CommandBuffer)
- func CmdEndRendering(commandBuffer CommandBuffer)
- func CmdEndVideoCoding(commandBuffer CommandBuffer) error
- func CmdExecuteCommands(commandBuffer CommandBuffer, commandBuffers []CommandBuffer)
- func CmdFillBuffer(commandBuffer CommandBuffer, dstBuffer Buffer, dstOffset DeviceSize, ...)
- func CmdInsertDebugUtilsLabelEXT(commandBuffer CommandBuffer, labelInfo *DebugUtilsLabel)
- func CmdNextSubpass(commandBuffer CommandBuffer, contents SubpassContents)
- func CmdPipelineBarrier(commandBuffer CommandBuffer, srcStageMask, dstStageMask PipelineStageFlags, ...)
- func CmdPipelineBarrierFull(commandBuffer CommandBuffer, srcStageMask PipelineStageFlags, ...)
- func CmdPushConstants(commandBuffer CommandBuffer, layout PipelineLayout, ...)
- func CmdPushConstantsTyped[T any](commandBuffer CommandBuffer, layout PipelineLayout, ...)
- func CmdResetEvent(commandBuffer CommandBuffer, event Event, stageMask PipelineStageFlags)
- func CmdResetQueryPool(commandBuffer CommandBuffer, queryPool QueryPool, ...)
- func CmdResolveImage(commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, ...)
- func CmdSetCullMode(commandBuffer CommandBuffer, cullMode CullModeFlags)
- func CmdSetDepthBoundsTestEnable(commandBuffer CommandBuffer, depthBoundsTestEnable bool)
- func CmdSetDepthCompareOp(commandBuffer CommandBuffer, depthCompareOp CompareOp)
- func CmdSetDepthTestEnable(commandBuffer CommandBuffer, depthTestEnable bool)
- func CmdSetDepthWriteEnable(commandBuffer CommandBuffer, depthWriteEnable bool)
- func CmdSetEvent(commandBuffer CommandBuffer, event Event, stageMask PipelineStageFlags)
- func CmdSetFrontFace(commandBuffer CommandBuffer, frontFace FrontFace)
- func CmdSetPrimitiveTopology(commandBuffer CommandBuffer, primitiveTopology PrimitiveTopology)
- func CmdSetScissor(commandBuffer CommandBuffer, firstScissor uint32, scissors []Rect2D)
- func CmdSetScissorWithCount(commandBuffer CommandBuffer, scissors []Rect2D)
- func CmdSetStencilOp(commandBuffer CommandBuffer, faceMask StencilFaceFlags, ...)
- func CmdSetStencilTestEnable(commandBuffer CommandBuffer, stencilTestEnable bool)
- func CmdSetViewport(commandBuffer CommandBuffer, firstViewport uint32, viewports []Viewport)
- func CmdSetViewportWithCount(commandBuffer CommandBuffer, viewports []Viewport)
- func CmdTraceRaysKHR(commandBuffer CommandBuffer, ...)
- func CmdUpdateBuffer(commandBuffer CommandBuffer, dstBuffer Buffer, dstOffset DeviceSize, ...)
- func CmdWaitEvents(commandBuffer CommandBuffer, events []Event, srcStageMask PipelineStageFlags, ...)
- func CmdWriteTimestamp(commandBuffer CommandBuffer, pipelineStage PipelineStageFlags, ...)
- func CopyDataToStagingBuffer(stagingBuffer *StagingBuffer, data []byte) error
- func DestroyAccelerationStructureKHR(device Device, accelerationStructure AccelerationStructureKHR)
- func DestroyBuffer(device Device, buffer Buffer)
- func DestroyBufferView(device Device, bufferView BufferView)
- func DestroyCommandPool(device Device, commandPool CommandPool)
- func DestroyDebugUtilsMessengerEXT(instance Instance, messenger DebugUtilsMessengerEXT)
- func DestroyDescriptorPool(device Device, pool DescriptorPool)
- func DestroyDescriptorSetLayout(device Device, layout DescriptorSetLayout)
- func DestroyDevice(device Device)
- func DestroyEvent(device Device, event Event)
- func DestroyFence(device Device, fence Fence)
- func DestroyFramebuffer(device Device, framebuffer Framebuffer)
- func DestroyImage(device Device, image Image)
- func DestroyImageView(device Device, imageView ImageView)
- func DestroyInstance(instance Instance)
- func DestroyPipeline(device Device, pipeline Pipeline)
- func DestroyPipelineCache(device Device, pipelineCache PipelineCache)
- func DestroyPipelineLayout(device Device, pipelineLayout PipelineLayout)
- func DestroyPrivateDataSlot(device Device, privateDataSlot PrivateDataSlot)
- func DestroyQueryPool(device Device, queryPool QueryPool)
- func DestroyRenderPass(device Device, renderPass RenderPass)
- func DestroySampler(device Device, sampler Sampler)
- func DestroySemaphore(device Device, semaphore Semaphore)
- func DestroyShaderModule(device Device, shaderModule ShaderModule)
- func DestroyStagingBuffer(device Device, stagingBuffer *StagingBuffer)
- func DestroySurface(instance Instance, surface Surface)
- func DestroySwapchain(device Device, swapchain Swapchain)
- func DestroyVideoSession(device Device, videoSession VideoSession)
- func DestroyVideoSessionParameters(device Device, videoSessionParameters VideoSessionParameters)
- func DeviceWaitIdle(device Device) error
- func DisableLeakTracker()
- func EnableLeakTracker()
- func EndCommandBuffer(commandBuffer CommandBuffer) error
- func FindMemoryType(memProperties PhysicalDeviceMemoryProperties, typeFilter uint32, ...) (uint32, bool)
- func FindMemoryTypeForUsage(memProperties PhysicalDeviceMemoryProperties, typeFilter uint32, ...) (uint32, bool)
- func FindVideoDecodeQueueFamily(physicalDevice PhysicalDevice) (uint32, bool)
- func FindVideoEncodeQueueFamily(physicalDevice PhysicalDevice) (uint32, bool)
- func FlushMappedMemoryRanges(device Device, memoryRanges []MappedMemoryRange) error
- func FreeCommandBuffers(device Device, commandPool CommandPool, commandBuffers []CommandBuffer)
- func FreeDescriptorSets(device Device, descriptorPool DescriptorPool, descriptorSets []DescriptorSet) error
- func FreeMemory(device Device, memory DeviceMemory)
- func GetPhysicalDeviceSurfaceSupport(physicalDevice PhysicalDevice, queueFamilyIndex uint32, surface Surface) (bool, error)
- func GetPipelineCacheData(device Device, pipelineCache PipelineCache) ([]byte, error)
- func GetPrivateData(device Device, objectType ObjectType, objectHandle uint64, ...) uint64
- func GetSemaphoreCounterValue(device Device, semaphore Semaphore) (uint64, error)
- func GetSupportedVideoCodecs(physicalDevice PhysicalDevice) ([]string, error)
- func InvalidateMappedMemoryRanges(device Device, memoryRanges []MappedMemoryRange) error
- func IsErrorDeviceLost(err error) bool
- func IsErrorOutOfDate(err error) bool
- func IsErrorSurfaceLost(err error) bool
- func IsExtensionSupported(extensionName string, availableExtensions []ExtensionProperties) bool
- func IsLayerSupported(layerName string, availableLayers []LayerProperties) bool
- func IsVulkanError(err error) bool
- func LoadAccelerationStructureFunctions(device Device)
- func LoadDebugUtilsFunctions(instance Instance)
- func LoadVideoDeviceFunctions(device Device) bool
- func LoadVideoFormatFunctions(instance Instance) bool
- func LoadVideoInstanceFunctions(instance Instance) bool
- func MapMemory(device Device, memory DeviceMemory, offset, size DeviceSize, flags uint32) (unsafe.Pointer, error)
- func MergePipelineCaches(device Device, dstCache PipelineCache, srcCaches []PipelineCache) error
- func QueueBeginDebugUtilsLabelEXT(queue Queue, labelInfo *DebugUtilsLabel)
- func QueueBindSparse(queue Queue, bindInfos []BindSparseInfo, fence Fence) error
- func QueueEndDebugUtilsLabelEXT(queue Queue)
- func QueueInsertDebugUtilsLabelEXT(queue Queue, labelInfo *DebugUtilsLabel)
- func QueuePresent(queue Queue, presentInfo *PresentInfo) (bool, error)
- func QueueSubmit(queue Queue, submitInfos []SubmitInfo, fence Fence) error
- func QueueSubmit2(queue Queue, submitInfos []SubmitInfo2, fence Fence) error
- func QueueWaitIdle(queue Queue) error
- func ReportLeaks() string
- func ResetCommandPool(device Device, commandPool CommandPool, flags CommandPoolResetFlags) error
- func ResetDescriptorPool(device Device, descriptorPool DescriptorPool) error
- func ResetEvent(device Device, event Event) error
- func ResetFences(device Device, fences []Fence) error
- func ResetQueryPool(device Device, queryPool QueryPool, firstQuery, queryCount uint32)
- func ResetVideoDeviceFunctions()
- func ResetVideoFormatFunctions()
- func ResetVideoInstanceFunctions()
- func SetDebugUtilsObjectNameEXT(device Device, nameInfo *DebugUtilsObjectNameInfo) error
- func SetEvent(device Device, event Event) error
- func SetPrivateData(device Device, objectType ObjectType, objectHandle uint64, ...) error
- func SignalSemaphore(device Device, signalInfo *SemaphoreSignalInfo) error
- func TransitionImageLayout(commandBuffer CommandBuffer, image Image, format Format, oldLayout ImageLayout, ...)
- func TrimCommandPool(device Device, commandPool CommandPool)
- func UnmapMemory(device Device, memory DeviceMemory)
- func UpdateDescriptorSets(device Device, writes []WriteDescriptorSet, copies []CopyDescriptorSet)
- func UpdateVideoSessionParameters(device Device, videoSessionParameters VideoSessionParameters, ...) error
- type AV1DecodeSessionCreateInfo
- type AV1EncodeSessionCreateInfo
- type AV1Level
- type AV1Profile
- type AccelerationStructure
- type AccelerationStructureBuildGeometryInfoKHR
- type AccelerationStructureCreateInfoKHR
- type AccelerationStructureKHR
- type AccelerationStructureTypeKHR
- type AccessFlags
- type ApplicationInfo
- type AttachmentDescription
- type AttachmentLoadOp
- type AttachmentReference
- type AttachmentStoreOp
- type BindSparseInfo
- type BlendFactor
- type BlendOp
- type Bool32
- type Buffer
- type BufferCopy
- type BufferCreateFlags
- type BufferCreateInfo
- type BufferImageCopy
- type BufferMemoryBarrier
- type BufferUsageFlags
- type BufferView
- type BufferViewCreateInfo
- type ClearAttachment
- type ClearColorValue
- type ClearDepthStencilValue
- type ClearRect
- type ClearValue
- type ColorComponentFlags
- type ColorSpace
- type CommandBuffer
- type CommandBufferAllocateInfo
- type CommandBufferBeginInfo
- type CommandBufferInheritanceInfo
- type CommandBufferLevel
- type CommandBufferSubmitInfo
- type CommandBufferUsageFlags
- type CommandPool
- type CommandPoolCreateFlags
- type CommandPoolCreateInfo
- type CommandPoolResetFlags
- type CompareOp
- type CompositeAlphaFlags
- type ComputePipelineCreateInfo
- type CopyDescriptorSet
- type CuFunction
- type CuModule
- type CullModeFlags
- type DPBManager
- func (dpb *DPBManager) AddSlot(imageView ImageView, imageLayout ImageLayout, poc int32) (*DPBSlot, error)
- func (dpb *DPBManager) CalculatePOC() int32
- func (dpb *DPBManager) GetReferenceSlots() []DPBSlot
- func (dpb *DPBManager) MarkAsLongTerm(slotIndex int32)
- func (dpb *DPBManager) RemoveOldestReference()
- func (dpb *DPBManager) Reset()
- type DPBSlot
- type DebugCallbackFunc
- type DebugUtilsLabel
- type DebugUtilsMessageSeverityFlags
- type DebugUtilsMessageTypeFlags
- type DebugUtilsMessengerCallbackData
- type DebugUtilsMessengerCreateInfo
- type DebugUtilsMessengerEXT
- type DebugUtilsObjectNameInfo
- type DeferredOperation
- type DependencyFlags
- type DescriptorBufferInfo
- type DescriptorImageInfo
- type DescriptorPool
- type DescriptorPoolCreateFlags
- type DescriptorPoolCreateInfo
- type DescriptorPoolManager
- type DescriptorPoolSize
- type DescriptorSet
- type DescriptorSetAllocateInfo
- type DescriptorSetLayout
- type DescriptorSetLayoutBinding
- type DescriptorSetLayoutCreateInfo
- type DescriptorType
- type DescriptorUpdateTemplate
- type Device
- type DeviceAddress
- type DeviceCreateInfo
- type DeviceGroupDeviceCreateInfo
- type DeviceMemory
- type DeviceQueueCreateInfo
- type DeviceSize
- type Display
- type DisplayMode
- type DrawMeshTasksIndirectCommandEXT
- type DynamicState
- type Event
- type EventCreateFlags
- type EventCreateInfo
- type ExtensionProperties
- type Extent2D
- type Extent3D
- type Fence
- type FenceCreateFlags
- type FenceCreateInfo
- type Filter
- type Flags
- type Format
- type FormatFeatureFlags
- type FormatProperties
- type Framebuffer
- type FramebufferCreateInfo
- type FrontFace
- type GraphicsPipelineCreateInfo
- type H264DecodeSessionCreateInfo
- type H264EncodeSessionCreateInfo
- type H264Level
- type H264Profile
- type H265DecodeSessionCreateInfo
- type H265EncodeSessionCreateInfo
- type H265Level
- type H265Profile
- type Image
- type ImageAspectFlags
- type ImageBlit
- type ImageCopy
- type ImageCreateFlags
- type ImageCreateInfo
- type ImageFormatProperties
- type ImageLayout
- type ImageMemoryBarrier
- type ImageResolve
- type ImageSubresource
- type ImageSubresourceLayers
- type ImageSubresourceRange
- type ImageTiling
- type ImageType
- type ImageUsageFlags
- type ImageView
- type ImageViewCreateInfo
- type ImageViewType
- type IndexType
- type Instance
- type InstanceCreateInfo
- type LayerProperties
- type LeakTracker
- type LogicOp
- type MappedMemoryRange
- type MemoryAllocateInfo
- type MemoryBarrier
- type MemoryHeap
- type MemoryHeapFlags
- type MemoryPool
- type MemoryPropertyFlags
- type MemoryRequirements
- func GetBufferMemoryRequirements(device Device, buffer Buffer) MemoryRequirements
- func GetDeviceBufferMemoryRequirements(device Device, bufferCreateInfo *BufferCreateInfo) MemoryRequirements
- func GetDeviceImageMemoryRequirements(device Device, imageCreateInfo *ImageCreateInfo) MemoryRequirements
- func GetImageMemoryRequirements(device Device, image Image) MemoryRequirements
- func GetVideoSessionMemoryRequirements(device Device, videoSession VideoSession) ([]MemoryRequirements, error)deprecated
- type MemoryType
- type MemoryUsage
- type MeshShaderFunctions
- func (f *MeshShaderFunctions) CmdDrawMeshTasksEXT(commandBuffer CommandBuffer, groupCountX, groupCountY, groupCountZ uint32)
- func (f *MeshShaderFunctions) CmdDrawMeshTasksIndirectCountEXT(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, ...)
- func (f *MeshShaderFunctions) CmdDrawMeshTasksIndirectEXT(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, ...)
- type MicromapEXT
- type ObjectType
- type Offset2D
- type Offset3D
- type OpticalFlowSession
- type PerformanceConfiguration
- type PhysicalDevice
- type PhysicalDeviceFeatures
- type PhysicalDeviceGroupProperties
- type PhysicalDeviceLimits
- type PhysicalDeviceMemoryProperties
- type PhysicalDeviceMeshShaderFeaturesEXT
- type PhysicalDeviceMeshShaderPropertiesEXT
- type PhysicalDeviceProperties
- type PhysicalDeviceSparseProperties
- type PhysicalDeviceType
- type PhysicalDeviceVulkan11Features
- type PhysicalDeviceVulkan12Features
- type PhysicalDeviceVulkan13Features
- type Pipeline
- type PipelineBindPoint
- type PipelineCache
- type PipelineCacheCreateFlags
- type PipelineCacheCreateInfo
- type PipelineColorBlendAttachmentState
- type PipelineColorBlendStateCreateInfo
- type PipelineCreateFlags
- type PipelineCreationFeedback
- type PipelineCreationFeedbackCreateInfo
- type PipelineCreationFeedbackFlags
- type PipelineDepthStencilStateCreateInfo
- type PipelineDynamicStateCreateInfo
- type PipelineInputAssemblyStateCreateInfo
- type PipelineLayout
- type PipelineLayoutCreateInfo
- type PipelineLibraryCreateInfoKHR
- type PipelineMultisampleStateCreateInfo
- type PipelineRasterizationStateCreateInfo
- type PipelineShaderStageCreateInfo
- type PipelineStageFlags
- type PipelineStageFlags2
- type PipelineTessellationStateCreateInfo
- type PipelineVertexInputStateCreateInfo
- type PipelineViewportStateCreateInfo
- type PolygonMode
- type PresentInfo
- type PresentMode
- type PrimitiveTopology
- type PrivateDataSlot
- type PrivateDataSlotCreateFlags
- type PrivateDataSlotCreateInfo
- type PushConstantRange
- type QueryControlFlags
- type QueryPipelineStatisticFlags
- type QueryPool
- type QueryPoolCreateFlags
- type QueryPoolCreateInfo
- type QueryResultFlags
- type QueryType
- type Queue
- type QueueFamilyProperties
- type QueueFlags
- type RayTracingFunctions
- type RayTracingPipelineCreateInfoKHR
- type RayTracingPipelineInterfaceCreateInfoKHR
- type RayTracingShaderGroupCreateInfoKHR
- type RayTracingShaderGroupTypeKHR
- type Rect2D
- type RenderPass
- type RenderPassBeginInfo
- type RenderPassCreateInfo
- type RenderingAttachmentInfo
- type RenderingFlags
- type RenderingInfo
- type ResolveModeFlagBits
- type Result
- func GetEventStatus(device Device, event Event) (Result, error)
- func GetFenceStatus(device Device, fence Fence) (Result, error)
- func GetQueryPoolResults(device Device, queryPool QueryPool, firstQuery, queryCount uint32, ...) ([]byte, Result, error)
- func GetQueryPoolResultsUint32(device Device, queryPool QueryPool, firstQuery, queryCount uint32, ...) ([]uint32, Result, error)
- func GetQueryPoolResultsUint64(device Device, queryPool QueryPool, firstQuery, queryCount uint32, ...) ([]uint64, Result, error)
- func WaitForFences(device Device, fences []Fence, waitAll bool, timeout uint64) (Result, error)
- func WaitSemaphores(device Device, waitInfo *SemaphoreWaitInfo, timeout uint64) (Result, error)
- type SampleCountFlags
- type Sampler
- type SamplerAddressMode
- type SamplerCreateInfo
- type SamplerYcbcrConversion
- type Semaphore
- type SemaphoreCreateInfo
- type SemaphoreSignalInfo
- type SemaphoreSubmitInfo
- type SemaphoreType
- type SemaphoreTypeCreateInfo
- type SemaphoreWaitFlags
- type SemaphoreWaitInfo
- type ShaderEXT
- type ShaderModule
- type ShaderModuleCreateInfo
- type ShaderStageFlags
- type SharingMode
- type SparseBufferMemoryBindInfo
- type SparseImageFormatFlags
- type SparseImageFormatProperties
- type SparseImageMemoryBind
- type SparseImageMemoryBindInfo
- type SparseImageMemoryRequirements
- type SparseImageOpaqueMemoryBindInfo
- type SparseMemoryBind
- type SparseMemoryBindFlags
- type StagingBuffer
- type StencilFaceFlags
- type StencilOp
- type StencilOpState
- type StridedDeviceAddressRegionKHR
- type SubmitFlags
- type SubmitInfo
- type SubmitInfo2
- type SubpassContents
- type SubpassDependency
- type SubpassDescription
- type SubresourceLayout
- type Surface
- type SurfaceCapabilities
- type SurfaceFormat
- type SurfaceTransformFlags
- type Swapchain
- type SwapchainCreateFlags
- type SwapchainCreateInfo
- type ThreadLocalCommandPool
- type ValidationCache
- type ValidationError
- type Version
- type VertexInputAttributeDescription
- type VertexInputBindingDescription
- type VertexInputRate
- type VideoBeginCodingInfo
- type VideoBindMemoryInfo
- type VideoCapabilities
- type VideoChromaSubsampling
- type VideoCodecOperationFlags
- type VideoCodingControlFlags
- type VideoCodingControlInfo
- type VideoComponentBitDepth
- type VideoDecodeCapabilities
- type VideoDecodeCapabilityFlags
- type VideoDecodeH264Capabilities
- type VideoDecodeH264PictureLayoutFlags
- type VideoDecodeH264ProfileInfo
- type VideoDecodeH264SessionParametersCreateInfo
- type VideoDecodeH265Capabilities
- type VideoDecodeH265ProfileInfo
- type VideoDecodeH265SessionParametersCreateInfo
- type VideoDecodeInfo
- type VideoDeviceFunctions
- type VideoEncodeCapabilities
- type VideoEncodeCapabilityFlags
- type VideoEncodeFeedbackFlags
- type VideoEncodeH264Capabilities
- type VideoEncodeH264ProfileInfo
- type VideoEncodeH264SessionParametersCreateInfo
- type VideoEncodeH265Capabilities
- type VideoEncodeH265ProfileInfo
- type VideoEncodeH265SessionParametersCreateInfo
- type VideoEncodeInfo
- type VideoEncodeRateControlInfo
- type VideoEncodeRateControlMode
- type VideoFormatProperties
- type VideoPictureResource
- type VideoProfileInfo
- type VideoSession
- func CreateAV1DecodeSession(device Device, createInfo *AV1DecodeSessionCreateInfo) (VideoSession, error)
- func CreateAV1EncodeSession(device Device, createInfo *AV1EncodeSessionCreateInfo) (VideoSession, error)
- func CreateH264DecodeSession(device Device, createInfo *H264DecodeSessionCreateInfo) (VideoSession, error)
- func CreateH264EncodeSession(device Device, createInfo *H264EncodeSessionCreateInfo) (VideoSession, error)
- func CreateH265DecodeSession(device Device, createInfo *H265DecodeSessionCreateInfo) (VideoSession, error)
- func CreateH265EncodeSession(device Device, createInfo *H265EncodeSessionCreateInfo) (VideoSession, error)
- func CreateVideoSession(device Device, createInfo *VideoSessionCreateInfo) (VideoSession, error)
- type VideoSessionCreateInfo
- type VideoSessionMemoryRequirements
- type VideoSessionParameters
- type VideoSessionParametersCreateInfo
- type VideoSessionParametersUpdateInfo
- type Viewport
- type VulkanError
- type WaylandSurfaceCreateInfoKHR
- type WriteDescriptorSet
- type XlibSurfaceCreateInfoKHR
- type YUVFormat
Constants ¶
const ( MaxMemoryTypes = C.VK_MAX_MEMORY_TYPES MaxMemoryHeaps = C.VK_MAX_MEMORY_HEAPS MaxPhysicalDeviceNameSize = C.VK_MAX_PHYSICAL_DEVICE_NAME_SIZE MaxExtensionNameSize = C.VK_MAX_EXTENSION_NAME_SIZE MaxDescriptionSize = C.VK_MAX_DESCRIPTION_SIZE UuidSize = C.VK_UUID_SIZE LuidSize = C.VK_LUID_SIZE MaxDriverNameSize = C.VK_MAX_DRIVER_NAME_SIZE MaxDriverInfoSize = C.VK_MAX_DRIVER_INFO_SIZE AttachmentUnused = C.VK_ATTACHMENT_UNUSED SubpassExternal = C.VK_SUBPASS_EXTERNAL QueueFamilyIgnored = C.VK_QUEUE_FAMILY_IGNORED QueueFamilyExternal = C.VK_QUEUE_FAMILY_EXTERNAL QueueFamilyForeignEXT = C.VK_QUEUE_FAMILY_FOREIGN_EXT RemainingMipLevels = C.VK_REMAINING_MIP_LEVELS RemainingArrayLayers = C.VK_REMAINING_ARRAY_LAYERS WholeSize = uint64(C.VK_WHOLE_SIZE) )
Constants
const ( // H.264 (AVC) extensions ExtensionNameVideoDecodeH264 = "VK_KHR_video_decode_h264" ExtensionNameVideoEncodeH264 = "VK_KHR_video_encode_h264" // H.265 (HEVC) extensions ExtensionNameVideoDecodeH265 = "VK_KHR_video_decode_h265" ExtensionNameVideoEncodeH265 = "VK_KHR_video_encode_h265" // AV1 extensions ExtensionNameVideoDecodeAV1 = "VK_KHR_video_decode_av1" ExtensionNameVideoEncodeAV1 = "VK_KHR_video_encode_av1" // Base video extensions ExtensionNameVideoQueue = "VK_KHR_video_queue" ExtensionNameVideoDecodeQueue = "VK_KHR_video_decode_queue" ExtensionNameVideoEncodeQueue = "VK_KHR_video_encode_queue" ExtensionNameVideoMaintenance1 = "VK_KHR_video_maintenance1" )
Video codec extension name constants
const ShaderUnusedKHR uint32 = C.VK_SHADER_UNUSED_KHR
Variables ¶
var (
NullHandle = unsafe.Pointer(nil)
)
Null handle constants
Functions ¶
func AcquireNextImage ¶ added in v1.1.0
func AcquireNextImage(device Device, swapchain Swapchain, timeout uint64, semaphore Semaphore, fence Fence) (uint32, bool, error)
AcquireNextImage acquires the next presentable image from a swapchain. Returns the index of the next image to use, and whether the swapchain is suboptimal.
func BeginCommandBuffer ¶
func BeginCommandBuffer(commandBuffer CommandBuffer, beginInfo *CommandBufferBeginInfo) error
BeginCommandBuffer begins recording a command buffer
func BindBufferMemory ¶
func BindBufferMemory(device Device, buffer Buffer, memory DeviceMemory, memoryOffset DeviceSize) error
BindBufferMemory binds buffer memory
func BindImageMemory ¶
func BindImageMemory(device Device, image Image, memory DeviceMemory, memoryOffset DeviceSize) error
BindImageMemory binds image memory
func BindVideoSessionMemory ¶
func BindVideoSessionMemory(device Device, videoSession VideoSession, bindInfos []VideoBindMemoryInfo) error
BindVideoSessionMemory binds memory to a video session
func ClearLeaks ¶ added in v1.2.0
func ClearLeaks()
ClearLeaks resets the current list of tracked allocations.
func CmdBeginDebugUtilsLabelEXT ¶ added in v1.2.0
func CmdBeginDebugUtilsLabelEXT(commandBuffer CommandBuffer, labelInfo *DebugUtilsLabel)
CmdBeginDebugUtilsLabelEXT opens a command buffer debug label region
func CmdBeginQuery ¶ added in v1.1.0
func CmdBeginQuery(commandBuffer CommandBuffer, queryPool QueryPool, query uint32, flags QueryControlFlags)
CmdBeginQuery begins a query
func CmdBeginRenderPass ¶
func CmdBeginRenderPass(commandBuffer CommandBuffer, beginInfo *RenderPassBeginInfo, contents SubpassContents)
CmdBeginRenderPass begins a render pass
func CmdBeginRendering ¶
func CmdBeginRendering(commandBuffer CommandBuffer, renderingInfo *RenderingInfo)
CmdBeginRendering begins a render pass instance with dynamic rendering
func CmdBeginVideoCoding ¶
func CmdBeginVideoCoding(commandBuffer CommandBuffer, beginInfo *VideoBeginCodingInfo) error
CmdBeginVideoCoding begins video coding operations in a command buffer. Returns an error if LoadVideoDeviceFunctions was not called or video extensions are not supported.
LIMITATION: reference slots cannot be bound yet (referenceSlotCount is always zero), so DPB-based decode/encode is not possible. See https://github.com/darkace1998/Golang-Vulkan-api/issues/122.
func CmdBindDescriptorSets ¶
func CmdBindDescriptorSets(commandBuffer CommandBuffer, pipelineBindPoint PipelineBindPoint, layout PipelineLayout, firstSet uint32, descriptorSets []DescriptorSet, dynamicOffsets []uint32)
CmdBindDescriptorSets binds descriptor sets to a command buffer
func CmdBindIndexBuffer ¶
func CmdBindIndexBuffer(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, indexType IndexType)
CmdBindIndexBuffer binds an index buffer
func CmdBindPipeline ¶
func CmdBindPipeline(commandBuffer CommandBuffer, pipelineBindPoint PipelineBindPoint, pipeline Pipeline)
CmdBindPipeline binds a pipeline
func CmdBindVertexBuffers ¶
func CmdBindVertexBuffers(commandBuffer CommandBuffer, firstBinding uint32, buffers []Buffer, offsets []DeviceSize)
CmdBindVertexBuffers binds vertex buffers
func CmdBindVertexBuffers2 ¶
func CmdBindVertexBuffers2(commandBuffer CommandBuffer, firstBinding uint32, buffers []Buffer, offsets []DeviceSize, sizes []DeviceSize, strides []DeviceSize)
CmdBindVertexBuffers2 binds vertex buffers with extended parameters. offsets must have the same length as buffers (pOffsets is required by the Vulkan spec); sizes and strides are optional and may be nil.
func CmdBlitImage ¶ added in v1.1.0
func CmdBlitImage( commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, dstImage Image, dstImageLayout ImageLayout, regions []ImageBlit, filter Filter, )
CmdBlitImage copies regions of an image with potential format conversion and scaling
func CmdBuildAccelerationStructuresKHR ¶ added in v1.2.0
func CmdBuildAccelerationStructuresKHR(commandBuffer CommandBuffer, infos []AccelerationStructureBuildGeometryInfoKHR)
CmdBuildAccelerationStructuresKHR builds acceleration structures (stubbed implementation).
func CmdClearAttachments ¶ added in v1.1.0
func CmdClearAttachments(commandBuffer CommandBuffer, attachments []ClearAttachment, rects []ClearRect)
CmdClearAttachments clears attachment regions within a render pass
func CmdClearColorImage ¶ added in v1.1.0
func CmdClearColorImage(commandBuffer CommandBuffer, image Image, imageLayout ImageLayout, color *ClearColorValue, ranges []ImageSubresourceRange)
CmdClearColorImage clears a color image outside of a render pass
func CmdClearDepthStencilImage ¶ added in v1.1.0
func CmdClearDepthStencilImage(commandBuffer CommandBuffer, image Image, imageLayout ImageLayout, depthStencil *ClearDepthStencilValue, ranges []ImageSubresourceRange)
CmdClearDepthStencilImage clears a depth/stencil image outside of a render pass
func CmdControlVideoCoding ¶
func CmdControlVideoCoding(commandBuffer CommandBuffer, controlInfo *VideoCodingControlInfo) error
CmdControlVideoCoding executes the operation CmdControlVideoCoding controls video coding operations. Returns an error if LoadVideoDeviceFunctions was not called or video extensions are not supported.
func CmdControlVideoCodingReset ¶ added in v1.1.0
func CmdControlVideoCodingReset(commandBuffer CommandBuffer) error
CmdControlVideoCodingReset issues a reset control command for video coding
func CmdCopyBuffer ¶
func CmdCopyBuffer(commandBuffer CommandBuffer, srcBuffer, dstBuffer Buffer, regions []BufferCopy)
CmdCopyBuffer copies data between buffers
func CmdCopyBufferToImage ¶ added in v1.1.0
func CmdCopyBufferToImage( commandBuffer CommandBuffer, srcBuffer Buffer, dstImage Image, dstImageLayout ImageLayout, regions []BufferImageCopy, )
CmdCopyBufferToImage copies data from a buffer to an image
func CmdCopyImage ¶ added in v1.1.0
func CmdCopyImage( commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, dstImage Image, dstImageLayout ImageLayout, regions []ImageCopy, )
CmdCopyImage copies data between images
func CmdCopyImageToBuffer ¶ added in v1.1.0
func CmdCopyImageToBuffer( commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, dstBuffer Buffer, regions []BufferImageCopy, )
CmdCopyImageToBuffer copies data from an image to a buffer
func CmdCopyQueryPoolResults ¶ added in v1.1.0
func CmdCopyQueryPoolResults(commandBuffer CommandBuffer, queryPool QueryPool, firstQuery, queryCount uint32, dstBuffer Buffer, dstOffset DeviceSize, stride DeviceSize, flags QueryResultFlags)
CmdCopyQueryPoolResults copies the results of queries in a query pool to a buffer object
func CmdDecodeVideo ¶
func CmdDecodeVideo(commandBuffer CommandBuffer, decodeInfo *VideoDecodeInfo) error
CmdDecodeVideo performs video decode operation in a command buffer. Returns an error if LoadVideoDeviceFunctions was not called or video extensions are not supported.
LIMITATION: the mandatory codec-specific picture info (e.g. VkVideoDecodeH264PictureInfoKHR) and reference slots are not yet implemented, so the recorded command does not satisfy Vulkan valid usage for real frame decoding. Supplying ReferenceSlots returns an error. See https://github.com/darkace1998/Golang-Vulkan-api/issues/122.
func CmdDispatch ¶
func CmdDispatch(commandBuffer CommandBuffer, groupCountX, groupCountY, groupCountZ uint32)
CmdDispatch dispatches compute work
func CmdDispatchIndirect ¶
func CmdDispatchIndirect(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize)
CmdDispatchIndirect dispatches compute work with parameters from a buffer
func CmdDraw ¶
func CmdDraw(commandBuffer CommandBuffer, vertexCount, instanceCount, firstVertex, firstInstance uint32)
CmdDraw records a draw command
func CmdDrawIndexed ¶
func CmdDrawIndexed(commandBuffer CommandBuffer, indexCount, instanceCount, firstIndex uint32, vertexOffset int32, firstInstance uint32)
CmdDrawIndexed records an indexed draw command
func CmdDrawIndexedIndirect ¶ added in v1.1.0
func CmdDrawIndexedIndirect(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, drawCount, stride uint32)
CmdDrawIndexedIndirect executes the operation CmdDrawIndexedIndirect records an indexed indirect draw command The draw parameters are read from a buffer at the specified offset stride specifies the byte stride between successive draw parameter structures
func CmdDrawIndexedIndirectCount ¶ added in v1.1.0
func CmdDrawIndexedIndirectCount(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, countBuffer Buffer, countBufferOffset DeviceSize, maxDrawCount, stride uint32)
CmdDrawIndexedIndirectCount executes the operation CmdDrawIndexedIndirectCount records an indexed indirect draw command with draw count from a buffer (Vulkan 1.2+) The draw count is read from countBuffer at countBufferOffset maxDrawCount specifies the maximum number of draws that will be executed
func CmdDrawIndirect ¶ added in v1.1.0
func CmdDrawIndirect(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, drawCount, stride uint32)
CmdDrawIndirect executes the operation CmdDrawIndirect records an indirect draw command The draw parameters are read from a buffer at the specified offset stride specifies the byte stride between successive draw parameter structures
func CmdDrawIndirectCount ¶ added in v1.1.0
func CmdDrawIndirectCount(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, countBuffer Buffer, countBufferOffset DeviceSize, maxDrawCount, stride uint32)
CmdDrawIndirectCount executes the operation CmdDrawIndirectCount records an indirect draw command with draw count from a buffer (Vulkan 1.2+) The draw count is read from countBuffer at countBufferOffset maxDrawCount specifies the maximum number of draws that will be executed
func CmdDrawMeshTasksEXT ¶ added in v1.2.0
func CmdDrawMeshTasksEXT(commandBuffer CommandBuffer, groupCountX, groupCountY, groupCountZ uint32)
CmdDrawMeshTasksEXT draws mesh tasks using the functions of the first device passed to LoadMeshShaderFunctions. Single-device convenience; multi-device applications must use MeshShaderFunctions methods.
func CmdDrawMeshTasksIndirectCountEXT ¶ added in v1.2.0
func CmdDrawMeshTasksIndirectCountEXT(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, countBuffer Buffer, countBufferOffset DeviceSize, maxDrawCount, stride uint32)
CmdDrawMeshTasksIndirectCountEXT draws mesh tasks with indirect parameters and indirect count using the functions of the first device passed to LoadMeshShaderFunctions. Single-device convenience; multi-device applications must use MeshShaderFunctions methods.
func CmdDrawMeshTasksIndirectEXT ¶ added in v1.2.0
func CmdDrawMeshTasksIndirectEXT(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, drawCount, stride uint32)
CmdDrawMeshTasksIndirectEXT draws mesh tasks with indirect parameters using the functions of the first device passed to LoadMeshShaderFunctions. Single-device convenience; multi-device applications must use MeshShaderFunctions methods.
func CmdEncodeVideo ¶
func CmdEncodeVideo(commandBuffer CommandBuffer, encodeInfo *VideoEncodeInfo) error
CmdEncodeVideo performs video encode operation in a command buffer. Returns an error if LoadVideoDeviceFunctions was not called or video extensions are not supported.
LIMITATION: the mandatory codec-specific picture info (e.g. VkVideoEncodeH264PictureInfoKHR) and reference slots are not yet implemented, so the recorded command does not satisfy Vulkan valid usage for real frame encoding. Supplying ReferenceSlots returns an error. See https://github.com/darkace1998/Golang-Vulkan-api/issues/122.
func CmdEndDebugUtilsLabelEXT ¶ added in v1.2.0
func CmdEndDebugUtilsLabelEXT(commandBuffer CommandBuffer)
CmdEndDebugUtilsLabelEXT closes a command buffer debug label region
func CmdEndQuery ¶ added in v1.1.0
func CmdEndQuery(commandBuffer CommandBuffer, queryPool QueryPool, query uint32)
CmdEndQuery ends a query
func CmdEndRenderPass ¶
func CmdEndRenderPass(commandBuffer CommandBuffer)
CmdEndRenderPass ends a render pass
func CmdEndRendering ¶
func CmdEndRendering(commandBuffer CommandBuffer)
CmdEndRendering ends a render pass instance with dynamic rendering
func CmdEndVideoCoding ¶
func CmdEndVideoCoding(commandBuffer CommandBuffer) error
CmdEndVideoCoding executes the operation CmdEndVideoCoding ends video coding operations in a command buffer. Returns an error if LoadVideoDeviceFunctions was not called or video extensions are not supported.
func CmdExecuteCommands ¶ added in v1.1.0
func CmdExecuteCommands(commandBuffer CommandBuffer, commandBuffers []CommandBuffer)
CmdExecuteCommands executes secondary command buffers from a primary command buffer
func CmdFillBuffer ¶ added in v1.1.0
func CmdFillBuffer( commandBuffer CommandBuffer, dstBuffer Buffer, dstOffset DeviceSize, size DeviceSize, data uint32, )
CmdFillBuffer executes the operation CmdFillBuffer fills a buffer with a fixed 32-bit value size must be a multiple of 4, or WholeSize to fill to the end
func CmdInsertDebugUtilsLabelEXT ¶ added in v1.2.0
func CmdInsertDebugUtilsLabelEXT(commandBuffer CommandBuffer, labelInfo *DebugUtilsLabel)
CmdInsertDebugUtilsLabelEXT inserts a single debug label into a command buffer
func CmdNextSubpass ¶ added in v1.1.0
func CmdNextSubpass(commandBuffer CommandBuffer, contents SubpassContents)
CmdNextSubpass advances to the next subpass in a render pass
func CmdPipelineBarrier ¶
func CmdPipelineBarrier(commandBuffer CommandBuffer, srcStageMask, dstStageMask PipelineStageFlags, dependencyFlags uint32)
CmdPipelineBarrier inserts a pipeline barrier
func CmdPipelineBarrierFull ¶ added in v1.1.0
func CmdPipelineBarrierFull( commandBuffer CommandBuffer, srcStageMask PipelineStageFlags, dstStageMask PipelineStageFlags, dependencyFlags DependencyFlags, memoryBarriers []MemoryBarrier, bufferMemoryBarriers []BufferMemoryBarrier, imageMemoryBarriers []ImageMemoryBarrier, )
CmdPipelineBarrierFull inserts a pipeline barrier with full memory barrier support
func CmdPushConstants ¶ added in v1.1.0
func CmdPushConstants(commandBuffer CommandBuffer, layout PipelineLayout, stageFlags ShaderStageFlags, offset uint32, data []byte)
CmdPushConstants executes the operation CmdPushConstants updates push constant values stageFlags specifies the shader stages that will use the push constants offset is the start offset of the push constant range to update (must be a multiple of 4) data is the actual data to upload (size must be a multiple of 4)
func CmdPushConstantsTyped ¶ added in v1.1.0
func CmdPushConstantsTyped[T any](commandBuffer CommandBuffer, layout PipelineLayout, stageFlags ShaderStageFlags, offset uint32, value *T)
CmdPushConstantsTyped executes the operation CmdPushConstantsTyped CmdPushConstantsTyped is a generic helper for pushing typed data as push constants This is a convenience wrapper around CmdPushConstants for common use cases
func CmdResetEvent ¶ added in v1.1.0
func CmdResetEvent(commandBuffer CommandBuffer, event Event, stageMask PipelineStageFlags)
CmdResetEvent resets an event object to unsignaled state from the device
func CmdResetQueryPool ¶ added in v1.1.0
func CmdResetQueryPool(commandBuffer CommandBuffer, queryPool QueryPool, firstQuery, queryCount uint32)
CmdResetQueryPool resets a range of queries in a query pool on the GPU
func CmdResolveImage ¶ added in v1.1.0
func CmdResolveImage( commandBuffer CommandBuffer, srcImage Image, srcImageLayout ImageLayout, dstImage Image, dstImageLayout ImageLayout, regions []ImageResolve, )
CmdResolveImage resolves a multisample image to a non-multisample image
func CmdSetCullMode ¶
func CmdSetCullMode(commandBuffer CommandBuffer, cullMode CullModeFlags)
CmdSetCullMode sets the cull mode dynamically
func CmdSetDepthBoundsTestEnable ¶
func CmdSetDepthBoundsTestEnable(commandBuffer CommandBuffer, depthBoundsTestEnable bool)
CmdSetDepthBoundsTestEnable sets depth bounds test enable state dynamically
func CmdSetDepthCompareOp ¶
func CmdSetDepthCompareOp(commandBuffer CommandBuffer, depthCompareOp CompareOp)
CmdSetDepthCompareOp sets depth compare operation dynamically
func CmdSetDepthTestEnable ¶
func CmdSetDepthTestEnable(commandBuffer CommandBuffer, depthTestEnable bool)
CmdSetDepthTestEnable sets depth test enable state dynamically
func CmdSetDepthWriteEnable ¶
func CmdSetDepthWriteEnable(commandBuffer CommandBuffer, depthWriteEnable bool)
CmdSetDepthWriteEnable sets depth write enable state dynamically
func CmdSetEvent ¶ added in v1.1.0
func CmdSetEvent(commandBuffer CommandBuffer, event Event, stageMask PipelineStageFlags)
CmdSetEvent sets an event object to signaled state from the device
func CmdSetFrontFace ¶
func CmdSetFrontFace(commandBuffer CommandBuffer, frontFace FrontFace)
CmdSetFrontFace sets the front face orientation dynamically
func CmdSetPrimitiveTopology ¶
func CmdSetPrimitiveTopology(commandBuffer CommandBuffer, primitiveTopology PrimitiveTopology)
CmdSetPrimitiveTopology sets the primitive topology dynamically
func CmdSetScissor ¶
func CmdSetScissor(commandBuffer CommandBuffer, firstScissor uint32, scissors []Rect2D)
CmdSetScissor sets the scissor rectangles
func CmdSetScissorWithCount ¶
func CmdSetScissorWithCount(commandBuffer CommandBuffer, scissors []Rect2D)
CmdSetScissorWithCount sets scissor rectangles with count dynamically
func CmdSetStencilOp ¶
func CmdSetStencilOp(commandBuffer CommandBuffer, faceMask StencilFaceFlags, failOp, passOp, depthFailOp StencilOp, compareOp CompareOp)
CmdSetStencilOp sets stencil operation dynamically
func CmdSetStencilTestEnable ¶
func CmdSetStencilTestEnable(commandBuffer CommandBuffer, stencilTestEnable bool)
CmdSetStencilTestEnable sets stencil test enable state dynamically
func CmdSetViewport ¶
func CmdSetViewport(commandBuffer CommandBuffer, firstViewport uint32, viewports []Viewport)
CmdSetViewport sets the viewport
func CmdSetViewportWithCount ¶
func CmdSetViewportWithCount(commandBuffer CommandBuffer, viewports []Viewport)
CmdSetViewportWithCount sets viewports with count dynamically
func CmdTraceRaysKHR ¶ added in v1.2.0
func CmdTraceRaysKHR(commandBuffer CommandBuffer, raygen, miss, hit, callable *StridedDeviceAddressRegionKHR, width, height, depth uint32)
CmdTraceRaysKHR records a trace-rays command using the functions of the first device passed to LoadRayTracingPipelineFunctions. Single-device convenience; multi-device applications must use RayTracingFunctions methods.
func CmdUpdateBuffer ¶ added in v1.1.0
func CmdUpdateBuffer( commandBuffer CommandBuffer, dstBuffer Buffer, dstOffset DeviceSize, data []byte, )
CmdUpdateBuffer executes the operation CmdUpdateBuffer updates buffer contents inline from host memory The data size must be less than or equal to 65536 bytes and a multiple of 4
func CmdWaitEvents ¶ added in v1.1.0
func CmdWaitEvents( commandBuffer CommandBuffer, events []Event, srcStageMask PipelineStageFlags, dstStageMask PipelineStageFlags, memoryBarriers []MemoryBarrier, bufferMemoryBarriers []BufferMemoryBarrier, imageMemoryBarriers []ImageMemoryBarrier, )
CmdWaitEvents waits for one or more events and inserts a set of memory barriers
func CmdWriteTimestamp ¶ added in v1.1.0
func CmdWriteTimestamp(commandBuffer CommandBuffer, pipelineStage PipelineStageFlags, queryPool QueryPool, query uint32)
CmdWriteTimestamp writes a device timestamp into a query object
func CopyDataToStagingBuffer ¶ added in v1.1.0
func CopyDataToStagingBuffer(stagingBuffer *StagingBuffer, data []byte) error
CopyDataToStagingBuffer copies data to a staging buffer
func DestroyAccelerationStructureKHR ¶ added in v1.2.0
func DestroyAccelerationStructureKHR(device Device, accelerationStructure AccelerationStructureKHR)
DestroyAccelerationStructureKHR destroys an acceleration structure.
func DestroyBuffer ¶
DestroyBuffer destroys a buffer
func DestroyBufferView ¶ added in v1.1.0
func DestroyBufferView(device Device, bufferView BufferView)
DestroyBufferView destroys a buffer view
func DestroyCommandPool ¶
func DestroyCommandPool(device Device, commandPool CommandPool)
DestroyCommandPool destroys a command pool
func DestroyDebugUtilsMessengerEXT ¶ added in v1.2.0
func DestroyDebugUtilsMessengerEXT(instance Instance, messenger DebugUtilsMessengerEXT)
DestroyDebugUtilsMessengerEXT destroys a debug messenger
func DestroyDescriptorPool ¶
func DestroyDescriptorPool(device Device, pool DescriptorPool)
DestroyDescriptorPool destroys a descriptor pool
func DestroyDescriptorSetLayout ¶
func DestroyDescriptorSetLayout(device Device, layout DescriptorSetLayout)
DestroyDescriptorSetLayout destroys a descriptor set layout
func DestroyEvent ¶ added in v1.1.0
DestroyEvent destroys an event object
func DestroyFramebuffer ¶ added in v1.1.0
func DestroyFramebuffer(device Device, framebuffer Framebuffer)
DestroyFramebuffer destroys a framebuffer
func DestroyImageView ¶
DestroyImageView destroys an image view
func DestroyInstance ¶
func DestroyInstance(instance Instance)
DestroyInstance destroys a Vulkan instance
func DestroyPipeline ¶
DestroyPipeline destroys a pipeline
func DestroyPipelineCache ¶ added in v1.1.0
func DestroyPipelineCache(device Device, pipelineCache PipelineCache)
DestroyPipelineCache destroys a pipeline cache
func DestroyPipelineLayout ¶
func DestroyPipelineLayout(device Device, pipelineLayout PipelineLayout)
DestroyPipelineLayout destroys a pipeline layout
func DestroyPrivateDataSlot ¶
func DestroyPrivateDataSlot(device Device, privateDataSlot PrivateDataSlot)
DestroyPrivateDataSlot destroys a private data slot
func DestroyQueryPool ¶ added in v1.1.0
DestroyQueryPool destroys a query pool
func DestroyRenderPass ¶
func DestroyRenderPass(device Device, renderPass RenderPass)
DestroyRenderPass destroys a render pass
func DestroySampler ¶
DestroySampler destroys a sampler
func DestroySemaphore ¶
DestroySemaphore destroys a semaphore
func DestroyShaderModule ¶
func DestroyShaderModule(device Device, shaderModule ShaderModule)
DestroyShaderModule destroys a shader module
func DestroyStagingBuffer ¶ added in v1.1.0
func DestroyStagingBuffer(device Device, stagingBuffer *StagingBuffer)
DestroyStagingBuffer destroys a staging buffer and frees its memory
func DestroySurface ¶ added in v1.1.0
DestroySurface destroys a surface
func DestroySwapchain ¶ added in v1.1.0
DestroySwapchain destroys a swapchain
func DestroyVideoSession ¶
func DestroyVideoSession(device Device, videoSession VideoSession)
DestroyVideoSession destroys a video session
func DestroyVideoSessionParameters ¶
func DestroyVideoSessionParameters(device Device, videoSessionParameters VideoSessionParameters)
DestroyVideoSessionParameters destroys video session parameters
func DeviceWaitIdle ¶
DeviceWaitIdle waits for a device to become idle
func DisableLeakTracker ¶ added in v1.2.0
func DisableLeakTracker()
DisableLeakTracker turns off tracking of Vulkan object allocations.
func EnableLeakTracker ¶ added in v1.2.0
func EnableLeakTracker()
EnableLeakTracker turns on tracking of Vulkan object allocations.
func EndCommandBuffer ¶
func EndCommandBuffer(commandBuffer CommandBuffer) error
EndCommandBuffer ends recording a command buffer
func FindMemoryType ¶
func FindMemoryType(memProperties PhysicalDeviceMemoryProperties, typeFilter uint32, properties MemoryPropertyFlags) (uint32, bool)
FindMemoryType finds a suitable memory type
func FindMemoryTypeForUsage ¶ added in v1.1.0
func FindMemoryTypeForUsage(memProperties PhysicalDeviceMemoryProperties, typeFilter uint32, usage MemoryUsage) (uint32, bool)
FindMemoryTypeForUsage finds a suitable memory type based on common usage patterns This provides automatic memory type selection for common use cases
func FindVideoDecodeQueueFamily ¶ added in v1.1.0
func FindVideoDecodeQueueFamily(physicalDevice PhysicalDevice) (uint32, bool)
FindVideoDecodeQueueFamily finds a queue family that supports video decode
func FindVideoEncodeQueueFamily ¶ added in v1.1.0
func FindVideoEncodeQueueFamily(physicalDevice PhysicalDevice) (uint32, bool)
FindVideoEncodeQueueFamily finds a queue family that supports video encode
func FlushMappedMemoryRanges ¶ added in v1.1.0
func FlushMappedMemoryRanges(device Device, memoryRanges []MappedMemoryRange) error
FlushMappedMemoryRanges flushes mapped memory ranges to make host writes visible to device This is required for non-coherent memory after the host writes to mapped memory
func FreeCommandBuffers ¶
func FreeCommandBuffers(device Device, commandPool CommandPool, commandBuffers []CommandBuffer)
FreeCommandBuffers frees command buffers
func FreeDescriptorSets ¶ added in v1.1.0
func FreeDescriptorSets(device Device, descriptorPool DescriptorPool, descriptorSets []DescriptorSet) error
FreeDescriptorSets frees one or more descriptor sets
func FreeMemory ¶
func FreeMemory(device Device, memory DeviceMemory)
FreeMemory frees device memory
func GetPhysicalDeviceSurfaceSupport ¶ added in v1.1.0
func GetPhysicalDeviceSurfaceSupport(physicalDevice PhysicalDevice, queueFamilyIndex uint32, surface Surface) (bool, error)
GetPhysicalDeviceSurfaceSupport queries if a queue family supports presentation
func GetPipelineCacheData ¶ added in v1.1.0
func GetPipelineCacheData(device Device, pipelineCache PipelineCache) ([]byte, error)
GetPipelineCacheData retrieves the data from a pipeline cache
func GetPrivateData ¶
func GetPrivateData(device Device, objectType ObjectType, objectHandle uint64, privateDataSlot PrivateDataSlot) uint64
GetPrivateData retrieves data associated with a Vulkan object
func GetSemaphoreCounterValue ¶ added in v1.1.0
GetSemaphoreCounterValue gets the current counter value of a timeline semaphore (Vulkan 1.2+)
func GetSupportedVideoCodecs ¶
func GetSupportedVideoCodecs(physicalDevice PhysicalDevice) ([]string, error)
GetSupportedVideoCodecs returns a list of supported video codecs on the system
func InvalidateMappedMemoryRanges ¶ added in v1.1.0
func InvalidateMappedMemoryRanges(device Device, memoryRanges []MappedMemoryRange) error
InvalidateMappedMemoryRanges invalidates mapped memory ranges to make device writes visible to host This is required for non-coherent memory before the host reads from mapped memory
func IsErrorDeviceLost ¶ added in v1.2.0
IsErrorDeviceLost checks if an error indicates that the Vulkan device has been lost (VK_ERROR_DEVICE_LOST). It correctly unwraps nested errors.
func IsErrorOutOfDate ¶ added in v1.2.0
IsErrorOutOfDate checks if an error indicates that the Vulkan swapchain is out of date (VK_ERROR_OUT_OF_DATE_KHR). It correctly unwraps nested errors.
func IsErrorSurfaceLost ¶ added in v1.2.0
IsErrorSurfaceLost checks if an error indicates that the Vulkan surface has been lost (VK_ERROR_SURFACE_LOST_KHR). It correctly unwraps nested errors.
func IsExtensionSupported ¶
func IsExtensionSupported(extensionName string, availableExtensions []ExtensionProperties) bool
IsExtensionSupported checks if an extension is supported
func IsLayerSupported ¶
func IsLayerSupported(layerName string, availableLayers []LayerProperties) bool
IsLayerSupported checks if a layer is supported
func IsVulkanError ¶
IsVulkanError checks if an error is a VulkanError
func LoadAccelerationStructureFunctions ¶ added in v1.2.0
func LoadAccelerationStructureFunctions(device Device)
LoadAccelerationStructureFunctions loads the device-level acceleration structure functions.
func LoadDebugUtilsFunctions ¶ added in v1.2.0
func LoadDebugUtilsFunctions(instance Instance)
LoadDebugUtilsFunctions loads the debug utils functions for an instance.
func LoadVideoDeviceFunctions ¶ added in v1.0.3
LoadVideoDeviceFunctions loads video extension functions that require a Vulkan device.
This function MUST be called after creating a logical device and before using any video-related functionality. If this function is not called, all video API calls will fail.
This function is thread-safe. The underlying C function pointers are loaded exactly once; subsequent calls return the cached result. Note that only one device is supported at a time. If you need to reload for a different device, use ResetVideoDeviceFunctions first. Returns false if any video extension function could not be loaded. This indicates the device does not fully support the VK_KHR_video_queue extension.
func LoadVideoFormatFunctions ¶ added in v1.1.0
LoadVideoFormatFunctions loads video format query functions. This must be called after creating a Vulkan instance.
This function is thread-safe. The underlying C function pointer is loaded exactly once; subsequent calls return the cached result. Only one instance is supported at a time; use ResetVideoFormatFunctions to reload for a different instance.
func LoadVideoInstanceFunctions ¶ added in v1.0.3
LoadVideoInstanceFunctions loads video extension functions that require a Vulkan instance.
This function MUST be called after creating a Vulkan instance and before using any video-related functionality. If this function is not called, all video API calls will fail.
This function is thread-safe. The underlying C function pointers are loaded exactly once; subsequent calls return the cached result. Note that only one instance is supported at a time. If you need to reload for a different instance, use ResetVideoInstanceFunctions first.
Returns false if the video extension functions could not be loaded (e.g., if the Vulkan implementation does not support the VK_KHR_video_queue extension).
func MapMemory ¶
func MapMemory(device Device, memory DeviceMemory, offset, size DeviceSize, flags uint32) (unsafe.Pointer, error)
MapMemory maps device memory
func MergePipelineCaches ¶ added in v1.1.0
func MergePipelineCaches(device Device, dstCache PipelineCache, srcCaches []PipelineCache) error
MergePipelineCaches merges multiple pipeline caches into a destination cache
func QueueBeginDebugUtilsLabelEXT ¶ added in v1.2.0
func QueueBeginDebugUtilsLabelEXT(queue Queue, labelInfo *DebugUtilsLabel)
QueueBeginDebugUtilsLabelEXT opens a queue debug label region
func QueueBindSparse ¶ added in v1.1.0
func QueueBindSparse(queue Queue, bindInfos []BindSparseInfo, fence Fence) error
QueueBindSparse binds sparse resources on a queue
func QueueEndDebugUtilsLabelEXT ¶ added in v1.2.0
func QueueEndDebugUtilsLabelEXT(queue Queue)
QueueEndDebugUtilsLabelEXT closes a queue debug label region
func QueueInsertDebugUtilsLabelEXT ¶ added in v1.2.0
func QueueInsertDebugUtilsLabelEXT(queue Queue, labelInfo *DebugUtilsLabel)
QueueInsertDebugUtilsLabelEXT inserts a single debug label into a queue
func QueuePresent ¶ added in v1.1.0
func QueuePresent(queue Queue, presentInfo *PresentInfo) (bool, error)
QueuePresent queues an image for presentation. Returns true if the swapchain is suboptimal.
func QueueSubmit ¶
func QueueSubmit(queue Queue, submitInfos []SubmitInfo, fence Fence) error
QueueSubmit submits command buffers to a queue
func QueueSubmit2 ¶
func QueueSubmit2(queue Queue, submitInfos []SubmitInfo2, fence Fence) error
QueueSubmit2 submits command buffers to a queue with enhanced synchronization
func QueueWaitIdle ¶
QueueWaitIdle waits for a queue to become idle
func ReportLeaks ¶ added in v1.2.0
func ReportLeaks() string
ReportLeaks returns a formatted string containing information about any un-freed resources.
func ResetCommandPool ¶ added in v1.1.0
func ResetCommandPool(device Device, commandPool CommandPool, flags CommandPoolResetFlags) error
ResetCommandPool resets a command pool
func ResetDescriptorPool ¶ added in v1.1.0
func ResetDescriptorPool(device Device, descriptorPool DescriptorPool) error
ResetDescriptorPool resets a descriptor pool
func ResetEvent ¶ added in v1.1.0
ResetEvent resets an event to unsignaled state from the host
func ResetQueryPool ¶ added in v1.1.0
ResetQueryPool resets a range of queries in a query pool on the host (Vulkan 1.2+) This requires the hostQueryReset feature to be enabled
func ResetVideoDeviceFunctions ¶ added in v1.1.0
func ResetVideoDeviceFunctions()
ResetVideoDeviceFunctions resets the device function loader so that LoadVideoDeviceFunctions can be called again with a different device. This is NOT thread-safe and must not be called concurrently with LoadVideoDeviceFunctions or any video API calls.
func ResetVideoFormatFunctions ¶ added in v1.2.2
func ResetVideoFormatFunctions()
ResetVideoFormatFunctions resets the format function loader so that LoadVideoFormatFunctions can be called again with a different instance. This is NOT thread-safe and must not be called concurrently with LoadVideoFormatFunctions or any video format queries.
func ResetVideoInstanceFunctions ¶ added in v1.1.0
func ResetVideoInstanceFunctions()
ResetVideoInstanceFunctions resets the instance function loader so that LoadVideoInstanceFunctions can be called again with a different instance. This is NOT thread-safe and must not be called concurrently with LoadVideoInstanceFunctions or any video API calls.
func SetDebugUtilsObjectNameEXT ¶ added in v1.2.0
func SetDebugUtilsObjectNameEXT(device Device, nameInfo *DebugUtilsObjectNameInfo) error
SetDebugUtilsObjectNameEXT gives a user-friendly name to an object
func SetPrivateData ¶
func SetPrivateData(device Device, objectType ObjectType, objectHandle uint64, privateDataSlot PrivateDataSlot, data uint64) error
SetPrivateData associates data with a Vulkan object
func SignalSemaphore ¶ added in v1.1.0
func SignalSemaphore(device Device, signalInfo *SemaphoreSignalInfo) error
SignalSemaphore signals a timeline semaphore (Vulkan 1.2+)
func TransitionImageLayout ¶ added in v1.1.0
func TransitionImageLayout( commandBuffer CommandBuffer, image Image, format Format, oldLayout ImageLayout, newLayout ImageLayout, subresourceRange ImageSubresourceRange, )
TransitionImageLayout transitions an image from one layout to another This is a helper function for common layout transitions
func TrimCommandPool ¶ added in v1.1.0
func TrimCommandPool(device Device, commandPool CommandPool)
TrimCommandPool trims a command pool (Vulkan 1.1+) This allows the implementation to reclaim unused memory from the command pool
func UnmapMemory ¶
func UnmapMemory(device Device, memory DeviceMemory)
UnmapMemory unmaps device memory
func UpdateDescriptorSets ¶ added in v1.1.0
func UpdateDescriptorSets(device Device, writes []WriteDescriptorSet, copies []CopyDescriptorSet)
UpdateDescriptorSets updates descriptor sets with write and copy operations Note: This function follows the Vulkan API which is void and doesn't return errors. If device is nil, the function returns early without performing any operation.
func UpdateVideoSessionParameters ¶ added in v1.1.0
func UpdateVideoSessionParameters(device Device, videoSessionParameters VideoSessionParameters, updateInfo *VideoSessionParametersUpdateInfo) error
UpdateVideoSessionParameters updates video session parameters, dispatching through the function pointer resolved for this specific device (loaded on first use via CreateVideoDeviceFunctions).
Types ¶
type AV1DecodeSessionCreateInfo ¶ added in v1.1.0
type AV1DecodeSessionCreateInfo struct {
Width uint32
Height uint32
ChromaSubsampling VideoChromaSubsampling
LumaBitDepth VideoComponentBitDepth
ChromaBitDepth VideoComponentBitDepth
MaxDpbSlots uint32
MaxActiveReferences uint32
QueueFamilyIndex uint32
PictureFormat Format
ReferenceFormat Format
}
AV1DecodeSessionCreateInfo contains configuration for AV1 decode session
func DefaultAV1DecodeSessionCreateInfo ¶ added in v1.1.0
func DefaultAV1DecodeSessionCreateInfo(width, height uint32) *AV1DecodeSessionCreateInfo
DefaultAV1DecodeSessionCreateInfo returns a default AV1 decode session configuration
type AV1EncodeSessionCreateInfo ¶ added in v1.1.0
type AV1EncodeSessionCreateInfo struct {
Width uint32
Height uint32
Profile AV1Profile
Level AV1Level
ChromaSubsampling VideoChromaSubsampling
LumaBitDepth VideoComponentBitDepth
ChromaBitDepth VideoComponentBitDepth
MaxDpbSlots uint32
MaxActiveReferences uint32
RateControl *VideoEncodeRateControlInfo
QueueFamilyIndex uint32
PictureFormat Format
ReferenceFormat Format
}
AV1EncodeSessionCreateInfo contains configuration for AV1 encode session
func DefaultAV1EncodeSessionCreateInfo ¶ added in v1.1.0
func DefaultAV1EncodeSessionCreateInfo(width, height uint32) *AV1EncodeSessionCreateInfo
DefaultAV1EncodeSessionCreateInfo returns a default AV1 encode session configuration
type AV1Level ¶ added in v1.1.0
type AV1Level uint32
AV1Level represents AV1 levels
const ( AV1Level2_0 AV1Level = 0 AV1Level2_1 AV1Level = 1 AV1Level3_0 AV1Level = 4 AV1Level3_1 AV1Level = 5 AV1Level4_0 AV1Level = 8 AV1Level4_1 AV1Level = 9 AV1Level5_0 AV1Level = 12 AV1Level5_1 AV1Level = 13 AV1Level5_2 AV1Level = 14 AV1Level5_3 AV1Level = 15 AV1Level6_0 AV1Level = 16 AV1Level6_1 AV1Level = 17 AV1Level6_2 AV1Level = 18 AV1Level6_3 AV1Level = 19 )
type AV1Profile ¶ added in v1.1.0
type AV1Profile uint32
AV1Profile represents AV1 profile identifiers
const ( AV1ProfileMain AV1Profile = 0 AV1ProfileHigh AV1Profile = 1 AV1ProfileProfessional AV1Profile = 2 )
type AccelerationStructure ¶
AccelerationStructure represents a Vulkan acceleration structure
type AccelerationStructureBuildGeometryInfoKHR ¶ added in v1.2.0
type AccelerationStructureBuildGeometryInfoKHR struct{}
AccelerationStructureBuildGeometryInfoKHR represents the VkAccelerationStructureBuildGeometryInfoKHR structure (stubbed for now).
type AccelerationStructureCreateInfoKHR ¶ added in v1.2.0
type AccelerationStructureCreateInfoKHR struct {
Buffer Buffer
Offset DeviceSize
Size DeviceSize
Type AccelerationStructureTypeKHR
DeviceAddress DeviceAddress
}
AccelerationStructureCreateInfoKHR represents the VkAccelerationStructureCreateInfoKHR structure.
type AccelerationStructureKHR ¶ added in v1.2.0
AccelerationStructureKHR represents the VkAccelerationStructureKHR handle.
func CreateAccelerationStructureKHR ¶ added in v1.2.0
func CreateAccelerationStructureKHR(device Device, createInfo *AccelerationStructureCreateInfoKHR) (AccelerationStructureKHR, error)
CreateAccelerationStructureKHR creates a new acceleration structure.
type AccelerationStructureTypeKHR ¶ added in v1.2.0
type AccelerationStructureTypeKHR int32
AccelerationStructureTypeKHR represents the type of acceleration structure.
const ( AccelerationStructureTypeTopLevelKHR AccelerationStructureTypeKHR = C.VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR AccelerationStructureTypeBottomLevelKHR AccelerationStructureTypeKHR = C.VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR AccelerationStructureTypeGenericKHR AccelerationStructureTypeKHR = C.VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR )
type AccessFlags ¶
type AccessFlags uint32
AccessFlags represents memory access flags
const ( AccessIndirectCommandReadBit AccessFlags = C.VK_ACCESS_INDIRECT_COMMAND_READ_BIT AccessIndexReadBit AccessFlags = C.VK_ACCESS_INDEX_READ_BIT AccessVertexAttributeReadBit AccessFlags = C.VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT AccessUniformReadBit AccessFlags = C.VK_ACCESS_UNIFORM_READ_BIT AccessInputAttachmentReadBit AccessFlags = C.VK_ACCESS_INPUT_ATTACHMENT_READ_BIT AccessShaderReadBit AccessFlags = C.VK_ACCESS_SHADER_READ_BIT AccessShaderWriteBit AccessFlags = C.VK_ACCESS_SHADER_WRITE_BIT AccessColorAttachmentReadBit AccessFlags = C.VK_ACCESS_COLOR_ATTACHMENT_READ_BIT AccessColorAttachmentWriteBit AccessFlags = C.VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT AccessDepthStencilAttachmentReadBit AccessFlags = C.VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT AccessDepthStencilAttachmentWriteBit AccessFlags = C.VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT AccessTransferReadBit AccessFlags = C.VK_ACCESS_TRANSFER_READ_BIT AccessTransferWriteBit AccessFlags = C.VK_ACCESS_TRANSFER_WRITE_BIT AccessHostReadBit AccessFlags = C.VK_ACCESS_HOST_READ_BIT AccessHostWriteBit AccessFlags = C.VK_ACCESS_HOST_WRITE_BIT AccessMemoryReadBit AccessFlags = C.VK_ACCESS_MEMORY_READ_BIT AccessMemoryWriteBit AccessFlags = C.VK_ACCESS_MEMORY_WRITE_BIT )
type ApplicationInfo ¶
type ApplicationInfo struct {
ApplicationName string
ApplicationVersion Version
EngineName string
EngineVersion Version
APIVersion Version
}
ApplicationInfo contains application information
type AttachmentDescription ¶
type AttachmentDescription struct {
Format Format
Samples SampleCountFlags
LoadOp AttachmentLoadOp
StoreOp AttachmentStoreOp
StencilLoadOp AttachmentLoadOp
StencilStoreOp AttachmentStoreOp
InitialLayout ImageLayout
FinalLayout ImageLayout
}
AttachmentDescription describes a render pass attachment
type AttachmentLoadOp ¶
type AttachmentLoadOp int32
AttachmentLoadOp represents attachment load operations
const ( AttachmentLoadOpLoad AttachmentLoadOp = C.VK_ATTACHMENT_LOAD_OP_LOAD AttachmentLoadOpClear AttachmentLoadOp = C.VK_ATTACHMENT_LOAD_OP_CLEAR AttachmentLoadOpDontCare AttachmentLoadOp = C.VK_ATTACHMENT_LOAD_OP_DONT_CARE )
type AttachmentReference ¶
type AttachmentReference struct {
Attachment uint32
Layout ImageLayout
}
AttachmentReference references an attachment
type AttachmentStoreOp ¶
type AttachmentStoreOp int32
AttachmentStoreOp represents attachment store operations
const ( AttachmentStoreOpStore AttachmentStoreOp = C.VK_ATTACHMENT_STORE_OP_STORE AttachmentStoreOpDontCare AttachmentStoreOp = C.VK_ATTACHMENT_STORE_OP_DONT_CARE )
type BindSparseInfo ¶ added in v1.1.0
type BindSparseInfo struct {
WaitSemaphores []Semaphore
BufferBinds []SparseBufferMemoryBindInfo
ImageOpaqueBinds []SparseImageOpaqueMemoryBindInfo
ImageBinds []SparseImageMemoryBindInfo
SignalSemaphores []Semaphore
}
BindSparseInfo describes a sparse binding operation
type BlendFactor ¶ added in v1.1.0
type BlendFactor uint32
BlendFactor represents blend factors
const ( BlendFactorZero BlendFactor = C.VK_BLEND_FACTOR_ZERO BlendFactorOne BlendFactor = C.VK_BLEND_FACTOR_ONE BlendFactorSrcColor BlendFactor = C.VK_BLEND_FACTOR_SRC_COLOR BlendFactorOneMinusSrcColor BlendFactor = C.VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR BlendFactorDstColor BlendFactor = C.VK_BLEND_FACTOR_DST_COLOR BlendFactorOneMinusDstColor BlendFactor = C.VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR BlendFactorSrcAlpha BlendFactor = C.VK_BLEND_FACTOR_SRC_ALPHA BlendFactorOneMinusSrcAlpha BlendFactor = C.VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA BlendFactorDstAlpha BlendFactor = C.VK_BLEND_FACTOR_DST_ALPHA BlendFactorOneMinusDstAlpha BlendFactor = C.VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA BlendFactorConstantColor BlendFactor = C.VK_BLEND_FACTOR_CONSTANT_COLOR BlendFactorOneMinusConstantColor BlendFactor = C.VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR BlendFactorConstantAlpha BlendFactor = C.VK_BLEND_FACTOR_CONSTANT_ALPHA BlendFactorOneMinusConstantAlpha BlendFactor = C.VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA BlendFactorSrcAlphaSaturate BlendFactor = C.VK_BLEND_FACTOR_SRC_ALPHA_SATURATE BlendFactorSrc1Color BlendFactor = C.VK_BLEND_FACTOR_SRC1_COLOR BlendFactorOneMinusSrc1Color BlendFactor = C.VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR BlendFactorSrc1Alpha BlendFactor = C.VK_BLEND_FACTOR_SRC1_ALPHA BlendFactorOneMinusSrc1Alpha BlendFactor = C.VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA )
type BlendOp ¶ added in v1.1.0
type BlendOp uint32
BlendOp represents blend operations
const ( BlendOpAdd BlendOp = C.VK_BLEND_OP_ADD BlendOpSubtract BlendOp = C.VK_BLEND_OP_SUBTRACT BlendOpReverseSubtract BlendOp = C.VK_BLEND_OP_REVERSE_SUBTRACT BlendOpMin BlendOp = C.VK_BLEND_OP_MIN BlendOpMax BlendOp = C.VK_BLEND_OP_MAX )
type Bool32 ¶
type Bool32 uint32
Bool32 defines the Bool32 type Bool type for Vulkan boolean values
type Buffer ¶
Buffer represents a Vulkan buffer
func CreateBuffer ¶
func CreateBuffer(device Device, createInfo *BufferCreateInfo) (Buffer, error)
CreateBuffer creates a buffer
type BufferCopy ¶
type BufferCopy struct {
SrcOffset DeviceSize
DstOffset DeviceSize
Size DeviceSize
}
BufferCopy describes a buffer copy region
type BufferCreateFlags ¶
type BufferCreateFlags uint32
BufferCreateFlags represents buffer creation flags
const ( BufferCreateSparseBindingBit BufferCreateFlags = C.VK_BUFFER_CREATE_SPARSE_BINDING_BIT BufferCreateSparseResidencyBit BufferCreateFlags = C.VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT BufferCreateSparseAliasedBit BufferCreateFlags = C.VK_BUFFER_CREATE_SPARSE_ALIASED_BIT BufferCreateProtectedBit BufferCreateFlags = C.VK_BUFFER_CREATE_PROTECTED_BIT BufferCreateDeviceAddressCaptureReplayBit BufferCreateFlags = C.VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT )
type BufferCreateInfo ¶
type BufferCreateInfo struct {
Flags BufferCreateFlags
Size DeviceSize
Usage BufferUsageFlags
SharingMode SharingMode
}
BufferCreateInfo contains buffer creation information
type BufferImageCopy ¶ added in v1.1.0
type BufferImageCopy struct {
BufferOffset DeviceSize
BufferRowLength uint32
BufferImageHeight uint32
ImageSubresource ImageSubresourceLayers
ImageOffset Offset3D
ImageExtent Extent3D
}
BufferImageCopy describes a buffer to image or image to buffer copy operation
type BufferMemoryBarrier ¶ added in v1.1.0
type BufferMemoryBarrier struct {
SrcAccessMask AccessFlags
DstAccessMask AccessFlags
SrcQueueFamilyIndex uint32
DstQueueFamilyIndex uint32
Buffer Buffer
Offset uint64
Size uint64
}
BufferMemoryBarrier represents a buffer memory barrier with queue family transfer support
type BufferUsageFlags ¶
type BufferUsageFlags uint32
BufferUsageFlags represents buffer usage flags
const ( BufferUsageTransferSrcBit BufferUsageFlags = C.VK_BUFFER_USAGE_TRANSFER_SRC_BIT BufferUsageTransferDstBit BufferUsageFlags = C.VK_BUFFER_USAGE_TRANSFER_DST_BIT BufferUsageUniformTexelBufferBit BufferUsageFlags = C.VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT BufferUsageStorageTexelBufferBit BufferUsageFlags = C.VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT BufferUsageUniformBufferBit BufferUsageFlags = C.VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT BufferUsageStorageBufferBit BufferUsageFlags = C.VK_BUFFER_USAGE_STORAGE_BUFFER_BIT BufferUsageIndexBufferBit BufferUsageFlags = C.VK_BUFFER_USAGE_INDEX_BUFFER_BIT BufferUsageVertexBufferBit BufferUsageFlags = C.VK_BUFFER_USAGE_VERTEX_BUFFER_BIT BufferUsageIndirectBufferBit BufferUsageFlags = C.VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT BufferUsageShaderDeviceAddressBit BufferUsageFlags = C.VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT )
type BufferView ¶
BufferView represents a Vulkan buffer view
func CreateBufferView ¶ added in v1.1.0
func CreateBufferView(device Device, createInfo *BufferViewCreateInfo) (BufferView, error)
CreateBufferView creates a buffer view
type BufferViewCreateInfo ¶ added in v1.1.0
type BufferViewCreateInfo struct {
Buffer Buffer
Format Format
Offset DeviceSize
Range DeviceSize
}
BufferViewCreateInfo contains buffer view creation information
type ClearAttachment ¶ added in v1.1.0
type ClearAttachment struct {
AspectMask ImageAspectFlags
ColorAttachment uint32
ClearValue ClearValue
}
ClearAttachment describes a clear attachment operation
type ClearColorValue ¶
ClearColorValue represents a clear color value
type ClearDepthStencilValue ¶
ClearDepthStencilValue represents a clear depth/stencil value
type ClearValue ¶
type ClearValue struct {
Color ClearColorValue
DepthStencil ClearDepthStencilValue
IsDepthStencil bool // Flag to indicate this is a depth/stencil clear value
}
ClearValue defines the ClearValue type ClearValue represents a clear value union Set IsDepthStencil to true when clearing depth/stencil attachments
type ColorComponentFlags ¶ added in v1.1.0
type ColorComponentFlags uint32
ColorComponentFlags represents color component write mask
const ( ColorComponentRBit ColorComponentFlags = C.VK_COLOR_COMPONENT_R_BIT ColorComponentGBit ColorComponentFlags = C.VK_COLOR_COMPONENT_G_BIT ColorComponentBBit ColorComponentFlags = C.VK_COLOR_COMPONENT_B_BIT ColorComponentABit ColorComponentFlags = C.VK_COLOR_COMPONENT_A_BIT ColorComponentAll ColorComponentFlags = ColorComponentRBit | ColorComponentGBit | ColorComponentBBit | ColorComponentABit )
type ColorSpace ¶ added in v1.1.0
type ColorSpace uint32
ColorSpace represents color space values
const ( ColorSpaceSRGBNonlinear ColorSpace = C.VK_COLOR_SPACE_SRGB_NONLINEAR_KHR ColorSpaceDisplayP3Nonlinear ColorSpace = C.VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT ColorSpaceExtendedSRGBLinear ColorSpace = C.VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT ColorSpaceDisplayP3Linear ColorSpace = C.VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT ColorSpaceDCIP3Nonlinear ColorSpace = C.VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT ColorSpaceBT709Linear ColorSpace = C.VK_COLOR_SPACE_BT709_LINEAR_EXT ColorSpaceBT709Nonlinear ColorSpace = C.VK_COLOR_SPACE_BT709_NONLINEAR_EXT ColorSpaceBT2020Linear ColorSpace = C.VK_COLOR_SPACE_BT2020_LINEAR_EXT ColorSpaceHDR10ST2084 ColorSpace = C.VK_COLOR_SPACE_HDR10_ST2084_EXT ColorSpaceDolbyVision ColorSpace = C.VK_COLOR_SPACE_DOLBYVISION_EXT ColorSpaceHDR10HLG ColorSpace = C.VK_COLOR_SPACE_HDR10_HLG_EXT ColorSpaceAdobeRGBLinear ColorSpace = C.VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT ColorSpaceAdobeRGBNonlinear ColorSpace = C.VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT ColorSpacePassThrough ColorSpace = C.VK_COLOR_SPACE_PASS_THROUGH_EXT ColorSpaceExtendedSRGBNonlinear ColorSpace = C.VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT )
type CommandBuffer ¶
CommandBuffer represents a Vulkan command buffer
func AllocateCommandBuffers ¶
func AllocateCommandBuffers(device Device, allocateInfo *CommandBufferAllocateInfo) ([]CommandBuffer, error)
AllocateCommandBuffers allocates command buffers
type CommandBufferAllocateInfo ¶
type CommandBufferAllocateInfo struct {
CommandPool CommandPool
Level CommandBufferLevel
CommandBufferCount uint32
}
CommandBufferAllocateInfo contains command buffer allocation information
type CommandBufferBeginInfo ¶
type CommandBufferBeginInfo struct {
Flags CommandBufferUsageFlags
InheritanceInfo *CommandBufferInheritanceInfo
}
CommandBufferBeginInfo contains command buffer begin information
type CommandBufferInheritanceInfo ¶ added in v1.1.0
type CommandBufferInheritanceInfo struct {
RenderPass RenderPass
Subpass uint32
Framebuffer Framebuffer
OcclusionQueryEnable bool
QueryFlags QueryControlFlags
PipelineStatistics QueryPipelineStatisticFlags
}
CommandBufferInheritanceInfo contains inheritance info for secondary command buffers
type CommandBufferLevel ¶
type CommandBufferLevel int32
CommandBufferLevel represents command buffer levels
const ( CommandBufferLevelPrimary CommandBufferLevel = C.VK_COMMAND_BUFFER_LEVEL_PRIMARY CommandBufferLevelSecondary CommandBufferLevel = C.VK_COMMAND_BUFFER_LEVEL_SECONDARY )
type CommandBufferSubmitInfo ¶
type CommandBufferSubmitInfo struct {
CommandBuffer CommandBuffer
DeviceMask uint32
}
CommandBufferSubmitInfo describes a command buffer submit operation
type CommandBufferUsageFlags ¶
type CommandBufferUsageFlags uint32
CommandBufferUsageFlags represents command buffer usage flags
const ( CommandBufferUsageOneTimeSubmitBit CommandBufferUsageFlags = C.VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT CommandBufferUsageRenderPassContinueBit CommandBufferUsageFlags = C.VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT CommandBufferUsageSimultaneousUseBit CommandBufferUsageFlags = C.VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT )
type CommandPool ¶
CommandPool represents a Vulkan command pool
func CreateCommandPool ¶
func CreateCommandPool(device Device, createInfo *CommandPoolCreateInfo) (CommandPool, error)
CreateCommandPool creates a command pool
type CommandPoolCreateFlags ¶
type CommandPoolCreateFlags uint32
CommandPoolCreateFlags represents command pool creation flags
const ( CommandPoolCreateTransientBit CommandPoolCreateFlags = C.VK_COMMAND_POOL_CREATE_TRANSIENT_BIT CommandPoolCreateResetCommandBufferBit CommandPoolCreateFlags = C.VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT CommandPoolCreateProtectedBit CommandPoolCreateFlags = C.VK_COMMAND_POOL_CREATE_PROTECTED_BIT )
type CommandPoolCreateInfo ¶
type CommandPoolCreateInfo struct {
Flags CommandPoolCreateFlags
QueueFamilyIndex uint32
}
CommandPoolCreateInfo contains command pool creation information
type CommandPoolResetFlags ¶ added in v1.1.0
type CommandPoolResetFlags uint32
CommandPoolResetFlags represents command pool reset flags
const (
CommandPoolResetReleaseResourcesBit CommandPoolResetFlags = C.VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT
)
type CompareOp ¶
type CompareOp uint32
CompareOp represents comparison operations
const ( CompareOpNever CompareOp = C.VK_COMPARE_OP_NEVER CompareOpLess CompareOp = C.VK_COMPARE_OP_LESS CompareOpEqual CompareOp = C.VK_COMPARE_OP_EQUAL CompareOpLessOrEqual CompareOp = C.VK_COMPARE_OP_LESS_OR_EQUAL CompareOpGreater CompareOp = C.VK_COMPARE_OP_GREATER CompareOpNotEqual CompareOp = C.VK_COMPARE_OP_NOT_EQUAL CompareOpGreaterOrEqual CompareOp = C.VK_COMPARE_OP_GREATER_OR_EQUAL CompareOpAlways CompareOp = C.VK_COMPARE_OP_ALWAYS )
type CompositeAlphaFlags ¶ added in v1.1.0
type CompositeAlphaFlags uint32
CompositeAlphaFlags represents composite alpha flags
const ( CompositeAlphaOpaque CompositeAlphaFlags = C.VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR CompositeAlphaPreMultiplied CompositeAlphaFlags = C.VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR CompositeAlphaPostMultiplied CompositeAlphaFlags = C.VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR CompositeAlphaInherit CompositeAlphaFlags = C.VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR )
type ComputePipelineCreateInfo ¶
type ComputePipelineCreateInfo struct {
Stage PipelineShaderStageCreateInfo
Layout PipelineLayout
}
ComputePipelineCreateInfo contains compute pipeline creation information
type CopyDescriptorSet ¶ added in v1.1.0
type CopyDescriptorSet struct {
SrcSet DescriptorSet
SrcBinding uint32
SrcArrayElement uint32
DstSet DescriptorSet
DstBinding uint32
DstArrayElement uint32
DescriptorCount uint32
}
CopyDescriptorSet describes a descriptor set copy operation
type CullModeFlags ¶
type CullModeFlags uint32
CullModeFlags represents face culling modes
const ( CullModeNone CullModeFlags = C.VK_CULL_MODE_NONE CullModeFront CullModeFlags = C.VK_CULL_MODE_FRONT_BIT CullModeBack CullModeFlags = C.VK_CULL_MODE_BACK_BIT CullModeFrontAndBack CullModeFlags = C.VK_CULL_MODE_FRONT_AND_BACK )
type DPBManager ¶ added in v1.1.0
type DPBManager struct {
// contains filtered or unexported fields
}
DPBManager manages the decoded picture buffer for video decode/encode
func CreateDPBManager ¶ added in v1.1.0
func CreateDPBManager(maxSlots uint32) *DPBManager
CreateDPBManager creates a new DPB manager with the specified number of slots
func (*DPBManager) AddSlot ¶ added in v1.1.0
func (dpb *DPBManager) AddSlot(imageView ImageView, imageLayout ImageLayout, poc int32) (*DPBSlot, error)
AddSlot adds a picture to the DPB. When the DPB is full, the oldest short-term reference is evicted and its slot index is reused so slot indices always stay below maxSlots and the DPB does not grow unboundedly.
func (*DPBManager) CalculatePOC ¶ added in v1.1.0
func (dpb *DPBManager) CalculatePOC() int32
CalculatePOC calculates the Picture Order Count for the next frame This is a simplified implementation for H.264/H.265
func (*DPBManager) GetReferenceSlots ¶ added in v1.1.0
func (dpb *DPBManager) GetReferenceSlots() []DPBSlot
GetReferenceSlots returns all current reference slots
func (*DPBManager) MarkAsLongTerm ¶ added in v1.1.0
func (dpb *DPBManager) MarkAsLongTerm(slotIndex int32)
MarkAsLongTerm marks a slot as a long-term reference
func (*DPBManager) RemoveOldestReference ¶ added in v1.1.0
func (dpb *DPBManager) RemoveOldestReference()
RemoveOldestReference removes the oldest short-term reference from the DPB
func (*DPBManager) Reset ¶ added in v1.1.0
func (dpb *DPBManager) Reset()
Reset clears all slots from the DPB
type DPBSlot ¶ added in v1.1.0
type DPBSlot struct {
SlotIndex int32
ImageView ImageView
ImageLayout ImageLayout
IsReference bool
PictureOrderCount int32
FrameNum int32
IsLongTerm bool
}
DPBSlot represents a slot in the decoded picture buffer
type DebugCallbackFunc ¶ added in v1.2.0
type DebugCallbackFunc func( messageSeverity DebugUtilsMessageSeverityFlags, messageType DebugUtilsMessageTypeFlags, callbackData *DebugUtilsMessengerCallbackData, ) bool
DebugCallbackFunc is the Go callback type for debug messages
type DebugUtilsLabel ¶ added in v1.2.0
DebugUtilsLabel specifies parameters for a debug label
type DebugUtilsMessageSeverityFlags ¶ added in v1.1.0
type DebugUtilsMessageSeverityFlags uint32
DebugUtilsMessageSeverityFlags represents debug message severity levels
const ( DebugUtilsMessageSeverityVerbose DebugUtilsMessageSeverityFlags = C.VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT DebugUtilsMessageSeverityInfo DebugUtilsMessageSeverityFlags = C.VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT DebugUtilsMessageSeverityWarning DebugUtilsMessageSeverityFlags = C.VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT DebugUtilsMessageSeverityError DebugUtilsMessageSeverityFlags = C.VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT )
type DebugUtilsMessageTypeFlags ¶ added in v1.1.0
type DebugUtilsMessageTypeFlags uint32
DebugUtilsMessageTypeFlags represents debug message types
const ( DebugUtilsMessageTypeGeneral DebugUtilsMessageTypeFlags = C.VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT DebugUtilsMessageTypeValidation DebugUtilsMessageTypeFlags = C.VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT DebugUtilsMessageTypePerformance DebugUtilsMessageTypeFlags = C.VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT )
type DebugUtilsMessengerCallbackData ¶ added in v1.1.0
type DebugUtilsMessengerCallbackData struct {
MessageIDName string
MessageIDNumber int32
Message string
}
DebugUtilsMessengerCallbackData contains data passed to debug callback
type DebugUtilsMessengerCreateInfo ¶ added in v1.1.0
type DebugUtilsMessengerCreateInfo struct {
MessageSeverity DebugUtilsMessageSeverityFlags
MessageType DebugUtilsMessageTypeFlags
}
DebugUtilsMessengerCreateInfo contains debug messenger creation information
type DebugUtilsMessengerEXT ¶ added in v1.2.0
DebugUtilsMessengerEXT represents a Vulkan debug utils messenger
func CreateDebugUtilsMessengerEXT ¶ added in v1.2.0
func CreateDebugUtilsMessengerEXT(instance Instance, createInfo *DebugUtilsMessengerCreateInfo, callback DebugCallbackFunc) (DebugUtilsMessengerEXT, error)
CreateDebugUtilsMessengerEXT creates a debug messenger
type DebugUtilsObjectNameInfo ¶ added in v1.2.0
type DebugUtilsObjectNameInfo struct {
ObjectType ObjectType
ObjectHandle uint64
ObjectName string
}
DebugUtilsObjectNameInfo defines parameters for naming an object
type DeferredOperation ¶
DeferredOperation represents a Vulkan deferred operation
type DependencyFlags ¶ added in v1.1.0
type DependencyFlags uint32
DependencyFlags represents dependency flags
const ( DependencyByRegionBit DependencyFlags = C.VK_DEPENDENCY_BY_REGION_BIT DependencyDeviceGroupBit DependencyFlags = C.VK_DEPENDENCY_DEVICE_GROUP_BIT DependencyViewLocalBit DependencyFlags = C.VK_DEPENDENCY_VIEW_LOCAL_BIT )
type DescriptorBufferInfo ¶ added in v1.1.0
type DescriptorBufferInfo struct {
Buffer Buffer
Offset DeviceSize
Range DeviceSize
}
DescriptorBufferInfo describes a buffer descriptor
type DescriptorImageInfo ¶ added in v1.1.0
type DescriptorImageInfo struct {
Sampler Sampler
ImageView ImageView
ImageLayout ImageLayout
}
DescriptorImageInfo describes an image descriptor
type DescriptorPool ¶
DescriptorPool represents a Vulkan descriptor pool
func CreateDescriptorPool ¶
func CreateDescriptorPool(device Device, createInfo *DescriptorPoolCreateInfo) (DescriptorPool, error)
CreateDescriptorPool creates a descriptor pool
type DescriptorPoolCreateFlags ¶ added in v1.2.0
type DescriptorPoolCreateFlags uint32
DescriptorPoolCreateFlags represents descriptor pool creation flags
const ( DescriptorPoolCreateFreeDescriptorSetBit DescriptorPoolCreateFlags = C.VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT DescriptorPoolCreateUpdateAfterBindBit DescriptorPoolCreateFlags = C.VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT )
type DescriptorPoolCreateInfo ¶
type DescriptorPoolCreateInfo struct {
Flags DescriptorPoolCreateFlags
MaxSets uint32
PoolSizes []DescriptorPoolSize
}
DescriptorPoolCreateInfo contains descriptor pool creation information
type DescriptorPoolManager ¶ added in v1.2.0
type DescriptorPoolManager struct {
// contains filtered or unexported fields
}
DescriptorPoolManager defines the DescriptorPoolManager type DescriptorPoolManager is a high-level utility that dynamically manages a growing collection of Vulkan descriptor pools. It eliminates the need to manually recreate pools when they run out of memory or get fragmented.
func NewDescriptorPoolManager ¶ added in v1.2.0
func NewDescriptorPoolManager(device Device, maxSetsPerPool uint32, poolSizes []DescriptorPoolSize, flags DescriptorPoolCreateFlags) (*DescriptorPoolManager, error)
NewDescriptorPoolManager creates a new DescriptorPoolManager
func (*DescriptorPoolManager) AllocateDescriptorSets ¶ added in v1.2.0
func (m *DescriptorPoolManager) AllocateDescriptorSets(layouts []DescriptorSetLayout) ([]DescriptorSet, error)
AllocateDescriptorSets allocates one or more descriptor sets, creating new pools if necessary
func (*DescriptorPoolManager) Destroy ¶ added in v1.2.0
func (m *DescriptorPoolManager) Destroy()
Destroy destroys all Vulkan descriptor pools managed by this manager
func (*DescriptorPoolManager) Reset ¶ added in v1.2.0
func (m *DescriptorPoolManager) Reset() error
Reset resets all used pools and makes them available for reallocation
type DescriptorPoolSize ¶
type DescriptorPoolSize struct {
Type DescriptorType
DescriptorCount uint32
}
DescriptorPoolSize describes a descriptor pool size
type DescriptorSet ¶
DescriptorSet represents a Vulkan descriptor set
func AllocateDescriptorSets ¶ added in v1.1.0
func AllocateDescriptorSets(device Device, allocateInfo *DescriptorSetAllocateInfo) ([]DescriptorSet, error)
AllocateDescriptorSets allocates one or more descriptor sets
type DescriptorSetAllocateInfo ¶ added in v1.1.0
type DescriptorSetAllocateInfo struct {
DescriptorPool DescriptorPool
SetLayouts []DescriptorSetLayout
}
DescriptorSetAllocateInfo contains descriptor set allocation information
type DescriptorSetLayout ¶
DescriptorSetLayout represents a Vulkan descriptor set layout
func CreateDescriptorSetLayout ¶
func CreateDescriptorSetLayout(device Device, createInfo *DescriptorSetLayoutCreateInfo) (DescriptorSetLayout, error)
CreateDescriptorSetLayout creates a descriptor set layout
type DescriptorSetLayoutBinding ¶
type DescriptorSetLayoutBinding struct {
Binding uint32
DescriptorType DescriptorType
DescriptorCount uint32
StageFlags ShaderStageFlags
}
DescriptorSetLayoutBinding describes a descriptor set layout binding
type DescriptorSetLayoutCreateInfo ¶
type DescriptorSetLayoutCreateInfo struct {
Bindings []DescriptorSetLayoutBinding
}
DescriptorSetLayoutCreateInfo contains descriptor set layout creation information
type DescriptorType ¶
type DescriptorType int32
DescriptorType represents descriptor types
const ( DescriptorTypeSampler DescriptorType = C.VK_DESCRIPTOR_TYPE_SAMPLER DescriptorTypeCombinedImageSampler DescriptorType = C.VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER DescriptorTypeSampledImage DescriptorType = C.VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE DescriptorTypeStorageImage DescriptorType = C.VK_DESCRIPTOR_TYPE_STORAGE_IMAGE DescriptorTypeUniformTexelBuffer DescriptorType = C.VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER DescriptorTypeStorageTexelBuffer DescriptorType = C.VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER DescriptorTypeUniformBuffer DescriptorType = C.VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER DescriptorTypeStorageBuffer DescriptorType = C.VK_DESCRIPTOR_TYPE_STORAGE_BUFFER DescriptorTypeUniformBufferDynamic DescriptorType = C.VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC DescriptorTypeStorageBufferDynamic DescriptorType = C.VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC DescriptorTypeInputAttachment DescriptorType = C.VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT )
type DescriptorUpdateTemplate ¶
DescriptorUpdateTemplate represents a Vulkan descriptor update template
type Device ¶
Device represents a Vulkan logical device
func CreateDevice ¶
func CreateDevice(physicalDevice PhysicalDevice, createInfo *DeviceCreateInfo) (Device, error)
CreateDevice creates a logical device
type DeviceCreateInfo ¶
type DeviceCreateInfo struct {
QueueCreateInfos []DeviceQueueCreateInfo
EnabledLayerNames []string
EnabledExtensionNames []string
EnabledFeatures *PhysicalDeviceFeatures
// EnableTimelineSemaphores chains VkPhysicalDeviceTimelineSemaphoreFeatures
// with timelineSemaphore enabled (Vulkan 1.2+). Required before using
// CreateTimelineSemaphore, WaitSemaphores, or SignalSemaphore on the
// created device.
EnableTimelineSemaphores bool
}
DeviceCreateInfo contains device creation information
type DeviceGroupDeviceCreateInfo ¶ added in v1.1.0
type DeviceGroupDeviceCreateInfo struct {
PhysicalDevices []PhysicalDevice
}
DeviceGroupDeviceCreateInfo contains device group creation information
type DeviceMemory ¶
DeviceMemory represents Vulkan device memory
func AllocateMemory ¶
func AllocateMemory(device Device, allocateInfo *MemoryAllocateInfo) (DeviceMemory, error)
AllocateMemory allocates device memory
type DeviceQueueCreateInfo ¶
DeviceQueueCreateInfo contains device queue creation information
type DeviceSize ¶
type DeviceSize uint64
DeviceSize represents device memory size
const DefaultMemoryAlignment DeviceSize = 256
DefaultMemoryAlignment is the default alignment for memory pool allocations
func GetDeviceMemoryCommitment ¶ added in v1.2.0
func GetDeviceMemoryCommitment(device Device, memory DeviceMemory) DeviceSize
GetDeviceMemoryCommitment queries the current memory commitment of the device
type DrawMeshTasksIndirectCommandEXT ¶ added in v1.2.0
type DrawMeshTasksIndirectCommandEXT struct {
GroupCountX uint32
GroupCountY uint32
GroupCountZ uint32
}
DrawMeshTasksIndirectCommandEXT contains parameters for indirect mesh tasks draw
type DynamicState ¶ added in v1.1.0
type DynamicState uint32
DynamicState represents dynamic pipeline states
const ( DynamicStateViewport DynamicState = C.VK_DYNAMIC_STATE_VIEWPORT DynamicStateScissor DynamicState = C.VK_DYNAMIC_STATE_SCISSOR DynamicStateLineWidth DynamicState = C.VK_DYNAMIC_STATE_LINE_WIDTH DynamicStateDepthBias DynamicState = C.VK_DYNAMIC_STATE_DEPTH_BIAS DynamicStateBlendConstants DynamicState = C.VK_DYNAMIC_STATE_BLEND_CONSTANTS DynamicStateDepthBounds DynamicState = C.VK_DYNAMIC_STATE_DEPTH_BOUNDS DynamicStateStencilCompareMask DynamicState = C.VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK DynamicStateStencilWriteMask DynamicState = C.VK_DYNAMIC_STATE_STENCIL_WRITE_MASK DynamicStateStencilReference DynamicState = C.VK_DYNAMIC_STATE_STENCIL_REFERENCE DynamicStateCullMode DynamicState = C.VK_DYNAMIC_STATE_CULL_MODE DynamicStateFrontFace DynamicState = C.VK_DYNAMIC_STATE_FRONT_FACE DynamicStatePrimitiveTopology DynamicState = C.VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY DynamicStateViewportWithCount DynamicState = C.VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT DynamicStateScissorWithCount DynamicState = C.VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT DynamicStateVertexInputBindingStride DynamicState = C.VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE DynamicStateDepthTestEnable DynamicState = C.VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE DynamicStateDepthWriteEnable DynamicState = C.VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE DynamicStateDepthCompareOp DynamicState = C.VK_DYNAMIC_STATE_DEPTH_COMPARE_OP DynamicStateDepthBoundsTestEnable DynamicState = C.VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE DynamicStateStencilTestEnable DynamicState = C.VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE DynamicStateStencilOp DynamicState = C.VK_DYNAMIC_STATE_STENCIL_OP DynamicStateRasterizerDiscardEnable DynamicState = C.VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE DynamicStateDepthBiasEnable DynamicState = C.VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE DynamicStatePrimitiveRestartEnable DynamicState = C.VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE )
type Event ¶
Event represents a Vulkan event
func CreateEvent ¶ added in v1.1.0
func CreateEvent(device Device, createInfo *EventCreateInfo) (Event, error)
CreateEvent creates an event object
type EventCreateFlags ¶ added in v1.1.0
type EventCreateFlags uint32
EventCreateFlags represents event creation flags
const (
EventCreateDeviceOnlyBit EventCreateFlags = C.VK_EVENT_CREATE_DEVICE_ONLY_BIT
)
type EventCreateInfo ¶ added in v1.1.0
type EventCreateInfo struct {
Flags EventCreateFlags
}
EventCreateInfo contains event creation information
type ExtensionProperties ¶
ExtensionProperties contains extension information
func EnumerateDeviceExtensionProperties ¶
func EnumerateDeviceExtensionProperties(physicalDevice PhysicalDevice, layerName string) ([]ExtensionProperties, error)
EnumerateDeviceExtensionProperties enumerates device extension properties
func EnumerateInstanceExtensionProperties ¶
func EnumerateInstanceExtensionProperties(layerName string) ([]ExtensionProperties, error)
EnumerateInstanceExtensionProperties enumerates available instance extensions
type Extent2D ¶
Extent2D represents a 2D extent
func GetRenderAreaGranularity ¶ added in v1.2.0
func GetRenderAreaGranularity(device Device, renderPass RenderPass) Extent2D
GetRenderAreaGranularity returns the render area granularity for a render pass
type Fence ¶
Fence represents a Vulkan fence
func CreateFence ¶
func CreateFence(device Device, createInfo *FenceCreateInfo) (Fence, error)
CreateFence creates a fence
type FenceCreateFlags ¶
type FenceCreateFlags uint32
FenceCreateFlags represents fence creation flags
const (
FenceCreateSignaledBit FenceCreateFlags = C.VK_FENCE_CREATE_SIGNALED_BIT
)
type FenceCreateInfo ¶
type FenceCreateInfo struct {
Flags FenceCreateFlags
}
FenceCreateInfo contains fence creation information
type Filter ¶
type Filter int32
Filter represents texture filtering modes
const ( FilterNearest Filter = C.VK_FILTER_NEAREST FilterLinear Filter = C.VK_FILTER_LINEAR )
const FilterCubic Filter = C.VK_FILTER_CUBIC_IMG
FilterCubic is a cubic filter mode (requires extension)
type Format ¶
type Format int32
Format represents pixel formats
const ( FormatUndefined Format = C.VK_FORMAT_UNDEFINED FormatR4G4UnormPack8 Format = C.VK_FORMAT_R4G4_UNORM_PACK8 FormatR4G4B4A4UnormPack16 Format = C.VK_FORMAT_R4G4B4A4_UNORM_PACK16 FormatB4G4R4A4UnormPack16 Format = C.VK_FORMAT_B4G4R4A4_UNORM_PACK16 FormatR5G6B5UnormPack16 Format = C.VK_FORMAT_R5G6B5_UNORM_PACK16 FormatB5G6R5UnormPack16 Format = C.VK_FORMAT_B5G6R5_UNORM_PACK16 FormatR5G5B5A1UnormPack16 Format = C.VK_FORMAT_R5G5B5A1_UNORM_PACK16 FormatB5G5R5A1UnormPack16 Format = C.VK_FORMAT_B5G5R5A1_UNORM_PACK16 FormatA1R5G5B5UnormPack16 Format = C.VK_FORMAT_A1R5G5B5_UNORM_PACK16 FormatR8Unorm Format = C.VK_FORMAT_R8_UNORM FormatR8Snorm Format = C.VK_FORMAT_R8_SNORM FormatR8Uscaled Format = C.VK_FORMAT_R8_USCALED FormatR8Sscaled Format = C.VK_FORMAT_R8_SSCALED FormatR8Uint Format = C.VK_FORMAT_R8_UINT FormatR8Sint Format = C.VK_FORMAT_R8_SINT FormatR8Srgb Format = C.VK_FORMAT_R8_SRGB FormatR8G8Unorm Format = C.VK_FORMAT_R8G8_UNORM FormatR8G8Snorm Format = C.VK_FORMAT_R8G8_SNORM FormatR8G8Uscaled Format = C.VK_FORMAT_R8G8_USCALED FormatR8G8Sscaled Format = C.VK_FORMAT_R8G8_SSCALED FormatR8G8Uint Format = C.VK_FORMAT_R8G8_UINT FormatR8G8Sint Format = C.VK_FORMAT_R8G8_SINT FormatR8G8Srgb Format = C.VK_FORMAT_R8G8_SRGB FormatR8G8B8Unorm Format = C.VK_FORMAT_R8G8B8_UNORM FormatR8G8B8Snorm Format = C.VK_FORMAT_R8G8B8_SNORM FormatR8G8B8Uscaled Format = C.VK_FORMAT_R8G8B8_USCALED FormatR8G8B8Sscaled Format = C.VK_FORMAT_R8G8B8_SSCALED FormatR8G8B8Uint Format = C.VK_FORMAT_R8G8B8_UINT FormatR8G8B8Sint Format = C.VK_FORMAT_R8G8B8_SINT FormatR8G8B8Srgb Format = C.VK_FORMAT_R8G8B8_SRGB FormatB8G8R8Unorm Format = C.VK_FORMAT_B8G8R8_UNORM FormatB8G8R8Snorm Format = C.VK_FORMAT_B8G8R8_SNORM FormatB8G8R8Uscaled Format = C.VK_FORMAT_B8G8R8_USCALED FormatB8G8R8Sscaled Format = C.VK_FORMAT_B8G8R8_SSCALED FormatB8G8R8Uint Format = C.VK_FORMAT_B8G8R8_UINT FormatB8G8R8Sint Format = C.VK_FORMAT_B8G8R8_SINT FormatB8G8R8Srgb Format = C.VK_FORMAT_B8G8R8_SRGB FormatR8G8B8A8Unorm Format = C.VK_FORMAT_R8G8B8A8_UNORM FormatR8G8B8A8Snorm Format = C.VK_FORMAT_R8G8B8A8_SNORM FormatR8G8B8A8Uscaled Format = C.VK_FORMAT_R8G8B8A8_USCALED FormatR8G8B8A8Sscaled Format = C.VK_FORMAT_R8G8B8A8_SSCALED FormatR8G8B8A8Uint Format = C.VK_FORMAT_R8G8B8A8_UINT FormatR8G8B8A8Sint Format = C.VK_FORMAT_R8G8B8A8_SINT FormatR8G8B8A8Srgb Format = C.VK_FORMAT_R8G8B8A8_SRGB FormatB8G8R8A8Unorm Format = C.VK_FORMAT_B8G8R8A8_UNORM FormatB8G8R8A8Snorm Format = C.VK_FORMAT_B8G8R8A8_SNORM FormatB8G8R8A8Uscaled Format = C.VK_FORMAT_B8G8R8A8_USCALED FormatB8G8R8A8Sscaled Format = C.VK_FORMAT_B8G8R8A8_SSCALED FormatB8G8R8A8Uint Format = C.VK_FORMAT_B8G8R8A8_UINT FormatB8G8R8A8Sint Format = C.VK_FORMAT_B8G8R8A8_SINT FormatB8G8R8A8Srgb Format = C.VK_FORMAT_B8G8R8A8_SRGB FormatD16Unorm Format = C.VK_FORMAT_D16_UNORM FormatX8D24UnormPack32 Format = C.VK_FORMAT_X8_D24_UNORM_PACK32 FormatD32Sfloat Format = C.VK_FORMAT_D32_SFLOAT FormatS8Uint Format = C.VK_FORMAT_S8_UINT FormatD16UnormS8Uint Format = C.VK_FORMAT_D16_UNORM_S8_UINT FormatD24UnormS8Uint Format = C.VK_FORMAT_D24_UNORM_S8_UINT FormatD32SfloatS8Uint Format = C.VK_FORMAT_D32_SFLOAT_S8_UINT // Additional pack32 formats FormatA2R10G10B10UnormPack32 Format = C.VK_FORMAT_A2R10G10B10_UNORM_PACK32 FormatA2B10G10R10UnormPack32 Format = C.VK_FORMAT_A2B10G10R10_UNORM_PACK32 // YCbCr formats for video FormatG8B8G8R8422Unorm Format = C.VK_FORMAT_G8B8G8R8_422_UNORM FormatB8G8R8G8422Unorm Format = C.VK_FORMAT_B8G8R8G8_422_UNORM FormatG8B8R83Plane420Unorm Format = C.VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM FormatG8B8R82Plane420Unorm Format = C.VK_FORMAT_G8_B8R8_2PLANE_420_UNORM FormatG8B8R83Plane422Unorm Format = C.VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM FormatG8B8R82Plane422Unorm Format = C.VK_FORMAT_G8_B8R8_2PLANE_422_UNORM FormatG8B8R83Plane444Unorm Format = C.VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM FormatG10X6B10X6G10X6R10X6422Unorm4Pack16 Format = C.VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 FormatG10X6B10X6R10X62Plane420Unorm3Pack16 Format = C.VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 FormatG10X6B10X6R10X62Plane422Unorm3Pack16 Format = C.VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 FormatG16B16R162Plane420Unorm Format = C.VK_FORMAT_G16_B16R16_2PLANE_420_UNORM FormatG16B16R162Plane422Unorm Format = C.VK_FORMAT_G16_B16R16_2PLANE_422_UNORM )
func YUVFormatToVulkanFormat ¶ added in v1.1.0
YUVFormatToVulkanFormat converts a YUV format to the corresponding Vulkan format
type FormatFeatureFlags ¶ added in v1.1.0
type FormatFeatureFlags uint32
FormatFeatureFlags represents format feature flags
const ( FormatFeatureSampledImageBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT FormatFeatureStorageImageBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT FormatFeatureStorageImageAtomicBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT FormatFeatureUniformTexelBufferBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT FormatFeatureStorageTexelBufferBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT FormatFeatureStorageTexelBufferAtomicBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT FormatFeatureVertexBufferBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT FormatFeatureColorAttachmentBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT FormatFeatureColorAttachmentBlendBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT FormatFeatureDepthStencilAttachmentBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT FormatFeatureBlitSrcBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_BLIT_SRC_BIT FormatFeatureBlitDstBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_BLIT_DST_BIT FormatFeatureSampledImageFilterLinearBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT FormatFeatureTransferSrcBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_TRANSFER_SRC_BIT FormatFeatureTransferDstBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_TRANSFER_DST_BIT FormatFeatureMidpointChromaSamplesBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT FormatFeatureSampledImageYcbcrConversionLinearFilterBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT FormatFeatureSampledImageFilterMinmaxBit FormatFeatureFlags = C.VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT )
type FormatProperties ¶ added in v1.1.0
type FormatProperties struct {
LinearTilingFeatures FormatFeatureFlags
OptimalTilingFeatures FormatFeatureFlags
BufferFeatures FormatFeatureFlags
}
FormatProperties contains format properties
func GetPhysicalDeviceFormatProperties ¶ added in v1.1.0
func GetPhysicalDeviceFormatProperties(physicalDevice PhysicalDevice, format Format) FormatProperties
GetPhysicalDeviceFormatProperties returns format properties for a physical device
type Framebuffer ¶
Framebuffer represents a Vulkan framebuffer
func CreateFramebuffer ¶ added in v1.1.0
func CreateFramebuffer(device Device, createInfo *FramebufferCreateInfo) (Framebuffer, error)
CreateFramebuffer creates a framebuffer
type FramebufferCreateInfo ¶ added in v1.1.0
type FramebufferCreateInfo struct {
RenderPass RenderPass
Attachments []ImageView
Width uint32
Height uint32
Layers uint32
}
FramebufferCreateInfo contains framebuffer creation information
type FrontFace ¶
type FrontFace uint32
FrontFace represents front-facing triangle orientation
const ( FrontFaceCounterClockwise FrontFace = C.VK_FRONT_FACE_COUNTER_CLOCKWISE FrontFaceClockwise FrontFace = C.VK_FRONT_FACE_CLOCKWISE )
type GraphicsPipelineCreateInfo ¶ added in v1.1.0
type GraphicsPipelineCreateInfo struct {
Stages []PipelineShaderStageCreateInfo
VertexInputState *PipelineVertexInputStateCreateInfo
InputAssemblyState *PipelineInputAssemblyStateCreateInfo
TessellationState *PipelineTessellationStateCreateInfo
ViewportState *PipelineViewportStateCreateInfo
RasterizationState *PipelineRasterizationStateCreateInfo
MultisampleState *PipelineMultisampleStateCreateInfo
DepthStencilState *PipelineDepthStencilStateCreateInfo
ColorBlendState *PipelineColorBlendStateCreateInfo
DynamicState *PipelineDynamicStateCreateInfo
Layout PipelineLayout
RenderPass RenderPass
Subpass uint32
BasePipelineHandle Pipeline
BasePipelineIndex int32
}
GraphicsPipelineCreateInfo contains graphics pipeline creation information
type H264DecodeSessionCreateInfo ¶ added in v1.1.0
type H264DecodeSessionCreateInfo struct {
Width uint32
Height uint32
ChromaSubsampling VideoChromaSubsampling
LumaBitDepth VideoComponentBitDepth
ChromaBitDepth VideoComponentBitDepth
MaxDpbSlots uint32
MaxActiveReferences uint32
QueueFamilyIndex uint32
PictureFormat Format
ReferenceFormat Format
}
H264DecodeSessionCreateInfo contains configuration for H.264 decode session
func DefaultH264DecodeSessionCreateInfo ¶ added in v1.1.0
func DefaultH264DecodeSessionCreateInfo(width, height uint32) *H264DecodeSessionCreateInfo
DefaultH264DecodeSessionCreateInfo returns a default H.264 decode session configuration
type H264EncodeSessionCreateInfo ¶ added in v1.1.0
type H264EncodeSessionCreateInfo struct {
Width uint32
Height uint32
Profile H264Profile
Level H264Level
ChromaSubsampling VideoChromaSubsampling
LumaBitDepth VideoComponentBitDepth
ChromaBitDepth VideoComponentBitDepth
MaxDpbSlots uint32
MaxActiveReferences uint32
RateControl *VideoEncodeRateControlInfo
QueueFamilyIndex uint32
PictureFormat Format
ReferenceFormat Format
}
H264EncodeSessionCreateInfo contains configuration for H.264 encode session.
LIMITATION: Level and RateControl are not currently applied to the created session; see https://github.com/darkace1998/Golang-Vulkan-api/issues/125.
func DefaultH264EncodeSessionCreateInfo ¶ added in v1.1.0
func DefaultH264EncodeSessionCreateInfo(width, height uint32) *H264EncodeSessionCreateInfo
DefaultH264EncodeSessionCreateInfo returns a default H.264 encode session configuration
type H264Level ¶ added in v1.1.0
type H264Level uint32
H264Level represents H.264/AVC levels
const ( H264Level1_0 H264Level = 10 H264Level1_1 H264Level = 11 H264Level1_2 H264Level = 12 H264Level1_3 H264Level = 13 H264Level2_0 H264Level = 20 H264Level2_1 H264Level = 21 H264Level2_2 H264Level = 22 H264Level3_0 H264Level = 30 H264Level3_1 H264Level = 31 H264Level3_2 H264Level = 32 H264Level4_0 H264Level = 40 H264Level4_1 H264Level = 41 H264Level4_2 H264Level = 42 H264Level5_0 H264Level = 50 H264Level5_1 H264Level = 51 H264Level5_2 H264Level = 52 )
type H264Profile ¶ added in v1.1.0
type H264Profile uint32
H264Profile represents H.264/AVC profile identifiers
const ( H264ProfileBaseline H264Profile = 66 H264ProfileMain H264Profile = 77 H264ProfileHigh H264Profile = 100 // H264ProfileHigh10 and H264ProfileHigh422 are valid H.264 profile_idc // values but are NOT defined by StdVideoH264ProfileIdc in the Vulkan // video std headers; passing them to a driver results in an invalid // profile. Prefer Baseline, Main, High, or High444. H264ProfileHigh10 H264Profile = 110 H264ProfileHigh422 H264Profile = 122 H264ProfileHigh444 H264Profile = 244 )
type H265DecodeSessionCreateInfo ¶ added in v1.1.0
type H265DecodeSessionCreateInfo struct {
Width uint32
Height uint32
ChromaSubsampling VideoChromaSubsampling
LumaBitDepth VideoComponentBitDepth
ChromaBitDepth VideoComponentBitDepth
MaxDpbSlots uint32
MaxActiveReferences uint32
QueueFamilyIndex uint32
PictureFormat Format
ReferenceFormat Format
}
H265DecodeSessionCreateInfo contains configuration for H.265 decode session
func DefaultH265DecodeSessionCreateInfo ¶ added in v1.1.0
func DefaultH265DecodeSessionCreateInfo(width, height uint32) *H265DecodeSessionCreateInfo
DefaultH265DecodeSessionCreateInfo returns a default H.265 decode session configuration
type H265EncodeSessionCreateInfo ¶ added in v1.1.0
type H265EncodeSessionCreateInfo struct {
Width uint32
Height uint32
Profile H265Profile
Level H265Level
ChromaSubsampling VideoChromaSubsampling
LumaBitDepth VideoComponentBitDepth
ChromaBitDepth VideoComponentBitDepth
MaxDpbSlots uint32
MaxActiveReferences uint32
RateControl *VideoEncodeRateControlInfo
QueueFamilyIndex uint32
PictureFormat Format
ReferenceFormat Format
}
H265EncodeSessionCreateInfo contains configuration for H.265 encode session.
LIMITATION: Level and RateControl are not currently applied to the created session; see https://github.com/darkace1998/Golang-Vulkan-api/issues/125.
func DefaultH265EncodeSessionCreateInfo ¶ added in v1.1.0
func DefaultH265EncodeSessionCreateInfo(width, height uint32) *H265EncodeSessionCreateInfo
DefaultH265EncodeSessionCreateInfo returns a default H.265 encode session configuration
type H265Level ¶ added in v1.1.0
type H265Level uint32
H265Level represents H.265/HEVC levels
const ( H265Level1_0 H265Level = 30 H265Level2_0 H265Level = 60 H265Level2_1 H265Level = 63 H265Level3_0 H265Level = 90 H265Level3_1 H265Level = 93 H265Level4_0 H265Level = 120 H265Level4_1 H265Level = 123 H265Level5_0 H265Level = 150 H265Level5_1 H265Level = 153 H265Level5_2 H265Level = 156 H265Level6_0 H265Level = 180 H265Level6_1 H265Level = 183 H265Level6_2 H265Level = 186 )
type H265Profile ¶ added in v1.1.0
type H265Profile uint32
H265Profile represents H.265/HEVC profile identifiers
const ( H265ProfileMain H265Profile = 1 H265ProfileMain10 H265Profile = 2 H265ProfileMainStillPicture H265Profile = 3 H265ProfileRext H265Profile = 4 H265ProfileSCC H265Profile = 9 )
type Image ¶
Image represents a Vulkan image
func CreateImage ¶
func CreateImage(device Device, createInfo *ImageCreateInfo) (Image, error)
CreateImage creates an image
type ImageAspectFlags ¶
type ImageAspectFlags uint32
ImageAspectFlags represents image aspect flags
const ( ImageAspectColorBit ImageAspectFlags = C.VK_IMAGE_ASPECT_COLOR_BIT ImageAspectDepthBit ImageAspectFlags = C.VK_IMAGE_ASPECT_DEPTH_BIT ImageAspectStencilBit ImageAspectFlags = C.VK_IMAGE_ASPECT_STENCIL_BIT )
type ImageBlit ¶ added in v1.1.0
type ImageBlit struct {
SrcSubresource ImageSubresourceLayers
SrcOffsets [2]Offset3D
DstSubresource ImageSubresourceLayers
DstOffsets [2]Offset3D
}
ImageBlit describes an image blit operation
type ImageCopy ¶ added in v1.1.0
type ImageCopy = ImageResolve
ImageCopy describes an image to image copy operation (same structure as ImageResolve)
type ImageCreateFlags ¶
type ImageCreateFlags uint32
ImageCreateFlags represents image creation flags
const ( ImageCreateSparseBindingBit ImageCreateFlags = C.VK_IMAGE_CREATE_SPARSE_BINDING_BIT ImageCreateSparseResidencyBit ImageCreateFlags = C.VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT ImageCreateSparseAliasedBit ImageCreateFlags = C.VK_IMAGE_CREATE_SPARSE_ALIASED_BIT ImageCreateMutableFormatBit ImageCreateFlags = C.VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT ImageCreateCubeCompatibleBit ImageCreateFlags = C.VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT ImageCreateAliasBit ImageCreateFlags = C.VK_IMAGE_CREATE_ALIAS_BIT ImageCreateSplitInstanceBindRegionsBit ImageCreateFlags = C.VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT ImageCreate2DArrayCompatibleBit ImageCreateFlags = C.VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT ImageCreateBlockTexelViewCompatibleBit ImageCreateFlags = C.VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT ImageCreateExtendedUsageBit ImageCreateFlags = C.VK_IMAGE_CREATE_EXTENDED_USAGE_BIT ImageCreateProtectedBit ImageCreateFlags = C.VK_IMAGE_CREATE_PROTECTED_BIT ImageCreateDisjointBit ImageCreateFlags = C.VK_IMAGE_CREATE_DISJOINT_BIT ImageCreateCornerSampledBitNV ImageCreateFlags = C.VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV ImageCreateSampleLocationsCompatibleDepthBitEXT ImageCreateFlags = C.VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT ImageCreateSubsampledBitEXT ImageCreateFlags = C.VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT )
type ImageCreateInfo ¶
type ImageCreateInfo struct {
Flags ImageCreateFlags
ImageType ImageType
Format Format
Extent Extent3D
MipLevels uint32
ArrayLayers uint32
Samples SampleCountFlags
Tiling ImageTiling
Usage ImageUsageFlags
SharingMode SharingMode
InitialLayout ImageLayout
}
ImageCreateInfo contains image creation information
type ImageFormatProperties ¶ added in v1.1.0
type ImageFormatProperties struct {
MaxExtent Extent3D
MaxMipLevels uint32
MaxArrayLayers uint32
SampleCounts SampleCountFlags
MaxResourceSize DeviceSize
}
ImageFormatProperties contains image format properties
func GetPhysicalDeviceImageFormatProperties ¶ added in v1.1.0
func GetPhysicalDeviceImageFormatProperties(physicalDevice PhysicalDevice, format Format, imageType ImageType, tiling ImageTiling, usage ImageUsageFlags, flags ImageCreateFlags) (ImageFormatProperties, error)
GetPhysicalDeviceImageFormatProperties returns image format properties for a physical device
type ImageLayout ¶
type ImageLayout int32
ImageLayout represents image layouts
const ( ImageLayoutUndefined ImageLayout = C.VK_IMAGE_LAYOUT_UNDEFINED ImageLayoutGeneral ImageLayout = C.VK_IMAGE_LAYOUT_GENERAL ImageLayoutColorAttachmentOptimal ImageLayout = C.VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL ImageLayoutDepthStencilAttachmentOptimal ImageLayout = C.VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL ImageLayoutDepthStencilReadOnlyOptimal ImageLayout = C.VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL ImageLayoutShaderReadOnlyOptimal ImageLayout = C.VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ImageLayoutTransferSrcOptimal ImageLayout = C.VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL ImageLayoutTransferDstOptimal ImageLayout = C.VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL ImageLayoutPreinitialized ImageLayout = C.VK_IMAGE_LAYOUT_PREINITIALIZED ImageLayoutPresentSrcKHR ImageLayout = C.VK_IMAGE_LAYOUT_PRESENT_SRC_KHR )
type ImageMemoryBarrier ¶ added in v1.1.0
type ImageMemoryBarrier struct {
SrcAccessMask AccessFlags
DstAccessMask AccessFlags
OldLayout ImageLayout
NewLayout ImageLayout
SrcQueueFamilyIndex uint32
DstQueueFamilyIndex uint32
Image Image
SubresourceRange ImageSubresourceRange
}
ImageMemoryBarrier represents an image memory barrier with queue family transfer support
type ImageResolve ¶ added in v1.1.0
type ImageResolve struct {
SrcSubresource ImageSubresourceLayers
SrcOffset Offset3D
DstSubresource ImageSubresourceLayers
DstOffset Offset3D
Extent Extent3D
}
ImageResolve describes an image resolve operation
type ImageSubresource ¶ added in v1.1.0
type ImageSubresource struct {
AspectMask ImageAspectFlags
MipLevel uint32
ArrayLayer uint32
}
ImageSubresource represents an image subresource
type ImageSubresourceLayers ¶ added in v1.1.0
type ImageSubresourceLayers struct {
AspectMask ImageAspectFlags
MipLevel uint32
BaseArrayLayer uint32
LayerCount uint32
}
ImageSubresourceLayers specifies image subresource layers
type ImageSubresourceRange ¶
type ImageSubresourceRange struct {
AspectMask ImageAspectFlags
BaseMipLevel uint32
LevelCount uint32
BaseArrayLayer uint32
LayerCount uint32
}
ImageSubresourceRange describes an image subresource range
type ImageTiling ¶
type ImageTiling int32
ImageTiling represents image tiling modes
const ( ImageTilingOptimal ImageTiling = C.VK_IMAGE_TILING_OPTIMAL ImageTilingLinear ImageTiling = C.VK_IMAGE_TILING_LINEAR )
type ImageType ¶
type ImageType int32
ImageType represents image types
const ( ImageType1D ImageType = C.VK_IMAGE_TYPE_1D ImageType2D ImageType = C.VK_IMAGE_TYPE_2D ImageType3D ImageType = C.VK_IMAGE_TYPE_3D )
type ImageUsageFlags ¶
type ImageUsageFlags uint32
ImageUsageFlags represents image usage flags
const ( ImageUsageTransferSrcBit ImageUsageFlags = C.VK_IMAGE_USAGE_TRANSFER_SRC_BIT ImageUsageTransferDstBit ImageUsageFlags = C.VK_IMAGE_USAGE_TRANSFER_DST_BIT ImageUsageSampledBit ImageUsageFlags = C.VK_IMAGE_USAGE_SAMPLED_BIT ImageUsageStorageBit ImageUsageFlags = C.VK_IMAGE_USAGE_STORAGE_BIT ImageUsageColorAttachmentBit ImageUsageFlags = C.VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT ImageUsageDepthStencilAttachmentBit ImageUsageFlags = C.VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT ImageUsageTransientAttachmentBit ImageUsageFlags = C.VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT ImageUsageInputAttachmentBit ImageUsageFlags = C.VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT )
type ImageView ¶
ImageView represents a Vulkan image view
func CreateImageView ¶
func CreateImageView(device Device, createInfo *ImageViewCreateInfo) (ImageView, error)
CreateImageView creates an image view
type ImageViewCreateInfo ¶
type ImageViewCreateInfo struct {
Image Image
ViewType ImageViewType
Format Format
SubresourceRange ImageSubresourceRange
}
ImageViewCreateInfo contains image view creation information
type ImageViewType ¶
type ImageViewType int32
ImageViewType represents image view types
const ( ImageViewType1D ImageViewType = C.VK_IMAGE_VIEW_TYPE_1D ImageViewType2D ImageViewType = C.VK_IMAGE_VIEW_TYPE_2D ImageViewType3D ImageViewType = C.VK_IMAGE_VIEW_TYPE_3D ImageViewTypeCube ImageViewType = C.VK_IMAGE_VIEW_TYPE_CUBE ImageViewType1DArray ImageViewType = C.VK_IMAGE_VIEW_TYPE_1D_ARRAY ImageViewType2DArray ImageViewType = C.VK_IMAGE_VIEW_TYPE_2D_ARRAY ImageViewTypeCubeArray ImageViewType = C.VK_IMAGE_VIEW_TYPE_CUBE_ARRAY )
type IndexType ¶
type IndexType int32
IndexType represents index buffer types
const ( IndexTypeUint16 IndexType = C.VK_INDEX_TYPE_UINT16 IndexTypeUint32 IndexType = C.VK_INDEX_TYPE_UINT32 )
type Instance ¶
Instance represents a Vulkan instance
func CreateInstance ¶
func CreateInstance(createInfo *InstanceCreateInfo) (Instance, error)
CreateInstance creates a Vulkan instance
type InstanceCreateInfo ¶
type InstanceCreateInfo struct {
ApplicationInfo *ApplicationInfo
EnabledLayerNames []string
EnabledExtensionNames []string
}
InstanceCreateInfo contains instance creation information
type LayerProperties ¶
type LayerProperties struct {
LayerName string
SpecVersion Version
ImplementationVersion Version
Description string
}
LayerProperties contains layer information
func EnumerateInstanceLayerProperties ¶
func EnumerateInstanceLayerProperties() ([]LayerProperties, error)
EnumerateInstanceLayerProperties enumerates available instance layers
type LeakTracker ¶ added in v1.2.0
type LeakTracker struct {
// contains filtered or unexported fields
}
LeakTracker is a utility to track Vulkan resource allocations and detect leaks.
type LogicOp ¶ added in v1.1.0
type LogicOp uint32
LogicOp represents logical operations
const ( LogicOpClear LogicOp = C.VK_LOGIC_OP_CLEAR LogicOpAnd LogicOp = C.VK_LOGIC_OP_AND LogicOpAndReverse LogicOp = C.VK_LOGIC_OP_AND_REVERSE LogicOpCopy LogicOp = C.VK_LOGIC_OP_COPY LogicOpAndInverted LogicOp = C.VK_LOGIC_OP_AND_INVERTED LogicOpNoOp LogicOp = C.VK_LOGIC_OP_NO_OP LogicOpXor LogicOp = C.VK_LOGIC_OP_XOR LogicOpOr LogicOp = C.VK_LOGIC_OP_OR LogicOpNor LogicOp = C.VK_LOGIC_OP_NOR LogicOpEquivalent LogicOp = C.VK_LOGIC_OP_EQUIVALENT LogicOpInvert LogicOp = C.VK_LOGIC_OP_INVERT LogicOpOrReverse LogicOp = C.VK_LOGIC_OP_OR_REVERSE LogicOpCopyInverted LogicOp = C.VK_LOGIC_OP_COPY_INVERTED LogicOpOrInverted LogicOp = C.VK_LOGIC_OP_OR_INVERTED LogicOpNand LogicOp = C.VK_LOGIC_OP_NAND LogicOpSet LogicOp = C.VK_LOGIC_OP_SET )
type MappedMemoryRange ¶ added in v1.1.0
type MappedMemoryRange struct {
Memory DeviceMemory
Offset DeviceSize
Size DeviceSize
}
MappedMemoryRange describes a mapped memory range for flush/invalidate operations
type MemoryAllocateInfo ¶
type MemoryAllocateInfo struct {
AllocationSize DeviceSize
MemoryTypeIndex uint32
}
MemoryAllocateInfo contains memory allocation information
type MemoryBarrier ¶ added in v1.1.0
type MemoryBarrier struct {
SrcAccessMask AccessFlags
DstAccessMask AccessFlags
}
MemoryBarrier represents a global memory barrier
type MemoryHeap ¶
type MemoryHeap struct {
Size DeviceSize
Flags MemoryHeapFlags
}
MemoryHeap contains memory heap information
type MemoryHeapFlags ¶
type MemoryHeapFlags uint32
MemoryHeapFlags represents memory heap flags
const ( MemoryHeapDeviceLocalBit MemoryHeapFlags = C.VK_MEMORY_HEAP_DEVICE_LOCAL_BIT MemoryHeapMultiInstanceBit MemoryHeapFlags = C.VK_MEMORY_HEAP_MULTI_INSTANCE_BIT )
type MemoryPool ¶ added in v1.1.0
type MemoryPool struct {
Device Device
Memory DeviceMemory
Size DeviceSize
MemoryTypeIndex uint32
Offset DeviceSize // Current allocation offset
Alignment DeviceSize // Minimum allocation alignment
// contains filtered or unexported fields
}
MemoryPool defines the MemoryPool type MemoryPool represents a simple memory pool for efficient allocations. It is safe for concurrent use by multiple goroutines.
func CreateMemoryPool ¶ added in v1.1.0
func CreateMemoryPool(device Device, size DeviceSize, memoryTypeIndex uint32, alignment DeviceSize) (*MemoryPool, error)
CreateMemoryPool creates a memory pool for efficient sub-allocations
func (*MemoryPool) Allocate ¶ added in v1.1.0
func (pool *MemoryPool) Allocate(size DeviceSize, alignment DeviceSize) (DeviceSize, error)
Allocate allocates memory from the pool Returns the offset within the pool memory, or an error if there's not enough space. This method is safe for concurrent use.
func (*MemoryPool) Destroy ¶ added in v1.1.0
func (pool *MemoryPool) Destroy()
Destroy destroys the memory pool and frees its memory
func (*MemoryPool) Reset ¶ added in v1.1.0
func (pool *MemoryPool) Reset()
Reset resets the pool for reuse (does not free memory). This method is safe for concurrent use.
type MemoryPropertyFlags ¶
type MemoryPropertyFlags uint32
MemoryPropertyFlags represents memory property flags
const ( MemoryPropertyDeviceLocalBit MemoryPropertyFlags = C.VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT MemoryPropertyHostVisibleBit MemoryPropertyFlags = C.VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT MemoryPropertyHostCoherentBit MemoryPropertyFlags = C.VK_MEMORY_PROPERTY_HOST_COHERENT_BIT MemoryPropertyHostCachedBit MemoryPropertyFlags = C.VK_MEMORY_PROPERTY_HOST_CACHED_BIT MemoryPropertyLazilyAllocatedBit MemoryPropertyFlags = C.VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT MemoryPropertyProtectedBit MemoryPropertyFlags = C.VK_MEMORY_PROPERTY_PROTECTED_BIT MemoryPropertyDeviceCoherentBit MemoryPropertyFlags = C.VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD MemoryPropertyDeviceUncachedBit MemoryPropertyFlags = C.VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD )
type MemoryRequirements ¶
type MemoryRequirements struct {
Size DeviceSize
Alignment DeviceSize
MemoryTypeBits uint32
}
MemoryRequirements contains memory requirements
func GetBufferMemoryRequirements ¶
func GetBufferMemoryRequirements(device Device, buffer Buffer) MemoryRequirements
GetBufferMemoryRequirements gets buffer memory requirements
func GetDeviceBufferMemoryRequirements ¶
func GetDeviceBufferMemoryRequirements(device Device, bufferCreateInfo *BufferCreateInfo) MemoryRequirements
GetDeviceBufferMemoryRequirements gets buffer memory requirements without creating a buffer (Vulkan 1.3)
func GetDeviceImageMemoryRequirements ¶
func GetDeviceImageMemoryRequirements(device Device, imageCreateInfo *ImageCreateInfo) MemoryRequirements
GetDeviceImageMemoryRequirements gets image memory requirements without creating an image (Vulkan 1.3)
func GetImageMemoryRequirements ¶
func GetImageMemoryRequirements(device Device, image Image) MemoryRequirements
GetImageMemoryRequirements gets image memory requirements
func GetVideoSessionMemoryRequirements
deprecated
func GetVideoSessionMemoryRequirements(device Device, videoSession VideoSession) ([]MemoryRequirements, error)
GetVideoSessionMemoryRequirements gets memory requirements for a video session.
Deprecated: this variant drops the memoryBindIndex reported by the driver, forcing callers to assume bind indices equal slice positions, which the Vulkan spec does not guarantee. Use GetVideoSessionMemoryBindRequirements and pass each element's MemoryBindIndex to BindVideoSessionMemory instead.
type MemoryType ¶
type MemoryType struct {
PropertyFlags MemoryPropertyFlags
HeapIndex uint32
}
MemoryType contains memory type information
type MemoryUsage ¶ added in v1.1.0
type MemoryUsage int
MemoryUsage represents common memory usage patterns for automatic memory type selection
const ( // MemoryUsageGPUOnly - Memory that is only accessible by the GPU (fastest for GPU operations) MemoryUsageGPUOnly MemoryUsage = iota // MemoryUsageCPUOnly - Memory that is only accessible by the CPU (for staging) MemoryUsageCPUOnly // MemoryUsageCPUToGPU - Memory for CPU-to-GPU data transfer (upload) MemoryUsageCPUToGPU // MemoryUsageGPUToCPU - Memory for GPU-to-CPU data transfer (readback) MemoryUsageGPUToCPU )
type MeshShaderFunctions ¶ added in v1.2.0
type MeshShaderFunctions struct {
// contains filtered or unexported fields
}
MeshShaderFunctions holds the device-level VK_EXT_mesh_shader function pointers for one specific VkDevice. Device-level function pointers are only valid for the device they were queried from, so applications using multiple devices must use one MeshShaderFunctions per device.
func LoadMeshShaderFunctions ¶ added in v1.2.0
func LoadMeshShaderFunctions(device Device) (*MeshShaderFunctions, error)
LoadMeshShaderFunctions resolves the device-level mesh shader functions for the given device and returns them. The result is cached per device; loading is idempotent and thread-safe.
The first successfully loaded device also becomes the dispatch target for the package-level CmdDrawMeshTasks* convenience functions. Applications with more than one device must call methods on the returned MeshShaderFunctions instead of the package-level functions.
Returns an error if the device is nil or the extension is unavailable.
func (*MeshShaderFunctions) CmdDrawMeshTasksEXT ¶ added in v1.2.0
func (f *MeshShaderFunctions) CmdDrawMeshTasksEXT(commandBuffer CommandBuffer, groupCountX, groupCountY, groupCountZ uint32)
CmdDrawMeshTasksEXT draws mesh tasks.
func (*MeshShaderFunctions) CmdDrawMeshTasksIndirectCountEXT ¶ added in v1.2.0
func (f *MeshShaderFunctions) CmdDrawMeshTasksIndirectCountEXT(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, countBuffer Buffer, countBufferOffset DeviceSize, maxDrawCount, stride uint32)
CmdDrawMeshTasksIndirectCountEXT draws mesh tasks with indirect parameters and indirect count.
func (*MeshShaderFunctions) CmdDrawMeshTasksIndirectEXT ¶ added in v1.2.0
func (f *MeshShaderFunctions) CmdDrawMeshTasksIndirectEXT(commandBuffer CommandBuffer, buffer Buffer, offset DeviceSize, drawCount, stride uint32)
CmdDrawMeshTasksIndirectEXT draws mesh tasks with indirect parameters.
type ObjectType ¶
type ObjectType uint32
ObjectType represents Vulkan object types
const ( ObjectTypeUnknown ObjectType = C.VK_OBJECT_TYPE_UNKNOWN ObjectTypeInstance ObjectType = C.VK_OBJECT_TYPE_INSTANCE ObjectTypePhysicalDevice ObjectType = C.VK_OBJECT_TYPE_PHYSICAL_DEVICE ObjectTypeDevice ObjectType = C.VK_OBJECT_TYPE_DEVICE ObjectTypeQueue ObjectType = C.VK_OBJECT_TYPE_QUEUE ObjectTypeSemaphore ObjectType = C.VK_OBJECT_TYPE_SEMAPHORE ObjectTypeCommandBuffer ObjectType = C.VK_OBJECT_TYPE_COMMAND_BUFFER ObjectTypeFence ObjectType = C.VK_OBJECT_TYPE_FENCE ObjectTypeDeviceMemory ObjectType = C.VK_OBJECT_TYPE_DEVICE_MEMORY ObjectTypeBuffer ObjectType = C.VK_OBJECT_TYPE_BUFFER )
type OpticalFlowSession ¶
OpticalFlowSession represents a Vulkan optical flow session
type PerformanceConfiguration ¶
PerformanceConfiguration represents a Vulkan performance configuration
type PhysicalDevice ¶
PhysicalDevice represents a Vulkan physical device
func EnumeratePhysicalDevices ¶
func EnumeratePhysicalDevices(instance Instance) ([]PhysicalDevice, error)
EnumeratePhysicalDevices enumerates physical devices
type PhysicalDeviceFeatures ¶
type PhysicalDeviceFeatures struct {
RobustBufferAccess bool
FullDrawIndexUint32 bool
ImageCubeArray bool
IndependentBlend bool
GeometryShader bool
TessellationShader bool
SampleRateShading bool
DualSrcBlend bool
LogicOp bool
MultiDrawIndirect bool
DrawIndirectFirstInstance bool
DepthClamp bool
DepthBiasClamp bool
FillModeNonSolid bool
DepthBounds bool
WideLines bool
LargePoints bool
AlphaToOne bool
MultiViewport bool
SamplerAnisotropy bool
TextureCompressionETC2 bool
TextureCompressionASTC_LDR bool
TextureCompressionBC bool
OcclusionQueryPrecise bool
PipelineStatisticsQuery bool
VertexPipelineStoresAndAtomics bool
FragmentStoresAndAtomics bool
ShaderTessellationAndGeometryPointSize bool
ShaderImageGatherExtended bool
ShaderStorageImageExtendedFormats bool
ShaderStorageImageMultisample bool
ShaderStorageImageReadWithoutFormat bool
ShaderStorageImageWriteWithoutFormat bool
ShaderUniformBufferArrayDynamicIndexing bool
ShaderSampledImageArrayDynamicIndexing bool
ShaderStorageBufferArrayDynamicIndexing bool
ShaderStorageImageArrayDynamicIndexing bool
ShaderClipDistance bool
ShaderCullDistance bool
ShaderFloat64 bool
ShaderInt64 bool
ShaderInt16 bool
ShaderResourceResidency bool
ShaderResourceMinLod bool
SparseBinding bool
SparseResidencyBuffer bool
SparseResidencyImage2D bool
SparseResidencyImage3D bool
SparseResidency2Samples bool
SparseResidency4Samples bool
SparseResidency8Samples bool
SparseResidency16Samples bool
SparseResidencyAliased bool
VariableMultisampleRate bool
InheritedQueries bool
}
PhysicalDeviceFeatures contains physical device features
func GetPhysicalDeviceFeatures ¶
func GetPhysicalDeviceFeatures(physicalDevice PhysicalDevice) PhysicalDeviceFeatures
GetPhysicalDeviceFeatures gets physical device features
func GetPhysicalDeviceFeatures2 ¶ added in v1.1.0
func GetPhysicalDeviceFeatures2(physicalDevice PhysicalDevice) (PhysicalDeviceFeatures, error)
GetPhysicalDeviceFeatures2 gets extended physical device features (Vulkan 1.1+)
type PhysicalDeviceGroupProperties ¶ added in v1.1.0
type PhysicalDeviceGroupProperties struct {
PhysicalDeviceCount uint32
PhysicalDevices []PhysicalDevice
SubsetAllocation bool
}
PhysicalDeviceGroupProperties contains physical device group information
func EnumeratePhysicalDeviceGroups ¶ added in v1.1.0
func EnumeratePhysicalDeviceGroups(instance Instance) ([]PhysicalDeviceGroupProperties, error)
EnumeratePhysicalDeviceGroups enumerates physical device groups for multi-GPU
type PhysicalDeviceLimits ¶
type PhysicalDeviceLimits struct {
MaxImageDimension1D uint32
MaxImageDimension2D uint32
MaxImageDimension3D uint32
MaxImageDimensionCube uint32
MaxImageArrayLayers uint32
MaxTexelBufferElements uint32
MaxUniformBufferRange uint32
MaxStorageBufferRange uint32
MaxPushConstantsSize uint32
MaxMemoryAllocationCount uint32
MaxSamplerAllocationCount uint32
BufferImageGranularity DeviceSize
SparseAddressSpaceSize DeviceSize
MaxBoundDescriptorSets uint32
MaxPerStageDescriptorSamplers uint32
MaxPerStageDescriptorUniformBuffers uint32
MaxPerStageDescriptorStorageBuffers uint32
MaxPerStageDescriptorSampledImages uint32
MaxPerStageDescriptorStorageImages uint32
MaxPerStageDescriptorInputAttachments uint32
MaxPerStageResources uint32
MaxDescriptorSetSamplers uint32
MaxDescriptorSetUniformBuffers uint32
MaxDescriptorSetUniformBuffersDynamic uint32
MaxDescriptorSetStorageBuffers uint32
MaxDescriptorSetStorageBuffersDynamic uint32
MaxDescriptorSetSampledImages uint32
MaxDescriptorSetStorageImages uint32
MaxDescriptorSetInputAttachments uint32
MaxVertexInputAttributes uint32
MaxVertexInputBindings uint32
MaxVertexInputAttributeOffset uint32
MaxVertexInputBindingStride uint32
MaxVertexOutputComponents uint32
MaxTessellationGenerationLevel uint32
MaxTessellationPatchSize uint32
MaxTessellationControlPerVertexInputComponents uint32
MaxTessellationControlPerVertexOutputComponents uint32
MaxTessellationControlPerPatchOutputComponents uint32
MaxTessellationControlTotalOutputComponents uint32
MaxTessellationEvaluationInputComponents uint32
MaxTessellationEvaluationOutputComponents uint32
MaxGeometryShaderInvocations uint32
MaxGeometryInputComponents uint32
MaxGeometryOutputComponents uint32
MaxGeometryOutputVertices uint32
MaxGeometryTotalOutputComponents uint32
MaxFragmentInputComponents uint32
MaxFragmentOutputAttachments uint32
MaxFragmentDualSrcAttachments uint32
MaxFragmentCombinedOutputResources uint32
MaxComputeWorkGroupCount [3]uint32
MaxComputeWorkGroupInvocations uint32
MaxComputeWorkGroupSize [3]uint32
SubPixelPrecisionBits uint32
SubTexelPrecisionBits uint32
MipmapPrecisionBits uint32
MaxDrawIndexedIndexValue uint32
MaxDrawIndirectCount uint32
MaxSamplerLodBias float32
MaxSamplerAnisotropy float32
MaxViewports uint32
MaxViewportDimensions [2]uint32
ViewportBoundsRange [2]float32
ViewportSubPixelBits uint32
MinMemoryMapAlignment uintptr
MinTexelBufferOffsetAlignment DeviceSize
MinUniformBufferOffsetAlignment DeviceSize
MinStorageBufferOffsetAlignment DeviceSize
MinTexelOffset int32
MaxTexelOffset uint32
MinTexelGatherOffset int32
MaxTexelGatherOffset uint32
MinInterpolationOffset float32
MaxInterpolationOffset float32
SubPixelInterpolationOffsetBits uint32
MaxFramebufferWidth uint32
MaxFramebufferHeight uint32
MaxFramebufferLayers uint32
FramebufferColorSampleCounts SampleCountFlags
FramebufferDepthSampleCounts SampleCountFlags
FramebufferStencilSampleCounts SampleCountFlags
FramebufferNoAttachmentsSampleCounts SampleCountFlags
MaxColorAttachments uint32
SampledImageColorSampleCounts SampleCountFlags
SampledImageIntegerSampleCounts SampleCountFlags
SampledImageDepthSampleCounts SampleCountFlags
SampledImageStencilSampleCounts SampleCountFlags
StorageImageSampleCounts SampleCountFlags
MaxSampleMaskWords uint32
TimestampComputeAndGraphics Bool32
TimestampPeriod float32
MaxClipDistances uint32
MaxCullDistances uint32
MaxCombinedClipAndCullDistances uint32
DiscreteQueuePriorities uint32
PointSizeRange [2]float32
LineWidthRange [2]float32
PointSizeGranularity float32
LineWidthGranularity float32
StrictLines Bool32
StandardSampleLocations Bool32
OptimalBufferCopyOffsetAlignment DeviceSize
OptimalBufferCopyRowPitchAlignment DeviceSize
NonCoherentAtomSize DeviceSize
}
PhysicalDeviceLimits contains physical device limits
type PhysicalDeviceMemoryProperties ¶
type PhysicalDeviceMemoryProperties struct {
MemoryTypeCount uint32
MemoryTypes [MaxMemoryTypes]MemoryType
MemoryHeapCount uint32
MemoryHeaps [MaxMemoryHeaps]MemoryHeap
}
PhysicalDeviceMemoryProperties contains memory properties
func GetPhysicalDeviceMemoryProperties ¶
func GetPhysicalDeviceMemoryProperties(physicalDevice PhysicalDevice) PhysicalDeviceMemoryProperties
GetPhysicalDeviceMemoryProperties gets physical device memory properties
type PhysicalDeviceMeshShaderFeaturesEXT ¶ added in v1.2.0
type PhysicalDeviceMeshShaderFeaturesEXT struct {
TaskShader Bool32
MeshShader Bool32
MultiviewMeshShader Bool32
PrimitiveFragmentShadingRateMeshShader Bool32
MeshShaderQueries Bool32
}
PhysicalDeviceMeshShaderFeaturesEXT represents the VK_EXT_mesh_shader features
type PhysicalDeviceMeshShaderPropertiesEXT ¶ added in v1.2.0
type PhysicalDeviceMeshShaderPropertiesEXT struct {
MaxTaskWorkGroupTotalCount uint32
MaxTaskWorkGroupCount [3]uint32
MaxTaskWorkGroupInvocations uint32
MaxTaskWorkGroupSize [3]uint32
MaxTaskPayloadSize uint32
MaxMeshWorkGroupTotalCount uint32
MaxMeshWorkGroupCount [3]uint32
MaxMeshWorkGroupInvocations uint32
MaxMeshWorkGroupSize [3]uint32
MaxMeshOutputMemorySize uint32
MaxMeshPayloadAndOutputMemorySize uint32
MaxMeshOutputComponents uint32
MaxMeshOutputVertices uint32
MaxMeshOutputPrimitives uint32
MaxMeshOutputLayers uint32
MaxMeshMultiviewViewCount uint32
MeshOutputPerVertexGranularity uint32
MeshOutputPerPrimitiveGranularity uint32
MaxPreferredTaskWorkGroupInvocations uint32
MaxPreferredMeshWorkGroupInvocations uint32
PrefersLocalInvocationVertexOutput Bool32
PrefersLocalInvocationPrimitiveOutput Bool32
PrefersCompactVertexOutput Bool32
PrefersCompactPrimitiveOutput Bool32
}
PhysicalDeviceMeshShaderPropertiesEXT represents the VK_EXT_mesh_shader properties
type PhysicalDeviceProperties ¶
type PhysicalDeviceProperties struct {
APIVersion Version
DriverVersion Version
VendorID uint32
DeviceID uint32
DeviceType PhysicalDeviceType
DeviceName string
PipelineCacheUUID [UuidSize]uint8
Limits PhysicalDeviceLimits
SparseProperties PhysicalDeviceSparseProperties
}
PhysicalDeviceProperties contains physical device properties
func GetPhysicalDeviceProperties ¶
func GetPhysicalDeviceProperties(physicalDevice PhysicalDevice) PhysicalDeviceProperties
GetPhysicalDeviceProperties gets physical device properties
type PhysicalDeviceSparseProperties ¶
type PhysicalDeviceSparseProperties struct {
ResidencyStandard2DBlockShape Bool32
ResidencyStandard2DMultisampleBlockShape Bool32
ResidencyStandard3DBlockShape Bool32
ResidencyAlignedMipSize Bool32
ResidencyNonResidentStrict Bool32
}
PhysicalDeviceSparseProperties contains sparse resource properties
type PhysicalDeviceType ¶
type PhysicalDeviceType int32
PhysicalDeviceType represents the type of physical device
const ( PhysicalDeviceTypeOther PhysicalDeviceType = C.VK_PHYSICAL_DEVICE_TYPE_OTHER PhysicalDeviceTypeIntegratedGPU PhysicalDeviceType = C.VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU PhysicalDeviceTypeDiscreteGPU PhysicalDeviceType = C.VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU PhysicalDeviceTypeVirtualGPU PhysicalDeviceType = C.VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU PhysicalDeviceTypeCPU PhysicalDeviceType = C.VK_PHYSICAL_DEVICE_TYPE_CPU )
type PhysicalDeviceVulkan11Features ¶ added in v1.1.0
type PhysicalDeviceVulkan11Features struct {
StorageBuffer16BitAccess bool
UniformAndStorageBuffer16BitAccess bool
StoragePushConstant16 bool
StorageInputOutput16 bool
Multiview bool
MultiviewGeometryShader bool
MultiviewTessellationShader bool
VariablePointersStorageBuffer bool
VariablePointers bool
ProtectedMemory bool
SamplerYcbcrConversion bool
ShaderDrawParameters bool
}
PhysicalDeviceVulkan11Features contains Vulkan 1.1 features
type PhysicalDeviceVulkan12Features ¶ added in v1.1.0
type PhysicalDeviceVulkan12Features struct {
SamplerMirrorClampToEdge bool
DrawIndirectCount bool
StorageBuffer8BitAccess bool
UniformAndStorageBuffer8BitAccess bool
StoragePushConstant8 bool
ShaderBufferInt64Atomics bool
ShaderFloat16 bool
ShaderInt8 bool
DescriptorIndexing bool
ShaderInputAttachmentArrayDynamicIndexing bool
ShaderUniformTexelBufferArrayDynamicIndexing bool
ShaderStorageTexelBufferArrayDynamicIndexing bool
ShaderUniformBufferArrayNonUniformIndexing bool
ShaderSampledImageArrayNonUniformIndexing bool
ShaderStorageBufferArrayNonUniformIndexing bool
ShaderStorageImageArrayNonUniformIndexing bool
ShaderInputAttachmentArrayNonUniformIndexing bool
ShaderUniformTexelBufferArrayNonUniformIndexing bool
ShaderStorageTexelBufferArrayNonUniformIndexing bool
DescriptorBindingUniformBufferUpdateAfterBind bool
DescriptorBindingSampledImageUpdateAfterBind bool
DescriptorBindingStorageImageUpdateAfterBind bool
DescriptorBindingStorageBufferUpdateAfterBind bool
DescriptorBindingUniformTexelBufferUpdateAfterBind bool
DescriptorBindingStorageTexelBufferUpdateAfterBind bool
DescriptorBindingUpdateUnusedWhilePending bool
DescriptorBindingPartiallyBound bool
DescriptorBindingVariableDescriptorCount bool
RuntimeDescriptorArray bool
SamplerFilterMinmax bool
ScalarBlockLayout bool
ImagelessFramebuffer bool
UniformBufferStandardLayout bool
ShaderSubgroupExtendedTypes bool
SeparateDepthStencilLayouts bool
HostQueryReset bool
TimelineSemaphore bool
BufferDeviceAddress bool
BufferDeviceAddressCaptureReplay bool
BufferDeviceAddressMultiDevice bool
VulkanMemoryModel bool
VulkanMemoryModelDeviceScope bool
VulkanMemoryModelAvailabilityVisibilityChains bool
ShaderOutputViewportIndex bool
ShaderOutputLayer bool
SubgroupBroadcastDynamicId bool
}
PhysicalDeviceVulkan12Features contains Vulkan 1.2 features
type PhysicalDeviceVulkan13Features ¶ added in v1.1.0
type PhysicalDeviceVulkan13Features struct {
RobustImageAccess bool
InlineUniformBlock bool
DescriptorBindingInlineUniformBlockUpdateAfterBind bool
PipelineCreationCacheControl bool
PrivateData bool
ShaderDemoteToHelperInvocation bool
ShaderTerminateInvocation bool
SubgroupSizeControl bool
ComputeFullSubgroups bool
Synchronization2 bool
TextureCompressionASTC_HDR bool
ShaderZeroInitializeWorkgroupMemory bool
DynamicRendering bool
ShaderIntegerDotProduct bool
Maintenance4 bool
}
PhysicalDeviceVulkan13Features contains Vulkan 1.3 features
type Pipeline ¶
Pipeline represents a Vulkan pipeline
func CreateComputePipelines ¶
func CreateComputePipelines(device Device, pipelineCache PipelineCache, createInfos []ComputePipelineCreateInfo) ([]Pipeline, error)
CreateComputePipelines creates compute pipelines
func CreateGraphicsPipelines ¶ added in v1.1.0
func CreateGraphicsPipelines(device Device, pipelineCache PipelineCache, createInfos []GraphicsPipelineCreateInfo) ([]Pipeline, error)
CreateGraphicsPipelines creates graphics pipelines
func CreateRayTracingPipelinesKHR ¶ added in v1.2.0
func CreateRayTracingPipelinesKHR(device Device, pipelineCache PipelineCache, createInfos []RayTracingPipelineCreateInfoKHR) ([]Pipeline, error)
CreateRayTracingPipelinesKHR creates ray tracing pipelines. The functions for the device are loaded on first use (per device).
type PipelineBindPoint ¶
type PipelineBindPoint int32
PipelineBindPoint represents pipeline bind points
const ( PipelineBindPointGraphics PipelineBindPoint = C.VK_PIPELINE_BIND_POINT_GRAPHICS PipelineBindPointCompute PipelineBindPoint = C.VK_PIPELINE_BIND_POINT_COMPUTE )
type PipelineCache ¶
PipelineCache represents a Vulkan pipeline cache
func CreatePipelineCache ¶ added in v1.1.0
func CreatePipelineCache(device Device, createInfo *PipelineCacheCreateInfo) (PipelineCache, error)
CreatePipelineCache creates a pipeline cache
type PipelineCacheCreateFlags ¶ added in v1.1.0
type PipelineCacheCreateFlags uint32
PipelineCacheCreateFlags represents pipeline cache creation flags
const (
PipelineCacheCreateExternallySynchronized PipelineCacheCreateFlags = 0x00000001
)
type PipelineCacheCreateInfo ¶ added in v1.1.0
type PipelineCacheCreateInfo struct {
Flags PipelineCacheCreateFlags
InitialData []byte
}
PipelineCacheCreateInfo contains pipeline cache creation information
type PipelineColorBlendAttachmentState ¶ added in v1.1.0
type PipelineColorBlendAttachmentState struct {
BlendEnable bool
SrcColorBlendFactor BlendFactor
DstColorBlendFactor BlendFactor
ColorBlendOp BlendOp
SrcAlphaBlendFactor BlendFactor
DstAlphaBlendFactor BlendFactor
AlphaBlendOp BlendOp
ColorWriteMask ColorComponentFlags
}
PipelineColorBlendAttachmentState contains color blend attachment state
type PipelineColorBlendStateCreateInfo ¶ added in v1.1.0
type PipelineColorBlendStateCreateInfo struct {
LogicOpEnable bool
LogicOp LogicOp
Attachments []PipelineColorBlendAttachmentState
BlendConstants [4]float32
}
PipelineColorBlendStateCreateInfo contains color blend state creation information
type PipelineCreateFlags ¶ added in v1.2.0
type PipelineCreateFlags uint32
PipelineCreateFlags represents pipeline creation flags.
const ( PipelineCreateDisableOptimizationBit PipelineCreateFlags = C.VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT PipelineCreateAllowDerivativesBit PipelineCreateFlags = C.VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT PipelineCreateDerivativeBit PipelineCreateFlags = C.VK_PIPELINE_CREATE_DERIVATIVE_BIT )
type PipelineCreationFeedback ¶
type PipelineCreationFeedback struct {
Flags PipelineCreationFeedbackFlags
Duration uint64
}
PipelineCreationFeedback provides feedback about pipeline creation
type PipelineCreationFeedbackCreateInfo ¶
type PipelineCreationFeedbackCreateInfo struct {
PipelineCreationFeedback *PipelineCreationFeedback
PipelineStageCreationFeedbacks []PipelineCreationFeedback
}
PipelineCreationFeedbackCreateInfo contains pipeline creation feedback information
type PipelineCreationFeedbackFlags ¶
type PipelineCreationFeedbackFlags uint32
PipelineCreationFeedbackFlags represents pipeline creation feedback flags
const ( PipelineCreationFeedbackValid PipelineCreationFeedbackFlags = C.VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT PipelineCreationFeedbackApplicationPipelineCacheHit PipelineCreationFeedbackFlags = C.VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT PipelineCreationFeedbackBasePipelineAcceleration PipelineCreationFeedbackFlags = C.VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT )
type PipelineDepthStencilStateCreateInfo ¶ added in v1.1.0
type PipelineDepthStencilStateCreateInfo struct {
DepthTestEnable bool
DepthWriteEnable bool
DepthCompareOp CompareOp
DepthBoundsTestEnable bool
StencilTestEnable bool
Front StencilOpState
Back StencilOpState
MinDepthBounds float32
MaxDepthBounds float32
}
PipelineDepthStencilStateCreateInfo contains depth/stencil state creation information
type PipelineDynamicStateCreateInfo ¶ added in v1.1.0
type PipelineDynamicStateCreateInfo struct {
DynamicStates []DynamicState
}
PipelineDynamicStateCreateInfo contains dynamic state creation information
type PipelineInputAssemblyStateCreateInfo ¶ added in v1.1.0
type PipelineInputAssemblyStateCreateInfo struct {
Topology PrimitiveTopology
PrimitiveRestartEnable bool
}
PipelineInputAssemblyStateCreateInfo contains input assembly state creation information
type PipelineLayout ¶
PipelineLayout represents a Vulkan pipeline layout
func CreatePipelineLayout ¶
func CreatePipelineLayout(device Device, createInfo *PipelineLayoutCreateInfo) (PipelineLayout, error)
CreatePipelineLayout creates a pipeline layout
type PipelineLayoutCreateInfo ¶
type PipelineLayoutCreateInfo struct {
SetLayouts []DescriptorSetLayout
PushConstants []PushConstantRange
}
PipelineLayoutCreateInfo contains pipeline layout creation information
type PipelineLibraryCreateInfoKHR ¶ added in v1.2.0
type PipelineLibraryCreateInfoKHR struct{}
PipelineLibraryCreateInfoKHR represents VkPipelineLibraryCreateInfoKHR (stub)
type PipelineMultisampleStateCreateInfo ¶ added in v1.1.0
type PipelineMultisampleStateCreateInfo struct {
RasterizationSamples SampleCountFlags
SampleShadingEnable bool
MinSampleShading float32
SampleMask []uint32
AlphaToCoverageEnable bool
AlphaToOneEnable bool
}
PipelineMultisampleStateCreateInfo contains multisample state creation information
type PipelineRasterizationStateCreateInfo ¶ added in v1.1.0
type PipelineRasterizationStateCreateInfo struct {
DepthClampEnable bool
RasterizerDiscardEnable bool
PolygonMode PolygonMode
CullMode CullModeFlags
FrontFace FrontFace
DepthBiasEnable bool
DepthBiasConstantFactor float32
DepthBiasClamp float32
DepthBiasSlopeFactor float32
LineWidth float32
}
PipelineRasterizationStateCreateInfo contains rasterization state creation information
type PipelineShaderStageCreateInfo ¶
type PipelineShaderStageCreateInfo struct {
Stage ShaderStageFlags
Module ShaderModule
Name string
}
PipelineShaderStageCreateInfo contains pipeline shader stage creation information
type PipelineStageFlags ¶
type PipelineStageFlags uint32
PipelineStageFlags represents pipeline stage flags
const ( PipelineStageTopOfPipeBit PipelineStageFlags = C.VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT PipelineStageDrawIndirectBit PipelineStageFlags = C.VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT PipelineStageVertexInputBit PipelineStageFlags = C.VK_PIPELINE_STAGE_VERTEX_INPUT_BIT PipelineStageVertexShaderBit PipelineStageFlags = C.VK_PIPELINE_STAGE_VERTEX_SHADER_BIT PipelineStageTessellationControlShaderBit PipelineStageFlags = C.VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT PipelineStageTessellationEvaluationShaderBit PipelineStageFlags = C.VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT PipelineStageGeometryShaderBit PipelineStageFlags = C.VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT PipelineStageFragmentShaderBit PipelineStageFlags = C.VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT PipelineStageEarlyFragmentTestsBit PipelineStageFlags = C.VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT PipelineStageLateFragmentTestsBit PipelineStageFlags = C.VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT PipelineStageColorAttachmentOutputBit PipelineStageFlags = C.VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT PipelineStageComputeShaderBit PipelineStageFlags = C.VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT PipelineStageTransferBit PipelineStageFlags = C.VK_PIPELINE_STAGE_TRANSFER_BIT PipelineStageBottomOfPipeBit PipelineStageFlags = C.VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT PipelineStageHostBit PipelineStageFlags = C.VK_PIPELINE_STAGE_HOST_BIT PipelineStageAllGraphicsBit PipelineStageFlags = C.VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT PipelineStageAllCommandsBit PipelineStageFlags = C.VK_PIPELINE_STAGE_ALL_COMMANDS_BIT )
type PipelineStageFlags2 ¶
type PipelineStageFlags2 uint64
PipelineStageFlags2 represents enhanced pipeline stage flags
const ( PipelineStage2None PipelineStageFlags2 = 0 PipelineStage2TopOfPipe PipelineStageFlags2 = 0x00000001 PipelineStage2DrawIndirect PipelineStageFlags2 = 0x00000002 PipelineStage2VertexInput PipelineStageFlags2 = 0x00000004 PipelineStage2VertexShader PipelineStageFlags2 = 0x00000008 PipelineStage2TessellationControlShader PipelineStageFlags2 = 0x00000010 PipelineStage2TessellationEvaluationShader PipelineStageFlags2 = 0x00000020 PipelineStage2GeometryShader PipelineStageFlags2 = 0x00000040 PipelineStage2FragmentShader PipelineStageFlags2 = 0x00000080 PipelineStage2EarlyFragmentTests PipelineStageFlags2 = 0x00000100 PipelineStage2LateFragmentTests PipelineStageFlags2 = 0x00000200 PipelineStage2ColorAttachmentOutput PipelineStageFlags2 = 0x00000400 PipelineStage2ComputeShader PipelineStageFlags2 = 0x00000800 PipelineStage2AllTransfer PipelineStageFlags2 = 0x00001000 PipelineStage2BottomOfPipe PipelineStageFlags2 = 0x00002000 PipelineStage2Host PipelineStageFlags2 = 0x00004000 PipelineStage2AllGraphics PipelineStageFlags2 = 0x00008000 PipelineStage2AllCommands PipelineStageFlags2 = 0x00010000 PipelineStage2Copy PipelineStageFlags2 = 0x100000000 PipelineStage2Resolve PipelineStageFlags2 = 0x200000000 PipelineStage2Blit PipelineStageFlags2 = 0x400000000 PipelineStage2Clear PipelineStageFlags2 = 0x800000000 PipelineStage2IndexInput PipelineStageFlags2 = 0x1000000000 PipelineStage2VertexAttributeInput PipelineStageFlags2 = 0x2000000000 PipelineStage2PreRasterizationShaders PipelineStageFlags2 = 0x4000000000 )
type PipelineTessellationStateCreateInfo ¶ added in v1.1.0
type PipelineTessellationStateCreateInfo struct {
PatchControlPoints uint32
}
PipelineTessellationStateCreateInfo contains tessellation state creation information
type PipelineVertexInputStateCreateInfo ¶ added in v1.1.0
type PipelineVertexInputStateCreateInfo struct {
VertexBindingDescriptions []VertexInputBindingDescription
VertexAttributeDescriptions []VertexInputAttributeDescription
}
PipelineVertexInputStateCreateInfo contains vertex input state creation information
type PipelineViewportStateCreateInfo ¶ added in v1.1.0
PipelineViewportStateCreateInfo contains viewport state creation information
type PolygonMode ¶ added in v1.1.0
type PolygonMode uint32
PolygonMode represents polygon rasterization mode
const ( PolygonModeFill PolygonMode = C.VK_POLYGON_MODE_FILL PolygonModeLine PolygonMode = C.VK_POLYGON_MODE_LINE PolygonModePoint PolygonMode = C.VK_POLYGON_MODE_POINT )
type PresentInfo ¶ added in v1.1.0
PresentInfo contains presentation information
type PresentMode ¶ added in v1.1.0
type PresentMode uint32
PresentMode represents presentation modes
const ( PresentModeImmediate PresentMode = C.VK_PRESENT_MODE_IMMEDIATE_KHR PresentModeMailbox PresentMode = C.VK_PRESENT_MODE_MAILBOX_KHR PresentModeFIFO PresentMode = C.VK_PRESENT_MODE_FIFO_KHR PresentModeFIFORelaxed PresentMode = C.VK_PRESENT_MODE_FIFO_RELAXED_KHR )
func GetPhysicalDeviceSurfacePresentModes ¶ added in v1.1.0
func GetPhysicalDeviceSurfacePresentModes(physicalDevice PhysicalDevice, surface Surface) ([]PresentMode, error)
GetPhysicalDeviceSurfacePresentModes gets surface present modes
type PrimitiveTopology ¶
type PrimitiveTopology uint32
PrimitiveTopology represents primitive topology
const ( PrimitiveTopologyPointList PrimitiveTopology = C.VK_PRIMITIVE_TOPOLOGY_POINT_LIST PrimitiveTopologyLineList PrimitiveTopology = C.VK_PRIMITIVE_TOPOLOGY_LINE_LIST PrimitiveTopologyLineStrip PrimitiveTopology = C.VK_PRIMITIVE_TOPOLOGY_LINE_STRIP PrimitiveTopologyTriangleList PrimitiveTopology = C.VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST PrimitiveTopologyTriangleStrip PrimitiveTopology = C.VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP PrimitiveTopologyTriangleFan PrimitiveTopology = C.VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN PrimitiveTopologyLineListWithAdjacency PrimitiveTopology = C.VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY PrimitiveTopologyLineStripWithAdjacency PrimitiveTopology = C.VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY PrimitiveTopologyTriangleListWithAdjacency PrimitiveTopology = C.VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY PrimitiveTopologyTriangleStripWithAdjacency PrimitiveTopology = C.VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY PrimitiveTopologyPatchList PrimitiveTopology = C.VK_PRIMITIVE_TOPOLOGY_PATCH_LIST )
type PrivateDataSlot ¶
PrivateDataSlot represents a Vulkan private data slot
func CreatePrivateDataSlot ¶
func CreatePrivateDataSlot(device Device, createInfo *PrivateDataSlotCreateInfo) (PrivateDataSlot, error)
CreatePrivateDataSlot creates a private data slot
type PrivateDataSlotCreateFlags ¶
type PrivateDataSlotCreateFlags uint32
PrivateDataSlotCreateFlags represents flags for private data slot creation
type PrivateDataSlotCreateInfo ¶
type PrivateDataSlotCreateInfo struct {
Flags PrivateDataSlotCreateFlags
}
PrivateDataSlotCreateInfo contains information for creating a private data slot
type PushConstantRange ¶
type PushConstantRange struct {
StageFlags ShaderStageFlags
Offset uint32
Size uint32
}
PushConstantRange represents a push constant range
type QueryControlFlags ¶ added in v1.1.0
type QueryControlFlags uint32
QueryControlFlags represents query control flags
const (
QueryControlPreciseBit QueryControlFlags = C.VK_QUERY_CONTROL_PRECISE_BIT
)
type QueryPipelineStatisticFlags ¶ added in v1.1.0
type QueryPipelineStatisticFlags uint32
QueryPipelineStatisticFlags represents query pipeline statistic flags
const ( QueryPipelineStatisticInputAssemblyVerticesBit QueryPipelineStatisticFlags = C.VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT QueryPipelineStatisticInputAssemblyPrimitivesBit QueryPipelineStatisticFlags = C.VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT QueryPipelineStatisticVertexShaderInvocationsBit QueryPipelineStatisticFlags = C.VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT QueryPipelineStatisticGeometryShaderInvocationsBit QueryPipelineStatisticFlags = C.VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT QueryPipelineStatisticGeometryShaderPrimitivesBit QueryPipelineStatisticFlags = C.VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT QueryPipelineStatisticClippingInvocationsBit QueryPipelineStatisticFlags = C.VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT QueryPipelineStatisticClippingPrimitivesBit QueryPipelineStatisticFlags = C.VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT QueryPipelineStatisticFragmentShaderInvocationsBit QueryPipelineStatisticFlags = C.VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT QueryPipelineStatisticTessellationControlShaderPatchesBit QueryPipelineStatisticFlags = C.VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT QueryPipelineStatisticTessellationEvaluationShaderInvocationsBit QueryPipelineStatisticFlags = C.VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT QueryPipelineStatisticComputeShaderInvocationsBit QueryPipelineStatisticFlags = C.VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT )
type QueryPool ¶
QueryPool represents a Vulkan query pool
func CreateQueryPool ¶ added in v1.1.0
func CreateQueryPool(device Device, createInfo *QueryPoolCreateInfo) (QueryPool, error)
CreateQueryPool creates a query pool for managing a number of queries
type QueryPoolCreateFlags ¶ added in v1.1.0
type QueryPoolCreateFlags uint32
QueryPoolCreateFlags represents query pool creation flags
type QueryPoolCreateInfo ¶ added in v1.1.0
type QueryPoolCreateInfo struct {
Flags QueryPoolCreateFlags
QueryType QueryType
QueryCount uint32
PipelineStatistics QueryPipelineStatisticFlags
}
QueryPoolCreateInfo contains query pool creation parameters
type QueryResultFlags ¶ added in v1.1.0
type QueryResultFlags uint32
QueryResultFlags represents query result retrieval flags
const ( QueryResult64Bit QueryResultFlags = C.VK_QUERY_RESULT_64_BIT QueryResultWait QueryResultFlags = C.VK_QUERY_RESULT_WAIT_BIT QueryResultWithAvailability QueryResultFlags = C.VK_QUERY_RESULT_WITH_AVAILABILITY_BIT QueryResultPartial QueryResultFlags = C.VK_QUERY_RESULT_PARTIAL_BIT QueryResultWithStatusKHR QueryResultFlags = 0x00000010 // VK_QUERY_RESULT_WITH_STATUS_BIT_KHR )
type QueryType ¶ added in v1.1.0
type QueryType uint32
QueryType represents the type of queries managed by a query pool
const ( QueryTypeOcclusion QueryType = C.VK_QUERY_TYPE_OCCLUSION QueryTypePipelineStatistics QueryType = C.VK_QUERY_TYPE_PIPELINE_STATISTICS QueryTypeTimestamp QueryType = C.VK_QUERY_TYPE_TIMESTAMP )
type Queue ¶
Queue represents a Vulkan queue
func GetDeviceQueue ¶
GetDeviceQueue gets a device queue
type QueueFamilyProperties ¶
type QueueFamilyProperties struct {
QueueFlags QueueFlags
QueueCount uint32
TimestampValidBits uint32
MinImageTransferGranularity Extent3D
}
QueueFamilyProperties contains queue family properties
func GetPhysicalDeviceQueueFamilyProperties ¶
func GetPhysicalDeviceQueueFamilyProperties(physicalDevice PhysicalDevice) []QueueFamilyProperties
GetPhysicalDeviceQueueFamilyProperties gets queue family properties
type QueueFlags ¶
type QueueFlags uint32
QueueFlags represents queue capability flags
const ( QueueGraphicsBit QueueFlags = C.VK_QUEUE_GRAPHICS_BIT QueueComputeBit QueueFlags = C.VK_QUEUE_COMPUTE_BIT QueueTransferBit QueueFlags = C.VK_QUEUE_TRANSFER_BIT QueueSparseBindingBit QueueFlags = C.VK_QUEUE_SPARSE_BINDING_BIT QueueProtectedBit QueueFlags = C.VK_QUEUE_PROTECTED_BIT QueueVideoDecodeBitKHR QueueFlags = C.VK_QUEUE_VIDEO_DECODE_BIT_KHR QueueVideoEncodeBitKHR QueueFlags = C.VK_QUEUE_VIDEO_ENCODE_BIT_KHR )
type RayTracingFunctions ¶ added in v1.2.0
type RayTracingFunctions struct {
// contains filtered or unexported fields
}
RayTracingFunctions holds the device-level VK_KHR_ray_tracing_pipeline function pointers for one specific VkDevice. Device-level function pointers are only valid for the device they were queried from, so applications using multiple devices must use one RayTracingFunctions per device.
func LoadRayTracingPipelineFunctions ¶ added in v1.2.0
func LoadRayTracingPipelineFunctions(device Device) (*RayTracingFunctions, error)
LoadRayTracingPipelineFunctions resolves the device-level ray tracing pipeline functions for the given device and returns them. The result is cached per device; loading is idempotent and thread-safe.
The first successfully loaded device also becomes the dispatch target for the package-level CmdTraceRaysKHR convenience function. Applications with more than one device must call methods on the returned RayTracingFunctions instead of the package-level functions.
Returns an error if the device is nil or the extension is unavailable.
func (*RayTracingFunctions) CmdTraceRaysKHR ¶ added in v1.2.0
func (f *RayTracingFunctions) CmdTraceRaysKHR(commandBuffer CommandBuffer, raygen, miss, hit, callable *StridedDeviceAddressRegionKHR, width, height, depth uint32)
CmdTraceRaysKHR records a trace-rays command using this device's function pointers.
type RayTracingPipelineCreateInfoKHR ¶ added in v1.2.0
type RayTracingPipelineCreateInfoKHR struct {
Flags PipelineCreateFlags
Stages []PipelineShaderStageCreateInfo
Groups []RayTracingShaderGroupCreateInfoKHR
MaxPipelineRayRecursionDepth uint32
LibraryInfo *PipelineLibraryCreateInfoKHR
LibraryInterface *RayTracingPipelineInterfaceCreateInfoKHR
DynamicState *PipelineDynamicStateCreateInfo
Layout PipelineLayout
BasePipelineHandle Pipeline
BasePipelineIndex int32
}
RayTracingPipelineCreateInfoKHR represents the VkRayTracingPipelineCreateInfoKHR structure.
type RayTracingPipelineInterfaceCreateInfoKHR ¶ added in v1.2.0
type RayTracingPipelineInterfaceCreateInfoKHR struct{}
RayTracingPipelineInterfaceCreateInfoKHR represents VkRayTracingPipelineInterfaceCreateInfoKHR (stub)
type RayTracingShaderGroupCreateInfoKHR ¶ added in v1.2.0
type RayTracingShaderGroupCreateInfoKHR struct {
Type RayTracingShaderGroupTypeKHR
GeneralShader uint32
ClosestHitShader uint32
AnyHitShader uint32
IntersectionShader uint32
AnyHitShaderDefault uint32
}
RayTracingShaderGroupCreateInfoKHR represents the VkRayTracingShaderGroupCreateInfoKHR structure.
type RayTracingShaderGroupTypeKHR ¶ added in v1.2.0
type RayTracingShaderGroupTypeKHR int32
RayTracingShaderGroupTypeKHR represents the type of a ray tracing shader group.
const ( RayTracingShaderGroupTypeGeneralKHR RayTracingShaderGroupTypeKHR = C.VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR RayTracingShaderGroupTypeTrianglesHitGroupKHR RayTracingShaderGroupTypeKHR = C.VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR RayTracingShaderGroupTypeProceduralHitGroupKHR RayTracingShaderGroupTypeKHR = C.VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR )
type RenderPass ¶
RenderPass represents a Vulkan render pass
func CreateRenderPass ¶
func CreateRenderPass(device Device, createInfo *RenderPassCreateInfo) (RenderPass, error)
CreateRenderPass creates a render pass
type RenderPassBeginInfo ¶
type RenderPassBeginInfo struct {
RenderPass RenderPass
Framebuffer Framebuffer
RenderArea Rect2D
ClearValues []ClearValue
}
RenderPassBeginInfo contains render pass begin information
type RenderPassCreateInfo ¶
type RenderPassCreateInfo struct {
Attachments []AttachmentDescription
Subpasses []SubpassDescription
Dependencies []SubpassDependency
}
RenderPassCreateInfo contains render pass creation information
type RenderingAttachmentInfo ¶
type RenderingAttachmentInfo struct {
ImageView ImageView
ImageLayout ImageLayout
ResolveMode ResolveModeFlagBits
ResolveImageView ImageView
ResolveImageLayout ImageLayout
LoadOp AttachmentLoadOp
StoreOp AttachmentStoreOp
ClearValue ClearValue
}
RenderingAttachmentInfo describes a single attachment for dynamic rendering
type RenderingFlags ¶
type RenderingFlags uint32
RenderingFlags represents flags for dynamic rendering
const ( RenderingContentsSecondaryCommandBuffers RenderingFlags = C.VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT RenderingSuspending RenderingFlags = C.VK_RENDERING_SUSPENDING_BIT RenderingResuming RenderingFlags = C.VK_RENDERING_RESUMING_BIT )
type RenderingInfo ¶
type RenderingInfo struct {
Flags RenderingFlags
RenderArea Rect2D
LayerCount uint32
ViewMask uint32
ColorAttachments []RenderingAttachmentInfo
DepthAttachment *RenderingAttachmentInfo
StencilAttachment *RenderingAttachmentInfo
}
RenderingInfo contains information to begin a render pass instance
type ResolveModeFlagBits ¶
type ResolveModeFlagBits uint32
ResolveModeFlagBits represents multisample resolve modes
const ( ResolveModeNone ResolveModeFlagBits = C.VK_RESOLVE_MODE_NONE ResolveModeSampleZero ResolveModeFlagBits = C.VK_RESOLVE_MODE_SAMPLE_ZERO_BIT ResolveModeAverage ResolveModeFlagBits = C.VK_RESOLVE_MODE_AVERAGE_BIT ResolveModeMin ResolveModeFlagBits = C.VK_RESOLVE_MODE_MIN_BIT ResolveModeMax ResolveModeFlagBits = C.VK_RESOLVE_MODE_MAX_BIT )
type Result ¶
type Result int32
Result represents Vulkan result codes
const ( Success Result = C.VK_SUCCESS NotReady Result = C.VK_NOT_READY Timeout Result = C.VK_TIMEOUT EventSet Result = C.VK_EVENT_SET EventReset Result = C.VK_EVENT_RESET Incomplete Result = C.VK_INCOMPLETE ErrorOutOfHostMemory Result = C.VK_ERROR_OUT_OF_HOST_MEMORY ErrorOutOfDeviceMemory Result = C.VK_ERROR_OUT_OF_DEVICE_MEMORY ErrorInitializationFailed Result = C.VK_ERROR_INITIALIZATION_FAILED ErrorDeviceLost Result = C.VK_ERROR_DEVICE_LOST ErrorMemoryMapFailed Result = C.VK_ERROR_MEMORY_MAP_FAILED ErrorLayerNotPresent Result = C.VK_ERROR_LAYER_NOT_PRESENT ErrorExtensionNotPresent Result = C.VK_ERROR_EXTENSION_NOT_PRESENT ErrorFeatureNotPresent Result = C.VK_ERROR_FEATURE_NOT_PRESENT ErrorIncompatibleDriver Result = C.VK_ERROR_INCOMPATIBLE_DRIVER ErrorTooManyObjects Result = C.VK_ERROR_TOO_MANY_OBJECTS ErrorFormatNotSupported Result = C.VK_ERROR_FORMAT_NOT_SUPPORTED ErrorFragmentedPool Result = C.VK_ERROR_FRAGMENTED_POOL ErrorUnknown Result = C.VK_ERROR_UNKNOWN ErrorOutOfPoolMemory Result = C.VK_ERROR_OUT_OF_POOL_MEMORY ErrorInvalidExternalHandle Result = C.VK_ERROR_INVALID_EXTERNAL_HANDLE ErrorFragmentation Result = C.VK_ERROR_FRAGMENTATION ErrorInvalidOpaqueCaptureAddress Result = C.VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS ErrorSurfaceLostKHR Result = C.VK_ERROR_SURFACE_LOST_KHR ErrorNativeWindowInUseKHR Result = C.VK_ERROR_NATIVE_WINDOW_IN_USE_KHR SuboptimalKHR Result = C.VK_SUBOPTIMAL_KHR ErrorOutOfDateKHR Result = C.VK_ERROR_OUT_OF_DATE_KHR ErrorIncompatibleDisplayKHR Result = C.VK_ERROR_INCOMPATIBLE_DISPLAY_KHR ErrorValidationFailedEXT Result = C.VK_ERROR_VALIDATION_FAILED_EXT ErrorInvalidShaderNV Result = C.VK_ERROR_INVALID_SHADER_NV ErrorInvalidDrmFormatModifierPlaneLayoutEXT Result = C.VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT ErrorNotPermittedEXT Result = C.VK_ERROR_NOT_PERMITTED_EXT ErrorFullScreenExclusiveModeLostEXT Result = C.VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT ThreadIdleKHR Result = C.VK_THREAD_IDLE_KHR ThreadDoneKHR Result = C.VK_THREAD_DONE_KHR OperationDeferredKHR Result = C.VK_OPERATION_DEFERRED_KHR OperationNotDeferredKHR Result = C.VK_OPERATION_NOT_DEFERRED_KHR PipelineCompileRequiredEXT Result = C.VK_PIPELINE_COMPILE_REQUIRED_EXT )
Vulkan result codes
func GetEventStatus ¶ added in v1.1.0
GetEventStatus gets the status of an event Returns Success if the event is signaled, EventReset if unsignaled
func GetFenceStatus ¶
GetFenceStatus gets fence status
func GetQueryPoolResults ¶ added in v1.1.0
func GetQueryPoolResults(device Device, queryPool QueryPool, firstQuery, queryCount uint32, dataSize uint64, stride DeviceSize, flags QueryResultFlags) ([]byte, Result, error)
GetQueryPoolResults retrieves results from a query pool as a byte slice.
stride is the byte distance between the results of consecutive queries. A stride of 0 derives the stride from flags (4 or 8 bytes, doubled when QueryResultWithAvailability is set), which is only correct for query types that write a single counter per query (occlusion, timestamp). Pipeline statistics queries write one counter per enabled statistic bit and must pass an explicit stride of numStatistics x 4 (or x 8 with QueryResult64Bit).
The returned Result is Success or NotReady with a nil error; without QueryResultWait, NotReady means some queries had no results available and the corresponding buffer entries were left unmodified. The error is non-nil only for real failures.
func GetQueryPoolResultsUint32 ¶ added in v1.1.0
func GetQueryPoolResultsUint32(device Device, queryPool QueryPool, firstQuery, queryCount uint32, flags QueryResultFlags) ([]uint32, Result, error)
GetQueryPoolResultsUint32 retrieves 32-bit query results. It is a convenience for query types that write a single counter per query (occlusion, timestamp); use GetQueryPoolResults with an explicit stride for pipeline statistics queries.
The returned Result is Success or NotReady with a nil error; without QueryResultWait, NotReady means some queries had no results available and the corresponding slice entries were left as zero.
func GetQueryPoolResultsUint64 ¶ added in v1.1.0
func GetQueryPoolResultsUint64(device Device, queryPool QueryPool, firstQuery, queryCount uint32, flags QueryResultFlags) ([]uint64, Result, error)
GetQueryPoolResultsUint64 retrieves 64-bit query results. It is a convenience for query types that write a single counter per query (occlusion, timestamp); use GetQueryPoolResults with an explicit stride for pipeline statistics queries.
The returned Result is Success or NotReady with a nil error; without QueryResultWait, NotReady means some queries had no results available and the corresponding slice entries were left as zero.
func WaitForFences ¶
WaitForFences waits for fences to be signaled.
The returned Result is Success when the fences were signaled, or Timeout when the timeout elapsed first — both with a nil error, since VK_TIMEOUT is a Vulkan success code (polling with timeout=0 is the standard non-blocking idiom). The error is non-nil only for real failures such as device loss.
func WaitSemaphores ¶ added in v1.1.0
func WaitSemaphores(device Device, waitInfo *SemaphoreWaitInfo, timeout uint64) (Result, error)
WaitSemaphores waits for timeline semaphores (Vulkan 1.2+).
The returned Result is Success when the wait condition was satisfied, or Timeout when the timeout elapsed first — both with a nil error, since VK_TIMEOUT is a Vulkan success code (polling with timeout=0 is the standard non-blocking idiom). The error is non-nil only for real failures such as device loss.
type SampleCountFlags ¶
type SampleCountFlags uint32
SampleCountFlags defines the SampleCountFlags type SampleCount represents sample count flags
const ( SampleCount1Bit SampleCountFlags = C.VK_SAMPLE_COUNT_1_BIT SampleCount2Bit SampleCountFlags = C.VK_SAMPLE_COUNT_2_BIT SampleCount4Bit SampleCountFlags = C.VK_SAMPLE_COUNT_4_BIT SampleCount8Bit SampleCountFlags = C.VK_SAMPLE_COUNT_8_BIT SampleCount16Bit SampleCountFlags = C.VK_SAMPLE_COUNT_16_BIT SampleCount32Bit SampleCountFlags = C.VK_SAMPLE_COUNT_32_BIT SampleCount64Bit SampleCountFlags = C.VK_SAMPLE_COUNT_64_BIT )
type Sampler ¶
Sampler represents a Vulkan sampler
func CreateSampler ¶
func CreateSampler(device Device, createInfo *SamplerCreateInfo) (Sampler, error)
CreateSampler creates a sampler
type SamplerAddressMode ¶
type SamplerAddressMode int32
SamplerAddressMode represents sampler address modes
const ( SamplerAddressModeRepeat SamplerAddressMode = C.VK_SAMPLER_ADDRESS_MODE_REPEAT SamplerAddressModeMirroredRepeat SamplerAddressMode = C.VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT SamplerAddressModeClampToEdge SamplerAddressMode = C.VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE SamplerAddressModeClampToBorder SamplerAddressMode = C.VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER SamplerAddressModeMirrorClampToEdge SamplerAddressMode = C.VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE )
type SamplerCreateInfo ¶
type SamplerCreateInfo struct {
MagFilter Filter
MinFilter Filter
AddressModeU SamplerAddressMode
AddressModeV SamplerAddressMode
AddressModeW SamplerAddressMode
}
SamplerCreateInfo contains sampler creation information
type SamplerYcbcrConversion ¶
SamplerYcbcrConversion represents a Vulkan sampler YCbCr conversion
type Semaphore ¶
Semaphore represents a Vulkan semaphore
func CreateSemaphore ¶
func CreateSemaphore(device Device, createInfo *SemaphoreCreateInfo) (Semaphore, error)
CreateSemaphore creates a semaphore
type SemaphoreCreateInfo ¶
type SemaphoreCreateInfo struct {
}
SemaphoreCreateInfo contains semaphore creation information
type SemaphoreSignalInfo ¶ added in v1.1.0
SemaphoreSignalInfo contains information for signaling a semaphore
type SemaphoreSubmitInfo ¶
type SemaphoreSubmitInfo struct {
Semaphore Semaphore
Value uint64
StageMask PipelineStageFlags2
DeviceIndex uint32
}
SemaphoreSubmitInfo describes a semaphore signal or wait operation
type SemaphoreType ¶ added in v1.1.0
type SemaphoreType uint32
SemaphoreType represents semaphore types
const ( SemaphoreTypeBinary SemaphoreType = C.VK_SEMAPHORE_TYPE_BINARY SemaphoreTypeTimeline SemaphoreType = C.VK_SEMAPHORE_TYPE_TIMELINE )
type SemaphoreTypeCreateInfo ¶ added in v1.1.0
type SemaphoreTypeCreateInfo struct {
SemaphoreType SemaphoreType
InitialValue uint64
}
SemaphoreTypeCreateInfo specifies the type of a semaphore
type SemaphoreWaitFlags ¶ added in v1.1.0
type SemaphoreWaitFlags uint32
SemaphoreWaitFlags represents semaphore wait flags
const (
SemaphoreWaitAnyBit SemaphoreWaitFlags = C.VK_SEMAPHORE_WAIT_ANY_BIT
)
type SemaphoreWaitInfo ¶ added in v1.1.0
type SemaphoreWaitInfo struct {
Flags SemaphoreWaitFlags
Semaphores []Semaphore
Values []uint64
}
SemaphoreWaitInfo contains information for waiting on semaphores
type ShaderModule ¶
ShaderModule represents a Vulkan shader module
func CreateShaderModule ¶
func CreateShaderModule(device Device, createInfo *ShaderModuleCreateInfo) (ShaderModule, error)
CreateShaderModule creates a shader module
type ShaderModuleCreateInfo ¶
ShaderModuleCreateInfo contains shader module creation information
type ShaderStageFlags ¶
type ShaderStageFlags uint32
ShaderStageFlags represents shader stage flags
const ( ShaderStageVertexBit ShaderStageFlags = C.VK_SHADER_STAGE_VERTEX_BIT ShaderStageTessellationControlBit ShaderStageFlags = C.VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT ShaderStageTessellationEvaluationBit ShaderStageFlags = C.VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT ShaderStageGeometryBit ShaderStageFlags = C.VK_SHADER_STAGE_GEOMETRY_BIT ShaderStageFragmentBit ShaderStageFlags = C.VK_SHADER_STAGE_FRAGMENT_BIT ShaderStageComputeBit ShaderStageFlags = C.VK_SHADER_STAGE_COMPUTE_BIT ShaderStageAllGraphics ShaderStageFlags = C.VK_SHADER_STAGE_ALL_GRAPHICS ShaderStageAll ShaderStageFlags = C.VK_SHADER_STAGE_ALL ShaderStageMeshBitEXT ShaderStageFlags = C.VK_SHADER_STAGE_MESH_BIT_EXT ShaderStageTaskBitEXT ShaderStageFlags = C.VK_SHADER_STAGE_TASK_BIT_EXT )
type SharingMode ¶
type SharingMode int32
SharingMode represents resource sharing mode
const ( SharingModeExclusive SharingMode = C.VK_SHARING_MODE_EXCLUSIVE SharingModeConcurrent SharingMode = C.VK_SHARING_MODE_CONCURRENT )
type SparseBufferMemoryBindInfo ¶ added in v1.1.0
type SparseBufferMemoryBindInfo struct {
Buffer Buffer
Binds []SparseMemoryBind
}
SparseBufferMemoryBindInfo specifies sparse buffer memory binding info
type SparseImageFormatFlags ¶ added in v1.1.0
type SparseImageFormatFlags uint32
SparseImageFormatFlags represents sparse image format flags
const ( SparseImageFormatSingleMiptailBit SparseImageFormatFlags = C.VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT SparseImageFormatAlignedMipSizeBit SparseImageFormatFlags = C.VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT SparseImageFormatNonstandardBlockSizeBit SparseImageFormatFlags = C.VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT )
type SparseImageFormatProperties ¶ added in v1.1.0
type SparseImageFormatProperties struct {
AspectMask ImageAspectFlags
ImageGranularity Extent3D
Flags SparseImageFormatFlags
}
SparseImageFormatProperties contains sparse image format properties
func GetPhysicalDeviceSparseImageFormatProperties ¶ added in v1.1.0
func GetPhysicalDeviceSparseImageFormatProperties(physicalDevice PhysicalDevice, format Format, imageType ImageType, samples SampleCountFlags, usage ImageUsageFlags, tiling ImageTiling) []SparseImageFormatProperties
GetPhysicalDeviceSparseImageFormatProperties returns sparse image format properties
type SparseImageMemoryBind ¶ added in v1.1.0
type SparseImageMemoryBind struct {
Subresource ImageSubresource
Offset Offset3D
Extent Extent3D
Memory DeviceMemory
MemoryOffset DeviceSize
Flags SparseMemoryBindFlags
}
SparseImageMemoryBind specifies a sparse image memory bind
type SparseImageMemoryBindInfo ¶ added in v1.1.0
type SparseImageMemoryBindInfo struct {
Image Image
Binds []SparseImageMemoryBind
}
SparseImageMemoryBindInfo specifies sparse image memory binding info
type SparseImageMemoryRequirements ¶ added in v1.1.0
type SparseImageMemoryRequirements struct {
FormatProperties SparseImageFormatProperties
ImageMipTailFirstLod uint32
ImageMipTailSize DeviceSize
ImageMipTailOffset DeviceSize
ImageMipTailStride DeviceSize
}
SparseImageMemoryRequirements contains sparse image memory requirements
func GetImageSparseMemoryRequirements ¶ added in v1.1.0
func GetImageSparseMemoryRequirements(device Device, image Image) []SparseImageMemoryRequirements
GetImageSparseMemoryRequirements returns sparse memory requirements for an image
type SparseImageOpaqueMemoryBindInfo ¶ added in v1.1.0
type SparseImageOpaqueMemoryBindInfo struct {
Image Image
Binds []SparseMemoryBind
}
SparseImageOpaqueMemoryBindInfo specifies sparse image opaque memory binding info
type SparseMemoryBind ¶ added in v1.1.0
type SparseMemoryBind struct {
ResourceOffset DeviceSize
Size DeviceSize
Memory DeviceMemory
MemoryOffset DeviceSize
Flags SparseMemoryBindFlags
}
SparseMemoryBind specifies a sparse memory bind operation
type SparseMemoryBindFlags ¶ added in v1.1.0
type SparseMemoryBindFlags uint32
SparseMemoryBindFlags represents sparse memory bind flags
const (
SparseMemoryBindMetadataBit SparseMemoryBindFlags = C.VK_SPARSE_MEMORY_BIND_METADATA_BIT
)
type StagingBuffer ¶ added in v1.1.0
type StagingBuffer struct {
Buffer Buffer
Memory DeviceMemory
Size DeviceSize
Data unsafe.Pointer // Mapped pointer (nil if not mapped)
}
StagingBuffer represents a staging buffer for host-to-device transfers
func CreateStagingBuffer ¶ added in v1.1.0
func CreateStagingBuffer(device Device, physicalDevice PhysicalDevice, size DeviceSize) (*StagingBuffer, error)
CreateStagingBuffer creates a staging buffer for host-to-device transfers The buffer is created with TRANSFER_SRC usage and host-visible, coherent memory
type StencilFaceFlags ¶
type StencilFaceFlags uint32
StencilFaceFlags represents stencil face selection
const ( StencilFaceFront StencilFaceFlags = C.VK_STENCIL_FACE_FRONT_BIT StencilFaceBack StencilFaceFlags = C.VK_STENCIL_FACE_BACK_BIT StencilFaceFrontAndBack StencilFaceFlags = C.VK_STENCIL_FACE_FRONT_AND_BACK )
type StencilOp ¶
type StencilOp uint32
StencilOp represents stencil operations
const ( StencilOpKeep StencilOp = C.VK_STENCIL_OP_KEEP StencilOpZero StencilOp = C.VK_STENCIL_OP_ZERO StencilOpReplace StencilOp = C.VK_STENCIL_OP_REPLACE StencilOpIncrementAndClamp StencilOp = C.VK_STENCIL_OP_INCREMENT_AND_CLAMP StencilOpDecrementAndClamp StencilOp = C.VK_STENCIL_OP_DECREMENT_AND_CLAMP StencilOpInvert StencilOp = C.VK_STENCIL_OP_INVERT StencilOpIncrementAndWrap StencilOp = C.VK_STENCIL_OP_INCREMENT_AND_WRAP StencilOpDecrementAndWrap StencilOp = C.VK_STENCIL_OP_DECREMENT_AND_WRAP )
type StencilOpState ¶ added in v1.1.0
type StencilOpState struct {
FailOp StencilOp
PassOp StencilOp
DepthFailOp StencilOp
CompareOp CompareOp
CompareMask uint32
WriteMask uint32
Reference uint32
}
StencilOpState contains stencil operation state
type StridedDeviceAddressRegionKHR ¶ added in v1.2.0
type StridedDeviceAddressRegionKHR struct {
DeviceAddress DeviceAddress
Stride DeviceSize
Size DeviceSize
}
StridedDeviceAddressRegionKHR represents the VkStridedDeviceAddressRegionKHR structure.
type SubmitFlags ¶
type SubmitFlags uint32
SubmitFlags represents flags for queue submission
const (
SubmitProtected SubmitFlags = C.VK_SUBMIT_PROTECTED_BIT
)
type SubmitInfo ¶
type SubmitInfo struct {
WaitSemaphores []Semaphore
WaitDstStageMask []PipelineStageFlags
CommandBuffers []CommandBuffer
SignalSemaphores []Semaphore
}
SubmitInfo contains queue submit information
type SubmitInfo2 ¶
type SubmitInfo2 struct {
Flags SubmitFlags
WaitSemaphoreInfos []SemaphoreSubmitInfo
CommandBufferInfos []CommandBufferSubmitInfo
SignalSemaphoreInfos []SemaphoreSubmitInfo
}
SubmitInfo2 describes a queue submission operation with enhanced synchronization
type SubpassContents ¶
type SubpassContents int32
SubpassContents represents subpass contents
const ( SubpassContentsInline SubpassContents = C.VK_SUBPASS_CONTENTS_INLINE SubpassContentsSecondaryCommandBuffers SubpassContents = C.VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS )
type SubpassDependency ¶
type SubpassDependency struct {
SrcSubpass uint32
DstSubpass uint32
SrcStageMask PipelineStageFlags
DstStageMask PipelineStageFlags
SrcAccessMask AccessFlags
DstAccessMask AccessFlags
DependencyFlags DependencyFlags
}
SubpassDependency describes subpass dependencies
type SubpassDescription ¶
type SubpassDescription struct {
PipelineBindPoint PipelineBindPoint
InputAttachments []AttachmentReference
ColorAttachments []AttachmentReference
ResolveAttachments []AttachmentReference
DepthStencilAttachment *AttachmentReference
PreserveAttachments []uint32
}
SubpassDescription describes a subpass
type SubresourceLayout ¶ added in v1.2.0
type SubresourceLayout struct {
Offset DeviceSize
Size DeviceSize
RowPitch DeviceSize
ArrayPitch DeviceSize
DepthPitch DeviceSize
}
SubresourceLayout represents an image subresource layout
func GetImageSubresourceLayout ¶ added in v1.2.0
func GetImageSubresourceLayout(device Device, image Image, subresource *ImageSubresource) SubresourceLayout
GetImageSubresourceLayout queries the layout of an image subresource
type Surface ¶
Surface represents a Vulkan surface
func CreateWaylandSurfaceKHR ¶ added in v1.2.0
func CreateWaylandSurfaceKHR(instance Instance, createInfo *WaylandSurfaceCreateInfoKHR) (Surface, error)
CreateWaylandSurfaceKHR creates a Vulkan surface for a Wayland window
func CreateXlibSurfaceKHR ¶ added in v1.2.0
func CreateXlibSurfaceKHR(instance Instance, createInfo *XlibSurfaceCreateInfoKHR) (Surface, error)
CreateXlibSurfaceKHR creates a Vulkan surface for an X11 window
type SurfaceCapabilities ¶ added in v1.1.0
type SurfaceCapabilities struct {
MinImageCount uint32
MaxImageCount uint32
CurrentExtent Extent2D
MinImageExtent Extent2D
MaxImageExtent Extent2D
MaxImageArrayLayers uint32
SupportedTransforms uint32
CurrentTransform uint32
SupportedCompositeAlpha uint32
SupportedUsageFlags ImageUsageFlags
}
SurfaceCapabilities describes the capabilities of a surface
func GetPhysicalDeviceSurfaceCapabilities ¶ added in v1.1.0
func GetPhysicalDeviceSurfaceCapabilities(physicalDevice PhysicalDevice, surface Surface) (SurfaceCapabilities, error)
GetPhysicalDeviceSurfaceCapabilities gets surface capabilities
type SurfaceFormat ¶ added in v1.1.0
SurfaceFormat describes a surface format and color space
func GetPhysicalDeviceSurfaceFormats ¶ added in v1.1.0
func GetPhysicalDeviceSurfaceFormats(physicalDevice PhysicalDevice, surface Surface) ([]SurfaceFormat, error)
GetPhysicalDeviceSurfaceFormats gets surface formats
type SurfaceTransformFlags ¶ added in v1.1.0
type SurfaceTransformFlags uint32
SurfaceTransformFlags represents surface transform flags
const ( SurfaceTransformIdentity SurfaceTransformFlags = C.VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR SurfaceTransformRotate90 SurfaceTransformFlags = C.VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR SurfaceTransformRotate180 SurfaceTransformFlags = C.VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR SurfaceTransformRotate270 SurfaceTransformFlags = C.VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR SurfaceTransformHorizontalMirror SurfaceTransformFlags = C.VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR SurfaceTransformHorizontalMirrorRotate90 SurfaceTransformFlags = C.VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR SurfaceTransformHorizontalMirrorRotate180 SurfaceTransformFlags = C.VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR SurfaceTransformHorizontalMirrorRotate270 SurfaceTransformFlags = C.VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR SurfaceTransformInherit SurfaceTransformFlags = C.VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR )
type Swapchain ¶
Swapchain represents a Vulkan swapchain
func CreateSwapchain ¶ added in v1.1.0
func CreateSwapchain(device Device, createInfo *SwapchainCreateInfo) (Swapchain, error)
CreateSwapchain creates a swapchain
type SwapchainCreateFlags ¶ added in v1.1.0
type SwapchainCreateFlags uint32
SwapchainCreateFlags represents swapchain creation flags
const ( SwapchainCreateSplitInstanceBindRegions SwapchainCreateFlags = C.VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR SwapchainCreateProtected SwapchainCreateFlags = C.VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR SwapchainCreateMutableFormat SwapchainCreateFlags = C.VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR )
type SwapchainCreateInfo ¶ added in v1.1.0
type SwapchainCreateInfo struct {
Flags SwapchainCreateFlags
Surface Surface
MinImageCount uint32
ImageFormat Format
ImageColorSpace ColorSpace
ImageExtent Extent2D
ImageArrayLayers uint32
ImageUsage ImageUsageFlags
ImageSharingMode SharingMode
QueueFamilyIndices []uint32
PreTransform SurfaceTransformFlags
CompositeAlpha CompositeAlphaFlags
PresentMode PresentMode
Clipped bool
OldSwapchain Swapchain
}
SwapchainCreateInfo contains swapchain creation information
type ThreadLocalCommandPool ¶ added in v1.1.0
type ThreadLocalCommandPool struct {
Device Device
CommandPool CommandPool
CommandBuffers []CommandBuffer
}
ThreadLocalCommandPool represents a command pool for thread-local use
func CreateThreadLocalCommandPool ¶ added in v1.1.0
func CreateThreadLocalCommandPool(device Device, queueFamilyIndex uint32) (*ThreadLocalCommandPool, error)
CreateThreadLocalCommandPool creates a thread local command pool
func (*ThreadLocalCommandPool) AllocatePrimaryCommandBuffer ¶ added in v1.1.0
func (pool *ThreadLocalCommandPool) AllocatePrimaryCommandBuffer() (CommandBuffer, error)
AllocatePrimaryCommandBuffer allocates a primary command buffer from the pool
func (*ThreadLocalCommandPool) AllocateSecondaryCommandBuffer ¶ added in v1.1.0
func (pool *ThreadLocalCommandPool) AllocateSecondaryCommandBuffer() (CommandBuffer, error)
AllocateSecondaryCommandBuffer allocates a secondary command buffer from the pool
func (*ThreadLocalCommandPool) Destroy ¶ added in v1.1.0
func (pool *ThreadLocalCommandPool) Destroy()
Destroy destroys the thread-local command pool
func (*ThreadLocalCommandPool) Reset ¶ added in v1.1.0
func (pool *ThreadLocalCommandPool) Reset() error
Reset resets the command pool and clears tracked command buffers
type ValidationCache ¶
ValidationCache represents a Vulkan validation cache
type ValidationError ¶
ValidationError represents input validation errors
func NewValidationError ¶
func NewValidationError(field, reason string) *ValidationError
NewValidationError creates a new ValidationError
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface
type Version ¶
type Version uint32
Version represents Vulkan API version
const ( Version10 Version = C.VK_API_VERSION_1_0 Version11 Version = C.VK_API_VERSION_1_1 Version12 Version = C.VK_API_VERSION_1_2 Version13 Version = C.VK_API_VERSION_1_3 // Version14 will be available when system supports Vulkan 1.4 Version14 Version = (1 << 22) | (4 << 12) // VK_MAKE_API_VERSION(0, 1, 4, 0) )
Vulkan API versions
func GetAPIVersion ¶
func GetAPIVersion() Version
GetAPIVersion returns the supported Vulkan API version
func MakeVersion ¶
MakeVersion creates a version number from major, minor, and patch components
type VertexInputAttributeDescription ¶ added in v1.1.0
type VertexInputAttributeDescription struct {
Location uint32
Binding uint32
Format Format
Offset uint32
}
VertexInputAttributeDescription describes a vertex input attribute
type VertexInputBindingDescription ¶ added in v1.1.0
type VertexInputBindingDescription struct {
Binding uint32
Stride uint32
InputRate VertexInputRate
}
VertexInputBindingDescription describes a vertex input binding
type VertexInputRate ¶ added in v1.1.0
type VertexInputRate uint32
VertexInputRate represents the rate at which vertex attributes are pulled from buffers
const ( VertexInputRateVertex VertexInputRate = C.VK_VERTEX_INPUT_RATE_VERTEX VertexInputRateInstance VertexInputRate = C.VK_VERTEX_INPUT_RATE_INSTANCE )
type VideoBeginCodingInfo ¶
type VideoBeginCodingInfo struct {
VideoSession VideoSession
VideoSessionParameters VideoSessionParameters
}
VideoBeginCodingInfo contains video begin coding information
type VideoBindMemoryInfo ¶
type VideoBindMemoryInfo struct {
MemoryBindIndex uint32
Memory DeviceMemory
MemoryOffset DeviceSize
MemorySize DeviceSize
}
VideoBindMemoryInfo contains video session memory binding information
type VideoCapabilities ¶
type VideoCapabilities struct {
Flags uint32
MinBitstreamBufferOffsetAlign DeviceSize
MinBitstreamBufferSizeAlign DeviceSize
PictureAccessGranularity Extent2D
MinCodedExtent Extent2D
MaxCodedExtent Extent2D
MaxDpbSlots uint32
MaxActiveReferencePictures uint32
// Populated for decode profiles.
Decode *VideoDecodeCapabilities
DecodeH264 *VideoDecodeH264Capabilities
DecodeH265 *VideoDecodeH265Capabilities
// Populated for encode profiles.
Encode *VideoEncodeCapabilities
EncodeH264 *VideoEncodeH264Capabilities
EncodeH265 *VideoEncodeH265Capabilities
}
VideoCapabilities represents video codec capabilities. The codec-specific sub-capabilities are populated according to the profile's codec operation.
func GetVideoCapabilities ¶
func GetVideoCapabilities(physicalDevice PhysicalDevice, videoProfile *VideoProfileInfo) (*VideoCapabilities, error)
GetVideoCapabilities retrieves video codec capabilities for a physical device
type VideoChromaSubsampling ¶
type VideoChromaSubsampling uint32
VideoChromaSubsampling represents video chroma subsampling formats
const ( VideoChromaSubsamplingInvalid VideoChromaSubsampling = 0 VideoChromaSubsamplingMonochrome VideoChromaSubsampling = 0x00000001 VideoChromaSubsampling420 VideoChromaSubsampling = 0x00000002 VideoChromaSubsampling422 VideoChromaSubsampling = 0x00000004 VideoChromaSubsampling444 VideoChromaSubsampling = 0x00000008 )
func GetChromaSubsamplingForYUVFormat ¶ added in v1.1.0
func GetChromaSubsamplingForYUVFormat(yuvFormat YUVFormat) VideoChromaSubsampling
GetChromaSubsamplingForYUVFormat returns the chroma subsampling for a YUV format
type VideoCodecOperationFlags ¶
type VideoCodecOperationFlags uint32
VideoCodecOperationFlags represents video codec operations
const ( VideoCodecOperationNone VideoCodecOperationFlags = 0 VideoCodecOperationDecodeH264Bit VideoCodecOperationFlags = 0x00000001 VideoCodecOperationDecodeH265Bit VideoCodecOperationFlags = 0x00000002 VideoCodecOperationDecodeAV1Bit VideoCodecOperationFlags = 0x00000004 VideoCodecOperationEncodeH264Bit VideoCodecOperationFlags = 0x00010000 VideoCodecOperationEncodeH265Bit VideoCodecOperationFlags = 0x00020000 VideoCodecOperationEncodeAV1Bit VideoCodecOperationFlags = 0x00040000 )
type VideoCodingControlFlags ¶ added in v1.1.0
type VideoCodingControlFlags uint32
VideoCodingControlFlags represents video coding control flags
const ( VideoCodingControlResetBit VideoCodingControlFlags = 0x00000001 // VideoCodingControlEncodeRateControlBit corresponds to // VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR. // // LIMITATION: the spec requires VkVideoEncodeRateControlInfoKHR to be // chained when this bit is set, which CmdControlVideoCoding cannot do yet; // see https://github.com/darkace1998/Golang-Vulkan-api/issues/125. VideoCodingControlEncodeRateControlBit VideoCodingControlFlags = 0x00000002 VideoCodingControlEncodeQualityLevelBit VideoCodingControlFlags = 0x00000004 // Deprecated: misleading name; use VideoCodingControlEncodeRateControlBit. VideoCodingControlEncodeBit VideoCodingControlFlags = 0x00000002 )
type VideoCodingControlInfo ¶
type VideoCodingControlInfo struct {
Flags uint32
}
VideoCodingControlInfo contains video coding control information
type VideoComponentBitDepth ¶
type VideoComponentBitDepth uint32
VideoComponentBitDepth represents video component bit depths
const ( VideoComponentBitDepthInvalid VideoComponentBitDepth = 0 VideoComponentBitDepth8 VideoComponentBitDepth = 0x00000001 VideoComponentBitDepth10 VideoComponentBitDepth = 0x00000004 VideoComponentBitDepth12 VideoComponentBitDepth = 0x00000010 )
func GetBitDepthForYUVFormat ¶ added in v1.1.0
func GetBitDepthForYUVFormat(yuvFormat YUVFormat) VideoComponentBitDepth
GetBitDepthForYUVFormat returns the luma bit depth for a YUV format
type VideoDecodeCapabilities ¶ added in v1.2.0
type VideoDecodeCapabilities struct {
Flags VideoDecodeCapabilityFlags
}
VideoDecodeCapabilities holds the decode-specific capabilities (VkVideoDecodeCapabilitiesKHR).
type VideoDecodeCapabilityFlags ¶ added in v1.2.0
type VideoDecodeCapabilityFlags uint32
VideoDecodeCapabilityFlags represents video decode capability flags
const ( VideoDecodeCapabilityDpbAndOutputCoincideBit VideoDecodeCapabilityFlags = 0x00000001 VideoDecodeCapabilityDpbAndOutputDistinctBit VideoDecodeCapabilityFlags = 0x00000002 )
type VideoDecodeH264Capabilities ¶ added in v1.2.0
VideoDecodeH264Capabilities holds H.264 decode capabilities (VkVideoDecodeH264CapabilitiesKHR).
type VideoDecodeH264PictureLayoutFlags ¶ added in v1.2.0
type VideoDecodeH264PictureLayoutFlags uint32
VideoDecodeH264PictureLayoutFlags represents H.264 decode picture layouts
const ( VideoDecodeH264PictureLayoutProgressive VideoDecodeH264PictureLayoutFlags = 0 VideoDecodeH264PictureLayoutInterlacedInterleavedLines VideoDecodeH264PictureLayoutFlags = 0x00000001 VideoDecodeH264PictureLayoutInterlacedSeparatePlanes VideoDecodeH264PictureLayoutFlags = 0x00000002 )
type VideoDecodeH264ProfileInfo ¶ added in v1.2.0
type VideoDecodeH264ProfileInfo struct {
StdProfileIdc H264Profile
PictureLayout VideoDecodeH264PictureLayoutFlags
}
VideoDecodeH264ProfileInfo is the codec-specific profile for H.264 decode (VkVideoDecodeH264ProfileInfoKHR).
type VideoDecodeH264SessionParametersCreateInfo ¶ added in v1.2.0
type VideoDecodeH264SessionParametersCreateInfo struct {
MaxStdSPSCount uint32
MaxStdPPSCount uint32
}
VideoDecodeH264SessionParametersCreateInfo sizes the H.264 decode parameter object (VkVideoDecodeH264SessionParametersCreateInfoKHR). Supplying actual SPS/PPS entries is not yet exposed; entries can be reserved here and the object updated later.
type VideoDecodeH265Capabilities ¶ added in v1.2.0
type VideoDecodeH265Capabilities struct {
MaxLevelIdc int32
}
VideoDecodeH265Capabilities holds H.265 decode capabilities (VkVideoDecodeH265CapabilitiesKHR).
type VideoDecodeH265ProfileInfo ¶ added in v1.2.0
type VideoDecodeH265ProfileInfo struct {
StdProfileIdc H265Profile
}
VideoDecodeH265ProfileInfo is the codec-specific profile for H.265 decode (VkVideoDecodeH265ProfileInfoKHR).
type VideoDecodeH265SessionParametersCreateInfo ¶ added in v1.2.0
type VideoDecodeH265SessionParametersCreateInfo struct {
MaxStdVPSCount uint32
MaxStdSPSCount uint32
MaxStdPPSCount uint32
}
VideoDecodeH265SessionParametersCreateInfo sizes the H.265 decode parameter object (VkVideoDecodeH265SessionParametersCreateInfoKHR).
type VideoDecodeInfo ¶
type VideoDecodeInfo struct {
SrcBuffer Buffer
SrcBufferOffset DeviceSize
SrcBufferRange DeviceSize
DstPictureResource VideoPictureResource
ReferenceSlots []struct {
SlotIndex int32
ImageView ImageView
ImageLayout ImageLayout
}
}
VideoDecodeInfo contains parameters for video decode operations.
LIMITATION: ReferenceSlots is not yet implemented and is currently ignored by CmdDecodeVideo; supplying reference slots returns an error. See https://github.com/darkace1998/Golang-Vulkan-api/issues/122.
type VideoDeviceFunctions ¶ added in v1.1.0
type VideoDeviceFunctions struct {
// contains filtered or unexported fields
}
VideoDeviceFunctions holds per-device video function pointers. Device-level function pointers are only valid for the device they were queried from, so each device gets its own instance.
func CreateVideoDeviceFunctions ¶ added in v1.1.0
func CreateVideoDeviceFunctions(device Device) (*VideoDeviceFunctions, error)
CreateVideoDeviceFunctions creates and loads video functions for a device. The function pointers are resolved from and stored for this specific device; loading is idempotent and thread-safe.
func GetVideoDeviceFunctions ¶ added in v1.1.0
func GetVideoDeviceFunctions(device Device) *VideoDeviceFunctions
GetVideoDeviceFunctions returns the video functions for a device
func (*VideoDeviceFunctions) IsLoaded ¶ added in v1.1.0
func (vdf *VideoDeviceFunctions) IsLoaded() bool
IsLoaded returns whether the video functions are loaded
type VideoEncodeCapabilities ¶ added in v1.2.2
type VideoEncodeCapabilities struct {
Flags VideoEncodeCapabilityFlags
RateControlModes VideoEncodeRateControlMode
MaxRateControlLayers uint32
MaxBitrate uint64
MaxQualityLevels uint32
EncodeInputPictureGranularity Extent2D
SupportedEncodeFeedbackFlags VideoEncodeFeedbackFlags
}
VideoEncodeCapabilities holds the encode-specific capabilities (VkVideoEncodeCapabilitiesKHR).
type VideoEncodeCapabilityFlags ¶ added in v1.2.2
type VideoEncodeCapabilityFlags uint32
VideoEncodeCapabilityFlags represents video encode capability flags (VkVideoEncodeCapabilityFlagsKHR).
const ( VideoEncodeCapabilityPrecedingExternallyEncodedBytesBit VideoEncodeCapabilityFlags = 0x00000001 VideoEncodeCapabilityInsufficientBitstreamBufferRangeDetectionBit VideoEncodeCapabilityFlags = 0x00000002 )
type VideoEncodeFeedbackFlags ¶ added in v1.2.2
type VideoEncodeFeedbackFlags uint32
VideoEncodeFeedbackFlags represents video encode feedback query flags (VkVideoEncodeFeedbackFlagsKHR).
const ( VideoEncodeFeedbackBitstreamBufferOffsetBit VideoEncodeFeedbackFlags = 0x00000001 VideoEncodeFeedbackBitstreamBytesWrittenBit VideoEncodeFeedbackFlags = 0x00000002 VideoEncodeFeedbackBitstreamHasOverridesBit VideoEncodeFeedbackFlags = 0x00000004 )
type VideoEncodeH264Capabilities ¶ added in v1.2.2
type VideoEncodeH264Capabilities struct {
Flags uint32
MaxLevelIdc int32
MaxSliceCount uint32
MaxPPictureL0ReferenceCount uint32
MaxBPictureL0ReferenceCount uint32
MaxL1ReferenceCount uint32
MaxTemporalLayerCount uint32
ExpectDyadicTemporalLayerPattern bool
MinQp int32
MaxQp int32
PrefersGopRemainingFrames bool
RequiresGopRemainingFrames bool
StdSyntaxFlags uint32
}
VideoEncodeH264Capabilities holds H.264 encode capabilities (VkVideoEncodeH264CapabilitiesKHR).
type VideoEncodeH264ProfileInfo ¶ added in v1.2.0
type VideoEncodeH264ProfileInfo struct {
StdProfileIdc H264Profile
}
VideoEncodeH264ProfileInfo is the codec-specific profile for H.264 encode (VkVideoEncodeH264ProfileInfoKHR).
type VideoEncodeH264SessionParametersCreateInfo ¶ added in v1.2.0
type VideoEncodeH264SessionParametersCreateInfo struct {
MaxStdSPSCount uint32
MaxStdPPSCount uint32
}
VideoEncodeH264SessionParametersCreateInfo sizes the H.264 encode parameter object (VkVideoEncodeH264SessionParametersCreateInfoKHR).
type VideoEncodeH265Capabilities ¶ added in v1.2.2
type VideoEncodeH265Capabilities struct {
Flags uint32
MaxLevelIdc int32
MaxSliceSegmentCount uint32
MaxTiles Extent2D
CtbSizes uint32
TransformBlockSizes uint32
MaxPPictureL0ReferenceCount uint32
MaxBPictureL0ReferenceCount uint32
MaxL1ReferenceCount uint32
MaxSubLayerCount uint32
ExpectDyadicTemporalSubLayerPattern bool
MinQp int32
MaxQp int32
PrefersGopRemainingFrames bool
RequiresGopRemainingFrames bool
StdSyntaxFlags uint32
}
VideoEncodeH265Capabilities holds H.265 encode capabilities (VkVideoEncodeH265CapabilitiesKHR).
type VideoEncodeH265ProfileInfo ¶ added in v1.2.0
type VideoEncodeH265ProfileInfo struct {
StdProfileIdc H265Profile
}
VideoEncodeH265ProfileInfo is the codec-specific profile for H.265 encode (VkVideoEncodeH265ProfileInfoKHR).
type VideoEncodeH265SessionParametersCreateInfo ¶ added in v1.2.0
type VideoEncodeH265SessionParametersCreateInfo struct {
MaxStdVPSCount uint32
MaxStdSPSCount uint32
MaxStdPPSCount uint32
}
VideoEncodeH265SessionParametersCreateInfo sizes the H.265 encode parameter object (VkVideoEncodeH265SessionParametersCreateInfoKHR).
type VideoEncodeInfo ¶
type VideoEncodeInfo struct {
SrcPictureResource VideoPictureResource
DstBuffer Buffer
DstBufferOffset DeviceSize
DstBufferRange DeviceSize
ReferenceSlots []struct {
SlotIndex int32
ImageView ImageView
ImageLayout ImageLayout
}
}
VideoEncodeInfo contains parameters for video encode operations.
LIMITATION: ReferenceSlots is not yet implemented and is currently ignored by CmdEncodeVideo; supplying reference slots returns an error. See https://github.com/darkace1998/Golang-Vulkan-api/issues/122.
type VideoEncodeRateControlInfo ¶ added in v1.1.0
type VideoEncodeRateControlInfo struct {
Mode VideoEncodeRateControlMode
LayerCount uint32
AverageBitrate uint64
MaxBitrate uint64
FrameRateNumerator uint32
FrameRateDenominator uint32
VirtualBufferSize uint64
InitialBufferFill uint64
}
VideoEncodeRateControlInfo contains rate control configuration
type VideoEncodeRateControlMode ¶ added in v1.1.0
type VideoEncodeRateControlMode uint32
VideoEncodeRateControlMode represents video encode rate control modes
const ( VideoEncodeRateControlModeDefault VideoEncodeRateControlMode = 0 VideoEncodeRateControlModeDisabled VideoEncodeRateControlMode = 1 // VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR VideoEncodeRateControlModeCBR VideoEncodeRateControlMode = 2 // VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR VideoEncodeRateControlModeVBR VideoEncodeRateControlMode = 4 // VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR )
type VideoFormatProperties ¶ added in v1.1.0
type VideoFormatProperties struct {
Format Format
ImageCreateFlags uint32
ImageType ImageType
ImageTiling ImageTiling
ImageUsageFlags ImageUsageFlags
}
VideoFormatProperties contains video format properties information
func GetVideoFormatProperties ¶ added in v1.1.0
func GetVideoFormatProperties(physicalDevice PhysicalDevice, videoProfile *VideoProfileInfo, imageUsage ImageUsageFlags) ([]VideoFormatProperties, error)
GetVideoFormatProperties queries the video format properties for a physical device
type VideoPictureResource ¶
type VideoPictureResource struct {
ImageView ImageView
ImageLayout ImageLayout
CodedOffset Offset2D
CodedExtent Extent2D
BaseArrayLayer uint32
}
VideoPictureResource contains video picture resource information
func CreateVideoPictureResource ¶ added in v1.1.0
func CreateVideoPictureResource(imageView ImageView, imageLayout ImageLayout, codedExtent Extent2D) VideoPictureResource
CreateVideoPictureResource creates a VideoPictureResource from an image view
func CreateVideoPictureResourceWithOffset ¶ added in v1.1.0
func CreateVideoPictureResourceWithOffset(imageView ImageView, imageLayout ImageLayout, codedOffset Offset2D, codedExtent Extent2D, baseArrayLayer uint32) VideoPictureResource
CreateVideoPictureResourceWithOffset creates a VideoPictureResource with a specific offset
type VideoProfileInfo ¶
type VideoProfileInfo struct {
VideoCodecOperation VideoCodecOperationFlags
ChromaSubsampling VideoChromaSubsampling
LumaBitDepth VideoComponentBitDepth
ChromaBitDepth VideoComponentBitDepth
// Codec-specific profile information; only the field matching
// VideoCodecOperation is used.
DecodeH264 *VideoDecodeH264ProfileInfo
DecodeH265 *VideoDecodeH265ProfileInfo
EncodeH264 *VideoEncodeH264ProfileInfo
EncodeH265 *VideoEncodeH265ProfileInfo
}
VideoProfileInfo describes a video profile.
The Vulkan spec requires every VkVideoProfileInfoKHR to chain a codec-specific profile struct matching VideoCodecOperation. Set the matching codec field (e.g. DecodeH264 for VideoCodecOperationDecodeH264Bit) to control it; when left nil a documented default is chained instead (H.264: High profile, progressive layout; H.265: Main profile).
type VideoSession ¶
VideoSession represents a Vulkan video session
func CreateAV1DecodeSession ¶ added in v1.1.0
func CreateAV1DecodeSession(device Device, createInfo *AV1DecodeSessionCreateInfo) (VideoSession, error)
CreateAV1DecodeSession creates an AV1 decode session with the given configuration.
LIMITATION: AV1 codec-specific profile chaining is not implemented, so this function currently always returns an error. See https://github.com/darkace1998/Golang-Vulkan-api/issues/124.
func CreateAV1EncodeSession ¶ added in v1.1.0
func CreateAV1EncodeSession(device Device, createInfo *AV1EncodeSessionCreateInfo) (VideoSession, error)
CreateAV1EncodeSession creates an AV1 encode session with the given configuration.
LIMITATION: AV1 codec-specific profile chaining is not implemented, so this function currently always returns an error. See https://github.com/darkace1998/Golang-Vulkan-api/issues/124.
func CreateH264DecodeSession ¶ added in v1.1.0
func CreateH264DecodeSession(device Device, createInfo *H264DecodeSessionCreateInfo) (VideoSession, error)
CreateH264DecodeSession creates an H.264 decode session with the given configuration
func CreateH264EncodeSession ¶ added in v1.1.0
func CreateH264EncodeSession(device Device, createInfo *H264EncodeSessionCreateInfo) (VideoSession, error)
CreateH264EncodeSession creates an H.264 encode session with the given configuration
func CreateH265DecodeSession ¶ added in v1.1.0
func CreateH265DecodeSession(device Device, createInfo *H265DecodeSessionCreateInfo) (VideoSession, error)
CreateH265DecodeSession creates an H.265 decode session with the given configuration
func CreateH265EncodeSession ¶ added in v1.1.0
func CreateH265EncodeSession(device Device, createInfo *H265EncodeSessionCreateInfo) (VideoSession, error)
CreateH265EncodeSession creates an H.265 encode session with the given configuration
func CreateVideoSession ¶
func CreateVideoSession(device Device, createInfo *VideoSessionCreateInfo) (VideoSession, error)
CreateVideoSession creates a video session for encoding or decoding
type VideoSessionCreateInfo ¶
type VideoSessionCreateInfo struct {
QueueFamilyIndex uint32
VideoProfile *VideoProfileInfo
PictureFormat Format
MaxCodedExtent Extent2D
ReferencePictureFormat Format
MaxDpbSlots uint32
MaxActiveReferences uint32
}
VideoSessionCreateInfo contains parameters for video session creation
type VideoSessionMemoryRequirements ¶ added in v1.2.2
type VideoSessionMemoryRequirements struct {
MemoryBindIndex uint32
MemoryRequirements MemoryRequirements
}
VideoSessionMemoryRequirements pairs a video session memory binding index with its memory requirements (VkVideoSessionMemoryRequirementsKHR).
func GetVideoSessionMemoryBindRequirements ¶ added in v1.2.2
func GetVideoSessionMemoryBindRequirements(device Device, videoSession VideoSession) ([]VideoSessionMemoryRequirements, error)
GetVideoSessionMemoryBindRequirements gets the memory requirements of each memory binding of a video session, including the binding index that must be passed back via VideoBindMemoryInfo.MemoryBindIndex when binding memory.
type VideoSessionParameters ¶
VideoSessionParameters represents Vulkan video session parameters
func CreateVideoSessionParameters ¶
func CreateVideoSessionParameters(device Device, createInfo *VideoSessionParametersCreateInfo) (VideoSessionParameters, error)
CreateVideoSessionParameters creates video session parameters
type VideoSessionParametersCreateInfo ¶
type VideoSessionParametersCreateInfo struct {
VideoSession VideoSession
VideoSessionParameters VideoSessionParameters
// Codec-specific parameter capacities; set the field matching the video
// session's codec operation.
DecodeH264 *VideoDecodeH264SessionParametersCreateInfo
DecodeH265 *VideoDecodeH265SessionParametersCreateInfo
EncodeH264 *VideoEncodeH264SessionParametersCreateInfo
EncodeH265 *VideoEncodeH265SessionParametersCreateInfo
}
VideoSessionParametersCreateInfo contains parameters for video session parameters. The Vulkan spec requires the codec-specific create struct matching the session's codec operation to be chained; set exactly one of the codec fields.
type VideoSessionParametersUpdateInfo ¶ added in v1.1.0
type VideoSessionParametersUpdateInfo struct {
UpdateSequenceCount uint32
}
VideoSessionParametersUpdateInfo contains update information for video session parameters
type Viewport ¶
type Viewport struct {
X float32
Y float32
Width float32
Height float32
MinDepth float32
MaxDepth float32
}
Viewport represents a viewport
type VulkanError ¶
VulkanError represents a structured Vulkan error with additional context
func NewVulkanError ¶
func NewVulkanError(result Result, operation string, details string) *VulkanError
NewVulkanError creates a new VulkanError
func (*VulkanError) Error ¶
func (e *VulkanError) Error() string
Error implements the error interface
func (*VulkanError) Unwrap ¶
func (e *VulkanError) Unwrap() error
Unwrap returns the underlying Result as an error for error unwrapping
type WaylandSurfaceCreateInfoKHR ¶ added in v1.2.0
type WaylandSurfaceCreateInfoKHR struct {
Display unsafe.Pointer // *C.struct_wl_display
Surface unsafe.Pointer // *C.struct_wl_surface
}
WaylandSurfaceCreateInfoKHR contains parameters for creating a Wayland surface
type WriteDescriptorSet ¶ added in v1.1.0
type WriteDescriptorSet struct {
DstSet DescriptorSet
DstBinding uint32
DstArrayElement uint32
DescriptorCount uint32
DescriptorType DescriptorType
ImageInfo []DescriptorImageInfo
BufferInfo []DescriptorBufferInfo
TexelBufferView []BufferView
}
WriteDescriptorSet describes a descriptor set write operation
type XlibSurfaceCreateInfoKHR ¶ added in v1.2.0
type XlibSurfaceCreateInfoKHR struct {
Dpy unsafe.Pointer // *C.Display
Window uintptr // C.Window
}
XlibSurfaceCreateInfoKHR contains parameters for creating an Xlib surface
type YUVFormat ¶ added in v1.1.0
type YUVFormat uint32
YUVFormat represents common YUV video formats
const ( YUVFormatNV12 YUVFormat = 0 // 4:2:0, 8-bit, semi-planar YUVFormatP010 YUVFormat = 1 // 4:2:0, 10-bit, semi-planar YUVFormatP016 YUVFormat = 2 // 4:2:0, 16-bit, semi-planar YUVFormatYUY2 YUVFormat = 3 // 4:2:2, 8-bit, packed YUVFormatY210 YUVFormat = 4 // 4:2:2, 10-bit, packed YUVFormatY410 YUVFormat = 5 // 4:4:4, 10-bit, packed YUVFormatAYUV YUVFormat = 6 // 4:4:4, 8-bit, packed )
Source Files
¶
- acceleration_structure.go
- cgo_linux.go
- command.go
- commands.go
- debug_utils.go
- descriptor_manager.go
- descriptors.go
- device.go
- doc.go
- errors.go
- instance.go
- leak_tracker.go
- memory.go
- misc.go
- pipeline.go
- queries.go
- ray_tracing.go
- resources.go
- surface_linux_wayland.go
- surface_linux_xlib.go
- swapchain.go
- synchronization.go
- types.go
- video.go
- video_helpers.go
- vulkan13.go
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
basic
command
|
|
|
benchmark
command
|
|
|
compute
command
|
|
|
descriptor_manager
command
|
|
|
descriptor_update
command
|
|
|
graphics_pipeline
command
|
|
|
multi_queue
command
|
|
|
pipeline_cache
command
|
|
|
push_constants
command
|
|
|
render_to_texture
command
|
|
|
secondary_command_buffer
command
|
|
|
simple
command
|
|
|
subpass_dependencies
command
|
|
|
swapchain
command
|
|
|
type
command
|
|
|
video
command
|
|
|
vulkan13
command
|