gpu

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package gpu renders vecmap scenes with OpenGL ES 3 in an offscreen context. Its output is an opaque image suitable for Fyne's canvas.Image. Successful renders wait for GPU completion and readback. No Fyne or GLFW context is modified.

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("OpenGL renderer closed")
View Source
var ErrUnavailable = errors.New("OpenGL renderer unavailable")

Functions

This section is empty.

Types

type Info

type Info struct {
	Vendor, Renderer, Version string
	// Samples is the most a picture is drawn with.
	Samples  int
	Software bool
}

type Options

type Options struct {
	// Samples is 1, 2, 4, or 8. Zero requests four samples per pixel.
	Samples int
	// SampleBudget caps a picture's pixels times its antialiasing samples.
	// A picture too large for Samples is drawn with fewer, two at the least.
	// Phone GPUs draw in tiles and slow down many times over past a size.
	// Zero is no cap.
	SampleBudget uint64
	// MaxBytes bounds resident buffers, textures and framebuffer attachments.
	// Zero permits 256 MiB. Driver overhead and the caller's image are extra.
	MaxBytes uint64
}

type Renderer

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

Renderer owns a context on a dedicated OS thread. Close releases it. Use one renderer per retained scene namespace. Scene resources are immutable: changed payloads must have a new revision, as required by scene.Scene.

func New

func New(options Options) (*Renderer, error)

func (*Renderer) Close

func (r *Renderer) Close() error

func (*Renderer) Info

func (r *Renderer) Info() Info

func (*Renderer) Render

func (r *Renderer) Render(ctx context.Context, target *image.RGBA, frame scene.Frame, options render.Options) (render.Stats, error)

Jump to

Keyboard shortcuts

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