gpux 0.1.0
gpux: ^0.1.0 copied to clipboard
Cross-platform GPU for Dart. Works on web and native.
gpux #
Cross-platform GPU for Dart. Uses WebGPU in the browser, wgpu everywhere else. The API follows the WebGPU spec so there's nothing new to learn if you've used it before.
import 'package:gpux/gpux.dart';
final gpu = Gpu();
final adapter = await gpu.requestAdapter();
final device = await adapter.requestDevice();
Downlevel capabilities #
Not every adapter supports the full spec (especially GLES fallbacks on old Android). Check before using optional features:
final controller = GpuController();
await controller.initialize();
if (controller.supportsCompute) {
// safe to create compute pipelines
}
if (!controller.workarounds.brokenMipmapGeneration) {
generateMipmaps(texture);
}
Blocklist #
On Android, some Vulkan drivers are broken beyond repair (old Adreno, Huawei Maleoon, pre-BXE PowerVR). gpux detects these at startup and falls back to GLES automatically.
Flutter #
For rendering to a Flutter widget, see flutter_gpux.