Skip to content

Commit

Permalink
💚
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon committed Dec 14, 2024
1 parent 8233656 commit 493419f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
4 changes: 2 additions & 2 deletions apps/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ PODS:
- React-debug
- react-native-safe-area-context (4.11.0):
- React-Core
- react-native-wgpu (0.1.19):
- react-native-wgpu (0.1.21):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1528,7 +1528,7 @@ SPEC CHECKSUMS:
React-logger: 29fa3e048f5f67fe396bc08af7606426d9bd7b5d
React-Mapbuffer: bf56147c9775491e53122a94c423ac201417e326
react-native-safe-area-context: 851c62c48dce80ccaa5637b6aa5991a1bc36eca9
react-native-wgpu: 5fd8cb5fd7bd00c88831d29438697d897fb680e8
react-native-wgpu: 5308faeb6d85925394351968f7970cd00eead0cc
React-nativeconfig: 9f223cd321823afdecf59ed00861ab2d69ee0fc1
React-NativeModulesApple: ff7efaff7098639db5631236cfd91d60abff04c0
React-perflogger: 32ed45d9cee02cf6639acae34251590dccd30994
Expand Down
32 changes: 13 additions & 19 deletions packages/webgpu/cpp/rnwgpu/api/GPUAdapterInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,26 @@ namespace m = margelo;

class GPUAdapterInfo : public m::HybridObject {
public:
explicit GPUAdapterInfo(wgpu::AdapterInfo &instance)
: HybridObject("GPUAdapterInfo"), _instance(std::move(instance)) {}
explicit GPUAdapterInfo(wgpu::AdapterInfo &info)
: HybridObject("GPUAdapterInfo"), _vendor(info.vendor),
_architecture(info.architecture),
_device(info.device),
_description(info.description) {}

public:
std::string getBrand() { return _name; }

std::string getVendor() {
if (_instance.vendor.length) {
return _instance.vendor.data;
}
return "";
return _vendor;
}
std::string getArchitecture() {
if (_instance.architecture.length) {
return _instance.architecture.data;
}
return "";
return _architecture;
}
std::string getDevice() {
if (_instance.device.length) {
return _instance.device.data;
}
return "";
return _device;
}
std::string getDescription() {
if (_instance.device.length) {
return _instance.device.data;
}
return "";
return _description;
}

void loadHybridMethods() override {
Expand All @@ -60,7 +51,10 @@ class GPUAdapterInfo : public m::HybridObject {
}

private:
wgpu::AdapterInfo _instance;
std::string _vendor;
std::string _architecture;
std::string _device;
std::string _description;
};

} // namespace rnwgpu
2 changes: 1 addition & 1 deletion packages/webgpu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-wgpu",
"version": "0.1.21",
"version": "0.1.22",
"description": "React Native WebGPU",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
1 change: 1 addition & 0 deletions packages/webgpu/src/__tests__/GPU.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ describe("Adapter", () => {
};
});
});
console.log(result);
expect(result).toBeDefined();
expect(result!.vendor).toBeDefined();
expect(result!.architecture).toBeDefined();
Expand Down

0 comments on commit 493419f

Please sign in to comment.