Documentation ¶
Overview ¶
https://vulkan-tutorial.com/en/Overview https://github.com/toy80/vk/blob/master/toy80-example-vk/toy80-example-vk.go
Index ¶
- func Main(appInfo AppInfo, mainFn func(Instance))
- func MakeVersion(major, minor, patch uint32) uint32
- type AppInfo
- type CommandBuffer
- type Device
- func (dev Device) CreateCommandPool(queueFamilyIndex C.uint) C.VkCommandPool
- func (dev Device) CreateGraphicsPipeline(swapchain *Swapchain, renderPass C.VkRenderPass) Pipeline
- func (dev Device) CreateRenderPass(swapchain *Swapchain) C.VkRenderPass
- func (device Device) CreateSemaphore() Semaphore
- func (dev Device) CreateShaderModule(code []byte) ShaderModule
- func (device Device) Destroy()
- func (device Device) GetGraphicsQueue(index C.uint) C.VkQueue
- func (device Device) GetPresentQueue(index C.uint) C.VkQueue
- func (device Device) GetQueue(familyIndex C.uint, index C.uint) C.VkQueue
- type Instance
- type Pipeline
- type Queue
- type QueueFamilyIndices
- type Semaphore
- type ShaderAsset
- type ShaderModule
- type Swapchain
- type SwapchainSupport
- type WindowSurface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeVersion ¶
Types ¶
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) CreateShaderModule ¶
func (dev Device) CreateShaderModule(code []byte) ShaderModule
type Instance ¶
type Instance struct { ApplicationName string ApplicationVersion uint32 EngineName string EngineVersion uint32 ValidationLayers []string EnableValidationLayers bool // contains filtered or unexported fields }
func (*Instance) CreateWindowSurface ¶
func (instance *Instance) CreateWindowSurface(width, height int) (*WindowSurface, error)
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 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) 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()
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
Click to show internal directories.
Click to hide internal directories.