@@ -21,7 +21,8 @@ class GPUAdapterInfo : public m::HybridObject {
2121 explicit GPUAdapterInfo (wgpu::AdapterInfo &info)
2222 : HybridObject(" GPUAdapterInfo" ), _vendor(info.vendor),
2323 _architecture(info.architecture), _device(info.device),
24- _description(info.description) {}
24+ _description(info.description),
25+ _isFallbackAdapter(info.adapterType == wgpu::AdapterType::CPU) {}
2526
2627public:
2728 std::string getBrand () { return _name; }
@@ -30,6 +31,7 @@ class GPUAdapterInfo : public m::HybridObject {
3031 std::string getArchitecture () { return _architecture; }
3132 std::string getDevice () { return _device; }
3233 std::string getDescription () { return _description; }
34+ bool getIsFallbackAdapter () { return _isFallbackAdapter; }
3335
3436 void loadHybridMethods () override {
3537 registerHybridGetter (" __brand" , &GPUAdapterInfo::getBrand, this );
@@ -39,13 +41,16 @@ class GPUAdapterInfo : public m::HybridObject {
3941 this );
4042 registerHybridGetter (" device" , &GPUAdapterInfo::getDevice, this );
4143 registerHybridGetter (" description" , &GPUAdapterInfo::getDescription, this );
44+ registerHybridGetter (" isFallbackAdapter" ,
45+ &GPUAdapterInfo::getIsFallbackAdapter, this );
4246 }
4347
4448private:
4549 std::string _vendor;
4650 std::string _architecture;
4751 std::string _device;
4852 std::string _description;
53+ bool _isFallbackAdapter;
4954};
5055
5156} // namespace rnwgpu
0 commit comments