vulkan

package module
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 9 Imported by: 0

README ¶

Golang-Vulkan-api

A Go binding for Vulkan 1.3+ graphics and compute APIs with broad coverage of the features implemented in this repository.

Overview

This library provides a type-safe Go interface to the Vulkan APIs used by the project examples and tests. It's designed to be used as a library for other Go projects that need low-level graphics and compute functionality.

Verified status

  • libvulkan-dev, libx11-dev, and libwayland-dev are installed on Linux (only libvulkan-dev is needed when building with -tags vk_headless)
  • go build ./... passes
  • go test ./... passes
  • go test -race ./... passes
  • Repository is synced with origin/main

Features

  • ✅ Vulkan 1.3 API Coverage: Core Vulkan 1.3 functions and types used by this repository
  • ✅ Dynamic Rendering: Modern renderpass-free rendering (VK_KHR_dynamic_rendering)
  • ✅ Synchronization2: Enhanced timeline semaphores and submission (VK_KHR_synchronization2)
  • ✅ Extended Dynamic State: More pipeline state that can be set dynamically
  • ✅ Private Data: Associate private data with Vulkan objects
  • ✅ Maintenance4: Enhanced buffer/image memory requirements without object creation
  • ✅ Type Safety: Go-idiomatic types with proper error handling
  • ✅ Memory Management: Safe memory allocation and management functions
  • ✅ Command Buffers: Full command buffer recording and submission
  • ✅ Synchronization: Semaphores, fences, and other sync primitives
  • ✅ Device Management: Physical and logical device enumeration and creation
  • ✅ Buffer/Image Operations: Buffer and image management helpers
  • ✅ Queue Operations: Graphics, compute, and transfer queue support
  • ✅ Compute Shaders: Compute pipeline support and example workloads
  • ✅ Storage Buffers: Large dataset handling for compute operations
  • ✅ Dispatch Commands: Efficient compute work group dispatching
  • ✅ Ray Tracing: Ray tracing pipelines and commands (VK_KHR_ray_tracing_pipeline)
  • ✅ Acceleration Structures: Create and manage acceleration structures (VK_KHR_acceleration_structure)
  • ✅ Platform Setup: Linux, Windows, and macOS setup notes are included

Video Codec Support 🎬

Supported on Compatible Hardware

These codecs have ratified extensions for both operations on compatible hardware:

  • H.264 (AVC) - VK_KHR_video_encode_h264 & VK_KHR_video_decode_h264
  • H.265 (HEVC) - VK_KHR_video_encode_h265 & VK_KHR_video_decode_h265
  • AV1 - VK_KHR_video_encode_av1 & VK_KHR_video_decode_av1

Hardware-accelerated video encoding and decoding is available through Vulkan Video extensions on compatible GPUs and drivers.

Checking Video Codec Support

Use the provided API to check which codecs are supported on your hardware:

// Get supported video codecs for a physical device
supportedCodecs, err := vulkan.GetSupportedVideoCodecs(physicalDevice)
if err != nil {
    log.Fatal(err)
}

for _, codec := range supportedCodecs {
    fmt.Printf("Supported: %s\n", codec)
}

See examples/video/main.go for a working example that detects and displays supported video codecs on your system.

Note: Actual hardware support depends on your GPU model and driver version. Extension availability does not guarantee hardware acceleration.

Vulkan 1.3 Features

Dynamic Rendering

Replace traditional render passes with flexible dynamic rendering:

renderingInfo := &vulkan.RenderingInfo{
    RenderArea: vulkan.Rect2D{
        Offset: vulkan.Offset2D{X: 0, Y: 0}, 
        Extent: vulkan.Extent2D{Width: 800, Height: 600},
    },
    LayerCount: 1,
    ColorAttachments: []vulkan.RenderingAttachmentInfo{
        {
            ImageView:   colorImageView,
            ImageLayout: vulkan.ImageLayoutColorAttachmentOptimal,
            LoadOp:      vulkan.AttachmentLoadOpClear,
            StoreOp:     vulkan.AttachmentStoreOpStore,
        },
    },
}

vulkan.CmdBeginRendering(commandBuffer, renderingInfo)
// Draw commands here
vulkan.CmdEndRendering(commandBuffer)
Synchronization2 (Enhanced Timeline Semaphores)

