react-native-wgpu 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/cpp/dawn/native/MetalBackend.h +1 -0
  2. package/cpp/dawn/native/WebGPUBackend.h +15 -1
  3. package/cpp/dawn/webgpu_cpp_print.h +9 -0
  4. package/cpp/rnwgpu/api/GPUAdapter.cpp +0 -6
  5. package/cpp/rnwgpu/api/GPUAdapter.h +0 -3
  6. package/cpp/rnwgpu/api/GPUAdapterInfo.h +6 -1
  7. package/cpp/rnwgpu/api/GPUCommandEncoder.cpp +1 -1
  8. package/cpp/rnwgpu/api/GPUDevice.cpp +1 -1
  9. package/cpp/rnwgpu/api/descriptors/Unions.h +4 -4
  10. package/cpp/webgpu/webgpu.h +47 -50
  11. package/cpp/webgpu/webgpu_cpp.h +151 -100
  12. package/lib/commonjs/hooks.js +3 -1
  13. package/lib/commonjs/hooks.js.map +1 -1
  14. package/lib/module/hooks.js +3 -1
  15. package/lib/module/hooks.js.map +1 -1
  16. package/lib/typescript/lib/commonjs/hooks.d.ts.map +1 -1
  17. package/lib/typescript/lib/module/hooks.d.ts.map +1 -1
  18. package/lib/typescript/src/hooks.d.ts.map +1 -1
  19. package/libs/android/arm64-v8a/libwebgpu_dawn.so +0 -0
  20. package/libs/android/armeabi-v7a/libwebgpu_dawn.so +0 -0
  21. package/libs/android/x86/libwebgpu_dawn.so +0 -0
  22. package/libs/android/x86_64/libwebgpu_dawn.so +0 -0
  23. package/libs/apple/arm64_iphoneos/libwebgpu_dawn.a +0 -0
  24. package/libs/apple/arm64_iphonesimulator/libwebgpu_dawn.a +0 -0
  25. package/libs/apple/arm64_xros/libwebgpu_dawn.a +0 -0
  26. package/libs/apple/arm64_xrsimulator/libwebgpu_dawn.a +0 -0
  27. package/libs/apple/iphonesimulator/libwebgpu_dawn.a +0 -0
  28. package/libs/apple/libwebgpu_dawn.xcframework/Info.plist +12 -12
  29. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/libwebgpu_dawn.a +0 -0
  30. package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/libwebgpu_dawn.a +0 -0
  31. package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/libwebgpu_dawn.a +0 -0
  32. package/libs/apple/libwebgpu_dawn.xcframework/xros-arm64/libwebgpu_dawn.a +0 -0
  33. package/libs/apple/libwebgpu_dawn.xcframework/xros-arm64-simulator/libwebgpu_dawn.a +0 -0
  34. package/libs/apple/universal_macosx/libwebgpu_dawn.a +0 -0
  35. package/libs/apple/x86_64_iphonesimulator/libwebgpu_dawn.a +0 -0
  36. package/libs/dawn.json +39 -62
  37. package/package.json +3 -3
  38. package/src/__tests__/GPU.spec.ts +3 -1
  39. package/src/__tests__/demos/Wireframe.spec.ts +2 -4
  40. package/src/hooks.tsx +3 -1
@@ -43,6 +43,7 @@ namespace dawn::native::metal {
43
43
  // does have a global queue of graphics operations, but the command buffers are inserted there
44
44
  // when they are "scheduled". Submitting other operations before the command buffer is
45
45
  // scheduled could lead to races in who gets scheduled first and incorrect rendering.
46
+ // TODO(crbug.com/444702048): Remove after migrating Chromium to commands scheduled futures.
46
47
  DAWN_NATIVE_EXPORT void WaitForCommandsToBeScheduled(WGPUDevice device);
47
48
 
48
49
  #if defined(__OBJC__)
@@ -28,8 +28,22 @@
28
28
  #ifndef INCLUDE_DAWN_NATIVE_WEBGPUBACKEND_H_
29
29
  #define INCLUDE_DAWN_NATIVE_WEBGPUBACKEND_H_
30
30
 
31
+ #include <ostream>
32
+
31
33
  #include "dawn/native/DawnNative.h"
32
34
 
33
- namespace dawn::native::webgpu {} // namespace dawn::native::webgpu
35
+ namespace dawn::native::webgpu {
36
+
37
+ using CaptureStream = std::ostream;
38
+
39
+ // Starts a capture on the given device.
40
+ DAWN_NATIVE_EXPORT void StartCapture(WGPUDevice device,
41
+ CaptureStream& commandStream,
42
+ CaptureStream& contentStream);
43
+
44
+ // Ends a capture on the given device.
45
+ DAWN_NATIVE_EXPORT void EndCapture(WGPUDevice device);
46
+
47
+ } // namespace dawn::native::webgpu
34
48
 
35
49
  #endif // INCLUDE_DAWN_NATIVE_WEBGPUBACKEND_H_
@@ -785,6 +785,9 @@ namespace wgpu {
785
785
  break;
786
786
  case FeatureName::ChromiumExperimentalBindless:
787
787
  o << "FeatureName::ChromiumExperimentalBindless";
788
+ break;
789
+ case FeatureName::AdapterPropertiesWGPU:
790
+ o << "FeatureName::AdapterPropertiesWGPU";
788
791
  break;
789
792
  default:
790
793
  o << "FeatureName::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast<typename std::underlying_type<FeatureName>::type>(value);
@@ -1514,6 +1517,12 @@ namespace wgpu {
1514
1517
  break;
1515
1518
  case SType::TexelBufferBindingLayout:
1516
1519
  o << "SType::TexelBufferBindingLayout";
1520
+ break;
1521
+ case SType::SharedTextureMemoryMetalEndAccessState:
1522
+ o << "SType::SharedTextureMemoryMetalEndAccessState";
1523
+ break;
1524
+ case SType::AdapterPropertiesWGPU:
1525
+ o << "SType::AdapterPropertiesWGPU";
1517
1526
  break;
1518
1527
  default:
1519
1528
  o << "SType::" << std::showbase << std::hex << std::setfill('0') << std::setw(4) << static_cast<typename std::underlying_type<SType>::type>(value);
@@ -151,10 +151,4 @@ std::shared_ptr<GPUAdapterInfo> GPUAdapter::getInfo() {
151
151
  return std::make_shared<GPUAdapterInfo>(info);
152
152
  }
153
153
 
154
- bool GPUAdapter::getIsFallbackAdapter() {
155
- wgpu::AdapterInfo adapterInfo = {};
156
- _instance.GetInfo(&adapterInfo);
157
- return adapterInfo.adapterType == wgpu::AdapterType::CPU;
158
- }
159
-
160
154
  } // namespace rnwgpu
@@ -37,7 +37,6 @@ public:
37
37
  std::unordered_set<std::string> getFeatures();
38
38
  std::shared_ptr<GPUSupportedLimits> getLimits();
39
39
  std::shared_ptr<GPUAdapterInfo> getInfo();
40
- bool getIsFallbackAdapter();
41
40
 
42
41
  void loadHybridMethods() override {
43
42
  registerHybridGetter("__brand", &GPUAdapter::getBrand, this);
@@ -45,8 +44,6 @@ public:
45
44
  registerHybridGetter("features", &GPUAdapter::getFeatures, this);
46
45
  registerHybridGetter("limits", &GPUAdapter::getLimits, this);
47
46
  registerHybridGetter("info", &GPUAdapter::getInfo, this);
48
- registerHybridGetter("isFallbackAdapter", &GPUAdapter::getIsFallbackAdapter,
49
- this);
50
47
  }
51
48
 
52
49
  inline const wgpu::Adapter get() { return _instance; }
@@ -21,7 +21,8 @@ public:
21
21
  explicit GPUAdapterInfo(wgpu::AdapterInfo &info)
22
22
  : HybridObject("GPUAdapterInfo"), _vendor(info.vendor),
23
23
  _architecture(info.architecture), _device(info.device),
24
- _description(info.description) {}
24
+ _description(info.description),
25
+ _isFallbackAdapter(info.adapterType == wgpu::AdapterType::CPU) {}
25
26
 
26
27
  public:
27
28
  std::string getBrand() { return _name; }
@@ -30,6 +31,7 @@ public:
30
31
  std::string getArchitecture() { return _architecture; }
31
32
  std::string getDevice() { return _device; }
32
33
  std::string getDescription() { return _description; }
34
+ bool getIsFallbackAdapter() { return _isFallbackAdapter; }
33
35
 
34
36
  void loadHybridMethods() override {
35
37
  registerHybridGetter("__brand", &GPUAdapterInfo::getBrand, this);
@@ -39,6 +41,8 @@ public:
39
41
  this);
40
42
  registerHybridGetter("device", &GPUAdapterInfo::getDevice, this);
41
43
  registerHybridGetter("description", &GPUAdapterInfo::getDescription, this);
44
+ registerHybridGetter("isFallbackAdapter",
45
+ &GPUAdapterInfo::getIsFallbackAdapter, this);
42
46
  }
43
47
 
44
48
  private:
@@ -46,6 +50,7 @@ private:
46
50
  std::string _architecture;
47
51
  std::string _device;
48
52
  std::string _description;
53
+ bool _isFallbackAdapter;
49
54
  };
50
55
 
51
56
  } // namespace rnwgpu
