vulkan

package
v0.0.0-...-7ee513c Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 59 Imported by: 0

README

Vulkan Status

Trace and Replay

Vulkan is currently WIP. Many samples, and applications work correctly, but some bugs may still be present.

Mid-Execution Capture

Mid-Execution capture allows an application to be traced starting at an arbitrary point in time.

If tracing from the command line this can be done with

gapit trace -start-defer

When using the GUI, this can be acheived by unchecking Trace from Beginning

Invalid VkDestoryXXX and VkFreeXXX Commands Due to Mid-Execution Capture

When using Mid-Execution capture, it is possible that at the time of capturing, an object's dependee has been destroyed but the object itself is still there, such objects will NOT be rebuilt for replay and the VkDestroyXXX referring to such object will be dropped for replay, also VkFreeXXX commands referring to such objects will be modified or dropped to not freeing those not-rebuilt objects.

For example: A VkImage might have been destroyed when a Mid-Execution capture starts, but the VkImageView handles that were created with the destroyed VkImage might still be there. In such cases, those VkImageView handles are invalid and will not be created during replay, also the VkFramebuffer handles that depend on those VkImageView handles will not be created during replay too. VkDestroyImageView and VkDestroyFramebuffer commands that refer to those VkImageView and VkFramebuffer handles will be dropped, so won't be called during replay.

Subcommands

When visualizing the tree of Commands, every VkQueueSubmit is expanded into a list of the commands that are run during that submission. From there you can query information about any call in the program.

Performance

We are still tuning performance for Vulkan in AGI. For Posix based platforms we handle persistently mapped coherent memory efficiently, but for Windows this is currently in progress. Large blocks of mapped coherent memory can greatly reduce replay performance and increase trace size.

Test applications

We use a set of Test Applications to validate whether or not Vulkan support is functioning. This repository contains applications that use most parts of the API, and will be expanded as more interesting and tricky uses of the API are found.

Current Support

The current status of support for the Vulkan API on a method by method basis are as follows.