Modern submission with enhanced synchronization:

submitInfo := []vulkan.SubmitInfo2{
    {
        CommandBufferInfos: []vulkan.CommandBufferSubmitInfo{
            {CommandBuffer: commandBuffer, DeviceMask: 0},
        },
        WaitSemaphoreInfos: []vulkan.SemaphoreSubmitInfo{
            {
                Semaphore: waitSemaphore,
                Value:     waitValue,
                StageMask: vulkan.PipelineStage2FragmentShader,
            },
        },
    },
}

err := vulkan.QueueSubmit2(queue, submitInfo, fence)
Extended Dynamic State

Set more pipeline state dynamically:

vulkan.CmdSetCullMode(commandBuffer, vulkan.CullModeBack)
vulkan.CmdSetFrontFace(commandBuffer, vulkan.FrontFaceCounterClockwise)
vulkan.CmdSetPrimitiveTopology(commandBuffer, vulkan.PrimitiveTopologyTriangleList)
vulkan.CmdSetDepthTestEnable(commandBuffer, true)
vulkan.CmdSetDepthCompareOp(commandBuffer, vulkan.CompareOpLess)
Private Data

Associate application data with Vulkan objects:

slot, err := vulkan.CreatePrivateDataSlot(device, &vulkan.PrivateDataSlotCreateInfo{})
err = vulkan.SetPrivateData(device, vulkan.ObjectTypeBuffer, uint64(buffer), slot, myData)
retrievedData := vulkan.GetPrivateData(device, vulkan.ObjectTypeBuffer, uint64(buffer), slot)
Maintenance4

Get memory requirements without creating objects:

memReqs := vulkan.GetDeviceBufferMemoryRequirements(device, &vulkan.BufferCreateInfo{
    Size:  1024 * 1024, // 1MB buffer
    Usage: vulkan.BufferUsageStorageBufferBit,
})

imageMemReqs := vulkan.GetDeviceImageMemoryRequirements(device, &vulkan.ImageCreateInfo{
    ImageType: vulkan.ImageType2D,
    Format:    vulkan.FormatR8G8B8A8Unorm,
    Extent:    vulkan.Extent3D{Width: 512, Height: 512, Depth: 1},
    Usage:     vulkan.ImageUsageColorAttachmentBit,
})

Requirements

  • Go 1.22 or later
  • CGO enabled
  • Vulkan SDK or development libraries installed (Linux: libvulkan-dev)
    • Linux: libvulkan-dev package. Default builds also need libx11-dev and libwayland-dev for the X11/Wayland surface support; headless builds (-tags vk_headless) need only libvulkan-dev. Testing requires mesa-vulkan-drivers vulkan-tools libwayland-dev libx11-dev.
    • Windows: Vulkan SDK from LunarG
    • macOS: Vulkan SDK with MoltenVK

Installation

go get github.com/darkace1998/golang-vulkan-api

Debugging and Resource Tracking

The library includes a built-in LeakTracker utility to help you monitor Vulkan object allocations and identify potential memory leaks (e.g., calling CreateBuffer without a corresponding DestroyBuffer).

package main

import (
    "fmt"
    vulkan "github.com/darkace1998/golang-vulkan-api"
)

func main() {
    // Enable tracking before creating objects
    vulkan.EnableLeakTracker()
    defer func() {
        // Report any un-freed resources at exit
        fmt.Println(vulkan.ReportLeaks())
    }()

    // ... your Vulkan code ...
}

Error Handling Patterns

See ERROR_HANDLING.md for idiomatic Go patterns for handling VulkanError vs. ValidationError, including retry logic for transient failures like VK_ERROR_DEVICE_LOST.

Troubleshooting

See TROUBLESHOOTING.md for solutions to common issues related to CGO, package dependencies, Vulkan drivers, and runtime segmentation faults.

Performance Tuning

See PERFORMANCE_TUNING.md for detailed strategies and tips for optimizing Vulkan compute workloads, particularly for AI/ML and general parallel processing tasks.

Thread Safety

See THREAD_SAFETY.md for detailed information about thread safety guarantees, host synchronization requirements, and specific details regarding video codec function loading.