@@ -41,7 +41,7 @@ std::shared_ptr<GPURenderPassEncoder> GPUCommandEncoder::beginRenderPass(
41
41
  std::shared_ptr<GPURenderPassDescriptor> descriptor) {
42
42
 
43
43
  wgpu::RenderPassDescriptor desc{};
44
- wgpu::RenderPassDescriptorMaxDrawCount maxDrawCountDesc{};
44
+ wgpu::RenderPassMaxDrawCount maxDrawCountDesc{};
45
45
  desc.nextInChain = &maxDrawCountDesc;
46
46
  Convertor conv;
47
47
 
@@ -70,7 +70,7 @@ GPUDevice::createTexture(std::shared_ptr<GPUTextureDescriptor> descriptor) {
70
70
 
71
71
  std::shared_ptr<GPUShaderModule> GPUDevice::createShaderModule(
72
72
  std::shared_ptr<GPUShaderModuleDescriptor> descriptor) {
73
- wgpu::ShaderModuleWGSLDescriptor wgsl_desc{};
73
+ wgpu::ShaderSourceWGSL wgsl_desc{};
74
74
  wgpu::ShaderModuleDescriptor sm_desc{};
75
75
  Convertor conv;
76
76
  if (!conv(wgsl_desc.code, descriptor->code) ||
@@ -487,7 +487,7 @@ inline void convertJSUnionToEnum(const std::string &inUnion,
487
487
  *outEnum = wgpu::FeatureName::AdapterPropertiesVk;
488
488
  } else if (inUnion == "r8unorm-storage") {
489
489
  *outEnum = wgpu::FeatureName::R8UnormStorage;
490
- } else if (inUnion == "dawn-format-capabilities") {
490
+ } else if (inUnion == "format-capabilities") {
491
491
  *outEnum = wgpu::FeatureName::DawnFormatCapabilities;
492
492
  } else if (inUnion == "norm16-texture-formats") {
493
493
  *outEnum = wgpu::FeatureName::Norm16TextureFormats;
@@ -590,6 +590,9 @@ inline void convertEnumToJSUnion(wgpu::FeatureName inEnum,
590
590
  case wgpu::FeatureName::DawnNative:
591
591
  *outUnion = "dawn-native";
592
592
  break;
593
+ case wgpu::FeatureName::DawnFormatCapabilities:
594
+ *outUnion = "format-capabilities";
595
+ break;
593
596
  case wgpu::FeatureName::ChromiumExperimentalTimestampQueryInsidePasses:
594
597
  *outUnion = "chromium-experimental-timestamp-query-inside-passes";
595
598
  break;
@@ -662,9 +665,6 @@ inline void convertEnumToJSUnion(wgpu::FeatureName inEnum,
662
665
  case wgpu::FeatureName::R8UnormStorage:
663
666
  *outUnion = "r8unorm-storage";
664
667
  break;
665
- case wgpu::FeatureName::DawnFormatCapabilities:
666
- *outUnion = "dawn-format-capabilities";
667
- break;
668
668
  case wgpu::FeatureName::Norm16TextureFormats:
669
669
  *outUnion = "norm16-texture-formats";
670
670
  break;
@@ -149,6 +149,7 @@ typedef struct WGPUTextureViewImpl* WGPUTextureView WGPU_OBJECT_ATTRIBUTE;
149
149
  // Structure forward declarations
150
150
  struct WGPUAdapterPropertiesD3D;
151
151
  struct WGPUAdapterPropertiesVk;
152
+ struct WGPUAdapterPropertiesWGPU;
152
153
  struct WGPUBindGroupDynamicBindingArray;
153
154
  struct WGPUBlendComponent;
154
155
  struct WGPUBufferBindingLayout;
@@ -296,7 +297,7 @@ struct WGPUSharedFenceExportInfo;
296
297
  struct WGPUSharedTextureMemoryAHardwareBufferProperties;
297
298
  struct WGPUSharedTextureMemoryBeginAccessDescriptor;
298
299
  struct WGPUSharedTextureMemoryDmaBufDescriptor;
299
- struct WGPUSharedTextureMemoryEndAccessState;
300
+ struct WGPUSharedTextureMemoryMetalEndAccessState;
300
301
  struct WGPUSurfaceDescriptor;
301
302
  struct WGPUTexelCopyBufferInfo;
302
303
  struct WGPUTexelCopyTextureInfo;
@@ -314,6 +315,7 @@ struct WGPUDeviceDescriptor;
314
315
  struct WGPUPipelineLayoutDescriptor;
315
316
  struct WGPURenderPassPixelLocalStorage;
316
317
  struct WGPUSharedTextureMemoryDescriptor;
318
+ struct WGPUSharedTextureMemoryEndAccessState;
317
319
  struct WGPUSharedTextureMemoryProperties;
318
320
  struct WGPUTextureViewDescriptor;
319
321
  struct WGPUVertexState;
@@ -613,6 +615,7 @@ typedef enum WGPUFeatureName {
613
615
  WGPUFeatureName_DawnDeviceAllocatorControl = 0x00050039,
614
616
  WGPUFeatureName_TextureComponentSwizzle = 0x0005003A,
615
617
  WGPUFeatureName_ChromiumExperimentalBindless = 0x0005003C,
618
+ WGPUFeatureName_AdapterPropertiesWGPU = 0x0005003D,
616
619
  WGPUFeatureName_Force32 = 0x7FFFFFFF
617
620
  } WGPUFeatureName WGPU_ENUM_ATTRIBUTE;
618
621
 
@@ -896,6 +899,8 @@ typedef enum WGPUSType {
896
899
  WGPUSType_BindGroupDynamicBindingArray = 0x0005004C,
897
900
  WGPUSType_TexelBufferBindingEntry = 0x0005004D,
898
901
  WGPUSType_TexelBufferBindingLayout = 0x0005004E,
902
+ WGPUSType_SharedTextureMemoryMetalEndAccessState = 0x0005004F,
903
+ WGPUSType_AdapterPropertiesWGPU = 0x00050050,
899
904
  WGPUSType_Force32 = 0x7FFFFFFF
900
905
  } WGPUSType WGPU_ENUM_ATTRIBUTE;
901
906
 
@@ -1446,6 +1451,20 @@ typedef struct WGPUAdapterPropertiesVk {
1446
1451
  /*.driverVersion=*/0 _wgpu_COMMA \
1447
1452
  })
1448
1453
 
1454
+ // Can be chained in WGPUAdapterInfo
1455
+ typedef struct WGPUAdapterPropertiesWGPU {
1456
+ WGPUChainedStruct chain;
1457
+ WGPUBackendType backendType;
1458
+ } WGPUAdapterPropertiesWGPU WGPU_STRUCTURE_ATTRIBUTE;
1459
+
1460
+ #define WGPU_ADAPTER_PROPERTIES_WGPU_INIT _wgpu_MAKE_INIT_STRUCT(WGPUAdapterPropertiesWGPU, { \
1461
+ /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \
1462
+ /*.next=*/NULL _wgpu_COMMA \
1463
+ /*.sType=*/WGPUSType_AdapterPropertiesWGPU _wgpu_COMMA \
1464
+ }) _wgpu_COMMA \
1465
+ /*.backendType=*/WGPUBackendType_Undefined _wgpu_COMMA \
1466
+ })
1467
+
1449
1468
  // Can be chained in WGPUBindGroupDescriptor
1450
1469
  typedef struct WGPUBindGroupDynamicBindingArray {
1451
1470
  WGPUChainedStruct chain;
@@ -3724,20 +3743,18 @@ typedef struct WGPUSharedTextureMemoryDmaBufDescriptor {
3724
3743
  /*.planes=*/NULL _wgpu_COMMA \
3725
3744
  })
3726
3745
 
3727
- typedef struct WGPUSharedTextureMemoryEndAccessState {
3728
- WGPUChainedStruct * nextInChain;
3729
- WGPUBool initialized;
3730
- size_t fenceCount;
3731
- WGPUSharedFence const * fences;
3732
- uint64_t const * signaledValues;
3733
- } WGPUSharedTextureMemoryEndAccessState WGPU_STRUCTURE_ATTRIBUTE;
3746
+ // Can be chained in WGPUSharedTextureMemoryEndAccessState
3747
+ typedef struct WGPUSharedTextureMemoryMetalEndAccessState {
3748
+ WGPUChainedStruct chain;
3749
+ WGPUFuture commandsScheduledFuture;
3750
+ } WGPUSharedTextureMemoryMetalEndAccessState WGPU_STRUCTURE_ATTRIBUTE;
3734
3751
 
3735
- #define WGPU_SHARED_TEXTURE_MEMORY_END_ACCESS_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryEndAccessState, { \
3736
- /*.nextInChain=*/NULL _wgpu_COMMA \
3737
- /*.initialized=*/WGPU_FALSE _wgpu_COMMA \
3738
- /*.fenceCount=*/0 _wgpu_COMMA \
3739
- /*.fences=*/NULL _wgpu_COMMA \
3740
- /*.signaledValues=*/NULL _wgpu_COMMA \
3752
+ #define WGPU_SHARED_TEXTURE_MEMORY_METAL_END_ACCESS_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryMetalEndAccessState, { \
3753
+ /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \
3754
+ /*.next=*/NULL _wgpu_COMMA \
3755
+ /*.sType=*/WGPUSType_SharedTextureMemoryMetalEndAccessState _wgpu_COMMA \
3756
+ }) _wgpu_COMMA \
3757
+ /*.commandsScheduledFuture=*/WGPU_FUTURE_INIT _wgpu_COMMA \
3741
3758
  })
3742
3759
 
3743
3760
  typedef struct WGPUSurfaceDescriptor {
@@ -4002,6 +4019,22 @@ typedef struct WGPUSharedTextureMemoryDescriptor {
4002
4019
  /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \
4003
4020
  })
4004
4021
 
4022
+ typedef struct WGPUSharedTextureMemoryEndAccessState {
4023
+ WGPUChainedStruct * nextInChain;
4024
+ WGPUBool initialized;
4025
+ size_t fenceCount;
4026
+ WGPUSharedFence const * fences;
4027
+ uint64_t const * signaledValues;
4028
+ } WGPUSharedTextureMemoryEndAccessState WGPU_STRUCTURE_ATTRIBUTE;
4029
+
4030
+ #define WGPU_SHARED_TEXTURE_MEMORY_END_ACCESS_STATE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUSharedTextureMemoryEndAccessState, { \
4031
+ /*.nextInChain=*/NULL _wgpu_COMMA \
4032
+ /*.initialized=*/WGPU_FALSE _wgpu_COMMA \
4033
+ /*.fenceCount=*/0 _wgpu_COMMA \
4034
+ /*.fences=*/NULL _wgpu_COMMA \
4035
+ /*.signaledValues=*/NULL _wgpu_COMMA \
4036
+ })
4037
+
4005
4038
  typedef struct WGPUSharedTextureMemoryProperties {
4006
4039
  WGPUChainedStruct * nextInChain;
4007
4040
  WGPUTextureUsage usage;
@@ -4124,42 +4157,6 @@ typedef struct WGPURenderPipelineDescriptor {
4124
4157
  /*.fragment=*/NULL _wgpu_COMMA \
4125
4158
  })
4126
4159
 
