Documentation
¶
Overview ¶
Package buffers models buffer ownership between the renderer and the compositor without GPU dependencies. The caller serializes all events.
Index ¶
- Variables
- type Buffer
- type Pool
- func (p *Pool) Acquire(b *Buffer) (uint64, error)
- func (p *Pool) Begin() (*Buffer, error)
- func (p *Pool) Commit(b *Buffer) (uint64, error)
- func (p *Pool) Own(b *Buffer) error
- func (p *Pool) Release(b *Buffer) error
- func (p *Pool) Remove(b *Buffer) error
- func (p *Pool) Resize(count int) error
- func (p *Pool) Retirable(b *Buffer) bool
- func (p *Pool) Reuse(b *Buffer, gpuWaitInstalled bool) error
- func (p *Pool) Signal(b *Buffer, point uint64) error
- type State
Constants ¶
This section is empty.
Variables ¶
var ErrNoBuffer = errors.New("no available buffer")
var ErrTransition = errors.New("invalid buffer transition")
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
ID, Generation uint64
State State
AcquirePoint, ReleasePoint uint64
WlReleased, PointSignaled bool
}
Buffer is an immutable identity and mutable ownership record. On an explicit sync surface wl_buffer.release is optional; only the latest release point of this buffer's own timeline authorizes reuse.
type Pool ¶
func (*Pool) Begin ¶
Begin skips rendering when every buffer is busy. Retired generations are never selected, even if their release events complete later.
func (*Pool) Release ¶
Release records an optional wl_buffer.release event. It never authorizes reuse, and a late event from a prior commit must not modify the new commit.
func (*Pool) Resize ¶
Resize installs an entirely new generation. Old images remain tracked until their latest release point signals; even Available old images are retired.
func (*Pool) Retirable ¶
Retirable reports when the compositor and GPU no longer own a retired image. An abandoned Rendering or Acquired image still needs the caller to finish or wait for its Vulkan submission before destroying the GPU allocation.