Getting Started

If you are new to Vulkan or this library, check out the Getting Started Tutorial for a step-by-step guide to writing your first Vulkan application.

Vulkan 1.4 Readiness

See VULKAN_1_4_READINESS.md for detailed information about the current state of Vulkan 1.4 support and our roadmap for future implementation.

Additional Documentation

The repository includes comprehensive documentation files to help you better understand and utilize the API:

Architecture

See ARCHITECTURE_DIAGRAMS.md for visual representations of the extension loading mechanism, error handling paths, and thread safety models used by this library.

Quick Start

package main

import (
    "fmt"
    "log"
    
    vulkan "github.com/darkace1998/golang-vulkan-api"
)

func main() {
    // Create Vulkan instance
    instanceCreateInfo := &vulkan.InstanceCreateInfo{
        ApplicationInfo: &vulkan.ApplicationInfo{
            ApplicationName:    "My Vulkan App",
            ApplicationVersion: vulkan.MakeVersion(1, 0, 0),
            EngineName:         "My Engine",
            EngineVersion:      vulkan.MakeVersion(1, 0, 0),
            APIVersion:         vulkan.Version13,
        },
    }

    instance, err := vulkan.CreateInstance(instanceCreateInfo)
    if err != nil {
        log.Fatal("Failed to create Vulkan instance:", err)
    }
    defer vulkan.DestroyInstance(instance)

    // Enumerate physical devices
    physicalDevices, err := vulkan.EnumeratePhysicalDevices(instance)
    if err != nil {
        log.Fatal("Failed to enumerate physical devices:", err)
    }

    fmt.Printf("Found %d physical device(s)\n", len(physicalDevices))
    
    // Get device properties
    for i, device := range physicalDevices {
        props := vulkan.GetPhysicalDeviceProperties(device)
        fmt.Printf("Device %d: %s\n", i, props.DeviceName)
    }
}

Core Components

Instance Management
  • Create and destroy Vulkan instances
  • Enumerate extensions and layers
  • Physical device enumeration
Device Management
  • Physical device properties and features
  • Logical device creation
  • Queue family management
Memory Management
  • Buffer and image creation
  • Memory allocation and binding
  • Memory type selection utilities
Command Buffers
  • Command pool management
  • Command buffer allocation and recording
  • Queue submission and synchronization
Compute Pipeline Usage
  • Compute pipeline helpers
  • Storage buffer management
  • Dispatch commands for parallel processing
  • Pipeline barriers for compute synchronization
Synchronization
  • Semaphores for GPU-GPU synchronization
  • Fences for CPU-GPU synchronization
  • Pipeline barriers and memory barriers

Examples

See the examples/ directory for example programs:

  • basic: Basic Vulkan setup and physical device enumeration.
  • benchmark: A GPU stress testing and benchmarking tool. See examples/benchmark/README.md for more details.
  • compute: Demonstrates how to run a compute shader, including buffer creation and memory binding.
  • descriptor_manager: Example demonstrating the usage of the high-level DescriptorPoolManager to easily allocate descriptor sets.
  • descriptor_update: Demonstrates how to bind uniform buffers and combined image samplers by updating descriptor sets.
  • graphics_pipeline: A comprehensive graphics pipeline example showing offscreen rendering with vertex buffers, shader modules, render pass, framebuffer, graphics pipeline creation, and draw commands.
  • multi_queue: Shows how to discover, create, and use multiple Vulkan queues, specifically focusing on parallel transfer and graphics operations.
  • pipeline_cache: Example demonstrating pipeline cache creation, retrieval, merging, and loading data.
  • push_constants: Demonstrates how to use push constants to pass small amounts of data to shaders efficiently.
  • render_to_texture: Demonstrates framebuffer creation, render pass, and reading back pixels without a window/surface.
  • secondary_command_buffer: Shows how to record and execute secondary command buffers.
  • simple: Minimal example for Vulkan instance creation.
  • subpass_dependencies: Demonstrates creating a multi-subpass render pass with a dependency chain and self-dependency.
  • swapchain: Demonstrates all swapchain types, constants, input validation, synchronization objects, and the full present loop workflow.
  • type: Type system and constant validation example.
  • video: Demonstrates video codec support detection.
  • vulkan13: Vulkan 1.3 feature demonstration, including dynamic state and rendering info.

