gpuhost

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: BSD-3-Clause Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gpuhost is an explicit.DeviceHost for tests: it holds the device that a test gives it, tells the watchers when the device is opened, lost or closed, and keeps the log that package gpu writes. gluttertest's recording device and the display and browser tests of package gpu use it. It is imported by tests only.

Flutter: no counterpart

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShaderOf

func ShaderOf(s *explicit.Shader) *gpu.Shader

ShaderOf makes a gpu.Shader of a shader that glutter-gen made for the explicit device, such as the shaders of the device tests, so that the tests of package gpu on a real GPU can use them. The vertex inputs are not in the explicit form: the entry points of a test have none.

Flutter: no counterpart

Types

type App

type App struct {
	// Binding is the widgets binding; package gpu reaches the device through it.
	Binding *widgets.WidgetsBinding
	// Host is the device host: it can lose the device and end the app.
	Host *Host
	// contains filtered or unexported fields
}

App is a widgets binding over a fake platform whose GPU device is the one a test gives: a real Vulkan, Direct3D 12 or WebGPU device, for the tests that run package gpu on a GPU.

Flutter: no counterpart

func NewBinding

func NewBinding(tb TB, dev explicit.Device) *App

NewBinding makes the app. The goroutine of the caller is its UI thread. The host ends with the test.

Flutter: no counterpart

func (*App) RunPosted

func (a *App) RunPosted()

RunPosted runs the functions that were posted to the UI thread, such as the done function of a read.

Flutter: no counterpart

type Host

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

Host is the device host of a test.

Flutter: no counterpart

func New

func New(dev explicit.Device) *Host

New returns a host whose device is open.

Flutter: no counterpart

func (*Host) ClearLogs

func (h *Host) ClearLogs()

ClearLogs forgets the log.

Flutter: no counterpart

func (*Host) Device

func (h *Host) Device() explicit.Device

Device returns the device of the moment.

Flutter: no counterpart

func (*Host) End

func (h *Host) End()

End ends the app as the engine does when its windows are gone: the device is closed and the watchers are told that the host ended. The second call does nothing.

Flutter: no counterpart

func (*Host) GPUDevice

func (h *Host) GPUDevice() (explicit.Device, explicit.HostState)

GPUDevice implements explicit.DeviceHost.

func (*Host) GPULogger

func (h *Host) GPULogger() *slog.Logger

GPULogger implements explicit.DeviceHost: the log is kept for Logs.

func (*Host) GPUTextures

func (h *Host) GPUTextures() *explicit.TextureRegistry

GPUTextures implements explicit.DeviceHost.

func (*Host) LogContains

func (h *Host) LogContains(text string) bool

LogContains says whether the log has the text.

Flutter: no counterpart

func (*Host) Logs

func (h *Host) Logs() string

Logs returns what package gpu logged.

Flutter: no counterpart

func (*Host) Lose

func (h *Host) Lose()

Lose loses the device, as a driver reset does: the watchers are told, and the host has no device until Open gives it one (the renderer asks the system for the new device, which may take a while).

Flutter: no counterpart

func (*Host) Open

func (h *Host) Open(dev explicit.Device)

Open gives the host a device, as the renderer does when it has made one, and tells the watchers.

Flutter: no counterpart

func (*Host) Replace

func (h *Host) Replace(fresh explicit.Device)

Replace loses the device and opens fresh at once, as the renderer does when the system has the new device ready (SPEC §9.4, §9.5).

Flutter: no counterpart

func (*Host) WatchGPUDevice

func (h *Host) WatchGPUDevice(fn func(explicit.DeviceEvent)) func()

WatchGPUDevice implements explicit.DeviceHost.

type TB

type TB interface {
	Helper()
	Cleanup(func())
}

TB is the part of testing.TB that NewBinding needs.

Flutter: no counterpart

Jump to

Keyboard shortcuts

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