flutter3d_impeller library

flutter_gpu as an implementation of flutter3d_hardware.

An application constructs GpuRenderBackend and hands it to Renderer.create. Nothing else in the stack names flutter_gpu, which is the property this package exists to hold: the engine is written against the HAL, and swapping this out for another backend is a change to one line of application wiring.

Classes

GpuCommandEncoder
CommandEncoder over one flutter_gpu command buffer with its one open pass — see the library comment on why the two are fused. submit is the end of both: it hands the buffer to the queue and moves the frame's accounting from "encoding" to "outstanding".
GpuFrame
A frame is done when nothing this side will add to it and the GPU has reported every buffer it holds. Both halves matter: a frame with one pass submitted and another about to be is not finished, and a frame whose passes are all submitted is not finished either until the queue says so.
GpuRenderBackend
flutter_gpu as a GraphicsDevice.
GpuShaderLibrary
Handles are cached per name so that two lookups of the same stage give the same handle. Nothing depends on that today — unlike TextureHandle, identity carries no contract here — but a map lookup is cheaper than an allocation on a path the particle contributor takes every frame.

Extensions

BlendFactorToGpu on BlendFactor
Maps the engine's BlendFactor to its package:flutter_gpu equivalent.
BlendOperationToGpu on BlendOperation
Maps the engine's BlendOperation to its package:flutter_gpu equivalent.
CompareFunctionToGpu on CompareFunction
Maps the engine's CompareFunction to its package:flutter_gpu equivalent.
CullModeToGpu on CullMode
Maps the engine's CullMode to its package:flutter_gpu equivalent.
GpuTextureHandle on TextureHandle
The one door back through TextureHandle to the flutter_gpu texture inside it, for the lines in a pass that must hand the real object to the device.
IndexTypeFromGpu on IndexType
Maps package:flutter_gpu's index type back to the engine's IndexType.
IndexTypeToGpu on IndexType
Maps the engine's IndexType to its package:flutter_gpu equivalent.
LoadActionToGpu on LoadAction
Maps the engine's LoadAction to its package:flutter_gpu equivalent.
MinMagFilterFromGpu on MinMagFilter
Maps package:flutter_gpu's min/mag filter back to the engine's MinMagFilter.
MinMagFilterToGpu on MinMagFilter
Maps the engine's MinMagFilter to its package:flutter_gpu equivalent.
MipFilterFromGpu on MipFilter
Maps package:flutter_gpu's mip filter back to the engine's MipFilter.
MipFilterToGpu on MipFilter
Maps the engine's MipFilter to its package:flutter_gpu equivalent.
PolygonModeToGpu on PolygonMode
Maps the engine's PolygonMode to its package:flutter_gpu equivalent.
PrimitiveTypeToGpu on PrimitiveType
Maps the engine's PrimitiveType to its package:flutter_gpu equivalent.
SamplerAddressModeFromGpu on SamplerAddressMode
Maps package:flutter_gpu's address mode back to the engine's SamplerAddressMode.
SamplerAddressModeToGpu on SamplerAddressMode
Maps the engine's SamplerAddressMode to its package:flutter_gpu equivalent.
SamplerOptionsFromGpu on SamplerOptions
Maps package:flutter_gpu's sampler options back to the engine's SamplerOptions, built fresh each call — the cache above is keyed the other way.
SamplerOptionsToGpu on SamplerOptions
Maps SamplerOptions to its package:flutter_gpu equivalent, served from the cache above rather than built per call — see the note on the cache.
StorageModeFromGpu on StorageMode
Maps package:flutter_gpu's storage mode back to the engine's StorageMode.
StorageModeToGpu on StorageMode
Maps the engine's StorageMode to its package:flutter_gpu equivalent.
StoreActionToGpu on StoreAction
Maps the engine's StoreAction to its package:flutter_gpu equivalent.
TextureFormatFromGpu on PixelFormat
Maps package:flutter_gpu's PixelFormat back to the engine's TextureFormat.
TextureFormatToGpu on TextureFormat
Maps the engine's TextureFormat to package:flutter_gpu's PixelFormat — same values, different name on that side.
TextureTypeToGpu on TextureType
Maps the engine's TextureType to its package:flutter_gpu equivalent — one-way, unlike its neighbours: TextureHandle carries the engine's type, so nothing ever reads one back off a device.
VertexFormatFromGpu on VertexFormat
Maps package:flutter_gpu's vertex format back to the engine's VertexFormat.
VertexFormatToGpu on VertexFormat
Maps the engine's VertexFormat to its package:flutter_gpu equivalent.
VertexLayoutSpecToGpu on VertexLayoutSpec
The whole layout, which is a structure rather than an enum and so is translated by construction rather than by a switch.
VertexStepModeFromGpu on VertexStepMode
Maps package:flutter_gpu's step mode back to the engine's VertexStepMode.
VertexStepModeToGpu on VertexStepMode
Maps the engine's VertexStepMode to its package:flutter_gpu equivalent.
WindingOrderToGpu on WindingOrder
Maps the engine's WindingOrder to its package:flutter_gpu equivalent.

Properties

defaultColorFormatOfContext → TextureFormat
The colour format the device prefers, as an engine value.
no setter
defaultDepthStencilFormat → TextureFormat
The depth/stencil format the device prefers, as an engine value.
no setter

Functions

colorFormatOrFallback(TextureFormat reported) → TextureFormat
What to use when the context reports TextureFormat.unknown.
createGpuTexture(StorageMode storageMode, int width, int height, {TextureFormat format = TextureFormat.r8g8b8a8UNormInt, int sampleCount = 1, bool enableRenderTargetUsage = true, bool enableShaderReadUsage = true, int mipLevelCount = 1, TextureType type = TextureType.texture2D}) → TextureHandle
Creates a flutter_gpu texture together with the single handle that will ever stand for it.
forgetDefaultColorFormat() → void
Forgets the cached answer, so the next reader asks the context again.