See examples/benchmark/README.md for detailed information about the GPU benchmark tool.

Testing

The implementation includes comprehensive tests and build checks:

# Build everything
go build ./...

# Run tests
go test ./...

# Run the race detector
go test -race ./...

# Run examples
go run ./examples/basic
go run ./examples/compute
go run ./examples/video
go run ./examples/benchmark -help

API Reference

Version Management
// Create version numbers
version := vulkan.MakeVersion(1, 3, 0)
major := version.Major()    // 1
minor := version.Minor()    // 3
patch := version.Patch()    // 0

// Predefined versions
vulkan.Version10  // Vulkan 1.0
vulkan.Version11  // Vulkan 1.1
vulkan.Version12  // Vulkan 1.2
vulkan.Version13  // Vulkan 1.3
vulkan.Version14  // Vulkan 1.4 (when available)
Error Handling
result := vulkan.SomeFunction()
if result != vulkan.Success {
    fmt.Printf("Error: %s\n", result.Error())
}

// Or for functions that return (value, error)
value, err := vulkan.SomeOtherFunction()
if err != nil {
    fmt.Printf("Error: %v\n", err)
}
Instance Creation
instance, err := vulkan.CreateInstance(&vulkan.InstanceCreateInfo{
    ApplicationInfo: &vulkan.ApplicationInfo{
        ApplicationName:    "My App",
        ApplicationVersion: vulkan.MakeVersion(1, 0, 0),
        EngineName:         "My Engine", 
        EngineVersion:      vulkan.MakeVersion(1, 0, 0),
        APIVersion:         vulkan.Version13,
    },
    EnabledLayerNames:     []string{"VK_LAYER_KHRONOS_validation"},
    EnabledExtensionNames: []string{"VK_EXT_debug_utils"},
})
Device Creation
device, err := vulkan.CreateDevice(physicalDevice, &vulkan.DeviceCreateInfo{
    QueueCreateInfos: []vulkan.DeviceQueueCreateInfo{
        {
            QueueFamilyIndex: graphicsQueueFamily,
            QueuePriorities:  []float32{1.0},
        },
    },
    EnabledExtensionNames: []string{"VK_KHR_swapchain"},
    EnabledFeatures:       &features,
})
Buffer Management
// Create buffer
buffer, err := vulkan.CreateBuffer(device, &vulkan.BufferCreateInfo{
    Size:        1024,
    Usage:       vulkan.BufferUsageVertexBufferBit,
    SharingMode: vulkan.SharingModeExclusive,
})

// Get memory requirements
memReqs := vulkan.GetBufferMemoryRequirements(device, buffer)

// Allocate and bind memory
memory, err := vulkan.AllocateMemory(device, &vulkan.MemoryAllocateInfo{
    AllocationSize:  memReqs.Size,
    MemoryTypeIndex: suitableMemoryType,
})

err = vulkan.BindBufferMemory(device, buffer, memory, 0)
Compute Pipeline Example
// Create compute shader module (from compiled SPIR-V bytecode)
shaderModule, err := vulkan.CreateShaderModule(device, &vulkan.ShaderModuleCreateInfo{
    CodeSize: uint32(len(shaderCode) * 4),
    Code:     shaderCode, // SPIR-V bytecode
})

// Create descriptor set layout for storage buffers
descriptorSetLayout, err := vulkan.CreateDescriptorSetLayout(device, &vulkan.DescriptorSetLayoutCreateInfo{
    Bindings: []vulkan.DescriptorSetLayoutBinding{
        {
            Binding:         0,
            DescriptorType:  vulkan.DescriptorTypeStorageBuffer,
            DescriptorCount: 1,
            StageFlags:      vulkan.ShaderStageComputeBit,
        },
    },
})

// Create compute pipeline
computePipelines, err := vulkan.CreateComputePipelines(device, nil, []vulkan.ComputePipelineCreateInfo{
    {
        Stage: vulkan.PipelineShaderStageCreateInfo{
            Stage:  vulkan.ShaderStageComputeBit,
            Module: shaderModule,
            Name:   "main",
        },
        Layout: pipelineLayout,
    },
})

