command

package
v0.0.0-...-124f97e Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer interface {
	device.Resource[core1_0.CommandBuffer]

	Reset()
	Begin()
	End()

	CmdCopyBuffer(src, dst buffer.T, regions ...core1_0.BufferCopy)
	CmdBindGraphicsPipeline(pipe pipeline.T)
	CmdBindGraphicsDescriptor(sets descriptor.Set)
	CmdBindVertexBuffer(vtx buffer.T, offset int)
	CmdBindIndexBuffers(idx buffer.T, offset int, kind core1_0.IndexType)
	CmdDraw(vertexCount, instanceCount, firstVertex, firstInstance int)
	CmdDrawIndexed(indexCount, instanceCount, firstIndex, vertexOffset, firstInstance int)
	CmdBeginRenderPass(pass renderpass.T, framebuffer framebuffer.T)
	CmdNextSubpass()
	CmdEndRenderPass()
	CmdSetViewport(x, y, w, h int) core1_0.Viewport
	CmdSetScissor(x, y, w, h int) core1_0.Rect2D
	CmdPushConstant(stages core1_0.ShaderStageFlags, offset int, value any)
	CmdImageBarrier(srcMask, dstMask core1_0.PipelineStageFlags, image image.T, oldLayout, newLayout core1_0.ImageLayout, aspects core1_0.ImageAspectFlags)
	CmdCopyBufferToImage(source buffer.T, dst image.T, layout core1_0.ImageLayout)
	CmdCopyImageToBuffer(src image.T, srcLayout core1_0.ImageLayout, aspect core1_0.ImageAspectFlags, dst buffer.T)
	CmdConvertImage(src image.T, srcLayout core1_0.ImageLayout, dst image.T, dstLayout core1_0.ImageLayout, aspects core1_0.ImageAspectFlags)
	CmdCopyImage(src image.T, srcLayout core1_0.ImageLayout, dst image.T, dstLayout core1_0.ImageLayout, aspects core1_0.ImageAspectFlags)
}

type CommandFn

type CommandFn func(Buffer)

type Pool

type Pool interface {
	device.Resource[core1_0.CommandPool]

	Allocate(level core1_0.CommandBufferLevel) Buffer
	AllocateBuffers(level core1_0.CommandBufferLevel, count int) []Buffer
}

func NewPool

func NewPool(device device.T, flags core1_0.CommandPoolCreateFlags, queueFamilyIdx int) Pool

type Recorder

type Recorder interface {
	Record(CommandFn)
	Apply(Buffer)
}

func NewRecorder

func NewRecorder() Recorder

type SubmitInfo

type SubmitInfo struct {
	Marker   string
	Wait     []Wait
	Signal   []sync.Semaphore
	Callback func()
}

type ThreadWorker

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

func NewThreadWorker

func NewThreadWorker(name string, buffer int, locked bool) *ThreadWorker

func (*ThreadWorker) Abort

func (tw *ThreadWorker) Abort()

Aborts the worker, cancelling any pending work.

func (*ThreadWorker) Flush

func (tw *ThreadWorker) Flush()

Flush blocks the caller until all pending work is completed

func (*ThreadWorker) Invoke

func (tw *ThreadWorker) Invoke(callback func())

Invoke schedules a callback to be called from the worker thread

func (*ThreadWorker) InvokeSync

func (tw *ThreadWorker) InvokeSync(callback func())

InvokeSync schedules a callback to be called on the worker thread, and blocks until the callback is finished.

func (*ThreadWorker) Stop

func (tw *ThreadWorker) Stop()

Stop the worker and release any resources. Blocks until all work in completed.

type Wait

type Wait struct {
	Semaphore sync.Semaphore
	Mask      core1_0.PipelineStageFlags
}

type Worker

type Worker interface {
	Ptr() core1_0.Queue
	Queue(CommandFn)
	Submit(SubmitInfo)
	Destroy()
	Flush()
	Invoke(func())
}

Workers manage a command pool thread

func NewWorker

func NewWorker(device device.T, name string, queueFlags core1_0.QueueFlags, queueIndex int) Worker

type Workers

type Workers []Worker

Jump to

Keyboard shortcuts

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