4127
- // WGPURenderPassDescriptorMaxDrawCount is deprecated.
4128
- // Use WGPURenderPassMaxDrawCount instead.
4129
- typedef WGPURenderPassMaxDrawCount WGPURenderPassDescriptorMaxDrawCount;
4130
-
4131
- // WGPUShaderModuleSPIRVDescriptor is deprecated.
4132
- // Use WGPUShaderSourceSPIRV instead.
4133
- typedef WGPUShaderSourceSPIRV WGPUShaderModuleSPIRVDescriptor;
4134
-
4135
- // WGPUShaderModuleWGSLDescriptor is deprecated.
4136
- // Use WGPUShaderSourceWGSL instead.
4137
- typedef WGPUShaderSourceWGSL WGPUShaderModuleWGSLDescriptor;
4138
-
4139
- // WGPUSurfaceDescriptorFromAndroidNativeWindow is deprecated.
4140
- // Use WGPUSurfaceSourceAndroidNativeWindow instead.
4141
- typedef WGPUSurfaceSourceAndroidNativeWindow WGPUSurfaceDescriptorFromAndroidNativeWindow;
4142
-
4143
- // WGPUSurfaceDescriptorFromMetalLayer is deprecated.
4144
- // Use WGPUSurfaceSourceMetalLayer instead.
4145
- typedef WGPUSurfaceSourceMetalLayer WGPUSurfaceDescriptorFromMetalLayer;
4146
-
4147
- // WGPUSurfaceDescriptorFromWaylandSurface is deprecated.
4148
- // Use WGPUSurfaceSourceWaylandSurface instead.
4149
- typedef WGPUSurfaceSourceWaylandSurface WGPUSurfaceDescriptorFromWaylandSurface;
4150
-
4151
- // WGPUSurfaceDescriptorFromWindowsHWND is deprecated.
4152
- // Use WGPUSurfaceSourceWindowsHWND instead.
4153
- typedef WGPUSurfaceSourceWindowsHWND WGPUSurfaceDescriptorFromWindowsHWND;
4154
-
4155
- // WGPUSurfaceDescriptorFromXcbWindow is deprecated.
4156
- // Use WGPUSurfaceSourceXCBWindow instead.
4157
- typedef WGPUSurfaceSourceXCBWindow WGPUSurfaceDescriptorFromXcbWindow;
4158
-
4159
- // WGPUSurfaceDescriptorFromXlibWindow is deprecated.
4160
- // Use WGPUSurfaceSourceXlibWindow instead.
4161
- typedef WGPUSurfaceSourceXlibWindow WGPUSurfaceDescriptorFromXlibWindow;
4162
-
4163
4160
  #ifdef __cplusplus
4164
4161
  extern "C" {
4165
4162
  #endif
@@ -363,6 +363,7 @@ enum class FeatureName : uint32_t {
363
363
  DawnDeviceAllocatorControl = WGPUFeatureName_DawnDeviceAllocatorControl,
364
364
  TextureComponentSwizzle = WGPUFeatureName_TextureComponentSwizzle,
365
365
  ChromiumExperimentalBindless = WGPUFeatureName_ChromiumExperimentalBindless,
366
+ AdapterPropertiesWGPU = WGPUFeatureName_AdapterPropertiesWGPU,
366
367
  };
367
368
  static_assert(sizeof(FeatureName) == sizeof(WGPUFeatureName), "sizeof mismatch for FeatureName");
368
369
  static_assert(alignof(FeatureName) == alignof(WGPUFeatureName), "alignof mismatch for FeatureName");
@@ -663,6 +664,8 @@ enum class SType : uint32_t {
663
664
  BindGroupDynamicBindingArray = WGPUSType_BindGroupDynamicBindingArray,
664
665
  TexelBufferBindingEntry = WGPUSType_TexelBufferBindingEntry,
665
666
  TexelBufferBindingLayout = WGPUSType_TexelBufferBindingLayout,
667
+ SharedTextureMemoryMetalEndAccessState = WGPUSType_SharedTextureMemoryMetalEndAccessState,
668
+ AdapterPropertiesWGPU = WGPUSType_AdapterPropertiesWGPU,
666
669
  };
667
670
  static_assert(sizeof(SType) == sizeof(WGPUSType), "sizeof mismatch for SType");
668
671
  static_assert(alignof(SType) == alignof(WGPUSType), "alignof mismatch for SType");
@@ -1220,6 +1223,7 @@ class TextureView;
1220
1223
  struct StringView;
1221
1224
  struct AdapterPropertiesD3D;
1222
1225
  struct AdapterPropertiesVk;
1226
+ struct AdapterPropertiesWGPU;
1223
1227
  struct BindGroupDynamicBindingArray;
1224
1228
  struct BlendComponent;
1225
1229
  struct BufferBindingLayout;
@@ -1367,7 +1371,7 @@ struct SharedFenceExportInfo;
1367
1371
  struct SharedTextureMemoryAHardwareBufferProperties;
1368
1372
  struct SharedTextureMemoryBeginAccessDescriptor;
1369
1373
  struct SharedTextureMemoryDmaBufDescriptor;
1370
- struct SharedTextureMemoryEndAccessState;
1374
+ struct SharedTextureMemoryMetalEndAccessState;
1371
1375
  struct SurfaceDescriptor;
1372
1376
  struct TexelCopyBufferInfo;
1373
1377
  struct TexelCopyTextureInfo;
@@ -1385,6 +1389,7 @@ struct DeviceDescriptor;
1385
1389
  struct PipelineLayoutDescriptor;
1386
1390
  struct RenderPassPixelLocalStorage;
1387
1391
  struct SharedTextureMemoryDescriptor;
1392
+ struct SharedTextureMemoryEndAccessState;
1388
1393
  struct SharedTextureMemoryProperties;
1389
1394
  struct TextureViewDescriptor;
1390
1395
  struct VertexState;
@@ -2217,6 +2222,18 @@ struct AdapterPropertiesVk : ChainedStructOut {
2217
2222
  alignas(kFirstMemberAlignment) uint32_t driverVersion;
2218
2223
  };
2219
2224
 
2225
+ // Can be chained in AdapterInfo
2226
+ struct AdapterPropertiesWGPU : ChainedStructOut {
2227
+ inline AdapterPropertiesWGPU();
2228
+
2229
+ struct Init;
2230
+ inline AdapterPropertiesWGPU(Init&& init);
2231
+ inline operator const WGPUAdapterPropertiesWGPU&() const noexcept;
2232
+
2233
+ static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(BackendType));
2234
+ alignas(kFirstMemberAlignment) BackendType backendType = BackendType::Undefined;
2235
+ };
2236
+
2220
2237
  // Can be chained in BindGroupDescriptor