Command Name Capture Mid-Execution Subcommands
vkAllocateCommandBuffers
vkCreateDevice
vkCreateInstance
vkDestroyDevice
vkDestroyInstance
vkEnumerateDeviceExtensionProperties
vkEnumerateDeviceLayerProperties
vkEnumerateInstanceExtensionProperties
vkEnumerateInstanceLayerProperties
vkEnumeratePhysicalDevices
vkFreeCommandBuffers
vkGetDeviceProcAddr
vkGetDeviceQueue
vkGetInstanceProcAddr
vkGetPhysicalDeviceSparseImageFormatProperties
vkGetPhysicalDeviceFeatures
vkGetPhysicalDeviceFormatProperties
vkGetPhysicalDeviceImageFormatProperties
vkGetPhysicalDeviceMemoryProperties
vkGetPhysicalDeviceProperties
vkGetPhysicalDeviceQueueFamilyProperties
vkAcquireNextImageKHR
vkAllocateDescriptorSets
vkAllocateMemory
vkBeginCommandBuffer
vkBindBufferMemory
vkBindImageMemory
vkCmdBeginQuery
vkCmdBeginRenderPass
vkCmdBindDescriptorSets
vkCmdBindIndexBuffer
vkCmdBindPipeline
vkCmdBindVertexBuffers
vkCmdBlitImage
vkCmdClearAttachments
vkCmdClearColorImage
vkCmdClearDepthStencilImage
vkCmdCopyBuffer
vkCmdCopyBufferToImage
vkCmdCopyImage
vkCmdCopyImageToBuffer
vkCmdCopyQueryPoolResults
vkCmdDispatch
vkCmdDispatchIndirect
vkCmdDraw
vkCmdDrawIndexed
vkCmdDrawIndexedIndirect
vkCmdDrawIndirect
vkCmdEndQuery
vkCmdEndRenderPass
vkCmdExecuteCommands
vkCmdFillBuffer
vkCmdNextSubpass
vkCmdPipelineBarrier
vkCmdPushConstants
vkCmdResetEvent
vkCmdResetQueryPool
vkCmdResolveImage
vkCmdSetBlendConstants
vkCmdSetDepthBias
vkCmdSetDepthBounds
vkCmdSetEvent
vkCmdSetLineWidth
vkCmdSetScissor
vkCmdSetStencilCompareMask
vkCmdSetStencilReference
vkCmdSetStencilWriteMask
vkCmdSetViewport
vkCmdUpdateBuffer
vkCmdWaitEvents
vkCmdWriteTimestamp
vkCreateAndroidSurfaceKHR
vkCreateBuffer
vkCreateBufferView
vkCreateCommandPool
vkCreateComputePipelines
vkCreateDescriptorPool
vkCreateDescriptorSetLayout
vkCreateDisplayModeKHR
vkCreateDisplayPlaneSurfaceKHR
vkCreateEvent
vkCreateFramebuffer
vkCreateGraphicsPipelines
vkCreateImage
vkCreateImageView
vkCreateMirSurfaceKHR
vkCreatePipelineCache
vkCreatePipelineLayout
vkCreateQueryPool
vkCreateRenderPass
vkCreateSampler
vkCreateSemaphore
vkCreateShaderModule
vkCreateSharedSwapchainsKHR
vkCreateSwapchainKHR
vkCreateWaylandSurfaceKHR
vkCreateWin32SurfaceKHR
vkCreateXcbSurfaceKHR
vkCreateXlibSurfaceKHR
vkDestroyBuffer
vkDestroyBufferView
vkDestroyCommandPool
vkDestroyDescriptorPool
vkDestroyDescriptorSetLayout
vkDestroyEvent
vkDestroyFramebuffer
vkDestroyImage
vkDestroyImageView
vkDestroyPipeline
vkDestroyPipelineCache
vkDestroyPipelineLayout
vkDestroyQueryPool
vkDestroyRenderPass
vkDestroySampler
vkDestroySemaphore
vkDestroyShaderModule
vkDestroySwapchainKHR
vkDeviceWaitIdle
vkEndCommandBuffer
vkFlushMappedMemoryRanges
vkFreeDescriptorSets
vkFreeMemory
vkGetBufferMemoryRequirements
vkGetDeviceMemoryCommitment
vkGetDisplayModePropertiesKHR
vkGetDisplayPlaneCapabilitiesKHR
vkGetDisplayPlaneSupportedDisplaysKHR
vkGetEventStatus
vkGetFenceStatus
vkGetImageMemoryRequirements
vkGetImageSparseMemoryRequirements
vkGetImageSubresourceLayout
vkGetPhysicalDeviceDisplayPlanePropertiesKHR
vkGetPhysicalDeviceDisplayPropertiesKHR
vkGetPhysicalDeviceMirPresentationSupportKHR
vkGetPhysicalDeviceSurfaceCapabilitiesKHR
vkGetPhysicalDeviceSurfaceFormatsKHR
vkGetPhysicalDeviceSurfacePresentModesKHR
vkGetPhysicalDeviceSurfaceSupportKHR
vkGetPhysicalDeviceWaylandPresentationSupportKHR
vkGetPhysicalDeviceWin32PresentationSupportKHR
vkGetPhysicalDeviceXcbPresentationSupportKHR
vkGetPhysicalDeviceXlibPresentationSupportKHR
vkGetPipelineCacheData
vkGetQueryPoolResults
vkGetRenderAreaGranularity
vkGetSwapchainImagesKHR
vkInvalidateMappedMemoryRanges
vkMapMemory
vkMergePipelineCaches
vkQueueBindSparse
vkQueuePresentKHR
vkQueueSubmit
vkQueueWaitIdle
vkResetCommandBuffer
vkResetCommandPool
vkResetDescriptorPool
vkResetEvent
vkResetFences
vkSetEvent
vkUnmapMemory
vkUpdateDescriptorSets
vkWaitForFences
vkCreateFence
vkDestroyFence
vkDestroySurfaceKHR

Documentation

Overview

Package vulkan implements the API interface for the Vulkan graphics library.

Index

Constants

View Source
const (
	VK_BEGIN_COMMAND_BUFFER   = "vkBeginCommandBuffer"
	VK_CMD_BEGIN_RENDER_PASS  = "vkCmdBeginRenderPass"
	VK_CMD_NEXT_SUBPASS       = "vkCmdNextSubpass"
	VK_COMMAND_BUFFER         = "vkCommandBuffer"
	VK_RENDER_PASS            = "vkRenderPass"
	VK_SUBPASS                = "vkSubpass"
	VK_END_COMMAND_BUFFER     = "vkEndCommandBuffer"
	VK_CMD_END_RENDER_PASS    = "vkCmdEndRenderPass"
	COMMAND_BUFFER            = "commandBuffer"
	VK_CMD_DEBUG_MARKER_BEGIN = "vkCmdDebugMarkerBeginEXT"
	VK_CMD_DEBUG_MARKER_END   = "vkCmdDebugMarkerEndEXT"
	VK_CMD_DEBUG_MARKER       = "vkCmdDebugMarker"
)

