mgpuReadOwnDeviceBufferLimits function
Exact limits on the resolved GPUDevice, or null if any JS surface is absent.
Implementation
(int, int)? mgpuReadOwnDeviceBufferLimits(JSObject device) {
try {
final limits = device.getProperty<JSAny?>('limits'.toJS);
if (limits == null || !limits.isA<JSObject>()) return null;
final ownLimits = limits as JSObject;
final maxBufferSize = _positiveSafeLimit(ownLimits, 'maxBufferSize');
final maxStorageBufferBindingSize =
_positiveSafeLimit(ownLimits, 'maxStorageBufferBindingSize');
if (maxBufferSize == null || maxStorageBufferBindingSize == null) {
return null;
}
return (maxBufferSize, maxStorageBufferBindingSize);
} catch (_) {
return null;
}
}