react-native-wgpu 0.1.22 → 0.2.0
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.
- package/cpp/dawn/dawn_proc_table.h +17 -25
- package/cpp/dawn/native/D3D11Backend.h +7 -0
- package/cpp/dawn/native/DawnNative.h +70 -26
- package/cpp/dawn/native/WebGPUBackend.h +35 -0
- package/cpp/dawn/platform/DawnPlatform.h +1 -0
- package/cpp/dawn/webgpu_cpp_print.h +338 -293
- package/cpp/dawn_logging.cpp +122 -0
- package/cpp/rnwgpu/SurfaceRegistry.h +3 -2
- package/cpp/rnwgpu/api/Convertors.h +38 -42
- package/cpp/rnwgpu/api/GPU.cpp +20 -18
- package/cpp/rnwgpu/api/GPU.h +6 -2
- package/cpp/rnwgpu/api/GPUAdapter.cpp +49 -40
- package/cpp/rnwgpu/api/GPUBuffer.cpp +21 -19
- package/cpp/rnwgpu/api/GPUCanvasContext.cpp +1 -0
- package/cpp/rnwgpu/api/GPUCommandEncoder.cpp +6 -6
- package/cpp/rnwgpu/api/GPUCompilationInfo.h +0 -9
- package/cpp/rnwgpu/api/GPUDevice.cpp +7 -10
- package/cpp/rnwgpu/api/GPUFeatures.h +5 -14
- package/cpp/rnwgpu/api/GPUQueue.cpp +4 -4
- package/cpp/rnwgpu/api/GPUShaderModule.cpp +0 -3
- package/cpp/rnwgpu/api/GPUSupportedLimits.cpp +31 -35
- package/cpp/rnwgpu/api/GPUSupportedLimits.h +3 -7
- package/cpp/rnwgpu/api/descriptors/Unions.h +257 -4
- package/cpp/webgpu/webgpu.h +2197 -1863
- package/cpp/webgpu/webgpu_cpp.h +2800 -2479
- package/cpp/webgpu/webgpu_cpp_print.h +33 -0
- package/cpp/webgpu/webgpu_glfw.h +17 -0
- package/lib/typescript/src/__tests__/components/meshes/mesh.d.ts.map +1 -1
- package/lib/typescript/src/__tests__/setup.d.ts.map +1 -1
- package/lib/typescript/src/hooks.d.ts.map +1 -1
- package/libs/android/arm64-v8a/libwebgpu_dawn.so +0 -0
- package/libs/android/armeabi-v7a/libwebgpu_dawn.so +0 -0
- package/libs/android/x86/libwebgpu_dawn.so +0 -0
- package/libs/android/x86_64/libwebgpu_dawn.so +0 -0
- package/libs/apple/arm64_iphoneos/libwebgpu_dawn.a +0 -0
- package/libs/apple/arm64_iphonesimulator/libwebgpu_dawn.a +0 -0
- package/libs/apple/arm64_xros/libwebgpu_dawn.a +0 -0
- package/libs/apple/arm64_xrsimulator/libwebgpu_dawn.a +0 -0
- package/libs/apple/iphonesimulator/libwebgpu_dawn.a +0 -0
- package/libs/apple/libwebgpu_dawn.xcframework/Info.plist +11 -11
- package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/libwebgpu_dawn.a +0 -0
- package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/libwebgpu_dawn.a +0 -0
- package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/libwebgpu_dawn.a +0 -0
- package/libs/apple/libwebgpu_dawn.xcframework/xros-arm64/libwebgpu_dawn.a +0 -0
- package/libs/apple/libwebgpu_dawn.xcframework/xros-arm64-simulator/libwebgpu_dawn.a +0 -0
- package/libs/apple/universal_macosx/libwebgpu_dawn.a +0 -0
- package/libs/apple/x86_64_iphonesimulator/libwebgpu_dawn.a +0 -0
- package/libs/dawn.json +659 -798
- package/package.json +4 -4
|
@@ -22,9 +22,6 @@ struct GPUCompilationMessage {
|
|
|
22
22
|
uint64_t linePos;
|
|
23
23
|
uint64_t offset;
|
|
24
24
|
uint64_t length;
|
|
25
|
-
uint64_t utf16LinePos;
|
|
26
|
-
uint64_t utf16Offset;
|
|
27
|
-
uint64_t utf16Length;
|
|
28
25
|
};
|
|
29
26
|
|
|
30
27
|
class GPUCompilationInfo : public m::HybridObject {
|
|
@@ -75,12 +72,6 @@ template <> struct JSIConverter<std::vector<rnwgpu::GPUCompilationMessage>> {
|
|
|
75
72
|
static_cast<double>(message.offset));
|
|
76
73
|
messageObj.setProperty(runtime, "length",
|
|
77
74
|
static_cast<double>(message.length));
|
|
78
|
-
messageObj.setProperty(runtime, "utf16LinePos",
|
|
79
|
-
static_cast<double>(message.utf16LinePos));
|
|
80
|
-
messageObj.setProperty(runtime, "utf16Offset",
|
|
81
|
-
static_cast<double>(message.utf16Offset));
|
|
82
|
-
messageObj.setProperty(runtime, "utf16Length",
|
|
83
|
-
static_cast<double>(message.utf16Length));
|
|
84
75
|
result.setValueAtIndex(runtime, i, messageObj);
|
|
85
76
|
}
|
|
86
77
|
return result;
|
|
@@ -22,7 +22,7 @@ GPUDevice::createBuffer(std::shared_ptr<GPUBufferDescriptor> descriptor) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
std::shared_ptr<GPUSupportedLimits> GPUDevice::getLimits() {
|
|
25
|
-
wgpu::
|
|
25
|
+
wgpu::Limits limits{};
|
|
26
26
|
if (!_instance.GetLimits(&limits)) {
|
|
27
27
|
throw std::runtime_error("failed to get device limits");
|
|
28
28
|
}
|
|
@@ -301,9 +301,8 @@ GPUDevice::popErrorScope() {
|
|
|
301
301
|
break;
|
|
302
302
|
}
|
|
303
303
|
case wgpu::ErrorType::Unknown:
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
message);
|
|
304
|
+
result =
|
|
305
|
+
std::make_shared<GPUError>(wgpu::ErrorType::Unknown, message);
|
|
307
306
|
break;
|
|
308
307
|
default:
|
|
309
308
|
throw std::runtime_error(
|
|
@@ -321,13 +320,11 @@ GPUDevice::popErrorScope() {
|
|
|
321
320
|
}
|
|
322
321
|
|
|
323
322
|
std::unordered_set<std::string> GPUDevice::getFeatures() {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
if (count > 0) {
|
|
327
|
-
_instance.EnumerateFeatures(features.data());
|
|
328
|
-
}
|
|
323
|
+
wgpu::SupportedFeatures supportedFeatures;
|
|
324
|
+
_instance.GetFeatures(&supportedFeatures);
|
|
329
325
|
std::unordered_set<std::string> result;
|
|
330
|
-
for (
|
|
326
|
+
for (size_t i = 0; i < supportedFeatures.featureCount; ++i) {
|
|
327
|
+
auto feature = supportedFeatures.features[i];
|
|
331
328
|
std::string name;
|
|
332
329
|
convertEnumToJSUnion(feature, &name);
|
|
333
330
|
result.insert(name);
|
|
@@ -47,9 +47,6 @@ static void convertEnumToJSUnion(wgpu::FeatureName inEnum,
|
|
|
47
47
|
case wgpu::FeatureName::Subgroups:
|
|
48
48
|
*outUnion = "subgroups";
|
|
49
49
|
break;
|
|
50
|
-
case wgpu::FeatureName::SubgroupsF16:
|
|
51
|
-
*outUnion = "subgroups-f16";
|
|
52
|
-
break;
|
|
53
50
|
case wgpu::FeatureName::DawnInternalUsages:
|
|
54
51
|
*outUnion = "dawn-internal-usages";
|
|
55
52
|
break;
|
|
@@ -65,9 +62,6 @@ static void convertEnumToJSUnion(wgpu::FeatureName inEnum,
|
|
|
65
62
|
case wgpu::FeatureName::ImplicitDeviceSynchronization:
|
|
66
63
|
*outUnion = "implicit-device-synchronization";
|
|
67
64
|
break;
|
|
68
|
-
// case wgpu::FeatureName::SurfaceCapabilities:
|
|
69
|
-
// *outUnion = "surface-capabilities";
|
|
70
|
-
// break;
|
|
71
65
|
case wgpu::FeatureName::TransientAttachments:
|
|
72
66
|
*outUnion = "transient-attachments";
|
|
73
67
|
break;
|
|
@@ -83,11 +77,8 @@ static void convertEnumToJSUnion(wgpu::FeatureName inEnum,
|
|
|
83
77
|
case wgpu::FeatureName::ANGLETextureSharing:
|
|
84
78
|
*outUnion = "angle-texture-sharing";
|
|
85
79
|
break;
|
|
86
|
-
case wgpu::FeatureName::
|
|
87
|
-
*outUnion = "chromium-experimental-subgroups";
|
|
88
|
-
break;
|
|
89
|
-
case wgpu::FeatureName::ChromiumExperimentalSubgroupUniformControlFlow:
|
|
90
|
-
*outUnion = "chromium-experimental-subgroup-uniform-control-flow";
|
|
80
|
+
case wgpu::FeatureName::ChromiumExperimentalSubgroupMatrix:
|
|
81
|
+
*outUnion = "chromium-experimental-subgroups-matrix";
|
|
91
82
|
break;
|
|
92
83
|
case wgpu::FeatureName::PixelLocalStorageCoherent:
|
|
93
84
|
*outUnion = "pixel-local-storage-coherent";
|
|
@@ -134,10 +125,10 @@ static void convertEnumToJSUnion(wgpu::FeatureName inEnum,
|
|
|
134
125
|
case wgpu::FeatureName::R8UnormStorage:
|
|
135
126
|
*outUnion = "r8unorm-storage";
|
|
136
127
|
break;
|
|
137
|
-
case wgpu::FeatureName::
|
|
128
|
+
case wgpu::FeatureName::DawnFormatCapabilities:
|
|
138
129
|
*outUnion = "format-capabilities";
|
|
139
130
|
break;
|
|
140
|
-
case wgpu::FeatureName::
|
|
131
|
+
case wgpu::FeatureName::DawnDrmFormatCapabilities:
|
|
141
132
|
*outUnion = "drm-format-capabilities";
|
|
142
133
|
break;
|
|
143
134
|
case wgpu::FeatureName::Norm16TextureFormats:
|
|
@@ -185,7 +176,7 @@ static void convertEnumToJSUnion(wgpu::FeatureName inEnum,
|
|
|
185
176
|
case wgpu::FeatureName::SharedFenceVkSemaphoreOpaqueFD:
|
|
186
177
|
*outUnion = "shared-fence-vk-semaphore-opaque-fd";
|
|
187
178
|
break;
|
|
188
|
-
case wgpu::FeatureName::
|
|
179
|
+
case wgpu::FeatureName::SharedFenceSyncFD:
|
|
189
180
|
*outUnion = "shared-fence-vk-semaphore-sync-fd";
|
|
190
181
|
break;
|
|
191
182
|
case wgpu::FeatureName::SharedFenceVkSemaphoreZirconHandle:
|
|
@@ -87,8 +87,8 @@ void GPUQueue::copyExternalImageToTexture(
|
|
|
87
87
|
std::shared_ptr<GPUImageCopyExternalImage> source,
|
|
88
88
|
std::shared_ptr<GPUImageCopyTextureTagged> destination,
|
|
89
89
|
std::shared_ptr<GPUExtent3D> size) {
|
|
90
|
-
wgpu::
|
|
91
|
-
wgpu::
|
|
90
|
+
wgpu::TexelCopyTextureInfo dst{};
|
|
91
|
+
wgpu::TexelCopyBufferLayout layout{};
|
|
92
92
|
wgpu::Extent3D sz{};
|
|
93
93
|
Convertor conv;
|
|
94
94
|
uint32_t bytesPerPixel =
|
|
@@ -137,8 +137,8 @@ void GPUQueue::writeTexture(std::shared_ptr<GPUImageCopyTexture> destination,
|
|
|
137
137
|
std::shared_ptr<ArrayBuffer> data,
|
|
138
138
|
std::shared_ptr<GPUImageDataLayout> dataLayout,
|
|
139
139
|
std::shared_ptr<GPUExtent3D> size) {
|
|
140
|
-
wgpu::
|
|
141
|
-
wgpu::
|
|
140
|
+
wgpu::TexelCopyTextureInfo dst{};
|
|
141
|
+
wgpu::TexelCopyBufferLayout layout{};
|
|
142
142
|
wgpu::Extent3D sz{};
|
|
143
143
|
Convertor conv;
|
|
144
144
|
if (!conv(dst, destination) || //
|
|
@@ -25,9 +25,6 @@ GPUShaderModule::getCompilationInfo() {
|
|
|
25
25
|
message.linePos = wgpuMessage.linePos;
|
|
26
26
|
message.offset = wgpuMessage.offset;
|
|
27
27
|
message.length = wgpuMessage.length;
|
|
28
|
-
message.utf16LinePos = wgpuMessage.utf16LinePos;
|
|
29
|
-
message.utf16Offset = wgpuMessage.utf16Offset;
|
|
30
|
-
message.utf16Length = wgpuMessage.utf16Length;
|
|
31
28
|
result->_messages.push_back(std::move(message));
|
|
32
29
|
}
|
|
33
30
|
}
|
|
@@ -3,131 +3,127 @@
|
|
|
3
3
|
namespace rnwgpu {
|
|
4
4
|
|
|
5
5
|
double GPUSupportedLimits::getMaxTextureDimension1D() {
|
|
6
|
-
return _instance.
|
|
6
|
+
return _instance.maxTextureDimension1D;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
double GPUSupportedLimits::getMaxTextureDimension2D() {
|
|
10
|
-
return _instance.
|
|
10
|
+
return _instance.maxTextureDimension2D;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
double GPUSupportedLimits::getMaxTextureDimension3D() {
|
|
14
|
-
return _instance.
|
|
14
|
+
return _instance.maxTextureDimension3D;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
double GPUSupportedLimits::getMaxTextureArrayLayers() {
|
|
18
|
-
return _instance.
|
|
18
|
+
return _instance.maxTextureArrayLayers;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
double GPUSupportedLimits::getMaxBindGroups() {
|
|
22
|
-
return _instance.
|
|
22
|
+
return _instance.maxBindGroups;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
double GPUSupportedLimits::getMaxBindGroupsPlusVertexBuffers() {
|
|
26
|
-
return _instance.
|
|
26
|
+
return _instance.maxBindGroupsPlusVertexBuffers;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
double GPUSupportedLimits::getMaxBindingsPerBindGroup() {
|
|
30
|
-
return _instance.
|
|
30
|
+
return _instance.maxBindingsPerBindGroup;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
double GPUSupportedLimits::getMaxDynamicUniformBuffersPerPipelineLayout() {
|
|
34
|
-
return _instance.
|
|
34
|
+
return _instance.maxDynamicUniformBuffersPerPipelineLayout;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
double GPUSupportedLimits::getMaxDynamicStorageBuffersPerPipelineLayout() {
|
|
38
|
-
return _instance.
|
|
38
|
+
return _instance.maxDynamicStorageBuffersPerPipelineLayout;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
double GPUSupportedLimits::getMaxSampledTexturesPerShaderStage() {
|
|
42
|
-
return _instance.
|
|
42
|
+
return _instance.maxSampledTexturesPerShaderStage;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
double GPUSupportedLimits::getMaxSamplersPerShaderStage() {
|
|
46
|
-
return _instance.
|
|
46
|
+
return _instance.maxSamplersPerShaderStage;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
double GPUSupportedLimits::getMaxStorageBuffersPerShaderStage() {
|
|
50
|
-
return _instance.
|
|
50
|
+
return _instance.maxStorageBuffersPerShaderStage;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
double GPUSupportedLimits::getMaxStorageTexturesPerShaderStage() {
|
|
54
|
-
return _instance.
|
|
54
|
+
return _instance.maxStorageTexturesPerShaderStage;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
double GPUSupportedLimits::getMaxUniformBuffersPerShaderStage() {
|
|
58
|
-
return _instance.
|
|
58
|
+
return _instance.maxUniformBuffersPerShaderStage;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
double GPUSupportedLimits::getMaxUniformBufferBindingSize() {
|
|
62
|
-
return _instance.
|
|
62
|
+
return _instance.maxUniformBufferBindingSize;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
double GPUSupportedLimits::getMaxStorageBufferBindingSize() {
|
|
66
|
-
return _instance.
|
|
66
|
+
return _instance.maxStorageBufferBindingSize;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
double GPUSupportedLimits::getMinUniformBufferOffsetAlignment() {
|
|
70
|
-
return _instance.
|
|
70
|
+
return _instance.minUniformBufferOffsetAlignment;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
double GPUSupportedLimits::getMinStorageBufferOffsetAlignment() {
|
|
74
|
-
return _instance.
|
|
74
|
+
return _instance.minStorageBufferOffsetAlignment;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
double GPUSupportedLimits::getMaxVertexBuffers() {
|
|
78
|
-
return _instance.
|
|
78
|
+
return _instance.maxVertexBuffers;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
double GPUSupportedLimits::getMaxBufferSize() {
|
|
82
|
-
return _instance.
|
|
82
|
+
return _instance.maxBufferSize;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
double GPUSupportedLimits::getMaxVertexAttributes() {
|
|
86
|
-
return _instance.
|
|
86
|
+
return _instance.maxVertexAttributes;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
double GPUSupportedLimits::getMaxVertexBufferArrayStride() {
|
|
90
|
-
return _instance.
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
double GPUSupportedLimits::getMaxInterStageShaderComponents() {
|
|
94
|
-
return _instance.limits.maxInterStageShaderComponents;
|
|
90
|
+
return _instance.maxVertexBufferArrayStride;
|
|
95
91
|
}
|
|
96
92
|
|
|
97
93
|
double GPUSupportedLimits::getMaxInterStageShaderVariables() {
|
|
98
|
-
return _instance.
|
|
94
|
+
return _instance.maxInterStageShaderVariables;
|
|
99
95
|
}
|
|
100
96
|
|
|
101
97
|
double GPUSupportedLimits::getMaxColorAttachments() {
|
|
102
|
-
return _instance.
|
|
98
|
+
return _instance.maxColorAttachments;
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
double GPUSupportedLimits::getMaxColorAttachmentBytesPerSample() {
|
|
106
|
-
return _instance.
|
|
102
|
+
return _instance.maxColorAttachmentBytesPerSample;
|
|
107
103
|
}
|
|
108
104
|
|
|
109
105
|
double GPUSupportedLimits::getMaxComputeWorkgroupStorageSize() {
|
|
110
|
-
return _instance.
|
|
106
|
+
return _instance.maxComputeWorkgroupStorageSize;
|
|
111
107
|
}
|
|
112
108
|
|
|
113
109
|
double GPUSupportedLimits::getMaxComputeInvocationsPerWorkgroup() {
|
|
114
|
-
return _instance.
|
|
110
|
+
return _instance.maxComputeInvocationsPerWorkgroup;
|
|
115
111
|
}
|
|
116
112
|
|
|
117
113
|
double GPUSupportedLimits::getMaxComputeWorkgroupSizeX() {
|
|
118
|
-
return _instance.
|
|
114
|
+
return _instance.maxComputeWorkgroupSizeX;
|
|
119
115
|
}
|
|
120
116
|
|
|
121
117
|
double GPUSupportedLimits::getMaxComputeWorkgroupSizeY() {
|
|
122
|
-
return _instance.
|
|
118
|
+
return _instance.maxComputeWorkgroupSizeY;
|
|
123
119
|
}
|
|
124
120
|
|
|
125
121
|
double GPUSupportedLimits::getMaxComputeWorkgroupSizeZ() {
|
|
126
|
-
return _instance.
|
|
122
|
+
return _instance.maxComputeWorkgroupSizeZ;
|
|
127
123
|
}
|
|
128
124
|
|
|
129
125
|
double GPUSupportedLimits::getMaxComputeWorkgroupsPerDimension() {
|
|
130
|
-
return _instance.
|
|
126
|
+
return _instance.maxComputeWorkgroupsPerDimension;
|
|
131
127
|
}
|
|
132
128
|
|
|
133
129
|
} // namespace rnwgpu
|
|
@@ -16,7 +16,7 @@ namespace m = margelo;
|
|
|
16
16
|
|
|
17
17
|
class GPUSupportedLimits : public m::HybridObject {
|
|
18
18
|
public:
|
|
19
|
-
explicit GPUSupportedLimits(wgpu::
|
|
19
|
+
explicit GPUSupportedLimits(wgpu::Limits instance)
|
|
20
20
|
: HybridObject("GPUSupportedLimits"), _instance(instance) {}
|
|
21
21
|
|
|
22
22
|
public:
|
|
@@ -44,7 +44,6 @@ public:
|
|
|
44
44
|
double getMaxBufferSize();
|
|
45
45
|
double getMaxVertexAttributes();
|
|
46
46
|
double getMaxVertexBufferArrayStride();
|
|
47
|
-
double getMaxInterStageShaderComponents();
|
|
48
47
|
double getMaxInterStageShaderVariables();
|
|
49
48
|
double getMaxColorAttachments();
|
|
50
49
|
double getMaxColorAttachmentBytesPerSample();
|
|
@@ -117,9 +116,6 @@ public:
|
|
|
117
116
|
registerHybridGetter("maxVertexBufferArrayStride",
|
|
118
117
|
&GPUSupportedLimits::getMaxVertexBufferArrayStride,
|
|
119
118
|
this);
|
|
120
|
-
registerHybridGetter("maxInterStageShaderComponents",
|
|
121
|
-
&GPUSupportedLimits::getMaxInterStageShaderComponents,
|
|
122
|
-
this);
|
|
123
119
|
registerHybridGetter("maxInterStageShaderVariables",
|
|
124
120
|
&GPUSupportedLimits::getMaxInterStageShaderVariables,
|
|
125
121
|
this);
|
|
@@ -148,10 +144,10 @@ public:
|
|
|
148
144
|
&GPUSupportedLimits::getMaxComputeWorkgroupsPerDimension, this);
|
|
149
145
|
}
|
|
150
146
|
|
|
151
|
-
inline const wgpu::
|
|
147
|
+
inline const wgpu::Limits get() { return _instance; }
|
|
152
148
|
|
|
153
149
|
private:
|
|
154
|
-
wgpu::
|
|
150
|
+
wgpu::Limits _instance;
|
|
155
151
|
};
|
|
156
152
|
|
|
157
153
|
} // namespace rnwgpu
|
|
@@ -432,10 +432,110 @@ static void convertJSUnionToEnum(const std::string &inUnion,
|
|
|
432
432
|
*outEnum = wgpu::FeatureName::BGRA8UnormStorage;
|
|
433
433
|
} else if (inUnion == "float32-filterable") {
|
|
434
434
|
*outEnum = wgpu::FeatureName::Float32Filterable;
|
|
435
|
-
} else if (inUnion == "
|
|
436
|
-
*outEnum = wgpu::FeatureName::
|
|
435
|
+
} else if (inUnion == "subgroups") {
|
|
436
|
+
*outEnum = wgpu::FeatureName::Subgroups;
|
|
437
|
+
} else if (inUnion == "dawn-internal-usages") {
|
|
438
|
+
*outEnum = wgpu::FeatureName::DawnInternalUsages;
|
|
439
|
+
} else if (inUnion == "dawn-multi-planar-formats") {
|
|
440
|
+
*outEnum = wgpu::FeatureName::DawnMultiPlanarFormats;
|
|
441
|
+
} else if (inUnion == "dawn-native") {
|
|
442
|
+
*outEnum = wgpu::FeatureName::DawnNative;
|
|
443
|
+
} else if (inUnion == "chromium-experimental-timestamp-query-inside-passes") {
|
|
444
|
+
*outEnum = wgpu::FeatureName::ChromiumExperimentalTimestampQueryInsidePasses;
|
|
445
|
+
} else if (inUnion == "implicit-device-synchronization") {
|
|
446
|
+
*outEnum = wgpu::FeatureName::ImplicitDeviceSynchronization;
|
|
447
|
+
} else if (inUnion == "transient-attachments") {
|
|
448
|
+
*outEnum = wgpu::FeatureName::TransientAttachments;
|
|
449
|
+
} else if (inUnion == "msaa-render-to-single-sampled") {
|
|
450
|
+
*outEnum = wgpu::FeatureName::MSAARenderToSingleSampled;
|
|
437
451
|
} else if (inUnion == "dual-source-blending") {
|
|
438
452
|
*outEnum = wgpu::FeatureName::DualSourceBlending;
|
|
453
|
+
} else if (inUnion == "d3d11-multithread-protected") {
|
|
454
|
+
*outEnum = wgpu::FeatureName::D3D11MultithreadProtected;
|
|
455
|
+
} else if (inUnion == "angle-texture-sharing") {
|
|
456
|
+
*outEnum = wgpu::FeatureName::ANGLETextureSharing;
|
|
457
|
+
} else if (inUnion == "chromium-experimental-subgroups-matrix") {
|
|
458
|
+
*outEnum = wgpu::FeatureName::ChromiumExperimentalSubgroupMatrix;
|
|
459
|
+
} else if (inUnion == "pixel-local-storage-coherent") {
|
|
460
|
+
*outEnum = wgpu::FeatureName::PixelLocalStorageCoherent;
|
|
461
|
+
} else if (inUnion == "pixel-local-storage-non-coherent") {
|
|
462
|
+
*outEnum = wgpu::FeatureName::PixelLocalStorageNonCoherent;
|
|
463
|
+
} else if (inUnion == "unorm16-texture-formats") {
|
|
464
|
+
*outEnum = wgpu::FeatureName::Unorm16TextureFormats;
|
|
465
|
+
} else if (inUnion == "snorm16-texture-formats") {
|
|
466
|
+
*outEnum = wgpu::FeatureName::Snorm16TextureFormats;
|
|
467
|
+
} else if (inUnion == "multi-planar-format-extended-usages") {
|
|
468
|
+
*outEnum = wgpu::FeatureName::MultiPlanarFormatExtendedUsages;
|
|
469
|
+
} else if (inUnion == "multi-planar-format-p010") {
|
|
470
|
+
*outEnum = wgpu::FeatureName::MultiPlanarFormatP010;
|
|
471
|
+
} else if (inUnion == "host-mapped-pointer") {
|
|
472
|
+
*outEnum = wgpu::FeatureName::HostMappedPointer;
|
|
473
|
+
} else if (inUnion == "multi-planar-render-targets") {
|
|
474
|
+
*outEnum = wgpu::FeatureName::MultiPlanarRenderTargets;
|
|
475
|
+
} else if (inUnion == "multi-planar-format-nv12a") {
|
|
476
|
+
*outEnum = wgpu::FeatureName::MultiPlanarFormatNv12a;
|
|
477
|
+
} else if (inUnion == "framebuffer-fetch") {
|
|
478
|
+
*outEnum = wgpu::FeatureName::FramebufferFetch;
|
|
479
|
+
} else if (inUnion == "buffer-map-extended-usages") {
|
|
480
|
+
*outEnum = wgpu::FeatureName::BufferMapExtendedUsages;
|
|
481
|
+
} else if (inUnion == "adapter-properties-memory-heaps") {
|
|
482
|
+
*outEnum = wgpu::FeatureName::AdapterPropertiesMemoryHeaps;
|
|
483
|
+
} else if (inUnion == "adapter-properties-d3d") {
|
|
484
|
+
*outEnum = wgpu::FeatureName::AdapterPropertiesD3D;
|
|
485
|
+
} else if (inUnion == "adapter-properties-vk") {
|
|
486
|
+
*outEnum = wgpu::FeatureName::AdapterPropertiesVk;
|
|
487
|
+
} else if (inUnion == "r8unorm-storage") {
|
|
488
|
+
*outEnum = wgpu::FeatureName::R8UnormStorage;
|
|
489
|
+
} else if (inUnion == "dawn-format-capabilities") {
|
|
490
|
+
*outEnum = wgpu::FeatureName::DawnFormatCapabilities;
|
|
491
|
+
} else if (inUnion == "norm16-texture-formats") {
|
|
492
|
+
*outEnum = wgpu::FeatureName::Norm16TextureFormats;
|
|
493
|
+
} else if (inUnion == "multi-planar-format-nv16") {
|
|
494
|
+
*outEnum = wgpu::FeatureName::MultiPlanarFormatNv16;
|
|
495
|
+
} else if (inUnion == "multi-planar-format-nv24") {
|
|
496
|
+
*outEnum = wgpu::FeatureName::MultiPlanarFormatNv24;
|
|
497
|
+
} else if (inUnion == "multi-planar-format-p210") {
|
|
498
|
+
*outEnum = wgpu::FeatureName::MultiPlanarFormatP210;
|
|
499
|
+
} else if (inUnion == "multi-planar-format-p410") {
|
|
500
|
+
*outEnum = wgpu::FeatureName::MultiPlanarFormatP410;
|
|
501
|
+
} else if (inUnion == "shared-texture-memory-vk-dedicated-allocation") {
|
|
502
|
+
*outEnum = wgpu::FeatureName::SharedTextureMemoryVkDedicatedAllocation;
|
|
503
|
+
} else if (inUnion == "shared-texture-memory-ahardware-buffer") {
|
|
504
|
+
*outEnum = wgpu::FeatureName::SharedTextureMemoryAHardwareBuffer;
|
|
505
|
+
} else if (inUnion == "shared-texture-memory-dma-buf") {
|
|
506
|
+
*outEnum = wgpu::FeatureName::SharedTextureMemoryDmaBuf;
|
|
507
|
+
} else if (inUnion == "shared-texture-memory-opaque-fd") {
|
|
508
|
+
*outEnum = wgpu::FeatureName::SharedTextureMemoryOpaqueFD;
|
|
509
|
+
} else if (inUnion == "shared-texture-memory-zircon-handle") {
|
|
510
|
+
*outEnum = wgpu::FeatureName::SharedTextureMemoryZirconHandle;
|
|
511
|
+
} else if (inUnion == "shared-texture-memory-dxgi-shared-handle") {
|
|
512
|
+
*outEnum = wgpu::FeatureName::SharedTextureMemoryDXGISharedHandle;
|
|
513
|
+
} else if (inUnion == "shared-texture-memory-d3d11-texture2d") {
|
|
514
|
+
*outEnum = wgpu::FeatureName::SharedTextureMemoryD3D11Texture2D;
|
|
515
|
+
} else if (inUnion == "shared-texture-memory-iosurface") {
|
|
516
|
+
*outEnum = wgpu::FeatureName::SharedTextureMemoryIOSurface;
|
|
517
|
+
} else if (inUnion == "shared-texture-memory-egl-image") {
|
|
518
|
+
*outEnum = wgpu::FeatureName::SharedTextureMemoryEGLImage;
|
|
519
|
+
} else if (inUnion == "shared-fence-vk-semaphore-opaque-fd") {
|
|
520
|
+
*outEnum = wgpu::FeatureName::SharedFenceVkSemaphoreOpaqueFD;
|
|
521
|
+
} else if (inUnion == "shared-fence-vk-semaphore-zircon-handle") {
|
|
522
|
+
*outEnum = wgpu::FeatureName::SharedFenceVkSemaphoreZirconHandle;
|
|
523
|
+
} else if (inUnion == "shared-fence-dxgi-shared-handle") {
|
|
524
|
+
*outEnum = wgpu::FeatureName::SharedFenceDXGISharedHandle;
|
|
525
|
+
} else if (inUnion == "shared-fence-mtl-shared-event") {
|
|
526
|
+
*outEnum = wgpu::FeatureName::SharedFenceMTLSharedEvent;
|
|
527
|
+
} else if (inUnion == "shared-buffer-memory-d3d12-resource") {
|
|
528
|
+
*outEnum = wgpu::FeatureName::SharedBufferMemoryD3D12Resource;
|
|
529
|
+
} else if (inUnion == "static-samplers") {
|
|
530
|
+
*outEnum = wgpu::FeatureName::StaticSamplers;
|
|
531
|
+
} else if (inUnion == "ycbcr-vulkan-samplers") {
|
|
532
|
+
*outEnum = wgpu::FeatureName::YCbCrVulkanSamplers;
|
|
533
|
+
} else if (inUnion == "shader-module-compilation-options") {
|
|
534
|
+
*outEnum = wgpu::FeatureName::ShaderModuleCompilationOptions;
|
|
535
|
+
} else if (inUnion == "dawn-load-resolve-texture") {
|
|
536
|
+
*outEnum = wgpu::FeatureName::DawnLoadResolveTexture;
|
|
537
|
+
} else if (inUnion == "clip-distances") {
|
|
538
|
+
*outEnum = wgpu::FeatureName::ClipDistances;
|
|
439
539
|
} else {
|
|
440
540
|
throw invalidUnion(inUnion);
|
|
441
541
|
}
|
|
@@ -477,12 +577,165 @@ static void convertEnumToJSUnion(wgpu::FeatureName inEnum,
|
|
|
477
577
|
case wgpu::FeatureName::Float32Filterable:
|
|
478
578
|
*outUnion = "float32-filterable";
|
|
479
579
|
break;
|
|
480
|
-
case wgpu::FeatureName::
|
|
481
|
-
*outUnion = "
|
|
580
|
+
case wgpu::FeatureName::Subgroups:
|
|
581
|
+
*outUnion = "subgroups";
|
|
582
|
+
break;
|
|
583
|
+
case wgpu::FeatureName::DawnInternalUsages:
|
|
584
|
+
*outUnion = "dawn-internal-usages";
|
|
585
|
+
break;
|
|
586
|
+
case wgpu::FeatureName::DawnMultiPlanarFormats:
|
|
587
|
+
*outUnion = "dawn-multi-planar-formats";
|
|
588
|
+
break;
|
|
589
|
+
case wgpu::FeatureName::DawnNative:
|
|
590
|
+
*outUnion = "dawn-native";
|
|
591
|
+
break;
|
|
592
|
+
case wgpu::FeatureName::ChromiumExperimentalTimestampQueryInsidePasses:
|
|
593
|
+
*outUnion = "chromium-experimental-timestamp-query-inside-passes";
|
|
594
|
+
break;
|
|
595
|
+
case wgpu::FeatureName::ImplicitDeviceSynchronization:
|
|
596
|
+
*outUnion = "implicit-device-synchronization";
|
|
597
|
+
break;
|
|
598
|
+
// case wgpu::FeatureName::SurfaceCapabilities:
|
|
599
|
+
// *outUnion = "surface-capabilities";
|
|
600
|
+
// break;
|
|
601
|
+
case wgpu::FeatureName::TransientAttachments:
|
|
602
|
+
*outUnion = "transient-attachments";
|
|
603
|
+
break;
|
|
604
|
+
case wgpu::FeatureName::MSAARenderToSingleSampled:
|
|
605
|
+
*outUnion = "msaa-render-to-single-sampled";
|
|
482
606
|
break;
|
|
483
607
|
case wgpu::FeatureName::DualSourceBlending:
|
|
484
608
|
*outUnion = "dual-source-blending";
|
|
485
609
|
break;
|
|
610
|
+
case wgpu::FeatureName::D3D11MultithreadProtected:
|
|
611
|
+
*outUnion = "d3d11-multithread-protected";
|
|
612
|
+
break;
|
|
613
|
+
case wgpu::FeatureName::ANGLETextureSharing:
|
|
614
|
+
*outUnion = "angle-texture-sharing";
|
|
615
|
+
break;
|
|
616
|
+
case wgpu::FeatureName::ChromiumExperimentalSubgroupMatrix:
|
|
617
|
+
*outUnion = "chromium-experimental-subgroups-matrix";
|
|
618
|
+
break;
|
|
619
|
+
case wgpu::FeatureName::PixelLocalStorageCoherent:
|
|
620
|
+
*outUnion = "pixel-local-storage-coherent";
|
|
621
|
+
break;
|
|
622
|
+
case wgpu::FeatureName::PixelLocalStorageNonCoherent:
|
|
623
|
+
*outUnion = "pixel-local-storage-non-coherent";
|
|
624
|
+
break;
|
|
625
|
+
case wgpu::FeatureName::Unorm16TextureFormats:
|
|
626
|
+
*outUnion = "unorm16-texture-formats";
|
|
627
|
+
break;
|
|
628
|
+
case wgpu::FeatureName::Snorm16TextureFormats:
|
|
629
|
+
*outUnion = "snorm16-texture-formats";
|
|
630
|
+
break;
|
|
631
|
+
case wgpu::FeatureName::MultiPlanarFormatExtendedUsages:
|
|
632
|
+
*outUnion = "multi-planar-format-extended-usages";
|
|
633
|
+
break;
|
|
634
|
+
case wgpu::FeatureName::MultiPlanarFormatP010:
|
|
635
|
+
*outUnion = "multi-planar-format-p010";
|
|
636
|
+
break;
|
|
637
|
+
case wgpu::FeatureName::HostMappedPointer:
|
|
638
|
+
*outUnion = "host-mapped-pointer";
|
|
639
|
+
break;
|
|
640
|
+
case wgpu::FeatureName::MultiPlanarRenderTargets:
|
|
641
|
+
*outUnion = "multi-planar-render-targets";
|
|
642
|
+
break;
|
|
643
|
+
case wgpu::FeatureName::MultiPlanarFormatNv12a:
|
|
644
|
+
*outUnion = "multi-planar-format-nv12a";
|
|
645
|
+
break;
|
|
646
|
+
case wgpu::FeatureName::FramebufferFetch:
|
|
647
|
+
*outUnion = "framebuffer-fetch";
|
|
648
|
+
break;
|
|
649
|
+
case wgpu::FeatureName::BufferMapExtendedUsages:
|
|
650
|
+
*outUnion = "buffer-map-extended-usages";
|
|
651
|
+
break;
|
|
652
|
+
case wgpu::FeatureName::AdapterPropertiesMemoryHeaps:
|
|
653
|
+
*outUnion = "adapter-properties-memory-heaps";
|
|
654
|
+
break;
|
|
655
|
+
case wgpu::FeatureName::AdapterPropertiesD3D:
|
|
656
|
+
*outUnion = "adapter-properties-d3d";
|
|
657
|
+
break;
|
|
658
|
+
case wgpu::FeatureName::AdapterPropertiesVk:
|
|
659
|
+
*outUnion = "adapter-properties-vk";
|
|
660
|
+
break;
|
|
661
|
+
case wgpu::FeatureName::R8UnormStorage:
|
|
662
|
+
*outUnion = "r8unorm-storage";
|
|
663
|
+
break;
|
|
664
|
+
case wgpu::FeatureName::DawnFormatCapabilities:
|
|
665
|
+
*outUnion = "dawn-format-capabilities";
|
|
666
|
+
break;
|
|
667
|
+
case wgpu::FeatureName::Norm16TextureFormats:
|
|
668
|
+
*outUnion = "norm16-texture-formats";
|
|
669
|
+
break;
|
|
670
|
+
case wgpu::FeatureName::MultiPlanarFormatNv16:
|
|
671
|
+
*outUnion = "multi-planar-format-nv16";
|
|
672
|
+
break;
|
|
673
|
+
case wgpu::FeatureName::MultiPlanarFormatNv24:
|
|
674
|
+
*outUnion = "multi-planar-format-nv24";
|
|
675
|
+
break;
|
|
676
|
+
case wgpu::FeatureName::MultiPlanarFormatP210:
|
|
677
|
+
*outUnion = "multi-planar-format-p210";
|
|
678
|
+
break;
|
|
679
|
+
case wgpu::FeatureName::MultiPlanarFormatP410:
|
|
680
|
+
*outUnion = "multi-planar-format-p410";
|
|
681
|
+
break;
|
|
682
|
+
case wgpu::FeatureName::SharedTextureMemoryVkDedicatedAllocation:
|
|
683
|
+
*outUnion = "shared-texture-memory-vk-dedicated-allocation";
|
|
684
|
+
break;
|
|
685
|
+
case wgpu::FeatureName::SharedTextureMemoryAHardwareBuffer:
|
|
686
|
+
*outUnion = "shared-texture-memory-ahardware-buffer";
|
|
687
|
+
break;
|
|
688
|
+
case wgpu::FeatureName::SharedTextureMemoryDmaBuf:
|
|
689
|
+
*outUnion = "shared-texture-memory-dma-buf";
|
|
690
|
+
break;
|
|
691
|
+
case wgpu::FeatureName::SharedTextureMemoryOpaqueFD:
|
|
692
|
+
*outUnion = "shared-texture-memory-opaque-fd";
|
|
693
|
+
break;
|
|
694
|
+
case wgpu::FeatureName::SharedTextureMemoryZirconHandle:
|
|
695
|
+
*outUnion = "shared-texture-memory-zircon-handle";
|
|
696
|
+
break;
|
|
697
|
+
case wgpu::FeatureName::SharedTextureMemoryDXGISharedHandle:
|
|
698
|
+
*outUnion = "shared-texture-memory-dxgi-shared-handle";
|
|
699
|
+
break;
|
|
700
|
+
case wgpu::FeatureName::SharedTextureMemoryD3D11Texture2D:
|
|
701
|
+
*outUnion = "shared-texture-memory-d3d11-texture2d";
|
|
702
|
+
break;
|
|
703
|
+
case wgpu::FeatureName::SharedTextureMemoryIOSurface:
|
|
704
|
+
*outUnion = "shared-texture-memory-iosurface";
|
|
705
|
+
break;
|
|
706
|
+
case wgpu::FeatureName::SharedTextureMemoryEGLImage:
|
|
707
|
+
*outUnion = "shared-texture-memory-egl-image";
|
|
708
|
+
break;
|
|
709
|
+
case wgpu::FeatureName::SharedFenceVkSemaphoreOpaqueFD:
|
|
710
|
+
*outUnion = "shared-fence-vk-semaphore-opaque-fd";
|
|
711
|
+
break;
|
|
712
|
+
case wgpu::FeatureName::SharedFenceVkSemaphoreZirconHandle:
|
|
713
|
+
*outUnion = "shared-fence-vk-semaphore-zircon-handle";
|
|
714
|
+
break;
|
|
715
|
+
case wgpu::FeatureName::SharedFenceDXGISharedHandle:
|
|
716
|
+
*outUnion = "shared-fence-dxgi-shared-handle";
|
|
717
|
+
break;
|
|
718
|
+
case wgpu::FeatureName::SharedFenceMTLSharedEvent:
|
|
719
|
+
*outUnion = "shared-fence-mtl-shared-event";
|
|
720
|
+
break;
|
|
721
|
+
case wgpu::FeatureName::SharedBufferMemoryD3D12Resource:
|
|
722
|
+
*outUnion = "shared-buffer-memory-d3d12-resource";
|
|
723
|
+
break;
|
|
724
|
+
case wgpu::FeatureName::StaticSamplers:
|
|
725
|
+
*outUnion = "static-samplers";
|
|
726
|
+
break;
|
|
727
|
+
case wgpu::FeatureName::YCbCrVulkanSamplers:
|
|
728
|
+
*outUnion = "ycbcr-vulkan-samplers";
|
|
729
|
+
break;
|
|
730
|
+
case wgpu::FeatureName::ShaderModuleCompilationOptions:
|
|
731
|
+
*outUnion = "shader-module-compilation-options";
|
|
732
|
+
break;
|
|
733
|
+
case wgpu::FeatureName::DawnLoadResolveTexture:
|
|
734
|
+
*outUnion = "dawn-load-resolve-texture";
|
|
735
|
+
break;
|
|
736
|
+
case wgpu::FeatureName::ClipDistances:
|
|
737
|
+
*outUnion = "clip-distances";
|
|
738
|
+
break;
|
|
486
739
|
default:
|
|
487
740
|
throw invalidEnum(inEnum);
|
|
488
741
|
}
|