// Record and dispatch compute work
vulkan.CmdBindPipeline(commandBuffer, vulkan.PipelineBindPointCompute, computePipelines[0])
vulkan.CmdDispatch(commandBuffer, workGroupsX, workGroupsY, workGroupsZ)

Building

The library uses CGO to interface with the Vulkan C API and is designed to work across multiple platforms. Make sure you have:

  1. CGO enabled (CGO_ENABLED=1)
  2. Vulkan development libraries installed
  3. A supported Go compiler (Go 1.22+)
# Build the repository
go build ./...

# Run tests
go test ./...

# Run the race detector
go test -race ./...

# Run an example
go run ./examples/basic

The library automatically configures build settings for your platform using Go build tags.

Platform-Specific Setup

Linux
# Install Vulkan development libraries plus the X11/Wayland headers
# used by the default (windowed) build
sudo apt-get install libvulkan-dev pkg-config libx11-dev libwayland-dev

# Or on other distributions
sudo yum install vulkan-devel pkgconf-pkg-config libX11-devel wayland-devel
sudo pacman -S vulkan-headers vulkan-validation-layers pkg-config libx11 wayland
Headless / server builds

The X11 and Wayland surface entry points are behind build tags. On a machine without display-server headers (servers, CI, slim containers), only libvulkan-dev is required:

# No windowing headers needed
go build -tags vk_headless ./...

# Or disable just one backend:
go build -tags vk_no_xlib ./...     # skip X11 (CreateXlibSurfaceKHR unavailable)
go build -tags vk_no_wayland ./...  # skip Wayland (CreateWaylandSurfaceKHR unavailable)
Windows
  1. Install the Vulkan SDK from LunarG
  2. Make sure the SDK is in your PATH
  3. Ensure Vulkan libraries are available:
    # The library will automatically link vulkan-1.lib
    # No additional configuration needed if SDK is installed properly
    
macOS
  1. Install Vulkan SDK with MoltenVK support from LunarG
  2. Install pkg-config if not available:
    brew install pkg-config
    
  3. Vulkan runs on top of Metal via MoltenVK translation layer
Other Unix Systems

Other Unix-like systems may work if pkg-config and Vulkan development libraries are available.

Contributing

Contributions are welcome! Please feel free to submit pull requests, report bugs, or suggest features. See CONTRIBUTING.md for detailed guidelines on building, testing, and submitting code.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Based on the official Vulkan specification
  • Inspired by other Vulkan bindings in the Go ecosystem
  • Thanks to the Vulkan community for excellent documentation

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 ¶

View Source
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

View Source
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

View Source
const ShaderUnusedKHR uint32 = C.VK_SHADER_UNUSED_KHR

Variables ¶

View Source
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 ¶

func DestroyBuffer(device Device, buffer Buffer)

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 DestroyDevice ¶

func DestroyDevice(device Device)

DestroyDevice destroys a logical device

func DestroyEvent ¶ added in v1.1.0

func DestroyEvent(device Device, event Event)

DestroyEvent destroys an event object

func DestroyFence ¶

func DestroyFence(device Device, fence Fence)

DestroyFence destroys a fence

func DestroyFramebuffer ¶ added in v1.1.0

func DestroyFramebuffer(device Device, framebuffer Framebuffer)

DestroyFramebuffer destroys a framebuffer

func DestroyImage ¶

func DestroyImage(device Device, image Image)

DestroyImage destroys an image

func DestroyImageView ¶

func DestroyImageView(device Device, imageView ImageView)

DestroyImageView destroys an image view

func DestroyInstance ¶

func DestroyInstance(instance Instance)

DestroyInstance destroys a Vulkan instance

func DestroyPipeline ¶

func DestroyPipeline(device Device, pipeline Pipeline)

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

func DestroyQueryPool(device Device, queryPool QueryPool)

DestroyQueryPool destroys a query pool

func DestroyRenderPass ¶

func DestroyRenderPass(device Device, renderPass RenderPass)

DestroyRenderPass destroys a render pass

func DestroySampler ¶

func DestroySampler(device Device, sampler Sampler)

DestroySampler destroys a sampler

func DestroySemaphore ¶

