warnIfNotHardwareAccelerated
Log a warning when the GPU adapter is a software fallback.
Checks adapter.info.isFallbackAdapter and logs a console warning. Common on Android emulators where rendering may be slow or missing features.
Usage
Call once when the adapter becomes available, typically in a useEffect:
import { } from "react";
import { , } from "react-native-webgpu";
export function () {
const { , } = ();
(() => {
if () {
();
}
}, []);
if (!) return null;
// configure canvas, build pipelines…
return null;
}With GPUDeviceProvider, read the adapter from useMainDevice the same way:
function () {
const { } = ();
(() => {
if () ();
}, []);
return null;
}This does not block rendering; it only logs. Test camera, native textures, and performance-critical paths on physical devices.
See also
- useDevice - requesting an adapter and device
- Native APIs - feature availability and emulator limitations
- GPUDeviceProvider - share one device and read it with
useMainDevice