@shopify/react-native-skia 2.6.1 → 2.6.3-next.1

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 (29) hide show
  1. package/cpp/dawn/include/dawn/dawn_proc.h +50 -0
  2. package/cpp/dawn/include/dawn/dawn_proc_table.h +326 -0
  3. package/cpp/dawn/include/dawn/dawn_thread_dispatch_proc.h +47 -0
  4. package/cpp/dawn/include/dawn/native/D3D11Backend.h +65 -0
  5. package/cpp/dawn/include/dawn/native/D3D12Backend.h +102 -0
  6. package/cpp/dawn/include/dawn/native/D3DBackend.h +56 -0
  7. package/cpp/dawn/include/dawn/native/DawnNative.h +369 -0
  8. package/cpp/dawn/include/dawn/native/MetalBackend.h +56 -0
  9. package/cpp/dawn/include/dawn/native/NullBackend.h +39 -0
  10. package/cpp/dawn/include/dawn/native/OpenGLBackend.h +89 -0
  11. package/cpp/dawn/include/dawn/native/VulkanBackend.h +183 -0
  12. package/cpp/dawn/include/dawn/native/WebGPUBackend.h +49 -0
  13. package/cpp/dawn/include/dawn/native/dawn_native_export.h +49 -0
  14. package/cpp/dawn/include/dawn/platform/DawnPlatform.h +203 -0
  15. package/cpp/dawn/include/dawn/platform/dawn_platform_export.h +49 -0
  16. package/cpp/dawn/include/dawn/replay/Replay.h +75 -0
  17. package/cpp/dawn/include/dawn/replay/dawn_replay_export.h +49 -0
  18. package/cpp/dawn/include/dawn/webgpu_cpp_print.h +2752 -0
  19. package/cpp/dawn/include/tint/tint.h +90 -0
  20. package/cpp/dawn/include/webgpu/webgpu.h +4902 -0
  21. package/cpp/dawn/include/webgpu/webgpu_cpp.h +10261 -0
  22. package/cpp/dawn/include/webgpu/webgpu_cpp_chained_struct.h +57 -0
  23. package/cpp/dawn/include/webgpu/webgpu_enum_class_bitmasks.h +161 -0
  24. package/cpp/dawn/include/webgpu/webgpu_glfw.h +88 -0
  25. package/cpp/skia/src/gpu/graphite/ContextOptionsPriv.h +45 -0
  26. package/cpp/skia/src/gpu/graphite/ResourceTypes.h +360 -0
  27. package/cpp/skia/src/gpu/graphite/TextureProxyView.h +105 -0
  28. package/package.json +7 -6
  29. package/scripts/install-libs.js +44 -4
