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 ¶
- func ShaderOf(s *explicit.Shader) *gpu.Shader
- type App
- type Host
- func (h *Host) ClearLogs()
- func (h *Host) Device() explicit.Device
- func (h *Host) End()
- func (h *Host) GPUDevice() (explicit.Device, explicit.HostState)
- func (h *Host) GPULogger() *slog.Logger
- func (h *Host) GPUTextures() *explicit.TextureRegistry
- func (h *Host) LogContains(text string) bool
- func (h *Host) Logs() string
- func (h *Host) Lose()
- func (h *Host) Open(dev explicit.Device)
- func (h *Host) Replace(fresh explicit.Device)
- func (h *Host) WatchGPUDevice(fn func(explicit.DeviceEvent)) func()
- type TB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShaderOf ¶
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 ¶
NewBinding makes the app. The goroutine of the caller is its UI thread. The host ends with the test.
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 (*Host) ClearLogs ¶
func (h *Host) ClearLogs()
ClearLogs forgets the log.
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) GPUTextures ¶
func (h *Host) GPUTextures() *explicit.TextureRegistry
GPUTextures implements explicit.DeviceHost.
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 ¶
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 ¶
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.