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
-
CommandEncoderover 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
BlendFactorto itspackage:flutter_gpuequivalent. - BlendOperationToGpu on BlendOperation
-
Maps the engine's
BlendOperationto itspackage:flutter_gpuequivalent. - CompareFunctionToGpu on CompareFunction
-
Maps the engine's
CompareFunctionto itspackage:flutter_gpuequivalent. - CullModeToGpu on CullMode
-
Maps the engine's
CullModeto itspackage:flutter_gpuequivalent. - GpuTextureHandle on TextureHandle
-
The one door back through
TextureHandleto 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'sIndexType. - IndexTypeToGpu on IndexType
-
Maps the engine's
IndexTypeto itspackage:flutter_gpuequivalent. - LoadActionToGpu on LoadAction
-
Maps the engine's
LoadActionto itspackage:flutter_gpuequivalent. - MinMagFilterFromGpu on MinMagFilter
-
Maps
package:flutter_gpu's min/mag filter back to the engine'sMinMagFilter. - MinMagFilterToGpu on MinMagFilter
-
Maps the engine's
MinMagFilterto itspackage:flutter_gpuequivalent. - MipFilterFromGpu on MipFilter
-
Maps
package:flutter_gpu's mip filter back to the engine'sMipFilter. - MipFilterToGpu on MipFilter
-
Maps the engine's
MipFilterto itspackage:flutter_gpuequivalent. - PolygonModeToGpu on PolygonMode
-
Maps the engine's
PolygonModeto itspackage:flutter_gpuequivalent. - PrimitiveTypeToGpu on PrimitiveType
-
Maps the engine's
PrimitiveTypeto itspackage:flutter_gpuequivalent. - SamplerAddressModeFromGpu on SamplerAddressMode
-
Maps
package:flutter_gpu's address mode back to the engine'sSamplerAddressMode. - SamplerAddressModeToGpu on SamplerAddressMode
-
Maps the engine's
SamplerAddressModeto itspackage:flutter_gpuequivalent. - SamplerOptionsFromGpu on SamplerOptions
-
Maps
package:flutter_gpu's sampler options back to the engine'sSamplerOptions, built fresh each call — the cache above is keyed the other way. - SamplerOptionsToGpu on SamplerOptions
-
Maps
SamplerOptionsto itspackage:flutter_gpuequivalent, 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'sStorageMode. - StorageModeToGpu on StorageMode
-
Maps the engine's
StorageModeto itspackage:flutter_gpuequivalent. - StoreActionToGpu on StoreAction
-
Maps the engine's
StoreActionto itspackage:flutter_gpuequivalent. - TextureFormatFromGpu on PixelFormat
-
Maps
package:flutter_gpu'sPixelFormatback to the engine'sTextureFormat. - TextureFormatToGpu on TextureFormat
-
Maps the engine's
TextureFormattopackage:flutter_gpu'sPixelFormat— same values, different name on that side. - TextureTypeToGpu on TextureType
-
Maps the engine's
TextureTypeto itspackage:flutter_gpuequivalent — one-way, unlike its neighbours:TextureHandlecarries 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'sVertexFormat. - VertexFormatToGpu on VertexFormat
-
Maps the engine's
VertexFormatto itspackage:flutter_gpuequivalent. - 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'sVertexStepMode. - VertexStepModeToGpu on VertexStepMode
-
Maps the engine's
VertexStepModeto itspackage:flutter_gpuequivalent. - WindingOrderToGpu on WindingOrder
-
Maps the engine's
WindingOrderto itspackage:flutter_gpuequivalent.
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.