vk

package
v0.0.0-...-8a12d84 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

https://vulkan-tutorial.com/en/Overview https://github.com/toy80/vk/blob/master/toy80-example-vk/toy80-example-vk.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(appInfo AppInfo, mainFn func(Instance))

func MakeVersion

func MakeVersion(major, minor, patch uint32) uint32

Types

type AppInfo

type AppInfo struct {
	Name    string
	Version uint32
}

type CommandBuffer

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

func (CommandBuffer) BeginCommandBuffer

func (cmd CommandBuffer) BeginCommandBuffer()

func (CommandBuffer) BeginRenderPass

func (cmd CommandBuffer) BeginRenderPass()

func (CommandBuffer) BindPipeline

func (cmd CommandBuffer) BindPipeline()

func (CommandBuffer) Draw

func (cmd CommandBuffer) Draw()

func (CommandBuffer) EndCommandBuffer

func (cmd CommandBuffer) EndCommandBuffer()

func (CommandBuffer) EndRenderPass

func (cmd CommandBuffer) EndRenderPass()

type Device

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

Device represents a logical device tied to a surface.

func (Device) CreateCommandPool

func (dev Device) CreateCommandPool(queueFamilyIndex C.uint) C.VkCommandPool

func (Device) CreateGraphicsPipeline

func (dev Device) CreateGraphicsPipeline(swapchain *Swapchain, renderPass C.VkRenderPass) Pipeline

func (Device) CreateRenderPass

func (dev Device) CreateRenderPass(swapchain *Swapchain) C.VkRenderPass

func (Device) CreateSemaphore

func (device Device) CreateSemaphore() Semaphore

func (Device) CreateShaderModule

func (dev Device) CreateShaderModule(code []byte) ShaderModule

func (Device) Destroy

func (device Device) Destroy()

func (Device) GetGraphicsQueue

func (device Device) GetGraphicsQueue(index C.uint) C.VkQueue

func (Device) GetPresentQueue

func (device Device) GetPresentQueue(index C.uint) C.VkQueue

func (Device) GetQueue

func (device Device) GetQueue(familyIndex C.uint, index C.uint) C.VkQueue

type Instance

type Instance struct {
	ApplicationName    string
	ApplicationVersion uint32

	EngineName    string
	EngineVersion uint32

	ValidationLayers       []string
	EnableValidationLayers bool
	// contains filtered or unexported fields
}

func (*Instance) Create

func (instance *Instance) Create() error

func (*Instance) CreateWindowSurface

func (instance *Instance) CreateWindowSurface(width, height int) (*WindowSurface, error)

func (*Instance) Destroy

func (instance *Instance) Destroy()

type Pipeline

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

func (Pipeline) Destroy

func (pipeline Pipeline) Destroy()

type Queue

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

func (Queue) Submit

func (queue Queue) Submit(infos ...C.VkSubmitInfo)

Submit a sequence of semaphores or command buffers to the queue.

type QueueFamilyIndices

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

type Semaphore

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

func (*Semaphore) Create

func (s *Semaphore) Create() error

func (Semaphore) Destroy

func (s Semaphore) Destroy()

type ShaderAsset

type ShaderAsset string

func (ShaderAsset) Module

func (name ShaderAsset) Module(dev Device) ShaderModule

type ShaderModule

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

func (ShaderModule) Destroy

func (sm ShaderModule) Destroy(dev Device)

type Swapchain

type Swapchain struct {
	ImageFormat C.VkFormat
	Extent      C.VkExtent2D

	ImageViews []C.VkImageView

	Framebuffers []C.VkFramebuffer
	// contains filtered or unexported fields
}

func (*Swapchain) Create

func (sc *Swapchain) Create(width, height uint) error

func (*Swapchain) CreateCommandBuffers

func (sc *Swapchain) CreateCommandBuffers()

func (*Swapchain) CreateFramebuffers

func (sc *Swapchain) CreateFramebuffers()

func (*Swapchain) CreateGraphicsPipeline

func (sc *Swapchain) CreateGraphicsPipeline()

func (*Swapchain) CreateImageViews

func (sc *Swapchain) CreateImageViews()

func (*Swapchain) CreateRenderPass

func (sc *Swapchain) CreateRenderPass()

func (*Swapchain) Destroy

func (sc *Swapchain) Destroy()

type SwapchainSupport

type SwapchainSupport struct {
	Capabilities C.VkSurfaceCapabilitiesKHR
	Formats      []C.VkSurfaceFormatKHR
	PresentModes []C.VkPresentModeKHR
}

func GetSwapchainSupport

func GetSwapchainSupport(device C.VkPhysicalDevice, surface C.VkSurfaceKHR) SwapchainSupport

func (SwapchainSupport) ChooseExtent

func (ss SwapchainSupport) ChooseExtent(width, height uint) C.VkExtent2D

func (SwapchainSupport) ChoosePresentMode

func (details SwapchainSupport) ChoosePresentMode() C.VkPresentModeKHR

func (SwapchainSupport) ChooseSurfaceFormat

func (details SwapchainSupport) ChooseSurfaceFormat() C.VkSurfaceFormatKHR

type WindowSurface

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

func (*WindowSurface) Create

func (surface *WindowSurface) Create(width, height int) error

func (*WindowSurface) CreateDevice

func (surface *WindowSurface) CreateDevice() (Device, error)

func (*WindowSurface) Destroy

func (surface *WindowSurface) Destroy()

func (*WindowSurface) EnumeratePhysicalDevices

func (surface *WindowSurface) EnumeratePhysicalDevices() C.VkPhysicalDevice

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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