Documentation
¶
Overview ¶
Package fakedevice is an explicit.Device that records every call, for the unit tests of the explicit renderer without a GPU. It checks the design limits of SPEC §9.3 as the real backends do, so a renderer that breaks one fails its test with GPULimitExceeded.
Flutter: no counterpart
Index ¶
- func Bytes(b explicit.Buffer) []byte
- type BufferWrite
- type Call
- type Device
- func (d *Device) Begin() (explicit.Encoder, error)
- func (d *Device) Calls() []Call
- func (d *Device) Close() error
- func (d *Device) Closed() bool
- func (d *Device) CompleteReads()
- func (d *Device) Description() string
- func (d *Device) Limits() explicit.Limits
- func (d *Device) NewBindGroup(p explicit.Pipeline, group int, entries []explicit.Binding) (explicit.BindGroup, error)
- func (d *Device) NewBuffer(size int, usage explicit.BufferUsage) (explicit.Buffer, error)
- func (d *Device) NewPipeline(desc explicit.PipelineDesc) (explicit.Pipeline, error)
- func (d *Device) NewSampler(desc explicit.SamplerDesc) (explicit.Sampler, error)
- func (d *Device) NewSwapchain(h gpu.SurfaceHandle) (explicit.Swapchain, error)
- func (d *Device) NewTexture(desc explicit.TextureDesc) (explicit.Texture, error)
- func (d *Device) Ops() []string
- func (d *Device) SetLimits(l explicit.Limits)
- func (d *Device) WriteBuffer(b explicit.Buffer, offset int, data []byte)
- func (d *Device) WriteTexture(t explicit.Texture, level int, r image.Rectangle, data []byte, stride int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BufferWrite ¶
type BufferWrite struct {
// Offset is where the data went in the buffer.
Offset int
// Data is a copy of the bytes written.
Data []byte
// Usage is what the buffer was made for.
Usage explicit.BufferUsage
}
BufferWrite is one call of WriteBuffer.
Flutter: no counterpart
type Call ¶
type Call struct {
// Op is the name of the method: "NewBuffer", "BeginPass", "Draw", ...
Op string
// Args are the arguments, as text.
Args string
}
Call is one call the renderer made, in order. Op names the method and Args are its arguments in a readable form.
Flutter: no counterpart
type Device ¶
type Device struct {
// Err, when set, is what the next call that can fail returns, once.
Err error
// AcquireErrs are the errors that the next calls of Swapchain.Acquire return, one
// each, before it succeeds again.
AcquireErrs []error
// CompleteReadsOnSubmit makes Submit run the done functions of the reads of the frame,
// as a device that waits for the GPU does.
CompleteReadsOnSubmit bool
// Name is what Description says.
Name string
// Writes are the calls of WriteBuffer, with a copy of their data.
Writes []BufferWrite
// contains filtered or unexported fields
}
Device is the fake device. The zero value is not usable; use New.
Flutter: no counterpart
func (*Device) CompleteReads ¶
func (d *Device) CompleteReads()
CompleteReads runs the done function of every ReadTexture that is waiting, as the GPU finishing the frame would. The real backends never call it inside the frame that asked, and neither does this: the test calls it after Submit.
Flutter: no counterpart
func (*Device) Description ¶
Description names the device, for the renderer's log.
Flutter: no counterpart
func (*Device) NewBindGroup ¶
func (d *Device) NewBindGroup(p explicit.Pipeline, group int, entries []explicit.Binding) (explicit.BindGroup, error)
NewBindGroup implements explicit.Device.
func (*Device) NewPipeline ¶
NewPipeline implements explicit.Device.
func (*Device) NewSampler ¶
NewSampler implements explicit.Device.
func (*Device) NewSwapchain ¶
NewSwapchain implements explicit.Device.
func (*Device) NewTexture ¶
NewTexture implements explicit.Device.
func (*Device) SetLimits ¶
SetLimits changes the limits the device checks, to test code that reads them.
Flutter: no counterpart
func (*Device) WriteBuffer ¶
WriteBuffer implements explicit.Device.