2221
2238
  struct BindGroupDynamicBindingArray : ChainedStruct {
2222
2239
  inline BindGroupDynamicBindingArray();
@@ -3962,24 +3979,16 @@ struct SharedTextureMemoryDmaBufDescriptor : ChainedStruct {
3962
3979
  SharedTextureMemoryDmaBufPlane const * planes = nullptr;
3963
3980
  };
3964
3981
 
3965
- struct SharedTextureMemoryEndAccessState {
3966
- inline SharedTextureMemoryEndAccessState();
3967
- inline ~SharedTextureMemoryEndAccessState();
3968
- SharedTextureMemoryEndAccessState(const SharedTextureMemoryEndAccessState&) = delete;
3969
- SharedTextureMemoryEndAccessState& operator=(const SharedTextureMemoryEndAccessState&) = delete;
3970
- inline SharedTextureMemoryEndAccessState(SharedTextureMemoryEndAccessState&&);
3971
- inline SharedTextureMemoryEndAccessState& operator=(SharedTextureMemoryEndAccessState&&);
3972
- inline operator const WGPUSharedTextureMemoryEndAccessState&() const noexcept;
3982
+ // Can be chained in SharedTextureMemoryEndAccessState
3983
+ struct SharedTextureMemoryMetalEndAccessState : ChainedStructOut {
3984
+ inline SharedTextureMemoryMetalEndAccessState();
3973
3985
 
3974
- ChainedStructOut * nextInChain = nullptr;
3975
- Bool const initialized = {};
3976
- size_t const fenceCount = {};
3977
- SharedFence const * const fences = nullptr;
3978
- uint64_t const * const signaledValues = nullptr;
3986
+ struct Init;
3987
+ inline SharedTextureMemoryMetalEndAccessState(Init&& init);
3988
+ inline operator const WGPUSharedTextureMemoryMetalEndAccessState&() const noexcept;
3979
3989
 
3980
- private:
3981
- inline void FreeMembers();
3982
- static inline void Reset(SharedTextureMemoryEndAccessState& value);
3990
+ static constexpr size_t kFirstMemberAlignment = detail::ConstexprMax(alignof(ChainedStruct), alignof(Future));
3991
+ alignas(kFirstMemberAlignment) Future commandsScheduledFuture = {};
3983
3992
  };
3984
3993
 
3985
3994
  struct SurfaceDescriptor {
@@ -4150,6 +4159,26 @@ struct SharedTextureMemoryDescriptor {
4150
4159
  StringView label = {};
4151
4160
  };
4152
4161
 
4162
+ struct SharedTextureMemoryEndAccessState {
4163
+ inline SharedTextureMemoryEndAccessState();
4164
+ inline ~SharedTextureMemoryEndAccessState();
4165
+ SharedTextureMemoryEndAccessState(const SharedTextureMemoryEndAccessState&) = delete;
4166
+ SharedTextureMemoryEndAccessState& operator=(const SharedTextureMemoryEndAccessState&) = delete;
4167
+ inline SharedTextureMemoryEndAccessState(SharedTextureMemoryEndAccessState&&);
4168
+ inline SharedTextureMemoryEndAccessState& operator=(SharedTextureMemoryEndAccessState&&);
4169
+ inline operator const WGPUSharedTextureMemoryEndAccessState&() const noexcept;
4170
+
4171
+ ChainedStructOut * nextInChain = nullptr;
4172
+ Bool const initialized = {};
4173
+ size_t const fenceCount = {};
4174
+ SharedFence const * const fences = nullptr;
4175
+ uint64_t const * const signaledValues = nullptr;
4176
+
4177
+ private:
4178
+ inline void FreeMembers();
4179
+ static inline void Reset(SharedTextureMemoryEndAccessState& value);
4180
+ };
4181
+
4153
4182
  struct SharedTextureMemoryProperties {
4154
4183
  inline operator const WGPUSharedTextureMemoryProperties&() const noexcept;
4155
4184
 
@@ -4315,6 +4344,26 @@ static_assert(alignof(AdapterPropertiesVk) == alignof(WGPUAdapterPropertiesVk),
4315
4344
  static_assert(offsetof(AdapterPropertiesVk, driverVersion) == offsetof(WGPUAdapterPropertiesVk, driverVersion),
4316
4345
  "offsetof mismatch for AdapterPropertiesVk::driverVersion");
4317
4346
 
4347
+ // AdapterPropertiesWGPU implementation
4348
+ AdapterPropertiesWGPU::AdapterPropertiesWGPU()
4349
+ : ChainedStructOut { nullptr, SType::AdapterPropertiesWGPU } {}
4350
+ struct AdapterPropertiesWGPU::Init {
4351
+ ChainedStructOut * nextInChain;
4352
+ BackendType backendType = BackendType::Undefined;
4353
+ };
4354
+ AdapterPropertiesWGPU::AdapterPropertiesWGPU(AdapterPropertiesWGPU::Init&& init)
4355
+ : ChainedStructOut { init.nextInChain, SType::AdapterPropertiesWGPU },
4356
+ backendType(std::move(init.backendType)){}
4357
+
4358
+ AdapterPropertiesWGPU::operator const WGPUAdapterPropertiesWGPU&() const noexcept {
4359
+ return *reinterpret_cast<const WGPUAdapterPropertiesWGPU*>(this);
4360
+ }
4361
+
4362
+ static_assert(sizeof(AdapterPropertiesWGPU) == sizeof(WGPUAdapterPropertiesWGPU), "sizeof mismatch for AdapterPropertiesWGPU");
4363
+ static_assert(alignof(AdapterPropertiesWGPU) == alignof(WGPUAdapterPropertiesWGPU), "alignof mismatch for AdapterPropertiesWGPU");
4364
+ static_assert(offsetof(AdapterPropertiesWGPU, backendType) == offsetof(WGPUAdapterPropertiesWGPU, backendType),
4365
+ "offsetof mismatch for AdapterPropertiesWGPU::backendType");
4366
+
4318
4367
  // BindGroupDynamicBindingArray implementation
4319
4368
  BindGroupDynamicBindingArray::BindGroupDynamicBindingArray()
4320
4369
  : ChainedStruct { nullptr, SType::BindGroupDynamicBindingArray } {}
@@ -7689,65 +7738,25 @@ static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, planeCount) == offse
7689
7738
  static_assert(offsetof(SharedTextureMemoryDmaBufDescriptor, planes) == offsetof(WGPUSharedTextureMemoryDmaBufDescriptor, planes),
7690
7739
  "offsetof mismatch for SharedTextureMemoryDmaBufDescriptor::planes");
7691
7740
 
7692
- // SharedTextureMemoryEndAccessState implementation
7693
- SharedTextureMemoryEndAccessState::SharedTextureMemoryEndAccessState() = default;
7694
- SharedTextureMemoryEndAccessState::~SharedTextureMemoryEndAccessState() {
7695
- FreeMembers();
7696
- }
7697
-
7698
- SharedTextureMemoryEndAccessState::SharedTextureMemoryEndAccessState(SharedTextureMemoryEndAccessState&& rhs)
7699
- : initialized(rhs.initialized),
7700
- fenceCount(rhs.fenceCount),
7701
- fences(rhs.fences),
7702
- signaledValues(rhs.signaledValues){
7703
- Reset(rhs);
7704
- }
7705
-
7706
- SharedTextureMemoryEndAccessState& SharedTextureMemoryEndAccessState::operator=(SharedTextureMemoryEndAccessState&& rhs) {
7707
- if (&rhs == this) {
7708
- return *this;
7709
- }
7710
- FreeMembers();
7711
- detail::AsNonConstReference(this->initialized) = std::move(rhs.initialized);
7712
- detail::AsNonConstReference(this->fenceCount) = std::move(rhs.fenceCount);
7713
- detail::AsNonConstReference(this->fences) = std::move(rhs.fences);
7714
- detail::AsNonConstReference(this->signaledValues) = std::move(rhs.signaledValues);
7715
- Reset(rhs);
7716
- return *this;
7717
- }
7718
-
7719
- void SharedTextureMemoryEndAccessState::FreeMembers() {
7720
- bool needsFreeing = false; if (this->fences != nullptr) { needsFreeing = true; } if (this->signaledValues != nullptr) { needsFreeing = true; }if (needsFreeing) {
7721
- wgpuSharedTextureMemoryEndAccessStateFreeMembers(
7722
- *reinterpret_cast<WGPUSharedTextureMemoryEndAccessState*>(this));
7723
- }
7724
- }
7725
-
7726
- // static
7727
- void SharedTextureMemoryEndAccessState::Reset(SharedTextureMemoryEndAccessState& value) {
7728
- SharedTextureMemoryEndAccessState defaultValue{};
7729
- detail::AsNonConstReference(value.initialized) = defaultValue.initialized;
7730
- detail::AsNonConstReference(value.fenceCount) = defaultValue.fenceCount;
7731
- detail::AsNonConstReference(value.fences) = defaultValue.fences;
7732
- detail::AsNonConstReference(value.signaledValues) = defaultValue.signaledValues;
7733
- }
7741
+ // SharedTextureMemoryMetalEndAccessState implementation
7742
+ SharedTextureMemoryMetalEndAccessState::SharedTextureMemoryMetalEndAccessState()
7743
+ : ChainedStructOut { nullptr, SType::SharedTextureMemoryMetalEndAccessState } {}
7744
+ struct SharedTextureMemoryMetalEndAccessState::Init {
7745
+ ChainedStructOut * nextInChain;
7746
+ Future commandsScheduledFuture = {};
7747
+ };
7748
+ SharedTextureMemoryMetalEndAccessState::SharedTextureMemoryMetalEndAccessState(SharedTextureMemoryMetalEndAccessState::Init&& init)
7749
+ : ChainedStructOut { init.nextInChain, SType::SharedTextureMemoryMetalEndAccessState },
7750
+ commandsScheduledFuture(std::move(init.commandsScheduledFuture)){}
7734
7751
 
7735
- SharedTextureMemoryEndAccessState::operator const WGPUSharedTextureMemoryEndAccessState&() const noexcept {
7736
- return *reinterpret_cast<const WGPUSharedTextureMemoryEndAccessState*>(this);
7752
+ SharedTextureMemoryMetalEndAccessState::operator const WGPUSharedTextureMemoryMetalEndAccessState&() const noexcept {
7753
+ return *reinterpret_cast<const WGPUSharedTextureMemoryMetalEndAccessState*>(this);
7737
7754
  }
7738
7755
 
7739
- static_assert(sizeof(SharedTextureMemoryEndAccessState) == sizeof(WGPUSharedTextureMemoryEndAccessState), "sizeof mismatch for SharedTextureMemoryEndAccessState");
7740
- static_assert(alignof(SharedTextureMemoryEndAccessState) == alignof(WGPUSharedTextureMemoryEndAccessState), "alignof mismatch for SharedTextureMemoryEndAccessState");
7741
- static_assert(offsetof(SharedTextureMemoryEndAccessState, nextInChain) == offsetof(WGPUSharedTextureMemoryEndAccessState, nextInChain),
7742
- "offsetof mismatch for SharedTextureMemoryEndAccessState::nextInChain");
7743
- static_assert(offsetof(SharedTextureMemoryEndAccessState, initialized) == offsetof(WGPUSharedTextureMemoryEndAccessState, initialized),
7744
- "offsetof mismatch for SharedTextureMemoryEndAccessState::initialized");
7745
- static_assert(offsetof(SharedTextureMemoryEndAccessState, fenceCount) == offsetof(WGPUSharedTextureMemoryEndAccessState, fenceCount),
7746
- "offsetof mismatch for SharedTextureMemoryEndAccessState::fenceCount");
7747
- static_assert(offsetof(SharedTextureMemoryEndAccessState, fences) == offsetof(WGPUSharedTextureMemoryEndAccessState, fences),
7748
- "offsetof mismatch for SharedTextureMemoryEndAccessState::fences");
7749
- static_assert(offsetof(SharedTextureMemoryEndAccessState, signaledValues) == offsetof(WGPUSharedTextureMemoryEndAccessState, signaledValues),
7750
- "offsetof mismatch for SharedTextureMemoryEndAccessState::signaledValues");
7756
+ static_assert(sizeof(SharedTextureMemoryMetalEndAccessState) == sizeof(WGPUSharedTextureMemoryMetalEndAccessState), "sizeof mismatch for SharedTextureMemoryMetalEndAccessState");
7757
+ static_assert(alignof(SharedTextureMemoryMetalEndAccessState) == alignof(WGPUSharedTextureMemoryMetalEndAccessState), "alignof mismatch for SharedTextureMemoryMetalEndAccessState");
7758
+ static_assert(offsetof(SharedTextureMemoryMetalEndAccessState, commandsScheduledFuture) == offsetof(WGPUSharedTextureMemoryMetalEndAccessState, commandsScheduledFuture),
7759
+ "offsetof mismatch for SharedTextureMemoryMetalEndAccessState::commandsScheduledFuture");
7751
7760
 
7752
7761
  // SurfaceDescriptor implementation
7753
7762
 
@@ -8106,6 +8115,66 @@ static_assert(offsetof(SharedTextureMemoryDescriptor, nextInChain) == offsetof(W
8106
8115
  static_assert(offsetof(SharedTextureMemoryDescriptor, label) == offsetof(WGPUSharedTextureMemoryDescriptor, label),
8107
8116
  "offsetof mismatch for SharedTextureMemoryDescriptor::label");
8108
8117
 
8118
+ // SharedTextureMemoryEndAccessState implementation
8119
+ SharedTextureMemoryEndAccessState::SharedTextureMemoryEndAccessState() = default;
8120
+ SharedTextureMemoryEndAccessState::~SharedTextureMemoryEndAccessState() {
8121
+ FreeMembers();
8122
+ }
8123
+
8124
+ SharedTextureMemoryEndAccessState::SharedTextureMemoryEndAccessState(SharedTextureMemoryEndAccessState&& rhs)
8125
+ : initialized(rhs.initialized),
8126
+ fenceCount(rhs.fenceCount),
8127
+ fences(rhs.fences),
8128
+ signaledValues(rhs.signaledValues){
8129
+ Reset(rhs);
8130
+ }
8131
+
8132
+ SharedTextureMemoryEndAccessState& SharedTextureMemoryEndAccessState::operator=(SharedTextureMemoryEndAccessState&& rhs) {
8133
+ if (&rhs == this) {
8134
+ return *this;
8135
+ }
8136
+ FreeMembers();
8137
+ detail::AsNonConstReference(this->initialized) = std::move(rhs.initialized);
8138
+ detail::AsNonConstReference(this->fenceCount) = std::move(rhs.fenceCount);
8139
+ detail::AsNonConstReference(this->fences) = std::move(rhs.fences);
8140
+ detail::AsNonConstReference(this->signaledValues) = std::move(rhs.signaledValues);
8141
+ Reset(rhs);
8142
+ return *this;
8143
+ }
8144
+
8145
+ void SharedTextureMemoryEndAccessState::FreeMembers() {
8146
+ bool needsFreeing = false; if (this->fences != nullptr) { needsFreeing = true; } if (this->signaledValues != nullptr) { needsFreeing = true; }if (needsFreeing) {
8147
+ wgpuSharedTextureMemoryEndAccessStateFreeMembers(
8148
+ *reinterpret_cast<WGPUSharedTextureMemoryEndAccessState*>(this));
8149
+ }
8150
+ }
8151
+
8152
+ // static
8153
+ void SharedTextureMemoryEndAccessState::Reset(SharedTextureMemoryEndAccessState& value) {
8154
+ SharedTextureMemoryEndAccessState defaultValue{};
8155
+ detail::AsNonConstReference(value.initialized) = defaultValue.initialized;
8156
+ detail::AsNonConstReference(value.fenceCount) = defaultValue.fenceCount;
8157
+ detail::AsNonConstReference(value.fences) = defaultValue.fences;
8158
+ detail::AsNonConstReference(value.signaledValues) = defaultValue.signaledValues;
8159
+ }
8160
+
8161
+ SharedTextureMemoryEndAccessState::operator const WGPUSharedTextureMemoryEndAccessState&() const noexcept {
8162
+ return *reinterpret_cast<const WGPUSharedTextureMemoryEndAccessState*>(this);
8163
+ }
8164
+
8165
+ static_assert(sizeof(SharedTextureMemoryEndAccessState) == sizeof(WGPUSharedTextureMemoryEndAccessState), "sizeof mismatch for SharedTextureMemoryEndAccessState");
8166
+ static_assert(alignof(SharedTextureMemoryEndAccessState) == alignof(WGPUSharedTextureMemoryEndAccessState), "alignof mismatch for SharedTextureMemoryEndAccessState");
8167
+ static_assert(offsetof(SharedTextureMemoryEndAccessState, nextInChain) == offsetof(WGPUSharedTextureMemoryEndAccessState, nextInChain),
8168
+ "offsetof mismatch for SharedTextureMemoryEndAccessState::nextInChain");
8169
+ static_assert(offsetof(SharedTextureMemoryEndAccessState, initialized) == offsetof(WGPUSharedTextureMemoryEndAccessState, initialized),
8170
+ "offsetof mismatch for SharedTextureMemoryEndAccessState::initialized");
8171
+ static_assert(offsetof(SharedTextureMemoryEndAccessState, fenceCount) == offsetof(WGPUSharedTextureMemoryEndAccessState, fenceCount),
8172
+ "offsetof mismatch for SharedTextureMemoryEndAccessState::fenceCount");
8173
+ static_assert(offsetof(SharedTextureMemoryEndAccessState, fences) == offsetof(WGPUSharedTextureMemoryEndAccessState, fences),
8174
+ "offsetof mismatch for SharedTextureMemoryEndAccessState::fences");
8175
+ static_assert(offsetof(SharedTextureMemoryEndAccessState, signaledValues) == offsetof(WGPUSharedTextureMemoryEndAccessState, signaledValues),
8176
+ "offsetof mismatch for SharedTextureMemoryEndAccessState::signaledValues");
8177
+
8109
8178
  // SharedTextureMemoryProperties implementation
8110
8179
 
8111
8180
  SharedTextureMemoryProperties::operator const WGPUSharedTextureMemoryProperties&() const noexcept {
@@ -10012,33 +10081,6 @@ static_assert(alignof(TextureView) == alignof(WGPUTextureView), "alignof mismatc
10012
10081
 
10013
10082
 
10014
10083
 
10015
- // RenderPassDescriptorMaxDrawCount is deprecated.
10016
- // Use RenderPassMaxDrawCount instead.
10017
- using RenderPassDescriptorMaxDrawCount = RenderPassMaxDrawCount;
10018
- // ShaderModuleSPIRVDescriptor is deprecated.
10019
- // Use ShaderSourceSPIRV instead.
10020
- using ShaderModuleSPIRVDescriptor = ShaderSourceSPIRV;
10021
- // ShaderModuleWGSLDescriptor is deprecated.
10022
- // Use ShaderSourceWGSL instead.
10023
- using ShaderModuleWGSLDescriptor = ShaderSourceWGSL;
10024
- // SurfaceDescriptorFromAndroidNativeWindow is deprecated.
10025
- // Use SurfaceSourceAndroidNativeWindow instead.
10026
- using SurfaceDescriptorFromAndroidNativeWindow = SurfaceSourceAndroidNativeWindow;
10027
- // SurfaceDescriptorFromMetalLayer is deprecated.
10028
- // Use SurfaceSourceMetalLayer instead.
10029
- using SurfaceDescriptorFromMetalLayer = SurfaceSourceMetalLayer;
10030
- // SurfaceDescriptorFromWaylandSurface is deprecated.
10031
- // Use SurfaceSourceWaylandSurface instead.
10032
- using SurfaceDescriptorFromWaylandSurface = SurfaceSourceWaylandSurface;
10033
- // SurfaceDescriptorFromWindowsHWND is deprecated.
10034
- // Use SurfaceSourceWindowsHWND instead.
10035
- using SurfaceDescriptorFromWindowsHWND = SurfaceSourceWindowsHWND;
10036
- // SurfaceDescriptorFromXcbWindow is deprecated.
10037
- // Use SurfaceSourceXCBWindow instead.
10038
- using SurfaceDescriptorFromXcbWindow = SurfaceSourceXCBWindow;
10039
- // SurfaceDescriptorFromXlibWindow is deprecated.
10040
- // Use SurfaceSourceXlibWindow instead.
10041
- using SurfaceDescriptorFromXlibWindow = SurfaceSourceXlibWindow;
10042
10084
 
10043
10085
  // Free Functions
10044
10086
  static inline Instance CreateInstance(InstanceDescriptor const * descriptor = nullptr) {
@@ -10064,6 +10106,7 @@ static inline Proc GetProcAddress(StringView procName) {
10064
10106
  } // namespace wgpu
10065
10107
 
10066
10108
  namespace wgpu {
10109
+
10067
10110
  template<>
10068
10111
  struct IsWGPUBitmask<wgpu::BufferUsage> {
10069
10112
  static constexpr bool enable = true;
@@ -10094,6 +10137,14 @@ struct IsWGPUBitmask<wgpu::TextureUsage> {
10094
10137
  static constexpr bool enable = true;
10095
10138
  };
10096
10139
 
10140
+
10141
+ inline bool operator==(const TextureComponentSwizzle& s1, const TextureComponentSwizzle& s2) {
10142
+ return s1.r == s2.r && s1.g == s2.g && s1.b == s2.b && s1.a == s2.a;
10143
+ }
10144
+ inline bool operator!=(const TextureComponentSwizzle& s1, const TextureComponentSwizzle& s2) {
10145
+ return !(s1 == s2);
10146
+ }
10147
+
10097
10148
  } // namespace wgpu
10098
10149
 
10099
10150
  namespace std {
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.warnIfNotHardwareAccelerated = exports.useSurface = exports.useMainDevice = exports.useGPUContext = exports.useDevice = exports.useCanvasEffect = exports.GPUDeviceProvider = void 0;
7
7
  var _react = require("react");
8
8
  const warnIfNotHardwareAccelerated = adapter => {
9
- if (adapter.isFallbackAdapter) {
9
+ // Check if adapter is a fallback adapter using the new GPUAdapterInfo API
10
+ // Note: isFallbackAdapter was moved from GPUAdapter to GPUAdapterInfo in Chrome 140
11
+ if (adapter.info && adapter.info.isFallbackAdapter) {
10
12
  console.warn("GPUAdapter is not hardware accelerated. This is common on Android emulators. Rendering will be slow. Some features may be unavailable.");
11
13
  }
12
14
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","warnIfNotHardwareAccelerated","adapter","isFallbackAdapter","console","warn","exports","DeviceContext","createContext","GPUDeviceProvider","children","adapterOptions","deviceDescriptor","state","useDevice","device","React","createElement","Provider","value","useSurface","surface","setSurface","useState","ref","useCanvasEffect","sur","current","getNativeSurface","useMainDevice","ctx","useContext","Error","setState","useEffect","navigator","gpu","requestAdapter","requestDevice","useGPUContext","context","setContext","getContext","effect","unsub","useRef","whenReady","sub","Promise","then"],"sourceRoot":"../../src","sources":["hooks.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAMO,MAAMC,4BAA4B,GAAIC,OAAmB,IAAK;EACnE,IAAIA,OAAO,CAACC,iBAAiB,EAAE;IAC7BC,OAAO,CAACC,IAAI,CACV,wIACF,CAAC;EACH;AACF,CAAC;AAACC,OAAA,CAAAL,4BAAA,GAAAA,4BAAA;AAOF,MAAMM,aAAa,gBAAG,IAAAC,oBAAa,EAAuB,IAAI,CAAC;AAQxD,MAAMC,iBAAiB,GAAGA,CAAC;EAChCC,QAAQ;EACRC,cAAc;EACdC;AACmB,CAAC,KAAK;EACzB,MAAMC,KAAK,GAAGC,SAAS,CAACH,cAAc,EAAEC,gBAAgB,CAAC;EACzD,IAAI,CAACC,KAAK,CAACE,MAAM,EAAE;IACjB,OAAO,IAAI;EACb;E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AACmB,SAAS,CAAC,YAAY;MAChC,MAAMC,GAAG,GAAGJ,MAAM,CAAC,CAAC;MACpB,IAAII,GAAG,EAAE;QACPH,KAAK,CAACjB,OAAO,GAAGoB,GAAG;MACrB;IACF,CAAC,CAAC;IACF,OAAO,MAAM;MACX,IAAIH,KAAK,CAACjB,OAAO,EAAE;QACjB,IAAIiB,KAAK,CAACjB,OAAO,YAAYqB,OAAO,EAAE;UACpCJ,KAAK,CAACjB,OAAO,CAACsB,IAAI,CAAEF,GAAG,IAAKA,GAAG,IAAIA,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC,MAAM;UACLH,KAAK,CAACjB,OAAO,CAAC,CAAC;QACjB;MACF;IACF,CAAC;IACD;EACF,CAAC,EAAE,EAAE,CAAC;EACN,OAAOH,GAAG;AACZ,CAAC;AAAClB,OAAA,CAAAmB,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","warnIfNotHardwareAccelerated","adapter","info","isFallbackAdapter","console","warn","exports","DeviceContext","createContext","GPUDeviceProvider","children","adapterOptions","deviceDescriptor","state","useDevice","device","React","createElement","Provider","value","useSurface","surface","setSurface","useState","ref","useCanvasEffect","sur","current","getNativeSurface","useMainDevice","ctx","useContext","Error","setState","useEffect","navigator","gpu","requestAdapter","requestDevice","useGPUContext","context","setContext","getContext","effect","unsub","useRef","whenReady","sub","Promise","then"],"sourceRoot":"../../src","sources":["hooks.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAMO,MAAMC,4BAA4B,GAAIC,OAAmB,IAAK;EACnE;EACA;EACA,IAAIA,OAAO,CAACC,IAAI,IAAID,OAAO,CAACC,IAAI,CAACC,iBAAiB,EAAE;IAClDC,OAAO,CAACC,IAAI,CACV,wIACF,CAAC;EACH;AACF,CAAC;AAACC,OAAA,CAAAN,4BAAA,GAAAA,4BAAA;AAOF,MAAMO,aAAa,gBAAG,IAAAC,oBAAa,EAAuB,IAAI,CAAC;AAQxD,MA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,EAAY,IAAI,CAAC;EACnC,IAAAX,gBAAS,EAAC,MAAM;IACd,IAAI,CAACV,GAAG,CAACG,OAAO,IAAI,CAACH,GAAG,CAACG,OAAO,CAACmB,SAAS,EAAE;MAC1C,MAAM,IAAId,KAAK,CAAC,kDAAkD,CAAC;IACrE;IACAR,GAAG,CAACG,OAAO,CAACmB,SAAS,CAAC,YAAY;MAChC,MAAMC,GAAG,GAAGJ,MAAM,CAAC,CAAC;MACpB,IAAII,GAAG,EAAE;QACPH,KAAK,CAACjB,OAAO,GAAGoB,GAAG;MACrB;IACF,CAAC,CAAC;IACF,OAAO,MAAM;MACX,IAAIH,KAAK,CAACjB,OAAO,EAAE;QACjB,IAAIiB,KAAK,CAACjB,OAAO,YAAYqB,OAAO,EAAE;UACpCJ,KAAK,CAACjB,OAAO,CAACsB,IAAI,CAAEF,GAAG,IAAKA,GAAG,IAAIA,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC,MAAM;UACLH,KAAK,CAACjB,OAAO,CAAC,CAAC;QACjB;MACF;IACF,CAAC;IACD;EACF,CAAC,EAAE,EAAE,CAAC;EACN,OAAOH,GAAG;AACZ,CAAC;AAAClB,OAAA,CAAAmB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -1,6 +1,8 @@
1
1
  import { createContext, useContext, useEffect, useRef, useState } from "react";
2
2
  export const warnIfNotHardwareAccelerated = adapter => {
3
- if (adapter.isFallbackAdapter) {
3
+ // Check if adapter is a fallback adapter using the new GPUAdapterInfo API
4
+ // Note: isFallbackAdapter was moved from GPUAdapter to GPUAdapterInfo in Chrome 140
5
+ if (adapter.info && adapter.info.isFallbackAdapter) {
4
6
  console.warn("GPUAdapter is not hardware accelerated. This is common on Android emulators. Rendering will be slow. Some features may be unavailable.");
5
7
  }
6
8
  };
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContext","useEffect","useRef","useState","warnIfNotHardwareAccelerated","adapter","isFallbackAdapter","console","warn","DeviceContext","GPUDeviceProvider","children","adapterOptions","deviceDescriptor","state","useDevice","device","React","createElement","Provider","value","useSurface","surface","setSurface","ref","useCanvasEffect","sur","current","getNativeSurface","useMainDevice","ctx","Error","setState","navigator","gpu","requestAdapter","requestDevice","useGPUContext","context","setContext","getContext","effect","unsub","whenReady","sub","Promise","then"],"sourceRoot":"../../src","sources":["hooks.tsx"],"mappings":"AACA,SAASA,aAAa,EAAEC,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAM9E,OAAO,MAAMC,4BAA4B,GAAIC,OAAmB,IAAK;EACnE,IAAIA,OAAO,CAACC,iBAAiB,EAAE;IAC7BC,OAAO,CAACC,IAAI,CACV,wIACF,CAAC;EACH;AACF,CAAC;AAOD,MAAMC,aAAa,gBAAGV,aAAa,CAAuB,IAAI,CAAC;AAQ/D,OAAO,MAAMW,iBAAiB,GAAGA,CAAC;EAChCC,QAAQ;EACRC,cAAc;EACdC;AACmB,CAAC,KAAK;EACzB,MAAMC,KAAK,GAAGC,SAAS,CAACH,cAAc,EAAEC,gBAAgB,CAAC;EACzD,IAAI,CAACC,KAAK,CAACE,MAAM,EAAE;IACjB,OAAO,IAAI;EACb;EACA,oBACEC,KAAA,CAAAC,aAAA,CAACT,aAAa,CAACU,QAAQ;IAACC,KAAK,EAAEN;EAAM,GAAEH,QAAiC,CAAC;AAE7E,CAAC;AAED,OAAO,MAAMU,UAAU,GAAGA,CAAA,KAAM;EAC9B,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGpB,QAAQ,CAAsB,IAAI,CAAC;EACjE,MAAMqB,GAAG,GAAGC,eAAe,CAAC,MAAM;IAChC,MAAMC,GAAG,GAAGF,GAAG,CAACG,OAAO,CAAEC,gBAAgB,CAAC,CAAC;IAC3CL,UAAU,CAACG,GAAG,CAAC;EACjB,CAAC,CAAC;EACF,OAAO;IAAEF,GAAG;IAAEF;EAAQ,CAAC;AACzB,CAAC;AAED,OAAO,MAAMO,aAAa,GAAGA,CAAA,KA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N,GAAG,CAACG,OAAO,CAAEa,UAAU,CAAC,QAAQ,CAAE;IAC9CD,UAAU,CAACT,GAAG,CAAC;EACjB,CAAC,CAAC;EACF,OAAO;IAAEN,GAAG;IAAEc;EAAQ,CAAC;AACzB,CAAC;AAED,OAAO,MAAMb,eAAe,GAC1BgB,MAIiB,IACd;EACH,MAAMC,KAAK,GAAGxC,MAAM,CAAmD,IAAI,CAAC;EAC5E,MAAMsB,GAAG,GAAGtB,MAAM,CAAY,IAAI,CAAC;EACnCD,SAAS,CAAC,MAAM;IACd,IAAI,CAACuB,GAAG,CAACG,OAAO,IAAI,CAACH,GAAG,CAACG,OAAO,CAACgB,SAAS,EAAE;MAC1C,MAAM,IAAIZ,KAAK,CAAC,kDAAkD,CAAC;IACrE;IACAP,GAAG,CAACG,OAAO,CAACgB,SAAS,CAAC,YAAY;MAChC,MAAMC,GAAG,GAAGH,MAAM,CAAC,CAAC;MACpB,IAAIG,GAAG,EAAE;QACPF,KAAK,CAACf,OAAO,GAAGiB,GAAG;MACrB;IACF,CAAC,CAAC;IACF,OAAO,MAAM;MACX,IAAIF,KAAK,CAACf,OAAO,EAAE;QACjB,IAAIe,KAAK,CAACf,OAAO,YAAYkB,OAAO,EAAE;UACpCH,KAAK,CAACf,OAAO,CAACmB,IAAI,CAAEF,GAAG,IAAKA,GAAG,IAAIA,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC,MAAM;UACLF,KAAK,CAACf,OAAO,CAAC,CAAC;QACjB;MACF;IACF,CAAC;IACD;EACF,CAAC,EAAE,EAAE,CAAC;EACN,OAAOH,GAAG;AACZ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createContext","useContext","useEffect","useRef","useState","warnIfNotHardwareAccelerated","adapter","info","isFallbackAdapter","console","warn","DeviceContext","GPUDeviceProvider","children","adapterOptions","deviceDescriptor","state","useDevice","device","React","createElement","Provider","value","useSurface","surface","setSurface","ref","useCanvasEffect","sur","current","getNativeSurface","useMainDevice","ctx","Error","setState","navigator","gpu","requestAdapter","requestDevice","useGPUContext","context","setContext","getContext","effect","unsub","whenReady","sub","Promise","then"],"sourceRoot":"../../src","sources":["hooks.tsx"],"mappings":"AACA,SAASA,aAAa,EAAEC,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAM9E,OAAO,MAAMC,4BAA4B,GAAIC,OAAmB,IAAK;EACnE;EACA;EACA,IAAIA,OAAO,CAACC,IAAI,IAAID,OAAO,CAACC,IAAI,CAACC,iBAAiB,EAAE;IAClDC,OAAO,CAACC,IAAI,CACV,wIACF,CAAC;EACH;AACF,CAAC;AAOD,MAAMC,aAAa,gBAAGX,aAAa,CAAuB,IAAI,CAAC;AAQ/D,OAAO,MAAMY,iBAAiB,GAAGA,CAAC;EAChCC,QAAQ;EACRC,cAAc;EACdC;AACmB,CAAC,KAAK;EACzB,MAAMC,KAAK,GAAGC,SAAS,CAACH,cAAc,EAAEC,gBAAgB,CAAC;EACzD,IAAI,CAACC,KAAK,CAACE,MAAM,EAAE;IACjB,OAAO,IAAI;EACb;EACA,oBACEC,KAAA,CAAAC,aAAA,CAACT,aAAa,CAACU,QAAQ;IAACC,KAAK,EAAEN;EAAM,GAAEH,QAAiC,CAAC;AAE7E,CAAC;AAED,OAAO,MAAMU,UAAU,GAAGA,CAAA,KAAM;EAC9B,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGrB,QAAQ,CAAsB,IAAI,CAAC;EACjE,MAAMsB,GAAG,GAAGC,eAAe,CAAC,MAAM;IAChC,MAAMC,GAAG,GAAGF,GAAG,CAACG,OAAO,CAAEC,gBAAgB,CAAC,CAAC;IAC3CL,UAAU,CAACG,GAAG,CAAC;EACjB,CAAC,CAAC;EACF,OAAO;IAAEF,GAAG;IAAEF;EAAQ,CAAC;AACzB,CAAC;AAED,OAAO,MAAMO,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAMC,GAAG,GAAG/B,UAAU,CAACU,aAAa,CAAC;EACrC,IAA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UAAU,CAACT,GAAG,CAAC;EACjB,CAAC,CAAC;EACF,OAAO;IAAEN,GAAG;IAAEc;EAAQ,CAAC;AACzB,CAAC;AAED,OAAO,MAAMb,eAAe,GAC1BgB,MAIiB,IACd;EACH,MAAMC,KAAK,GAAGzC,MAAM,CAAmD,IAAI,CAAC;EAC5E,MAAMuB,GAAG,GAAGvB,MAAM,CAAY,IAAI,CAAC;EACnCD,SAAS,CAAC,MAAM;IACd,IAAI,CAACwB,GAAG,CAACG,OAAO,IAAI,CAACH,GAAG,CAACG,OAAO,CAACgB,SAAS,EAAE;MAC1C,MAAM,IAAIZ,KAAK,CAAC,kDAAkD,CAAC;IACrE;IACAP,GAAG,CAACG,OAAO,CAACgB,SAAS,CAAC,YAAY;MAChC,MAAMC,GAAG,GAAGH,MAAM,CAAC,CAAC;MACpB,IAAIG,GAAG,EAAE;QACPF,KAAK,CAACf,OAAO,GAAGiB,GAAG;MACrB;IACF,CAAC,CAAC;IACF,OAAO,MAAM;MACX,IAAIF,KAAK,CAACf,OAAO,EAAE;QACjB,IAAIe,KAAK,CAACf,OAAO,YAAYkB,OAAO,EAAE;UACpCH,KAAK,CAACf,OAAO,CAACmB,IAAI,CAAEF,GAAG,IAAKA,GAAG,IAAIA,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC,MAAM;UACLF,KAAK,CAACf,OAAO,CAAC,CAAC;QACjB;MACF;IACF,CAAC;IACD;EACF,CAAC,EAAE,EAAE,CAAC;EACN,OAAOH,GAAG;AACZ,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../commonjs/hooks.js"],"names":[],"mappings":";AAOA,iEAIC;AAGD;;;;2GAYC;AAED;;;EAUC;AAED,uCAMC;AAED;;;EA0BC;AAED;;;EAUC;AAED,4EAyBC"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../commonjs/hooks.js"],"names":[],"mappings":";AAOA,iEAMC;AAGD;;;;2GAYC;AAED;;;EAUC;AAED,uCAMC;AAED;;;EA0BC;AAED;;;EAUC;AAED,4EAyBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../module/hooks.js"],"names":[],"mappings":"AACO,iEAIN;AAEM;;;;6HAYN;AACM;;;EAUN;AACM,uCAMN;AACM;;;EA0BN;AACM;;;EAUN;AACM,qFAyBN"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../module/hooks.js"],"names":[],"mappings":"AACO,iEAMN;AAEM;;;;6HAYN;AACM;;;EAUN;AACM,uCAMN;AACM;;;EA0BN;AACM;;;EAUN;AACM,qFAyBN"}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEzE,KAAK,WAAW,GAAG,MAAM,IAAI,CAAC;AAE9B,eAAO,MAAM,4BAA4B,GAAI,SAAS,UAAU,SAM/D,CAAC;AAEF,UAAU,aAAa;IACrB,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;CAC5B;AAED,QAAA,MAAM,aAAa,+CAA4C,CAAC;AAEhE,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IACnC,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;CACxC;AAED,eAAO,MAAM,iBAAiB,GAAI,iDAI/B,mBAAmB,uCAQrB,CAAC;AAEF,eAAO,MAAM,UAAU;;;CAOtB,CAAC;AAEF,eAAO,MAAM,aAAa,qBAMzB,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,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AI,CAAC,GAC3B,OAAO,CAAC,IAAI,CAAC,yCA0BlB,CAAC"}
Binary file
@@ -8,7 +8,7 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libwebgpu_dawn.a</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_x86_64-simulator</string>
11
+ <string>macos-arm64_x86_64</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>libwebgpu_dawn.a</string>
14
14
  <key>SupportedArchitectures</key>
@@ -17,9 +17,7 @@
17
17
  <string>x86_64</string>
18
18
  </array>
19
19
  <key>SupportedPlatform</key>
20
- <string>ios</string>
21
- <key>SupportedPlatformVariant</key>
22
- <string>simulator</string>
20
+ <string>macos</string>
23
21
  </dict>
24
22
  <dict>
25
23
  <key>BinaryPath</key>
@@ -39,7 +37,7 @@
39
37
  <key>BinaryPath</key>
40
38
  <string>libwebgpu_dawn.a</string>
41
39
  <key>LibraryIdentifier</key>
42
- <string>macos-arm64_x86_64</string>
40
+ <string>ios-arm64_x86_64-simulator</string>
43
41
  <key>LibraryPath</key>
44
42
  <string>libwebgpu_dawn.a</string>
45
43
  <key>SupportedArchitectures</key>
@@ -48,13 +46,15 @@
48
46
  <string>x86_64</string>
49
47
  </array>
50
48
  <key>SupportedPlatform</key>
51
- <string>macos</string>
49
+ <string>ios</string>
50
+ <key>SupportedPlatformVariant</key>
51
+ <string>simulator</string>
52
52
  </dict>
53
53
  <dict>
54
54
  <key>BinaryPath</key>
55
55
  <string>libwebgpu_dawn.a</string>
56
56
  <key>LibraryIdentifier</key>
57
- <string>xros-arm64-simulator</string>
57
+ <string>ios-arm64</string>
58
58
  <key>LibraryPath</key>
59
59
  <string>libwebgpu_dawn.a</string>
60
60
  <key>SupportedArchitectures</key>
@@ -62,15 +62,13 @@
62
62
  <string>arm64</string>
63
63
  </array>
64
64
  <key>SupportedPlatform</key>
65
- <string>xros</string>
66
- <key>SupportedPlatformVariant</key>
67
- <string>simulator</string>
65
+ <string>ios</string>
68
66
  </dict>
69
67
  <dict>
70
68
  <key>BinaryPath</key>
71
69
  <string>libwebgpu_dawn.a</string>
72
70
  <key>LibraryIdentifier</key>
73
- <string>ios-arm64</string>
71
+ <string>xros-arm64-simulator</string>
74
72
  <key>LibraryPath</key>
75
73
  <string>libwebgpu_dawn.a</string>
76
74
  <key>SupportedArchitectures</key>
@@ -78,7 +76,9 @@
78
76
  <string>arm64</string>
79
77
  </array>
80
78
  <key>SupportedPlatform</key>
81
- <string>ios</string>
79
+ <string>xros</string>
80
+ <key>SupportedPlatformVariant</key>
81
+ <string>simulator</string>
82
82
  </dict>
83
83
  </array>
84
84
  <key>CFBundlePackageType</key>
package/libs/dawn.json CHANGED
@@ -381,7 +381,7 @@
381
381
  "buffer binding type": {
382
382
  "category": "enum",
383
383
  "values": [
384
- {"value": 0, "name": "binding not used"},
384
+ {"value": 0, "name": "binding not used", "jsrepr": "undefined"},
385
385
  {"value": 1, "name": "undefined", "jsrepr": "undefined", "valid": false},
386
386
  {"value": 2, "name": "uniform"},
387
387
  {"value": 3, "name": "storage"},
@@ -401,7 +401,7 @@
401
401
  "sampler binding type": {
402
402
  "category": "enum",
403
403
  "values": [
404
- {"value": 0, "name": "binding not used"},
404
+ {"value": 0, "name": "binding not used", "jsrepr": "undefined"},
405
405
  {"value": 1, "name": "undefined", "jsrepr": "undefined", "valid": false},
406
406
  {"value": 2, "name": "filtering"},
407
407
  {"value": 3, "name": "non filtering"},
@@ -428,7 +428,7 @@
428
428
  "texture sample type": {
429
429
  "category": "enum",
430
430
  "values": [
431
- {"value": 0, "name": "binding not used"},
431
+ {"value": 0, "name": "binding not used", "jsrepr": "undefined"},
432
432
  {"value": 1, "name": "undefined", "jsrepr": "undefined", "valid": false},
433
433
  {"value": 2, "name": "float"},
434
434
  {"value": 3, "name": "unfilterable float"},
@@ -505,7 +505,7 @@
505
505
  "storage texture access": {
506
506
  "category": "enum",
507
507
  "values": [
508
- {"value": 0, "name": "binding not used"},
508
+ {"value": 0, "name": "binding not used", "jsrepr": "undefined"},
509
509
  {"value": 1, "name": "undefined", "jsrepr": "undefined", "valid": false},
510
510
  {"value": 2, "name": "write only"},
511
511
  {"value": 3, "name": "read only"},
@@ -728,6 +728,7 @@
728
728
  },
729
729
  {
730
730
  "name": "get map state",
731
+ "no autolock": true,
731
732
  "returns": "buffer map state"
732
733
  },
733
734
  {
@@ -2139,6 +2140,15 @@
2139
2140
  {"name": "signaled values", "type": "uint64_t", "annotation": "const*", "length": "fence count"}
2140
2141
  ]
2141
2142
  },
2143
+ "shared texture memory metal end access state": {
2144
+ "category": "structure",
2145
+ "chained": "out",
2146
+ "chain roots": ["shared texture memory end access state"],
2147
+ "tags": ["dawn", "native"],
2148
+ "members": [
2149
+ {"name": "commands scheduled future", "type": "future"}
2150
+ ]
2151
+ },
2142
2152
  "shared texture memory vk image layout begin state": {
2143
2153
  "category": "structure",
2144
2154
  "chained": "in",
@@ -2440,8 +2450,9 @@
2440
2450
  {"value": 55, "name": "chromium experimental subgroup matrix", "tags": ["dawn"]},
2441
2451
  {"value": 56, "name": "shared fence EGL sync", "tags": ["dawn", "native"]},
2442
2452
  {"value": 57, "name": "dawn device allocator control", "tags": ["dawn"]},
2443
- {"value": 58, "name": "texture component swizzle", "tags": ["dawn"]},
2444
- {"value": 60, "name": "chromium experimental bindless", "tags": ["dawn"]}
2453
+ {"value": 58, "name": "texture component swizzle", "tags": ["dawn", "emscripten"]},
2454
+ {"value": 60, "name": "chromium experimental bindless", "tags": ["dawn"]},
2455
+ {"value": 61, "name": "adapter properties WGPU", "tags": ["dawn"]}
2445
2456
  ]
2446
2457
  },
2447
2458
  "filter mode": {
@@ -3167,11 +3178,6 @@
3167
3178
  {"name": "timestamp writes", "type": "pass timestamp writes", "annotation": "const*", "optional": true}
3168
3179
  ]
3169
3180
  },
3170
- "render pass descriptor max draw count": {
3171
- "category": "typedef",
3172
- "type": "render pass max draw count",
3173
- "tags": ["dawn"]
3174
- },
3175
3181
  "render pass max draw count": {
3176
3182
  "category": "structure",
3177
3183
  "chained": "in",
@@ -3623,11 +3629,6 @@
3623
3629
  {"name": "label", "type": "string view", "optional": true}
3624
3630
  ]
3625
3631
  },
3626
- "shader module SPIRV descriptor": {
3627
- "category": "typedef",
3628
- "type": "shader source SPIRV",
3629
- "tags": ["dawn"]
3630
- },
3631
3632
  "shader source SPIRV": {
3632
3633
  "category": "structure",
3633
3634
  "chained": "in",
@@ -3637,11 +3638,6 @@
3637
3638
  {"name": "code", "type": "uint32_t", "annotation": "const*", "length": "code size"}
3638
3639
  ]
3639
3640
  },
3640
- "shader module WGSL descriptor": {
3641
- "category": "typedef",
3642
- "type": "shader source WGSL",
3643
- "tags": ["dawn"]
3644
- },
3645
3641
  "shader source WGSL": {
3646
3642
  "category": "structure",
3647
3643
  "chained": "in",
@@ -3749,11 +3745,6 @@
3749
3745
  {"name": "label", "type": "string view", "optional": true}
3750
3746
  ]
3751
3747
  },
3752
- "surface descriptor from android native window": {
3753
- "category": "typedef",
3754
- "type": "surface source android native window",
3755
- "tags": ["art", "native", "dawn"]
3756
- },
3757
3748
  "surface source android native window": {
3758
3749
  "category": "structure",
3759
3750
  "chained": "in",
@@ -3772,11 +3763,6 @@
3772
3763
  {"name": "selector", "type": "string view"}
3773
3764
  ]
3774
3765
  },
3775
- "surface descriptor from metal layer": {
3776
- "category": "typedef",
3777
- "type": "surface source metal layer",
3778
- "tags": ["native", "dawn"]
3779
- },
3780
3766
  "surface source metal layer": {
3781
3767
  "category": "structure",
3782
3768
  "chained": "in",
@@ -3786,11 +3772,6 @@
3786
3772
  {"name": "layer", "type": "void", "annotation": "*"}
3787
3773
  ]
3788
3774
  },
3789
- "surface descriptor from windows HWND": {
3790
- "category": "typedef",
3791
- "type": "surface source windows HWND",
3792
- "tags": ["native", "dawn"]
3793
- },
3794
3775
  "surface source windows HWND": {
3795
3776
  "category": "structure",
3796
3777
  "chained": "in",
@@ -3801,11 +3782,6 @@
3801
3782
  {"name": "hwnd", "type": "void", "annotation": "*"}
3802
3783
  ]
3803
3784
  },
3804
- "surface descriptor from xcb window": {
3805
- "category": "typedef",
3806
- "type": "surface source XCB window",
3807
- "tags": ["native", "dawn"]
3808
- },
3809
3785
  "surface source XCB window": {
3810
3786
  "category": "structure",
3811
3787
  "chained": "in",
@@ -3816,11 +3792,6 @@
3816
3792
  {"name": "window", "type": "uint32_t"}
3817
3793
  ]
3818
3794
  },
3819
- "surface descriptor from xlib window": {
3820
- "category": "typedef",
3821
- "type": "surface source xlib window",
3822
- "tags": ["native", "dawn"]
3823
- },
3824
3795
  "surface source xlib window": {
3825
3796
  "category": "structure",
3826
3797
  "chained": "in",
@@ -3831,11 +3802,6 @@
3831
3802
  {"name": "window", "type": "uint64_t"}
3832
3803
  ]
3833
3804
  },
3834
- "surface descriptor from wayland surface": {
3835
- "category": "typedef",
3836
- "type": "surface source wayland surface",
3837
- "tags": ["native", "dawn"]
3838
- },
3839
3805
  "surface source wayland surface": {
3840
3806
  "category": "structure",
3841
3807
  "chained": "in",
@@ -3996,14 +3962,16 @@
3996
3962
  {"value": 68, "name": "render pass descriptor resolve rect", "tags": ["dawn"]},
3997
3963
  {"value": 69, "name": "request adapter WebGPU backend options", "tags": ["dawn", "native"]},
3998
3964
  {"value": 70, "name": "dawn fake device initialize error for testing", "tags": ["dawn"]},
3999
- {"value": 71, "name": "texture component swizzle descriptor", "tags": ["dawn"]},
3965
+ {"value": 71, "name": "texture component swizzle descriptor", "tags": ["dawn", "emscripten"]},
4000
3966
  {"value": 72, "name": "shared texture memory D3D11 begin state", "tags": ["dawn", "native"]},
4001
3967
  {"value": 73, "name": "dawn consume adapter descriptor", "tags": ["dawn"]},
4002
3968
  {"value": 74, "name": "bind group layout dynamic binding array", "tags": ["dawn"]},
4003
3969
  {"value": 75, "name": "dynamic binding array limits", "tags": ["dawn"]},
4004
3970
  {"value": 76, "name": "bind group dynamic binding array", "tags": ["dawn"]},
4005
3971
  {"value": 77, "name": "texel buffer binding entry", "tags": ["dawn"]},
4006
- {"value": 78, "name": "texel buffer binding layout", "tags": ["dawn"]}
3972
+ {"value": 78, "name": "texel buffer binding layout", "tags": ["dawn"]},
3973
+ {"value": 79, "name": "shared texture memory metal end access state", "tags": ["dawn", "native"]},
3974
+ {"value": 80, "name": "adapter properties WGPU", "tags": ["dawn"]}
4007
3975
  ]
4008
3976
  },
4009
3977
  "texture": {
@@ -4314,7 +4282,7 @@
4314
4282
  },
4315
4283
  "texture component swizzle descriptor": {
4316
4284
  "category": "structure",
4317
- "tags": ["dawn"],
4285
+ "tags": ["dawn", "emscripten"],
4318
4286
  "chained": "in",
4319
4287
  "chain roots": ["texture view descriptor"],
4320
4288
  "members": [
@@ -4358,7 +4326,7 @@
4358
4326
  },
4359
4327
  "texture component swizzle": {
4360
4328
  "category": "structure",
4361
- "tags": ["dawn"],
4329
+ "tags": ["dawn", "emscripten"],
4362
4330
  "extensible": false,
4363
4331
  "members": [
4364
4332
  {"name": "r", "type": "component swizzle", "default": "r"},
@@ -4369,15 +4337,15 @@
4369
4337
  },
4370
4338
  "component swizzle": {
4371
4339
  "category": "enum",
4372
- "tags": ["dawn"],
4340
+ "tags": ["dawn", "emscripten"],
4373
4341
  "values": [
4374
4342
  {"value": 0, "name": "undefined", "jsrepr": "undefined"},
4375
- {"value": 1, "name": "zero"},
4376
- {"value": 2, "name": "one"},
4377
- {"value": 3, "name": "r"},
4378
- {"value": 4, "name": "g"},
4379
- {"value": 5, "name": "b"},
4380
- {"value": 6, "name": "a"}
4343
+ {"value": 1, "name": "zero", "jsrepr": "'0'"},
4344
+ {"value": 2, "name": "one", "jsrepr": "'1'"},
4345
+ {"value": 3, "name": "r", "jsrepr": "'r'"},
4346
+ {"value": 4, "name": "g", "jsrepr": "'g'"},
4347
+ {"value": 5, "name": "b", "jsrepr": "'b'"},
4348
+ {"value": 6, "name": "a", "jsrepr": "'a'"}
4381
4349
  ]
4382
4350
  },
4383
4351
  "y cb cr vk descriptor": {
@@ -4647,6 +4615,15 @@
4647
4615
  {"name": "driver version", "type": "uint32_t"}
4648
4616
  ]
4649
4617
  },
4618
+ "adapter properties WGPU": {
4619
+ "category": "structure",
4620
+ "chained": "out",
4621
+ "chain roots": ["adapter info"],
4622
+ "tags": ["dawn"],
4623
+ "members": [
4624
+ {"name": "backend type", "type": "backend type"}
4625
+ ]
4626
+ },
4650
4627
  "dawn buffer descriptor error info from wire client": {
4651
4628
  "category": "structure",
4652
4629
  "chained": "in",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-wgpu",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "React Native WebGPU",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -63,7 +63,7 @@
63
63
  "@types/react": "^18.2.44",
64
64
  "@types/seedrandom": "^3.0.8",
65
65
  "@types/ws": "^8.5.10",
66
- "@webgpu/types": "0.1.51",
66
+ "@webgpu/types": "0.1.65",
67
67
  "clang-format": "^1.8.0",
68
68
  "del-cli": "^5.1.0",
69
69
  "eslint": "9.35.0",
@@ -76,7 +76,7 @@
76
76
  "pixelmatch": "5.3.0",
77
77
  "pngjs": "^7.0.0",
78
78
  "prettier": "^3.0.3",
79
- "puppeteer": "22",
79
+ "puppeteer": "24.24.1",
80
80
  "react": "19.1.0",
81
81
  "react-native": "0.81.4",
82
82
  "react-native-builder-bob": "^0.23.2",
@@ -74,7 +74,9 @@ describe("Adapter", () => {
74
74
  });
75
75
  it("isFallback", async () => {
76
76
  const result = await client.eval(({ gpu }) => {
77
- return gpu.requestAdapter().then((adapter) => adapter!.isFallbackAdapter);
77
+ return gpu
78
+ .requestAdapter()
79
+ .then((adapter) => adapter && adapter.info.isFallbackAdapter);
78
80
  });
79
81
  expect(result).toBe(false);
80
82
  });
@@ -6,8 +6,6 @@ import {
6
6
  } from "../components/Wireframe/Shaders";
7
7
  import { client } from "../setup";
8
8
 
9
- type TypedArrayView = Float32Array | Uint32Array;
10
-
11
9
  type Model = {
12
10
  vertexBuffer: GPUBuffer;
13
11
  indexBuffer: GPUBuffer;
@@ -65,14 +63,14 @@ describe("Wireframe", () => {
65
63
  function createBufferWithData(
66
64
  // eslint-disable-next-line @typescript-eslint/no-shadow
67
65
  device: GPUDevice,
68
- data: TypedArrayView,
66
+ data: Float32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>,
69
67
  usage: GPUBufferUsageFlags,
70
68
  ) {
71
69
  const buffer = device.createBuffer({
72
70
  size: data.byteLength,
73
71
  usage,
74
72
  });
75
- device.queue.writeBuffer(buffer, 0, data);
73
+ device.queue.writeBuffer(buffer, 0, data.buffer);
76
74
  return buffer;
77
75
  }
78
76
 
package/src/hooks.tsx CHANGED
@@ -6,7 +6,9 @@ import type { RNCanvasContext, CanvasRef, NativeCanvas } from "./Canvas";
6
6
  type Unsubscribe = () => void;
7
7
 
8
8
  export const warnIfNotHardwareAccelerated = (adapter: GPUAdapter) => {
9
- if (adapter.isFallbackAdapter) {
9
+ // Check if adapter is a fallback adapter using the new GPUAdapterInfo API
10
+ // Note: isFallbackAdapter was moved from GPUAdapter to GPUAdapterInfo in Chrome 140
11
+ if (adapter.info && adapter.info.isFallbackAdapter) {
10
12
  console.warn(
11
13
  "GPUAdapter is not hardware accelerated. This is common on Android emulators. Rendering will be slow. Some features may be unavailable.",
12
14
  );