func DestroySemaphore(device Device, semaphore Semaphore)

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

func DestroySurface(instance Instance, surface Surface)

DestroySurface destroys a surface

func DestroySwapchain ¶ added in v1.1.0

func DestroySwapchain(device Device, swapchain Swapchain)

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 ¶

func DeviceWaitIdle(device Device) error

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

func GetSemaphoreCounterValue(device Device, semaphore Semaphore) (uint64, error)

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

func IsErrorDeviceLost(err error) bool

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

func IsErrorOutOfDate(err error) bool

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

func IsErrorSurfaceLost(err error) bool

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 ¶

func IsVulkanError(err error) bool

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

func LoadVideoDeviceFunctions(device Device) bool

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

func LoadVideoFormatFunctions(instance Instance) bool

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

func LoadVideoInstanceFunctions(instance Instance) bool

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 ¶

func QueueWaitIdle(queue Queue) error

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

func ResetEvent(device Device, event Event) error

ResetEvent resets an event to unsignaled state from the host

func ResetFences ¶

func ResetFences(device Device, fences []Fence) error

ResetFences resets fences

func ResetQueryPool ¶ added in v1.1.0

func ResetQueryPool(device Device, queryPool QueryPool, firstQuery, queryCount uint32)

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 SetEvent ¶ added in v1.1.0

func SetEvent(device Device, event Event) error

SetEvent sets an event to signaled state from the host

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 ¶

type AccelerationStructure unsafe.Pointer

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

type AccelerationStructureKHR unsafe.Pointer

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.

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

const (
	False Bool32 = C.VK_FALSE
	True  Bool32 = C.VK_TRUE
)

func FromBool ¶

func FromBool(b bool) Bool32

FromBool converts a Go bool to Bool32

func (Bool32) ToBool ¶

func (b Bool32) ToBool() bool

ToBool converts a Bool32 to a Go bool

type Buffer ¶

type Buffer unsafe.Pointer

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 ¶

type BufferView unsafe.Pointer

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 ¶

type ClearColorValue struct {
	Float32 [4]float32
	Int32   [4]int32
	Uint32  [4]uint32
}

ClearColorValue represents a clear color value

type ClearDepthStencilValue ¶

type ClearDepthStencilValue struct {
	Depth   float32
	Stencil uint32
}

ClearDepthStencilValue represents a clear depth/stencil value

type ClearRect ¶ added in v1.1.0

type ClearRect struct {
	Rect           Rect2D
	BaseArrayLayer uint32
	LayerCount     uint32
}

ClearRect represents a clear rectangle

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

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 ¶

type CommandBuffer unsafe.Pointer

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 ¶

type CommandPool unsafe.Pointer

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

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

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 CuFunction ¶

type CuFunction unsafe.Pointer

CuFunction represents a Vulkan CU function

type CuModule ¶

type CuModule unsafe.Pointer

CuModule represents a Vulkan CU module

type CullModeFlags ¶

type CullModeFlags uint32

CullModeFlags represents face culling modes

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

type DebugUtilsLabel struct {
	LabelName string
	Color     [4]float32
}

DebugUtilsLabel specifies parameters for a debug label

type DebugUtilsMessageSeverityFlags ¶ added in v1.1.0

type DebugUtilsMessageSeverityFlags uint32

DebugUtilsMessageSeverityFlags represents debug message severity levels

type DebugUtilsMessageTypeFlags ¶ added in v1.1.0

type DebugUtilsMessageTypeFlags uint32

DebugUtilsMessageTypeFlags represents debug message types

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

type DebugUtilsMessengerEXT unsafe.Pointer

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 ¶

type DeferredOperation unsafe.Pointer

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 ¶

type DescriptorPool unsafe.Pointer

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 ¶

type DescriptorSet unsafe.Pointer

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 ¶

type DescriptorSetLayout unsafe.Pointer

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 ¶

type DescriptorUpdateTemplate unsafe.Pointer

DescriptorUpdateTemplate represents a Vulkan descriptor update template

type Device ¶

type Device unsafe.Pointer

Device represents a Vulkan logical device

func CreateDevice ¶

func CreateDevice(physicalDevice PhysicalDevice, createInfo *DeviceCreateInfo) (Device, error)