@@ -0,0 +1,50 @@
1
+ // Copyright 2019 The Dawn & Tint Authors
2
+ //
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
5
+ //
6
+ // 1. Redistributions of source code must retain the above copyright notice, this
7
+ // list of conditions and the following disclaimer.
8
+ //
9
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ // this list of conditions and the following disclaimer in the documentation
11
+ // and/or other materials provided with the distribution.
12
+ //
13
+ // 3. Neither the name of the copyright holder nor the names of its
14
+ // contributors may be used to endorse or promote products derived from
15
+ // this software without specific prior written permission.
16
+ //
17
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef INCLUDE_DAWN_DAWN_PROC_H_
29
+ #define INCLUDE_DAWN_DAWN_PROC_H_
30
+
31
+ #include <webgpu/webgpu.h>
32
+
33
+ #include "dawn/dawn_proc_table.h"
34
+
35
+ #ifdef __cplusplus
36
+ extern "C" {
37
+ #endif
38
+
39
+ // Sets the static proctable used by libdawn_proc to implement the Dawn entrypoints. Passing NULL
40
+ // for `procs` sets up the null proctable that contains only null function pointers. It is the
41
+ // default value of the proctable. Setting the proctable back to null is good practice when you
42
+ // are done using libdawn_proc since further usage will cause a segfault instead of calling an
43
+ // unexpected function.
44
+ WGPU_EXPORT void dawnProcSetProcs(const DawnProcTable* procs);
45
+
46
+ #ifdef __cplusplus
47
+ } // extern "C"
48
+ #endif
49
+
50
+ #endif // INCLUDE_DAWN_DAWN_PROC_H_
@@ -0,0 +1,326 @@
1
+
2
+ #ifndef DAWN_DAWN_PROC_TABLE_H_
3
+ #define DAWN_DAWN_PROC_TABLE_H_
4
+
5
+ #include "webgpu/webgpu.h"
6
+
7
+ // Note: Often allocated as a static global. Do not add a complex constructor.
8
+ typedef struct DawnProcTable {
9
+ WGPUProcCreateInstance createInstance;
10
+ WGPUProcGetInstanceFeatures getInstanceFeatures;
11
+ WGPUProcGetInstanceLimits getInstanceLimits;
12
+ WGPUProcHasInstanceFeature hasInstanceFeature;
13
+ WGPUProcGetProcAddress getProcAddress;
14
+
15
+ WGPUProcAdapterCreateDevice adapterCreateDevice;
16
+ WGPUProcAdapterGetFeatures adapterGetFeatures;
17
+ WGPUProcAdapterGetFormatCapabilities adapterGetFormatCapabilities;
18
+ WGPUProcAdapterGetInfo adapterGetInfo;
19
+ WGPUProcAdapterGetInstance adapterGetInstance;
20
+ WGPUProcAdapterGetLimits adapterGetLimits;
21
+ WGPUProcAdapterHasFeature adapterHasFeature;
22
+ WGPUProcAdapterRequestDevice adapterRequestDevice;
23
+ WGPUProcAdapterAddRef adapterAddRef;
24
+ WGPUProcAdapterRelease adapterRelease;
25
+
26
+ WGPUProcAdapterInfoFreeMembers adapterInfoFreeMembers;
27
+
28
+ WGPUProcAdapterPropertiesMemoryHeapsFreeMembers adapterPropertiesMemoryHeapsFreeMembers;
29
+
30
+ WGPUProcAdapterPropertiesSubgroupMatrixConfigsFreeMembers adapterPropertiesSubgroupMatrixConfigsFreeMembers;
31
+
32
+ WGPUProcBindGroupSetLabel bindGroupSetLabel;
33
+ WGPUProcBindGroupAddRef bindGroupAddRef;
34
+ WGPUProcBindGroupRelease bindGroupRelease;
35
+
36
+ WGPUProcBindGroupLayoutSetLabel bindGroupLayoutSetLabel;
37
+ WGPUProcBindGroupLayoutAddRef bindGroupLayoutAddRef;
38
+ WGPUProcBindGroupLayoutRelease bindGroupLayoutRelease;
39
+
40
+ WGPUProcBufferCreateTexelView bufferCreateTexelView;
41
+ WGPUProcBufferDestroy bufferDestroy;
42
+ WGPUProcBufferGetConstMappedRange bufferGetConstMappedRange;
43
+ WGPUProcBufferGetMappedRange bufferGetMappedRange;
44
+ WGPUProcBufferGetMapState bufferGetMapState;
45
+ WGPUProcBufferGetSize bufferGetSize;
46
+ WGPUProcBufferGetUsage bufferGetUsage;
47
+ WGPUProcBufferMapAsync bufferMapAsync;
48
+ WGPUProcBufferReadMappedRange bufferReadMappedRange;
49
+ WGPUProcBufferSetLabel bufferSetLabel;
50
+ WGPUProcBufferUnmap bufferUnmap;
51
+ WGPUProcBufferWriteMappedRange bufferWriteMappedRange;
52
+ WGPUProcBufferAddRef bufferAddRef;
53
+ WGPUProcBufferRelease bufferRelease;
54
+
55
+ WGPUProcCommandBufferSetLabel commandBufferSetLabel;
56
+ WGPUProcCommandBufferAddRef commandBufferAddRef;
57
+ WGPUProcCommandBufferRelease commandBufferRelease;
58
+
59
+ WGPUProcCommandEncoderBeginComputePass commandEncoderBeginComputePass;
60
+ WGPUProcCommandEncoderBeginRenderPass commandEncoderBeginRenderPass;
61
+ WGPUProcCommandEncoderClearBuffer commandEncoderClearBuffer;
62
+ WGPUProcCommandEncoderCopyBufferToBuffer commandEncoderCopyBufferToBuffer;
63
+ WGPUProcCommandEncoderCopyBufferToTexture commandEncoderCopyBufferToTexture;
64
+ WGPUProcCommandEncoderCopyTextureToBuffer commandEncoderCopyTextureToBuffer;
65
+ WGPUProcCommandEncoderCopyTextureToTexture commandEncoderCopyTextureToTexture;
66
+ WGPUProcCommandEncoderFinish commandEncoderFinish;
67
+ WGPUProcCommandEncoderInjectValidationError commandEncoderInjectValidationError;
68
+ WGPUProcCommandEncoderInsertDebugMarker commandEncoderInsertDebugMarker;
69
+ WGPUProcCommandEncoderPopDebugGroup commandEncoderPopDebugGroup;
70
+ WGPUProcCommandEncoderPushDebugGroup commandEncoderPushDebugGroup;
71
+ WGPUProcCommandEncoderResolveQuerySet commandEncoderResolveQuerySet;
72
+ WGPUProcCommandEncoderSetLabel commandEncoderSetLabel;
73
+ WGPUProcCommandEncoderWriteBuffer commandEncoderWriteBuffer;
74
+ WGPUProcCommandEncoderWriteTimestamp commandEncoderWriteTimestamp;
75
+ WGPUProcCommandEncoderAddRef commandEncoderAddRef;
76
+ WGPUProcCommandEncoderRelease commandEncoderRelease;
77
+
78
+ WGPUProcComputePassEncoderDispatchWorkgroups computePassEncoderDispatchWorkgroups;
79
+ WGPUProcComputePassEncoderDispatchWorkgroupsIndirect computePassEncoderDispatchWorkgroupsIndirect;
80
+ WGPUProcComputePassEncoderEnd computePassEncoderEnd;
81
+ WGPUProcComputePassEncoderInsertDebugMarker computePassEncoderInsertDebugMarker;
82
+ WGPUProcComputePassEncoderPopDebugGroup computePassEncoderPopDebugGroup;
83
+ WGPUProcComputePassEncoderPushDebugGroup computePassEncoderPushDebugGroup;
84
+ WGPUProcComputePassEncoderSetBindGroup computePassEncoderSetBindGroup;
85
+ WGPUProcComputePassEncoderSetImmediates computePassEncoderSetImmediates;
86
+ WGPUProcComputePassEncoderSetLabel computePassEncoderSetLabel;
87
+ WGPUProcComputePassEncoderSetPipeline computePassEncoderSetPipeline;
88
+ WGPUProcComputePassEncoderSetResourceTable computePassEncoderSetResourceTable;
89
+ WGPUProcComputePassEncoderWriteTimestamp computePassEncoderWriteTimestamp;
90
+ WGPUProcComputePassEncoderAddRef computePassEncoderAddRef;
91
+ WGPUProcComputePassEncoderRelease computePassEncoderRelease;
92
+
93
+ WGPUProcComputePipelineGetBindGroupLayout computePipelineGetBindGroupLayout;
94
+ WGPUProcComputePipelineSetLabel computePipelineSetLabel;
95
+ WGPUProcComputePipelineAddRef computePipelineAddRef;
96
+ WGPUProcComputePipelineRelease computePipelineRelease;
97
+
98
+ WGPUProcDawnDrmFormatCapabilitiesFreeMembers dawnDrmFormatCapabilitiesFreeMembers;
99
+
100
+ WGPUProcDeviceCreateBindGroup deviceCreateBindGroup;
101
+ WGPUProcDeviceCreateBindGroupLayout deviceCreateBindGroupLayout;
102
+ WGPUProcDeviceCreateBuffer deviceCreateBuffer;
103
+ WGPUProcDeviceCreateCommandEncoder deviceCreateCommandEncoder;
104
+ WGPUProcDeviceCreateComputePipeline deviceCreateComputePipeline;
105
+ WGPUProcDeviceCreateComputePipelineAsync deviceCreateComputePipelineAsync;
106
+ WGPUProcDeviceCreateErrorBuffer deviceCreateErrorBuffer;
107
+ WGPUProcDeviceCreateErrorExternalTexture deviceCreateErrorExternalTexture;
108
+ WGPUProcDeviceCreateErrorShaderModule deviceCreateErrorShaderModule;
109
+ WGPUProcDeviceCreateErrorTexture deviceCreateErrorTexture;
110
+ WGPUProcDeviceCreateExternalTexture deviceCreateExternalTexture;
111
+ WGPUProcDeviceCreatePipelineLayout deviceCreatePipelineLayout;
112
+ WGPUProcDeviceCreateQuerySet deviceCreateQuerySet;
113
+ WGPUProcDeviceCreateRenderBundleEncoder deviceCreateRenderBundleEncoder;
114
+ WGPUProcDeviceCreateRenderPipeline deviceCreateRenderPipeline;
115
+ WGPUProcDeviceCreateRenderPipelineAsync deviceCreateRenderPipelineAsync;
116
+ WGPUProcDeviceCreateResourceTable deviceCreateResourceTable;
117
+ WGPUProcDeviceCreateSampler deviceCreateSampler;
118
+ WGPUProcDeviceCreateShaderModule deviceCreateShaderModule;
119
+ WGPUProcDeviceCreateTexture deviceCreateTexture;
120
+ WGPUProcDeviceDestroy deviceDestroy;
121
+ WGPUProcDeviceForceLoss deviceForceLoss;
122
+ WGPUProcDeviceGetAdapter deviceGetAdapter;
123
+ WGPUProcDeviceGetAdapterInfo deviceGetAdapterInfo;
124
+ WGPUProcDeviceGetAHardwareBufferProperties deviceGetAHardwareBufferProperties;
125
+ WGPUProcDeviceGetFeatures deviceGetFeatures;
126
+ WGPUProcDeviceGetLimits deviceGetLimits;
127
+ WGPUProcDeviceGetLostFuture deviceGetLostFuture;
128
+ WGPUProcDeviceGetQueue deviceGetQueue;
129
+ WGPUProcDeviceHasFeature deviceHasFeature;
130
+ WGPUProcDeviceImportSharedBufferMemory deviceImportSharedBufferMemory;
131
+ WGPUProcDeviceImportSharedFence deviceImportSharedFence;
132
+ WGPUProcDeviceImportSharedTextureMemory deviceImportSharedTextureMemory;
133
+ WGPUProcDeviceInjectError deviceInjectError;
134
+ WGPUProcDevicePopErrorScope devicePopErrorScope;
135
+ WGPUProcDevicePushErrorScope devicePushErrorScope;
136
+ WGPUProcDeviceSetLabel deviceSetLabel;
137
+ WGPUProcDeviceSetLoggingCallback deviceSetLoggingCallback;
138
+ WGPUProcDeviceTick deviceTick;
139
+ WGPUProcDeviceValidateTextureDescriptor deviceValidateTextureDescriptor;
140
+ WGPUProcDeviceAddRef deviceAddRef;
141
+ WGPUProcDeviceRelease deviceRelease;
142
+
143
+ WGPUProcExternalTextureDestroy externalTextureDestroy;
144
+ WGPUProcExternalTextureExpire externalTextureExpire;
145
+ WGPUProcExternalTextureRefresh externalTextureRefresh;
146
+ WGPUProcExternalTextureSetLabel externalTextureSetLabel;
147
+ WGPUProcExternalTextureAddRef externalTextureAddRef;
148
+ WGPUProcExternalTextureRelease externalTextureRelease;
149
+
150
+ WGPUProcInstanceCreateSurface instanceCreateSurface;
151
+ WGPUProcInstanceGetWGSLLanguageFeatures instanceGetWGSLLanguageFeatures;
152
+ WGPUProcInstanceHasWGSLLanguageFeature instanceHasWGSLLanguageFeature;
153
+ WGPUProcInstanceProcessEvents instanceProcessEvents;
154
+ WGPUProcInstanceRequestAdapter instanceRequestAdapter;
155
+ WGPUProcInstanceWaitAny instanceWaitAny;
156
+ WGPUProcInstanceAddRef instanceAddRef;
157
+ WGPUProcInstanceRelease instanceRelease;
158
+
159
+ WGPUProcPipelineLayoutSetLabel pipelineLayoutSetLabel;
160
+ WGPUProcPipelineLayoutAddRef pipelineLayoutAddRef;
161
+ WGPUProcPipelineLayoutRelease pipelineLayoutRelease;
162
+
163
+ WGPUProcQuerySetDestroy querySetDestroy;
164
+ WGPUProcQuerySetGetCount querySetGetCount;
165
+ WGPUProcQuerySetGetType querySetGetType;
166
+ WGPUProcQuerySetSetLabel querySetSetLabel;
167
+ WGPUProcQuerySetAddRef querySetAddRef;
168
+ WGPUProcQuerySetRelease querySetRelease;
169
+
170
+ WGPUProcQueueCopyExternalTextureForBrowser queueCopyExternalTextureForBrowser;
171
+ WGPUProcQueueCopyTextureForBrowser queueCopyTextureForBrowser;
172
+ WGPUProcQueueOnSubmittedWorkDone queueOnSubmittedWorkDone;
173
+ WGPUProcQueueSetLabel queueSetLabel;
174
+ WGPUProcQueueSubmit queueSubmit;
175
+ WGPUProcQueueWriteBuffer queueWriteBuffer;
176
+ WGPUProcQueueWriteTexture queueWriteTexture;
177
+ WGPUProcQueueAddRef queueAddRef;
178
+ WGPUProcQueueRelease queueRelease;
179
+
180
+ WGPUProcRenderBundleSetLabel renderBundleSetLabel;
181
+ WGPUProcRenderBundleAddRef renderBundleAddRef;
182
+ WGPUProcRenderBundleRelease renderBundleRelease;
183
+
184
+ WGPUProcRenderBundleEncoderDraw renderBundleEncoderDraw;
185
+ WGPUProcRenderBundleEncoderDrawIndexed renderBundleEncoderDrawIndexed;
186
+ WGPUProcRenderBundleEncoderDrawIndexedIndirect renderBundleEncoderDrawIndexedIndirect;
187
+ WGPUProcRenderBundleEncoderDrawIndirect renderBundleEncoderDrawIndirect;
188
+ WGPUProcRenderBundleEncoderFinish renderBundleEncoderFinish;
189
+ WGPUProcRenderBundleEncoderInsertDebugMarker renderBundleEncoderInsertDebugMarker;
190
+ WGPUProcRenderBundleEncoderPopDebugGroup renderBundleEncoderPopDebugGroup;
191
+ WGPUProcRenderBundleEncoderPushDebugGroup renderBundleEncoderPushDebugGroup;
192
+ WGPUProcRenderBundleEncoderSetBindGroup renderBundleEncoderSetBindGroup;
193
+ WGPUProcRenderBundleEncoderSetImmediates renderBundleEncoderSetImmediates;
194
+ WGPUProcRenderBundleEncoderSetIndexBuffer renderBundleEncoderSetIndexBuffer;
195
+ WGPUProcRenderBundleEncoderSetLabel renderBundleEncoderSetLabel;
196
+ WGPUProcRenderBundleEncoderSetPipeline renderBundleEncoderSetPipeline;
197
+ WGPUProcRenderBundleEncoderSetResourceTable renderBundleEncoderSetResourceTable;
198
+ WGPUProcRenderBundleEncoderSetVertexBuffer renderBundleEncoderSetVertexBuffer;
199
+ WGPUProcRenderBundleEncoderAddRef renderBundleEncoderAddRef;
200
+ WGPUProcRenderBundleEncoderRelease renderBundleEncoderRelease;
201
+
202
+ WGPUProcRenderPassEncoderBeginOcclusionQuery renderPassEncoderBeginOcclusionQuery;
203
+ WGPUProcRenderPassEncoderDraw renderPassEncoderDraw;
204
+ WGPUProcRenderPassEncoderDrawIndexed renderPassEncoderDrawIndexed;
205
+ WGPUProcRenderPassEncoderDrawIndexedIndirect renderPassEncoderDrawIndexedIndirect;
206
+ WGPUProcRenderPassEncoderDrawIndirect renderPassEncoderDrawIndirect;
207
+ WGPUProcRenderPassEncoderEnd renderPassEncoderEnd;
208
+ WGPUProcRenderPassEncoderEndOcclusionQuery renderPassEncoderEndOcclusionQuery;
209
+ WGPUProcRenderPassEncoderExecuteBundles renderPassEncoderExecuteBundles;
210
+ WGPUProcRenderPassEncoderInsertDebugMarker renderPassEncoderInsertDebugMarker;
211
+ WGPUProcRenderPassEncoderMultiDrawIndexedIndirect renderPassEncoderMultiDrawIndexedIndirect;
212
+ WGPUProcRenderPassEncoderMultiDrawIndirect renderPassEncoderMultiDrawIndirect;
213
+ WGPUProcRenderPassEncoderPixelLocalStorageBarrier renderPassEncoderPixelLocalStorageBarrier;
214
+ WGPUProcRenderPassEncoderPopDebugGroup renderPassEncoderPopDebugGroup;
215
+ WGPUProcRenderPassEncoderPushDebugGroup renderPassEncoderPushDebugGroup;
216
+ WGPUProcRenderPassEncoderSetBindGroup renderPassEncoderSetBindGroup;
217
+ WGPUProcRenderPassEncoderSetBlendConstant renderPassEncoderSetBlendConstant;
218
+ WGPUProcRenderPassEncoderSetImmediates renderPassEncoderSetImmediates;
219
+ WGPUProcRenderPassEncoderSetIndexBuffer renderPassEncoderSetIndexBuffer;
220
+ WGPUProcRenderPassEncoderSetLabel renderPassEncoderSetLabel;
221
+ WGPUProcRenderPassEncoderSetPipeline renderPassEncoderSetPipeline;
222
+ WGPUProcRenderPassEncoderSetResourceTable renderPassEncoderSetResourceTable;
223
+ WGPUProcRenderPassEncoderSetScissorRect renderPassEncoderSetScissorRect;
224
+ WGPUProcRenderPassEncoderSetStencilReference renderPassEncoderSetStencilReference;
225
+ WGPUProcRenderPassEncoderSetVertexBuffer renderPassEncoderSetVertexBuffer;
226
+ WGPUProcRenderPassEncoderSetViewport renderPassEncoderSetViewport;
227
+ WGPUProcRenderPassEncoderWriteTimestamp renderPassEncoderWriteTimestamp;
228
+ WGPUProcRenderPassEncoderAddRef renderPassEncoderAddRef;
229
+ WGPUProcRenderPassEncoderRelease renderPassEncoderRelease;
230
+
231
+ WGPUProcRenderPipelineGetBindGroupLayout renderPipelineGetBindGroupLayout;
232
+ WGPUProcRenderPipelineSetLabel renderPipelineSetLabel;
233
+ WGPUProcRenderPipelineAddRef renderPipelineAddRef;
234
+ WGPUProcRenderPipelineRelease renderPipelineRelease;
235
+
236
+ WGPUProcResourceTableDestroy resourceTableDestroy;
237
+ WGPUProcResourceTableGetSize resourceTableGetSize;
238
+ WGPUProcResourceTableInsertBinding resourceTableInsertBinding;
239
+ WGPUProcResourceTableRemoveBinding resourceTableRemoveBinding;
240
+ WGPUProcResourceTableUpdate resourceTableUpdate;
241
+ WGPUProcResourceTableAddRef resourceTableAddRef;
242
+ WGPUProcResourceTableRelease resourceTableRelease;
243
+
244
+ WGPUProcSamplerSetLabel samplerSetLabel;
245
+ WGPUProcSamplerAddRef samplerAddRef;
246
+ WGPUProcSamplerRelease samplerRelease;
247
+
248
+ WGPUProcShaderModuleGetCompilationInfo shaderModuleGetCompilationInfo;
249
+ WGPUProcShaderModuleSetLabel shaderModuleSetLabel;
250
+ WGPUProcShaderModuleAddRef shaderModuleAddRef;
251
+ WGPUProcShaderModuleRelease shaderModuleRelease;
252
+
253
+ WGPUProcSharedBufferMemoryBeginAccess sharedBufferMemoryBeginAccess;
254
+ WGPUProcSharedBufferMemoryCreateBuffer sharedBufferMemoryCreateBuffer;
255
+ WGPUProcSharedBufferMemoryEndAccess sharedBufferMemoryEndAccess;
256
+ WGPUProcSharedBufferMemoryGetProperties sharedBufferMemoryGetProperties;
257
+ WGPUProcSharedBufferMemoryIsDeviceLost sharedBufferMemoryIsDeviceLost;
258
+ WGPUProcSharedBufferMemorySetLabel sharedBufferMemorySetLabel;
259
+ WGPUProcSharedBufferMemoryAddRef sharedBufferMemoryAddRef;
260
+ WGPUProcSharedBufferMemoryRelease sharedBufferMemoryRelease;
261
+
262
+ WGPUProcSharedBufferMemoryEndAccessStateFreeMembers sharedBufferMemoryEndAccessStateFreeMembers;
263
+
264
+ WGPUProcSharedFenceExportInfo sharedFenceExportInfo;
265
+ WGPUProcSharedFenceAddRef sharedFenceAddRef;
266
+ WGPUProcSharedFenceRelease sharedFenceRelease;
267
+
268
+ WGPUProcSharedTextureMemoryBeginAccess sharedTextureMemoryBeginAccess;
269
+ WGPUProcSharedTextureMemoryCreateTexture sharedTextureMemoryCreateTexture;
270
+ WGPUProcSharedTextureMemoryEndAccess sharedTextureMemoryEndAccess;
271
+ WGPUProcSharedTextureMemoryGetProperties sharedTextureMemoryGetProperties;
272
+ WGPUProcSharedTextureMemoryIsDeviceLost sharedTextureMemoryIsDeviceLost;
273
+ WGPUProcSharedTextureMemorySetLabel sharedTextureMemorySetLabel;
274
+ WGPUProcSharedTextureMemoryAddRef sharedTextureMemoryAddRef;
275
+ WGPUProcSharedTextureMemoryRelease sharedTextureMemoryRelease;
276
+
277
+ WGPUProcSharedTextureMemoryEndAccessStateFreeMembers sharedTextureMemoryEndAccessStateFreeMembers;
278
+
279
+ WGPUProcSupportedFeaturesFreeMembers supportedFeaturesFreeMembers;
280
+
281
+ WGPUProcSupportedInstanceFeaturesFreeMembers supportedInstanceFeaturesFreeMembers;
282
+
283
+ WGPUProcSupportedWGSLLanguageFeaturesFreeMembers supportedWGSLLanguageFeaturesFreeMembers;
284
+
285
+ WGPUProcSurfaceConfigure surfaceConfigure;
286
+ WGPUProcSurfaceGetCapabilities surfaceGetCapabilities;
287
+ WGPUProcSurfaceGetCurrentTexture surfaceGetCurrentTexture;
288
+ WGPUProcSurfacePresent surfacePresent;
289
+ WGPUProcSurfaceSetLabel surfaceSetLabel;
290
+ WGPUProcSurfaceUnconfigure surfaceUnconfigure;
291
+ WGPUProcSurfaceAddRef surfaceAddRef;
292
+ WGPUProcSurfaceRelease surfaceRelease;
293
+
294
+ WGPUProcSurfaceCapabilitiesFreeMembers surfaceCapabilitiesFreeMembers;
295
+
296
+ WGPUProcTexelBufferViewSetLabel texelBufferViewSetLabel;
297
+ WGPUProcTexelBufferViewAddRef texelBufferViewAddRef;
298
+ WGPUProcTexelBufferViewRelease texelBufferViewRelease;
299
+
300
+ WGPUProcTextureCreateErrorView textureCreateErrorView;
301
+ WGPUProcTextureCreateView textureCreateView;
302
+ WGPUProcTextureDestroy textureDestroy;
303
+ WGPUProcTextureGetDepthOrArrayLayers textureGetDepthOrArrayLayers;
304
+ WGPUProcTextureGetDimension textureGetDimension;
305
+ WGPUProcTextureGetFormat textureGetFormat;
306
+ WGPUProcTextureGetHeight textureGetHeight;
307
+ WGPUProcTextureGetMipLevelCount textureGetMipLevelCount;
308
+ WGPUProcTextureGetSampleCount textureGetSampleCount;
309
+ WGPUProcTextureGetTextureBindingViewDimension textureGetTextureBindingViewDimension;
310
+ WGPUProcTextureGetUsage textureGetUsage;
311
+ WGPUProcTextureGetWidth textureGetWidth;
312
+ WGPUProcTexturePin texturePin;
313
+ WGPUProcTextureSetLabel textureSetLabel;
314
+ WGPUProcTextureSetOwnershipForMemoryDump textureSetOwnershipForMemoryDump;
315
+ WGPUProcTextureUnpin textureUnpin;
316
+ WGPUProcTextureAddRef textureAddRef;
317
+ WGPUProcTextureRelease textureRelease;
318
+
319
+ WGPUProcTextureViewSetLabel textureViewSetLabel;
320
+ WGPUProcTextureViewAddRef textureViewAddRef;
321
+ WGPUProcTextureViewRelease textureViewRelease;
322
+
323
+
324
+ } DawnProcTable;
325
+
326
+ #endif // DAWN_DAWN_PROC_TABLE_H_
@@ -0,0 +1,47 @@
1
+ // Copyright 2020 The Dawn & Tint Authors
2
+ //
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
5
+ //
6
+ // 1. Redistributions of source code must retain the above copyright notice, this
7
+ // list of conditions and the following disclaimer.
8
+ //
9
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ // this list of conditions and the following disclaimer in the documentation
11
+ // and/or other materials provided with the distribution.
12
+ //
13
+ // 3. Neither the name of the copyright holder nor the names of its
14
+ // contributors may be used to endorse or promote products derived from
15
+ // this software without specific prior written permission.
16
+ //
17
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef INCLUDE_DAWN_DAWN_THREAD_DISPATCH_PROC_H_
29
+ #define INCLUDE_DAWN_DAWN_THREAD_DISPATCH_PROC_H_
30
+
31
+ #include "dawn/dawn_proc.h"
32
+
33
+ #ifdef __cplusplus
34
+ extern "C" {
35
+ #endif
36
+
37
+ // Call dawnProcSetProcs(&dawnThreadDispatchProcTable) and then use dawnProcSetPerThreadProcs
38
+ // to set per-thread procs.
39
+ WGPU_EXPORT extern DawnProcTable dawnThreadDispatchProcTable;
40
+ WGPU_EXPORT void dawnProcSetDefaultThreadProcs(const DawnProcTable* procs);
41
+ WGPU_EXPORT void dawnProcSetPerThreadProcs(const DawnProcTable* procs);
42
+
43
+ #ifdef __cplusplus
44
+ } // extern "C"
45
+ #endif
46
+
47
+ #endif // INCLUDE_DAWN_DAWN_THREAD_DISPATCH_PROC_H_
@@ -0,0 +1,65 @@
1
+ // Copyright 2023 The Dawn & Tint Authors
2
+ //
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
5
+ //
6
+ // 1. Redistributions of source code must retain the above copyright notice, this
7
+ // list of conditions and the following disclaimer.
8
+ //
9
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ // this list of conditions and the following disclaimer in the documentation
11
+ // and/or other materials provided with the distribution.
12
+ //
13
+ // 3. Neither the name of the copyright holder nor the names of its
14
+ // contributors may be used to endorse or promote products derived from
15
+ // this software without specific prior written permission.
16
+ //
17
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef INCLUDE_DAWN_NATIVE_D3D11BACKEND_H_
29
+ #define INCLUDE_DAWN_NATIVE_D3D11BACKEND_H_
30
+
31
+ #include <d3d11_1.h>
32
+ #include <wrl/client.h>
33
+
34
+ #include <memory>
35
+ #include <optional>
36
+
37
+ #include "dawn/native/D3DBackend.h"
38
+
39
+ namespace dawn::native::d3d11 {
40
+
41
+ DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr<ID3D11Device> GetD3D11Device(WGPUDevice device);
42
+
43
+ // May be chained on RequestAdapterOptions
44
+ struct DAWN_NATIVE_EXPORT RequestAdapterOptionsD3D11Device : wgpu::ChainedStruct {
45
+ RequestAdapterOptionsD3D11Device() {
46
+ sType = static_cast<wgpu::SType>(WGPUSType_RequestAdapterOptionsD3D11Device);
47
+ }
48
+
49
+ Microsoft::WRL::ComPtr<ID3D11Device> device;
50
+ };
51
+
52
+ // May be chained on SharedTextureMemoryDescriptor
53
+ struct DAWN_NATIVE_EXPORT SharedTextureMemoryD3D11Texture2DDescriptor : wgpu::ChainedStruct {
54
+ SharedTextureMemoryD3D11Texture2DDescriptor() {
55
+ sType = static_cast<wgpu::SType>(WGPUSType_SharedTextureMemoryD3D11Texture2DDescriptor);
56
+ }
57
+
58
+ // This ID3D11Texture2D object must be created from the same ID3D11Device used in the
59
+ // WGPUDevice.
60
+ Microsoft::WRL::ComPtr<ID3D11Texture2D> texture;
61
+ };
62
+
63
+ } // namespace dawn::native::d3d11
64
+
65
+ #endif // INCLUDE_DAWN_NATIVE_D3D11BACKEND_H_
@@ -0,0 +1,102 @@
1
+ // Copyright 2018 The Dawn & Tint Authors
2
+ //
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
5
+ //
6
+ // 1. Redistributions of source code must retain the above copyright notice, this
7
+ // list of conditions and the following disclaimer.
8
+ //
9
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ // this list of conditions and the following disclaimer in the documentation
11
+ // and/or other materials provided with the distribution.
12
+ //
13
+ // 3. Neither the name of the copyright holder nor the names of its
14
+ // contributors may be used to endorse or promote products derived from
15
+ // this software without specific prior written permission.
16
+ //
17
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef INCLUDE_DAWN_NATIVE_D3D12BACKEND_H_
29
+ #define INCLUDE_DAWN_NATIVE_D3D12BACKEND_H_
30
+
31
+ #include <d3d11on12.h>
32
+ #include <d3d12.h>
33
+ #include <dxgi1_4.h>
34
+ #include <wrl/client.h>
35
+
36
+ #include "dawn/native/D3DBackend.h"
37
+
38
+ struct ID3D12Device;
39
+ struct ID3D12Resource;
40
+
41
+ namespace dawn::native::d3d12 {
42
+
43
+ class Device;
44
+
45
+ enum MemorySegment {
46
+ Local,
47
+ NonLocal,
48
+ };
49
+
50
+ DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr<ID3D12Device> GetD3D12Device(WGPUDevice device);
51
+
52
+ DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr<ID3D11On12Device> GetOrCreateD3D11On12Device(
53
+ WGPUDevice device);
54
+
55
+ DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr<ID3D12CommandQueue> GetD3D12CommandQueue(
56
+ WGPUDevice device);
57
+
58
+ DAWN_NATIVE_EXPORT uint64_t SetExternalMemoryReservation(WGPUDevice device,
59
+ uint64_t requestedReservationSize,
60
+ MemorySegment memorySegment);
61
+
62
+ // May be chained on SharedBufferMemoryDescriptor
63
+ struct DAWN_NATIVE_EXPORT SharedBufferMemoryD3D12ResourceDescriptor : wgpu::ChainedStruct {
64
+ SharedBufferMemoryD3D12ResourceDescriptor() {
65
+ sType = static_cast<wgpu::SType>(WGPUSType_SharedBufferMemoryD3D12ResourceDescriptor);
66
+ }
67
+
68
+ // This ID3D12Resource object must be created from the same ID3D12Device used in the
69
+ // WGPUDevice.
70
+ Microsoft::WRL::ComPtr<ID3D12Resource> resource;
71
+ };
72
+
73
+ // May be chained on SharedBufferMemoryDescriptor
74
+ struct DAWN_NATIVE_EXPORT SharedBufferMemoryD3D12SharedMemoryFileHandleDescriptor
75
+ : wgpu::ChainedStruct {
76
+ SharedBufferMemoryD3D12SharedMemoryFileHandleDescriptor() {
77
+ sType = static_cast<wgpu::SType>(
78
+ WGPUSType_SharedBufferMemoryD3D12SharedMemoryFileMappingHandleDescriptor);
79
+ }
80
+ // A handle to a shared memory file created with CreateFileMapping. The handle must be closed
81
+ // outside of Dawn with CloseHandle when it is no longer needed.
82
+ HANDLE handle = nullptr;
83
+ uint64_t size = 0u;
84
+
85
+ // The size must be a multiple of this alignment to hold a D3D12 buffer resource.
86
+ constexpr static uint32_t kRequiredAlignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
87
+ };
88
+
89
+ // May be chained on SharedTextureMemoryDescriptor.
90
+ struct DAWN_NATIVE_EXPORT SharedTextureMemoryD3D12ResourceDescriptor : wgpu::ChainedStruct {
91
+ SharedTextureMemoryD3D12ResourceDescriptor() {
92
+ sType = static_cast<wgpu::SType>(WGPUSType_SharedTextureMemoryD3D12ResourceDescriptor);
93
+ }
94
+
95
+ // This ID3D12Resource object must be created from the same ID3D12Device used in the
96
+ // WGPUDevice.
97
+ Microsoft::WRL::ComPtr<ID3D12Resource> resource;
98
+ };
99
+
100
+ } // namespace dawn::native::d3d12
101
+
102
+ #endif // INCLUDE_DAWN_NATIVE_D3D12BACKEND_H_
@@ -0,0 +1,56 @@
1
+ // Copyright 2023 The Dawn & Tint Authors
2
+ //
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are met:
5
+ //
6
+ // 1. Redistributions of source code must retain the above copyright notice, this
7
+ // list of conditions and the following disclaimer.
8
+ //
9
+ // 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ // this list of conditions and the following disclaimer in the documentation
11
+ // and/or other materials provided with the distribution.
12
+ //
13
+ // 3. Neither the name of the copyright holder nor the names of its
14
+ // contributors may be used to endorse or promote products derived from
15
+ // this software without specific prior written permission.
16
+ //
17
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+ #ifndef INCLUDE_DAWN_NATIVE_D3DBACKEND_H_
29
+ #define INCLUDE_DAWN_NATIVE_D3DBACKEND_H_
30
+
31
+ #include <dxgi1_4.h>
32
+ #include <webgpu/webgpu_cpp_chained_struct.h>
33
+ #include <wrl/client.h>
34
+
35
+ #include <memory>
36
+ #include <vector>
37
+
38
+ #include "dawn/native/DawnNative.h"
39
+
40
+ namespace dawn::native::d3d {
41
+
42
+ DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr<IDXGIAdapter> GetDXGIAdapter(WGPUAdapter adapter);
43
+
44
+ // Can be chained in WGPURequestAdapterOptions
45
+ struct DAWN_NATIVE_EXPORT RequestAdapterOptionsLUID : wgpu::ChainedStruct {
46
+ RequestAdapterOptionsLUID();
47
+
48
+ ::LUID adapterLUID;
49
+ };
50
+
51
+ // Chrome uses 0 as acquire key.
52
+ static constexpr uint64_t kDXGIKeyedMutexAcquireKey = 0;
53
+
54
+ } // namespace dawn::native::d3d
55
+
56
+ #endif // INCLUDE_DAWN_NATIVE_D3DBACKEND_H_