wgpu_engine

package
v0.0.0-...-e2d5c53 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	Device *wgpu.Device

	UseCPU bool
	// contains filtered or unexported fields
}

func New

func New(dev *wgpu.Device, options *RendererOptions) *Engine

func (*Engine) RenderToSurface

func (eng *Engine) RenderToSurface(
	arena *mem.Arena,
	queue *wgpu.Queue,
	enc *encoding.Encoding,
	surface *wgpu.SurfaceTexture,
	params *renderer.RenderParams,
	pgroup *ProfilerGroup,
)

func (*Engine) RenderToTexture

func (eng *Engine) RenderToTexture(
	arena *mem.Arena,
	queue *wgpu.Queue,
	enc *encoding.Encoding,
	texture *wgpu.TextureView,
	params *renderer.RenderParams,
	pgroup *ProfilerGroup,
) *wgpu.CommandBuffer

func (*Engine) RunRecording

func (eng *Engine) RunRecording(
	arena *mem.Arena,
	queue *wgpu.Queue,
	recording renderer.Recording,
	externalResources []ExternalResource,
	label string,
	pgroup *ProfilerGroup,
) *wgpu.CommandBuffer

type ExternalBuffer

type ExternalBuffer struct {
	Proxy  renderer.BufferProxy
	Buffer *wgpu.Buffer
}

type ExternalImage

type ExternalImage struct {
	Proxy renderer.ImageProxy
	View  *wgpu.TextureView
}

type ExternalResource

type ExternalResource interface {
}

type Profiler

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

func NewNopProfiler

func NewNopProfiler() *Profiler

func NewProfiler

func NewProfiler(dev *wgpu.Device) *Profiler

func (*Profiler) Collect

func (p *Profiler) Collect() []ProfilerResult

Collect returns all available profiler results. The return value is only valid until the next call to Collect.

func (*Profiler) Map

func (p *Profiler) Map()

func (*Profiler) Resolve

func (p *Profiler) Resolve(enc *wgpu.CommandEncoder)

func (*Profiler) Start

func (p *Profiler) Start(tag uint64) *ProfilerGroup

type ProfilerGroup

type ProfilerGroup struct {
	Tag   uint64
	Label string
	// contains filtered or unexported fields
}

func (*ProfilerGroup) Begin

func (g *ProfilerGroup) Begin(enc *wgpu.CommandEncoder, label string) ProfilerSpan

func (*ProfilerGroup) Compute

func (g *ProfilerGroup) Compute(arena *mem.Arena, label string) *wgpu.ComputePassTimestampWrites

func (*ProfilerGroup) End

func (g *ProfilerGroup) End()

func (*ProfilerGroup) Nest

func (g *ProfilerGroup) Nest(label string) *ProfilerGroup

func (*ProfilerGroup) Render

func (g *ProfilerGroup) Render(arena *mem.Arena, label string) *wgpu.RenderPassTimestampWrites

func (*ProfilerGroup) Start

func (g *ProfilerGroup) Start(label string) profiler.ProfilerGroup

type ProfilerQuery

type ProfilerQuery struct {
	Label string
	// contains filtered or unexported fields
}

type ProfilerQueryResult

type ProfilerQueryResult struct {
	Label string
	Start uint64
	End   uint64
}

type ProfilerResult

type ProfilerResult struct {
	Tag      uint64
	Label    string
	CPUStart time.Time
	CPUEnd   time.Time
	Queries  []ProfilerQueryResult
	Children []ProfilerResult
}

type ProfilerSpan

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

func (ProfilerSpan) End

func (span ProfilerSpan) End(enc *wgpu.CommandEncoder)

type RendererOptions

type RendererOptions struct {
	SurfaceFormat wgpu.TextureFormat
	UseCPU        bool
}

Directories

Path Synopsis
cpu
Package cpu provides CPU implementations of the compute shaders.
Package cpu provides CPU implementations of the compute shaders.

Jump to

Keyboard shortcuts

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