Variables

This section is empty.

Functions

func AddCommand

func AddCommand(ctx context.Context,
	cb CommandBuilder,
	commandBuffer VkCommandBuffer,
	r *api.GlobalState,
	s *api.GlobalState,
	rebuildInfo interface{}) (func(), api.Cmd, error)

AddCommand recreates the command defined by recreateInfo and places it into the given command buffer. It returns the commands that it had to create in order to satisfy the command. It also returns a function to clean up the data that was allocated during the creation.

func CallReflectedCommand

func CallReflectedCommand(ctx context.Context, cmd api.Cmd, id api.CmdID, s *api.GlobalState, b *rb.Builder, w api.StateWatcher, sub, data interface{})

CallReflectedCommand unpacks the given subcommand and arguments, and calls the method

func EnterRecreate

func EnterRecreate(ctx context.Context, s *api.GlobalState) func()

func GetCommandArgs

func GetCommandArgs(ctx context.Context,
	cr CommandReferenceʳ,
	s *State) interface{}

GetCommandArgs takes a command reference and returns the command arguments of that recorded command.

func GetCommandFunction

func GetCommandFunction(cr *CommandReference) interface{}

GetCommandFunction takes a command reference (recorded command buffer command) and returns the function which mutates the state as the recorded command get executed.

func IsFullyBound

func IsFullyBound(offset VkDeviceSize, size VkDeviceSize,
	bindings U64ːVkSparseMemoryBindᵐ) bool

IsFullyBound returns true if the resource range from offset with size is fully covered in the bindings. If the size ofd the resource range is 0, returns false.

func NewAllocationTracker

func NewAllocationTracker(inputState *api.GlobalState) *allocationTracker

func NewCommandSplitter

func NewCommandSplitter(ctx context.Context, cmdsOffset uint64) *commandSplitter

func NewLoopingVulkanControlFlowGenerator

func NewLoopingVulkanControlFlowGenerator(ctx context.Context, chain *transform.TransformChain, out transform.Writer, graphicsCapture *capture.GraphicsCapture, loopStart api.CmdID, loopEnd api.CmdID, loopCount int32, loopCallbacks loopCallbacks) controlFlowGenerator.ControlFlowGenerator

NewLoopingVulkanControlFlowGenerator generates a simple control flow that takes initial and real commands and transforms all of them

func NewStencilOverdraw

func NewStencilOverdraw() *stencilOverdraw

Types

type FenceState

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

type InsertionCommand

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

InsertionCommand is a temporary command that is expected to be replaced by a down-stream transform.

func (*InsertionCommand) API

func (s *InsertionCommand) API() api.API

func (*InsertionCommand) Alive

func (s *InsertionCommand) Alive() bool

func (*InsertionCommand) Clone

func (s *InsertionCommand) Clone() api.Cmd

func (*InsertionCommand) CmdFlags

func (s *InsertionCommand) CmdFlags() api.CmdFlags

func (*InsertionCommand) CmdName

func (s *InsertionCommand) CmdName() string

CmdName returns the name of the command.

func (*InsertionCommand) CmdParams

func (s *InsertionCommand) CmdParams() api.Properties

func (*InsertionCommand) CmdResult

func (s *InsertionCommand) CmdResult() *api.Property

func (*InsertionCommand) Extras

func (s *InsertionCommand) Extras() *api.CmdExtras

func (*InsertionCommand) Mutate

func (*InsertionCommand) SetTerminated

func (s *InsertionCommand) SetTerminated(bool)

func (*InsertionCommand) SetThread

func (s *InsertionCommand) SetThread(c uint64)

func (*InsertionCommand) Terminated

func (s *InsertionCommand) Terminated() bool

func (*InsertionCommand) Thread

func (s *InsertionCommand) Thread() uint64

type QueuedCommand

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

Directories

Path Synopsis
Package vulkan_pb describes the serialization format for the vulkan api.
Package vulkan_pb describes the serialization format for the vulkan api.

Jump to

Keyboard shortcuts

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