CreateDevice creates a logical device

type DeviceAddress ¶

type DeviceAddress uint64

DeviceAddress represents device memory address

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 ¶

type DeviceMemory unsafe.Pointer

DeviceMemory represents Vulkan device memory

func AllocateMemory ¶

func AllocateMemory(device Device, allocateInfo *MemoryAllocateInfo) (DeviceMemory, error)

AllocateMemory allocates device memory

type DeviceQueueCreateInfo ¶

type DeviceQueueCreateInfo struct {
	QueueFamilyIndex uint32
	QueuePriorities  []float32
}

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 Display ¶

type Display unsafe.Pointer

Display represents a Vulkan display

type DisplayMode ¶

type DisplayMode unsafe.Pointer

DisplayMode represents a Vulkan display mode

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 ¶

type Event unsafe.Pointer

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 ¶

type ExtensionProperties struct {
	ExtensionName string
	SpecVersion   uint32
}

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 ¶

type Extent2D struct {
	Width  uint32
	Height uint32
}

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 Extent3D ¶

type Extent3D struct {
	Width  uint32
	Height uint32
	Depth  uint32
}

Extent3D represents a 3D extent

type Fence ¶

type Fence unsafe.Pointer

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 Flags ¶

type Flags uint32

Flags represents generic flags

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

func YUVFormatToVulkanFormat(yuvFormat YUVFormat) Format

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 ¶

type Framebuffer unsafe.Pointer

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 ¶

type Image unsafe.Pointer

Image represents a Vulkan image

func CreateImage ¶

func CreateImage(device Device, createInfo *ImageCreateInfo) (Image, error)

CreateImage creates an image

func GetSwapchainImages ¶ added in v1.1.0

func GetSwapchainImages(device Device, swapchain Swapchain) ([]Image, error)

GetSwapchainImages gets the swapchain images

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 ¶

type ImageView unsafe.Pointer

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

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 ¶

type Instance unsafe.Pointer

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

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 MicromapEXT ¶

type MicromapEXT unsafe.Pointer

MicromapEXT represents a Vulkan micromap EXT

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 Offset2D ¶

type Offset2D struct {
	X int32
	Y int32
}

Offset2D represents a 2D offset

type Offset3D ¶ added in v1.1.0

type Offset3D struct {
	X int32
	Y int32
	Z int32
}

Offset3D represents a 3D offset

type OpticalFlowSession ¶

type OpticalFlowSession unsafe.Pointer

OpticalFlowSession represents a Vulkan optical flow session

type PerformanceConfiguration ¶

type PerformanceConfiguration unsafe.Pointer

PerformanceConfiguration represents a Vulkan performance configuration

type PhysicalDevice ¶

type PhysicalDevice unsafe.Pointer

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
	MaxComputeSharedMemorySize                      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
	MaxTaskSharedMemorySize               uint32
	MaxTaskPayloadAndSharedMemorySize     uint32
	MaxMeshWorkGroupTotalCount            uint32
	MaxMeshWorkGroupCount                 [3]uint32
	MaxMeshWorkGroupInvocations           uint32
	MaxMeshWorkGroupSize                  [3]uint32
	MaxMeshSharedMemorySize               uint32
	MaxMeshPayloadAndSharedMemorySize     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

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
	ShaderSharedInt64Atomics                           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 ¶

type Pipeline unsafe.Pointer

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 ¶

type PipelineCache unsafe.Pointer

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

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 ¶

type PipelineLayout unsafe.Pointer

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

type PipelineViewportStateCreateInfo struct {
	Viewports []Viewport
	Scissors  []Rect2D
}

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

type PresentInfo struct {
	WaitSemaphores []Semaphore
	Swapchains     []Swapchain
	ImageIndices   []uint32
}

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 ¶

type PrivateDataSlot unsafe.Pointer

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 ¶

type QueryPool unsafe.Pointer

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 ¶

type Queue unsafe.Pointer

Queue represents a Vulkan queue

func GetDeviceQueue ¶

func GetDeviceQueue(device Device, queueFamilyIndex, queueIndex uint32) Queue

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.

type Rect2D ¶

type Rect2D struct {
	Offset Offset2D
	Extent Extent2D
}

Rect2D represents a 2D rectangle

type RenderPass ¶

type RenderPass unsafe.Pointer

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

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

func GetEventStatus(device Device, event Event) (Result, error)

GetEventStatus gets the status of an event Returns Success if the event is signaled, EventReset if unsignaled

func GetFenceStatus ¶

func GetFenceStatus(device Device, fence Fence) (Result, error)

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 ¶

func WaitForFences(device Device, fences []Fence, waitAll bool, timeout uint64) (Result, error)

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.

func (Result) Error ¶

func (r Result) Error() string

Error returns the error message for the result

func (Result) IsError ¶

func (r Result) IsError() bool

IsError returns true if the result represents an error condition

func (Result) IsSuccess ¶

func (r Result) IsSuccess() bool

IsSuccess returns true if the result represents success

type SampleCountFlags ¶

type SampleCountFlags uint32

SampleCountFlags defines the SampleCountFlags type SampleCount represents sample count flags

type Sampler ¶

type Sampler unsafe.Pointer

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 ¶

type SamplerYcbcrConversion unsafe.Pointer

SamplerYcbcrConversion represents a Vulkan sampler YCbCr conversion

type Semaphore ¶

type Semaphore unsafe.Pointer

Semaphore represents a Vulkan semaphore

func CreateSemaphore ¶

func CreateSemaphore(device Device, createInfo *SemaphoreCreateInfo) (Semaphore, error)

CreateSemaphore creates a semaphore

func CreateTimelineSemaphore ¶ added in v1.1.0

func CreateTimelineSemaphore(device Device, initialValue uint64) (Semaphore, error)

CreateTimelineSemaphore creates a timeline semaphore (Vulkan 1.2+)

type SemaphoreCreateInfo ¶

type SemaphoreCreateInfo struct {
}

SemaphoreCreateInfo contains semaphore creation information

type SemaphoreSignalInfo ¶ added in v1.1.0

type SemaphoreSignalInfo struct {
	Semaphore Semaphore
	Value     uint64
}

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 ShaderEXT ¶

type ShaderEXT unsafe.Pointer

ShaderEXT represents a Vulkan shader EXT

type ShaderModule ¶

type ShaderModule unsafe.Pointer

ShaderModule represents a Vulkan shader module

func CreateShaderModule ¶

func CreateShaderModule(device Device, createInfo *ShaderModuleCreateInfo) (ShaderModule, error)

CreateShaderModule creates a shader module

type ShaderModuleCreateInfo ¶

type ShaderModuleCreateInfo struct {
	CodeSize uint32
	Code     []uint32
}

ShaderModuleCreateInfo contains shader module creation information

type ShaderStageFlags ¶

type ShaderStageFlags uint32

ShaderStageFlags represents shader stage flags

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

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 ¶

type Surface unsafe.Pointer

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

type SurfaceFormat struct {
	Format     Format
	ColorSpace uint32
}

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

type Swapchain ¶

type Swapchain unsafe.Pointer

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

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 ¶

type ValidationCache unsafe.Pointer

ValidationCache represents a Vulkan validation cache

type ValidationError ¶

type ValidationError struct {
	Field  string
	Reason string
}

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 ¶

func MakeVersion(major, minor, patch uint32) Version

MakeVersion creates a version number from major, minor, and patch components

func (Version) Major ¶

func (v Version) Major() uint32

Major extracts the major version number

func (Version) Minor ¶

func (v Version) Minor() uint32

Minor extracts the minor version number

func (Version) Patch ¶

func (v Version) Patch() uint32

Patch extracts the patch version number

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

type VideoDecodeH264Capabilities struct {
	MaxLevelIdc            int32
	FieldOffsetGranularity Offset2D
}

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 ¶

type VideoSession unsafe.Pointer

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 ¶

type VideoSessionParameters unsafe.Pointer

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 ¶

type VulkanError struct {
	Result    Result
	Operation string
	Details   string
}

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
)

Directories ¶

Path Synopsis
examples
basic command
benchmark command
compute command
multi_queue command
pipeline_cache command
push_constants command
simple command
swapchain command
type command
video command
vulkan13 command

Jump to

Keyboard shortcuts

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