react-native-wgpu 0.3.1 → 0.4.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/README.md +7 -5
- package/apple/MetalView.mm +1 -1
- package/cpp/rnwgpu/api/GPU.h +0 -1
- package/cpp/rnwgpu/api/GPUAdapter.cpp +7 -7
- package/cpp/webgpu/webgpu.h +4827 -5
- package/cpp/webgpu/webgpu_cpp.h +10140 -5
- package/cpp/webgpu/webgpu_cpp_print.h +2687 -5
- package/lib/commonjs/Canvas.js +10 -3
- package/lib/commonjs/Canvas.js.map +1 -1
- package/lib/commonjs/WebGPUViewNativeComponent.web.js +99 -0
- package/lib/commonjs/WebGPUViewNativeComponent.web.js.map +1 -0
- package/lib/commonjs/WebPolyfillGPUModule.js +40 -0
- package/lib/commonjs/WebPolyfillGPUModule.js.map +1 -0
- package/lib/commonjs/index.js +4 -208
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/main/index.js +227 -0
- package/lib/commonjs/main/index.js.map +1 -0
- package/lib/commonjs/main/index.web.js +51 -0
- package/lib/commonjs/main/index.web.js.map +1 -0
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/utils.js +11 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/module/Canvas.js +11 -4
- package/lib/module/Canvas.js.map +1 -1
- package/lib/module/WebGPUViewNativeComponent.web.js +93 -0
- package/lib/module/WebGPUViewNativeComponent.web.js.map +1 -0
- package/lib/module/WebPolyfillGPUModule.js +38 -0
- package/lib/module/WebPolyfillGPUModule.js.map +1 -0
- package/lib/module/index.js +3 -160
- package/lib/module/index.js.map +1 -1
- package/lib/module/main/index.js +168 -0
- package/lib/module/main/index.js.map +1 -0
- package/lib/module/main/index.web.js +8 -0
- package/lib/module/main/index.web.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils.js +5 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/typescript/lib/commonjs/WebGPUViewNativeComponent.web.d.ts +5 -0
- package/lib/typescript/lib/commonjs/WebGPUViewNativeComponent.web.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/WebPolyfillGPUModule.d.ts +2 -0
- package/lib/typescript/lib/commonjs/WebPolyfillGPUModule.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts +0 -1
- package/lib/typescript/lib/commonjs/main/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/main/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/main/index.web.d.ts +2 -0
- package/lib/typescript/lib/commonjs/main/index.web.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/types.d.ts +1 -0
- package/lib/typescript/lib/commonjs/types.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils.d.ts +3 -0
- package/lib/typescript/lib/commonjs/utils.d.ts.map +1 -0
- package/lib/typescript/lib/module/Canvas.d.ts.map +1 -1
- package/lib/typescript/lib/module/WebGPUViewNativeComponent.web.d.ts +2 -0
- package/lib/typescript/lib/module/WebGPUViewNativeComponent.web.d.ts.map +1 -0
- package/lib/typescript/lib/module/WebPolyfillGPUModule.d.ts +2 -0
- package/lib/typescript/lib/module/WebPolyfillGPUModule.d.ts.map +1 -0
- package/lib/typescript/lib/module/index.d.ts +1 -5
- package/lib/typescript/lib/module/main/index.d.ts +6 -0
- package/lib/typescript/lib/module/main/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/main/index.web.d.ts +5 -0
- package/lib/typescript/lib/module/main/index.web.d.ts.map +1 -0
- package/lib/typescript/lib/module/types.d.ts +1 -0
- package/lib/typescript/lib/module/types.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils.d.ts +2 -0
- package/lib/typescript/lib/module/utils.d.ts.map +1 -0
- package/lib/typescript/src/Canvas.d.ts.map +1 -1
- package/lib/typescript/src/WebGPUViewNativeComponent.d.ts +1 -1
- package/lib/typescript/src/WebGPUViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/WebGPUViewNativeComponent.web.d.ts +118 -0
- package/lib/typescript/src/WebGPUViewNativeComponent.web.d.ts.map +1 -0
- package/lib/typescript/src/WebPolyfillGPUModule.d.ts +2 -0
- package/lib/typescript/src/WebPolyfillGPUModule.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +16 -5
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/main/index.d.ts +6 -0
- package/lib/typescript/src/main/index.d.ts.map +1 -0
- package/lib/typescript/src/main/index.web.d.ts +6 -0
- package/lib/typescript/src/main/index.web.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +19 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts +2 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/package.json +2 -1
- package/src/Canvas.tsx +12 -4
- package/src/WebGPUViewNativeComponent.ts +1 -1
- package/src/WebGPUViewNativeComponent.web.ts +108 -0
- package/src/WebPolyfillGPUModule.ts +53 -0
- package/src/index.tsx +25 -196
- package/src/main/index.tsx +204 -0
- package/src/main/index.web.tsx +8 -0
- package/src/types.ts +20 -0
- package/src/utils.ts +4 -0
- package/cpp/dawn/dawn_proc_table.h +0 -313
- package/cpp/dawn/native/DawnNative.h +0 -361
- package/cpp/dawn/native/NullBackend.h +0 -39
- package/cpp/dawn/native/OpenGLBackend.h +0 -82
- package/cpp/dawn/native/VulkanBackend.h +0 -183
- package/cpp/dawn/native/dawn_native_export.h +0 -49
- package/cpp/dawn/webgpu.h +0 -4855
- package/cpp/dawn/webgpu_cpp.h +0 -10168
- package/cpp/dawn/webgpu_cpp_print.h +0 -2715
- package/cpp/dawn/wire/client/webgpu.h +0 -354
- package/cpp/dawn/wire/client/webgpu_cpp.h +0 -10343
- package/cpp/dawn/wire/client/webgpu_cpp_print.h +0 -2715
- package/lib/commonjs/WebGPUView.js +0 -2
- package/lib/commonjs/WebGPUView.js.map +0 -1
- package/lib/module/WebGPUView.js +0 -2
- package/lib/module/WebGPUView.js.map +0 -1
- package/lib/typescript/lib/commonjs/WebGPUView.d.ts +0 -1
- package/lib/typescript/lib/commonjs/WebGPUView.d.ts.map +0 -1
- package/lib/typescript/lib/module/WebGPUView.d.ts +0 -1
- package/lib/typescript/lib/module/WebGPUView.d.ts.map +0 -1
- package/lib/typescript/src/WebGPUView.d.ts +0 -1
- package/lib/typescript/src/WebGPUView.d.ts.map +0 -1
- package/src/WebGPUView.tsx +0 -0
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
#ifndef DAWN_DAWN_PROC_TABLE_H_
|
|
3
|
-
#define DAWN_DAWN_PROC_TABLE_H_
|
|
4
|
-
|
|
5
|
-
#include "dawn/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
|
-
WGPUProcBindGroupDestroy bindGroupDestroy;
|
|
33
|
-
WGPUProcBindGroupSetLabel bindGroupSetLabel;
|
|
34
|
-
WGPUProcBindGroupAddRef bindGroupAddRef;
|
|
35
|
-
WGPUProcBindGroupRelease bindGroupRelease;
|
|
36
|
-
|
|
37
|
-
WGPUProcBindGroupLayoutSetLabel bindGroupLayoutSetLabel;
|
|
38
|
-
WGPUProcBindGroupLayoutAddRef bindGroupLayoutAddRef;
|
|
39
|
-
WGPUProcBindGroupLayoutRelease bindGroupLayoutRelease;
|
|
40
|
-
|
|
41
|
-
WGPUProcBufferCreateTexelView bufferCreateTexelView;
|
|
42
|
-
WGPUProcBufferDestroy bufferDestroy;
|
|
43
|
-
WGPUProcBufferGetConstMappedRange bufferGetConstMappedRange;
|
|
44
|
-
WGPUProcBufferGetMappedRange bufferGetMappedRange;
|
|
45
|
-
WGPUProcBufferGetMapState bufferGetMapState;
|
|
46
|
-
WGPUProcBufferGetSize bufferGetSize;
|
|
47
|
-
WGPUProcBufferGetUsage bufferGetUsage;
|
|
48
|
-
WGPUProcBufferMapAsync bufferMapAsync;
|
|
49
|
-
WGPUProcBufferReadMappedRange bufferReadMappedRange;
|
|
50
|
-
WGPUProcBufferSetLabel bufferSetLabel;
|
|
51
|
-
WGPUProcBufferUnmap bufferUnmap;
|
|
52
|
-
WGPUProcBufferWriteMappedRange bufferWriteMappedRange;
|
|
53
|
-
WGPUProcBufferAddRef bufferAddRef;
|
|
54
|
-
WGPUProcBufferRelease bufferRelease;
|
|
55
|
-
|
|
56
|
-
WGPUProcCommandBufferSetLabel commandBufferSetLabel;
|
|
57
|
-
WGPUProcCommandBufferAddRef commandBufferAddRef;
|
|
58
|
-
WGPUProcCommandBufferRelease commandBufferRelease;
|
|
59
|
-
|
|
60
|
-
WGPUProcCommandEncoderBeginComputePass commandEncoderBeginComputePass;
|
|
61
|
-
WGPUProcCommandEncoderBeginRenderPass commandEncoderBeginRenderPass;
|
|
62
|
-
WGPUProcCommandEncoderClearBuffer commandEncoderClearBuffer;
|
|
63
|
-
WGPUProcCommandEncoderCopyBufferToBuffer commandEncoderCopyBufferToBuffer;
|
|
64
|
-
WGPUProcCommandEncoderCopyBufferToTexture commandEncoderCopyBufferToTexture;
|
|
65
|
-
WGPUProcCommandEncoderCopyTextureToBuffer commandEncoderCopyTextureToBuffer;
|
|
66
|
-
WGPUProcCommandEncoderCopyTextureToTexture commandEncoderCopyTextureToTexture;
|
|
67
|
-
WGPUProcCommandEncoderFinish commandEncoderFinish;
|
|
68
|
-
WGPUProcCommandEncoderInjectValidationError commandEncoderInjectValidationError;
|
|
69
|
-
WGPUProcCommandEncoderInsertDebugMarker commandEncoderInsertDebugMarker;
|
|
70
|
-
WGPUProcCommandEncoderPopDebugGroup commandEncoderPopDebugGroup;
|
|
71
|
-
WGPUProcCommandEncoderPushDebugGroup commandEncoderPushDebugGroup;
|
|
72
|
-
WGPUProcCommandEncoderResolveQuerySet commandEncoderResolveQuerySet;
|
|
73
|
-
WGPUProcCommandEncoderSetLabel commandEncoderSetLabel;
|
|
74
|
-
WGPUProcCommandEncoderWriteBuffer commandEncoderWriteBuffer;
|
|
75
|
-
WGPUProcCommandEncoderWriteTimestamp commandEncoderWriteTimestamp;
|
|
76
|
-
WGPUProcCommandEncoderAddRef commandEncoderAddRef;
|
|
77
|
-
WGPUProcCommandEncoderRelease commandEncoderRelease;
|
|
78
|
-
|
|
79
|
-
WGPUProcComputePassEncoderDispatchWorkgroups computePassEncoderDispatchWorkgroups;
|
|
80
|
-
WGPUProcComputePassEncoderDispatchWorkgroupsIndirect computePassEncoderDispatchWorkgroupsIndirect;
|
|
81
|
-
WGPUProcComputePassEncoderEnd computePassEncoderEnd;
|
|
82
|
-
WGPUProcComputePassEncoderInsertDebugMarker computePassEncoderInsertDebugMarker;
|
|
83
|
-
WGPUProcComputePassEncoderPopDebugGroup computePassEncoderPopDebugGroup;
|
|
84
|
-
WGPUProcComputePassEncoderPushDebugGroup computePassEncoderPushDebugGroup;
|
|
85
|
-
WGPUProcComputePassEncoderSetBindGroup computePassEncoderSetBindGroup;
|
|
86
|
-
WGPUProcComputePassEncoderSetImmediateData computePassEncoderSetImmediateData;
|
|
87
|
-
WGPUProcComputePassEncoderSetLabel computePassEncoderSetLabel;
|
|
88
|
-
WGPUProcComputePassEncoderSetPipeline computePassEncoderSetPipeline;
|
|
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
|
-
WGPUProcDeviceCreateSampler deviceCreateSampler;
|
|
117
|
-
WGPUProcDeviceCreateShaderModule deviceCreateShaderModule;
|
|
118
|
-
WGPUProcDeviceCreateTexture deviceCreateTexture;
|
|
119
|
-
WGPUProcDeviceDestroy deviceDestroy;
|
|
120
|
-
WGPUProcDeviceForceLoss deviceForceLoss;
|
|
121
|
-
WGPUProcDeviceGetAdapter deviceGetAdapter;
|
|
122
|
-
WGPUProcDeviceGetAdapterInfo deviceGetAdapterInfo;
|
|
123
|
-
WGPUProcDeviceGetAHardwareBufferProperties deviceGetAHardwareBufferProperties;
|
|
124
|
-
WGPUProcDeviceGetFeatures deviceGetFeatures;
|
|
125
|
-
WGPUProcDeviceGetLimits deviceGetLimits;
|
|
126
|
-
WGPUProcDeviceGetLostFuture deviceGetLostFuture;
|
|
127
|
-
WGPUProcDeviceGetQueue deviceGetQueue;
|
|
128
|
-
WGPUProcDeviceHasFeature deviceHasFeature;
|
|
129
|
-
WGPUProcDeviceImportSharedBufferMemory deviceImportSharedBufferMemory;
|
|
130
|
-
WGPUProcDeviceImportSharedFence deviceImportSharedFence;
|
|
131
|
-
WGPUProcDeviceImportSharedTextureMemory deviceImportSharedTextureMemory;
|
|
132
|
-
WGPUProcDeviceInjectError deviceInjectError;
|
|
133
|
-
WGPUProcDevicePopErrorScope devicePopErrorScope;
|
|
134
|
-
WGPUProcDevicePushErrorScope devicePushErrorScope;
|
|
135
|
-
WGPUProcDeviceSetLabel deviceSetLabel;
|
|
136
|
-
WGPUProcDeviceSetLoggingCallback deviceSetLoggingCallback;
|
|
137
|
-
WGPUProcDeviceTick deviceTick;
|
|
138
|
-
WGPUProcDeviceValidateTextureDescriptor deviceValidateTextureDescriptor;
|
|
139
|
-
WGPUProcDeviceAddRef deviceAddRef;
|
|
140
|
-
WGPUProcDeviceRelease deviceRelease;
|
|
141
|
-
|
|
142
|
-
WGPUProcExternalTextureDestroy externalTextureDestroy;
|
|
143
|
-
WGPUProcExternalTextureExpire externalTextureExpire;
|
|
144
|
-
WGPUProcExternalTextureRefresh externalTextureRefresh;
|
|
145
|
-
WGPUProcExternalTextureSetLabel externalTextureSetLabel;
|
|
146
|
-
WGPUProcExternalTextureAddRef externalTextureAddRef;
|
|
147
|
-
WGPUProcExternalTextureRelease externalTextureRelease;
|
|
148
|
-
|
|
149
|
-
WGPUProcInstanceCreateSurface instanceCreateSurface;
|
|
150
|
-
WGPUProcInstanceGetWGSLLanguageFeatures instanceGetWGSLLanguageFeatures;
|
|
151
|
-
WGPUProcInstanceHasWGSLLanguageFeature instanceHasWGSLLanguageFeature;
|
|
152
|
-
WGPUProcInstanceProcessEvents instanceProcessEvents;
|
|
153
|
-
WGPUProcInstanceRequestAdapter instanceRequestAdapter;
|
|
154
|
-
WGPUProcInstanceWaitAny instanceWaitAny;
|
|
155
|
-
WGPUProcInstanceAddRef instanceAddRef;
|
|
156
|
-
WGPUProcInstanceRelease instanceRelease;
|
|
157
|
-
|
|
158
|
-
WGPUProcPipelineLayoutSetLabel pipelineLayoutSetLabel;
|
|
159
|
-
WGPUProcPipelineLayoutAddRef pipelineLayoutAddRef;
|
|
160
|
-
WGPUProcPipelineLayoutRelease pipelineLayoutRelease;
|
|
161
|
-
|
|
162
|
-
WGPUProcQuerySetDestroy querySetDestroy;
|
|
163
|
-
WGPUProcQuerySetGetCount querySetGetCount;
|
|
164
|
-
WGPUProcQuerySetGetType querySetGetType;
|
|
165
|
-
WGPUProcQuerySetSetLabel querySetSetLabel;
|
|
166
|
-
WGPUProcQuerySetAddRef querySetAddRef;
|
|
167
|
-
WGPUProcQuerySetRelease querySetRelease;
|
|
168
|
-
|
|
169
|
-
WGPUProcQueueCopyExternalTextureForBrowser queueCopyExternalTextureForBrowser;
|
|
170
|
-
WGPUProcQueueCopyTextureForBrowser queueCopyTextureForBrowser;
|
|
171
|
-
WGPUProcQueueOnSubmittedWorkDone queueOnSubmittedWorkDone;
|
|
172
|
-
WGPUProcQueueSetLabel queueSetLabel;
|
|
173
|
-
WGPUProcQueueSubmit queueSubmit;
|
|
174
|
-
WGPUProcQueueWriteBuffer queueWriteBuffer;
|
|
175
|
-
WGPUProcQueueWriteTexture queueWriteTexture;
|
|
176
|
-
WGPUProcQueueAddRef queueAddRef;
|
|
177
|
-
WGPUProcQueueRelease queueRelease;
|
|
178
|
-
|
|
179
|
-
WGPUProcRenderBundleSetLabel renderBundleSetLabel;
|
|
180
|
-
WGPUProcRenderBundleAddRef renderBundleAddRef;
|
|
181
|
-
WGPUProcRenderBundleRelease renderBundleRelease;
|
|
182
|
-
|
|
183
|
-
WGPUProcRenderBundleEncoderDraw renderBundleEncoderDraw;
|
|
184
|
-
WGPUProcRenderBundleEncoderDrawIndexed renderBundleEncoderDrawIndexed;
|
|
185
|
-
WGPUProcRenderBundleEncoderDrawIndexedIndirect renderBundleEncoderDrawIndexedIndirect;
|
|
186
|
-
WGPUProcRenderBundleEncoderDrawIndirect renderBundleEncoderDrawIndirect;
|
|
187
|
-
WGPUProcRenderBundleEncoderFinish renderBundleEncoderFinish;
|
|
188
|
-
WGPUProcRenderBundleEncoderInsertDebugMarker renderBundleEncoderInsertDebugMarker;
|
|
189
|
-
WGPUProcRenderBundleEncoderPopDebugGroup renderBundleEncoderPopDebugGroup;
|
|
190
|
-
WGPUProcRenderBundleEncoderPushDebugGroup renderBundleEncoderPushDebugGroup;
|
|
191
|
-
WGPUProcRenderBundleEncoderSetBindGroup renderBundleEncoderSetBindGroup;
|
|
192
|
-
WGPUProcRenderBundleEncoderSetImmediateData renderBundleEncoderSetImmediateData;
|
|
193
|
-
WGPUProcRenderBundleEncoderSetIndexBuffer renderBundleEncoderSetIndexBuffer;
|
|
194
|
-
WGPUProcRenderBundleEncoderSetLabel renderBundleEncoderSetLabel;
|
|
195
|
-
WGPUProcRenderBundleEncoderSetPipeline renderBundleEncoderSetPipeline;
|
|
196
|
-
WGPUProcRenderBundleEncoderSetVertexBuffer renderBundleEncoderSetVertexBuffer;
|
|
197
|
-
WGPUProcRenderBundleEncoderAddRef renderBundleEncoderAddRef;
|
|
198
|
-
WGPUProcRenderBundleEncoderRelease renderBundleEncoderRelease;
|
|
199
|
-
|
|
200
|
-
WGPUProcRenderPassEncoderBeginOcclusionQuery renderPassEncoderBeginOcclusionQuery;
|
|
201
|
-
WGPUProcRenderPassEncoderDraw renderPassEncoderDraw;
|
|
202
|
-
WGPUProcRenderPassEncoderDrawIndexed renderPassEncoderDrawIndexed;
|
|
203
|
-
WGPUProcRenderPassEncoderDrawIndexedIndirect renderPassEncoderDrawIndexedIndirect;
|
|
204
|
-
WGPUProcRenderPassEncoderDrawIndirect renderPassEncoderDrawIndirect;
|
|
205
|
-
WGPUProcRenderPassEncoderEnd renderPassEncoderEnd;
|
|
206
|
-
WGPUProcRenderPassEncoderEndOcclusionQuery renderPassEncoderEndOcclusionQuery;
|
|
207
|
-
WGPUProcRenderPassEncoderExecuteBundles renderPassEncoderExecuteBundles;
|
|
208
|
-
WGPUProcRenderPassEncoderInsertDebugMarker renderPassEncoderInsertDebugMarker;
|
|
209
|
-
WGPUProcRenderPassEncoderMultiDrawIndexedIndirect renderPassEncoderMultiDrawIndexedIndirect;
|
|
210
|
-
WGPUProcRenderPassEncoderMultiDrawIndirect renderPassEncoderMultiDrawIndirect;
|
|
211
|
-
WGPUProcRenderPassEncoderPixelLocalStorageBarrier renderPassEncoderPixelLocalStorageBarrier;
|
|
212
|
-
WGPUProcRenderPassEncoderPopDebugGroup renderPassEncoderPopDebugGroup;
|
|
213
|
-
WGPUProcRenderPassEncoderPushDebugGroup renderPassEncoderPushDebugGroup;
|
|
214
|
-
WGPUProcRenderPassEncoderSetBindGroup renderPassEncoderSetBindGroup;
|
|
215
|
-
WGPUProcRenderPassEncoderSetBlendConstant renderPassEncoderSetBlendConstant;
|
|
216
|
-
WGPUProcRenderPassEncoderSetImmediateData renderPassEncoderSetImmediateData;
|
|
217
|
-
WGPUProcRenderPassEncoderSetIndexBuffer renderPassEncoderSetIndexBuffer;
|
|
218
|
-
WGPUProcRenderPassEncoderSetLabel renderPassEncoderSetLabel;
|
|
219
|
-
WGPUProcRenderPassEncoderSetPipeline renderPassEncoderSetPipeline;
|
|
220
|
-
WGPUProcRenderPassEncoderSetScissorRect renderPassEncoderSetScissorRect;
|
|
221
|
-
WGPUProcRenderPassEncoderSetStencilReference renderPassEncoderSetStencilReference;
|
|
222
|
-
WGPUProcRenderPassEncoderSetVertexBuffer renderPassEncoderSetVertexBuffer;
|
|
223
|
-
WGPUProcRenderPassEncoderSetViewport renderPassEncoderSetViewport;
|
|
224
|
-
WGPUProcRenderPassEncoderWriteTimestamp renderPassEncoderWriteTimestamp;
|
|
225
|
-
WGPUProcRenderPassEncoderAddRef renderPassEncoderAddRef;
|
|
226
|
-
WGPUProcRenderPassEncoderRelease renderPassEncoderRelease;
|
|
227
|
-
|
|
228
|
-
WGPUProcRenderPipelineGetBindGroupLayout renderPipelineGetBindGroupLayout;
|
|
229
|
-
WGPUProcRenderPipelineSetLabel renderPipelineSetLabel;
|
|
230
|
-
WGPUProcRenderPipelineAddRef renderPipelineAddRef;
|
|
231
|
-
WGPUProcRenderPipelineRelease renderPipelineRelease;
|
|
232
|
-
|
|
233
|
-
WGPUProcSamplerSetLabel samplerSetLabel;
|
|
234
|
-
WGPUProcSamplerAddRef samplerAddRef;
|
|
235
|
-
WGPUProcSamplerRelease samplerRelease;
|
|
236
|
-
|
|
237
|
-
WGPUProcShaderModuleGetCompilationInfo shaderModuleGetCompilationInfo;
|
|
238
|
-
WGPUProcShaderModuleSetLabel shaderModuleSetLabel;
|
|
239
|
-
WGPUProcShaderModuleAddRef shaderModuleAddRef;
|
|
240
|
-
WGPUProcShaderModuleRelease shaderModuleRelease;
|
|
241
|
-
|
|
242
|
-
WGPUProcSharedBufferMemoryBeginAccess sharedBufferMemoryBeginAccess;
|
|
243
|
-
WGPUProcSharedBufferMemoryCreateBuffer sharedBufferMemoryCreateBuffer;
|
|
244
|
-
WGPUProcSharedBufferMemoryEndAccess sharedBufferMemoryEndAccess;
|
|
245
|
-
WGPUProcSharedBufferMemoryGetProperties sharedBufferMemoryGetProperties;
|
|
246
|
-
WGPUProcSharedBufferMemoryIsDeviceLost sharedBufferMemoryIsDeviceLost;
|
|
247
|
-
WGPUProcSharedBufferMemorySetLabel sharedBufferMemorySetLabel;
|
|
248
|
-
WGPUProcSharedBufferMemoryAddRef sharedBufferMemoryAddRef;
|
|
249
|
-
WGPUProcSharedBufferMemoryRelease sharedBufferMemoryRelease;
|
|
250
|
-
|
|
251
|
-
WGPUProcSharedBufferMemoryEndAccessStateFreeMembers sharedBufferMemoryEndAccessStateFreeMembers;
|
|
252
|
-
|
|
253
|
-
WGPUProcSharedFenceExportInfo sharedFenceExportInfo;
|
|
254
|
-
WGPUProcSharedFenceAddRef sharedFenceAddRef;
|
|
255
|
-
WGPUProcSharedFenceRelease sharedFenceRelease;
|
|
256
|
-
|
|
257
|
-
WGPUProcSharedTextureMemoryBeginAccess sharedTextureMemoryBeginAccess;
|
|
258
|
-
WGPUProcSharedTextureMemoryCreateTexture sharedTextureMemoryCreateTexture;
|
|
259
|
-
WGPUProcSharedTextureMemoryEndAccess sharedTextureMemoryEndAccess;
|
|
260
|
-
WGPUProcSharedTextureMemoryGetProperties sharedTextureMemoryGetProperties;
|
|
261
|
-
WGPUProcSharedTextureMemoryIsDeviceLost sharedTextureMemoryIsDeviceLost;
|
|
262
|
-
WGPUProcSharedTextureMemorySetLabel sharedTextureMemorySetLabel;
|
|
263
|
-
WGPUProcSharedTextureMemoryAddRef sharedTextureMemoryAddRef;
|
|
264
|
-
WGPUProcSharedTextureMemoryRelease sharedTextureMemoryRelease;
|
|
265
|
-
|
|
266
|
-
WGPUProcSharedTextureMemoryEndAccessStateFreeMembers sharedTextureMemoryEndAccessStateFreeMembers;
|
|
267
|
-
|
|
268
|
-
WGPUProcSupportedFeaturesFreeMembers supportedFeaturesFreeMembers;
|
|
269
|
-
|
|
270
|
-
WGPUProcSupportedInstanceFeaturesFreeMembers supportedInstanceFeaturesFreeMembers;
|
|
271
|
-
|
|
272
|
-
WGPUProcSupportedWGSLLanguageFeaturesFreeMembers supportedWGSLLanguageFeaturesFreeMembers;
|
|
273
|
-
|
|
274
|
-
WGPUProcSurfaceConfigure surfaceConfigure;
|
|
275
|
-
WGPUProcSurfaceGetCapabilities surfaceGetCapabilities;
|
|
276
|
-
WGPUProcSurfaceGetCurrentTexture surfaceGetCurrentTexture;
|
|
277
|
-
WGPUProcSurfacePresent surfacePresent;
|
|
278
|
-
WGPUProcSurfaceSetLabel surfaceSetLabel;
|
|
279
|
-
WGPUProcSurfaceUnconfigure surfaceUnconfigure;
|
|
280
|
-
WGPUProcSurfaceAddRef surfaceAddRef;
|
|
281
|
-
WGPUProcSurfaceRelease surfaceRelease;
|
|
282
|
-
|
|
283
|
-
WGPUProcSurfaceCapabilitiesFreeMembers surfaceCapabilitiesFreeMembers;
|
|
284
|
-
|
|
285
|
-
WGPUProcTexelBufferViewSetLabel texelBufferViewSetLabel;
|
|
286
|
-
WGPUProcTexelBufferViewAddRef texelBufferViewAddRef;
|
|
287
|
-
WGPUProcTexelBufferViewRelease texelBufferViewRelease;
|
|
288
|
-
|
|
289
|
-
WGPUProcTextureCreateErrorView textureCreateErrorView;
|
|
290
|
-
WGPUProcTextureCreateView textureCreateView;
|
|
291
|
-
WGPUProcTextureDestroy textureDestroy;
|
|
292
|
-
WGPUProcTextureGetDepthOrArrayLayers textureGetDepthOrArrayLayers;
|
|
293
|
-
WGPUProcTextureGetDimension textureGetDimension;
|
|
294
|
-
WGPUProcTextureGetFormat textureGetFormat;
|
|
295
|
-
WGPUProcTextureGetHeight textureGetHeight;
|
|
296
|
-
WGPUProcTextureGetMipLevelCount textureGetMipLevelCount;
|
|
297
|
-
WGPUProcTextureGetSampleCount textureGetSampleCount;
|
|
298
|
-
WGPUProcTextureGetUsage textureGetUsage;
|
|
299
|
-
WGPUProcTextureGetWidth textureGetWidth;
|
|
300
|
-
WGPUProcTexturePin texturePin;
|
|
301
|
-
WGPUProcTextureSetLabel textureSetLabel;
|
|
302
|
-
WGPUProcTextureUnpin textureUnpin;
|
|
303
|
-
WGPUProcTextureAddRef textureAddRef;
|
|
304
|
-
WGPUProcTextureRelease textureRelease;
|
|
305
|
-
|
|
306
|
-
WGPUProcTextureViewSetLabel textureViewSetLabel;
|
|
307
|
-
WGPUProcTextureViewAddRef textureViewAddRef;
|
|
308
|
-
WGPUProcTextureViewRelease textureViewRelease;
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
} DawnProcTable;
|
|
312
|
-
|
|
313
|
-
#endif // DAWN_DAWN_PROC_TABLE_H_
|
|
@@ -1,361 +0,0 @@
|
|
|
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_DAWNNATIVE_H_
|
|
29
|
-
#define INCLUDE_DAWN_NATIVE_DAWNNATIVE_H_
|
|
30
|
-
|
|
31
|
-
#include <webgpu/webgpu_cpp.h>
|
|
32
|
-
|
|
33
|
-
#include <string>
|
|
34
|
-
#include <string_view>
|
|
35
|
-
#include <vector>
|
|
36
|
-
|
|
37
|
-
#include "dawn/dawn_proc_table.h"
|
|
38
|
-
#include "dawn/native/dawn_native_export.h"
|
|
39
|
-
|
|
40
|
-
namespace dawn::platform {
|
|
41
|
-
class Platform;
|
|
42
|
-
} // namespace dawn::platform
|
|
43
|
-
|
|
44
|
-
namespace dawn::native {
|
|
45
|
-
|
|
46
|
-
class InstanceBase;
|
|
47
|
-
class AdapterBase;
|
|
48
|
-
|
|
49
|
-
// Each toggle is assigned with a TogglesStage, indicating the validation and earliest usage
|
|
50
|
-
// time of the toggle.
|
|
51
|
-
enum class ToggleStage { Instance, Adapter, Device };
|
|
52
|
-
|
|
53
|
-
// A struct to record the information of a toggle. A toggle is a code path in Dawn device that
|
|
54
|
-
// can be manually configured to run or not outside Dawn, including workarounds, special
|
|
55
|
-
// features and optimizations.
|
|
56
|
-
struct ToggleInfo {
|
|
57
|
-
const char* name;
|
|
58
|
-
const char* description;
|
|
59
|
-
const char* url;
|
|
60
|
-
ToggleStage stage;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
// A struct to record the information of a feature. A feature is a GPU feature that is not
|
|
64
|
-
// required to be supported by all Dawn backends and can only be used when it is enabled on the
|
|
65
|
-
// creation of device.
|
|
66
|
-
struct FeatureInfo {
|
|
67
|
-
const char* name;
|
|
68
|
-
const char* description;
|
|
69
|
-
const char* url;
|
|
70
|
-
// The enum of feature state, could be stable or experimental. Using an experimental feature
|
|
71
|
-
// requires the AllowUnsafeAPIs toggle to be enabled.
|
|
72
|
-
enum class FeatureState { Stable = 0, Experimental };
|
|
73
|
-
FeatureState featureState;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
// An adapter is an object that represent on possibility of creating devices in the system.
|
|
77
|
-
// Most of the time it will represent a combination of a physical GPU and an API. Not that the
|
|
78
|
-
// same GPU can be represented by multiple adapters but on different APIs.
|
|
79
|
-
//
|
|
80
|
-
// The underlying Dawn adapter is owned by the Dawn instance so this class is not RAII but just
|
|
81
|
-
// a reference to an underlying adapter.
|
|
82
|
-
class DAWN_NATIVE_EXPORT Adapter {
|
|
83
|
-
public:
|
|
84
|
-
Adapter();
|
|
85
|
-
// NOLINTNEXTLINE(runtime/explicit)
|
|
86
|
-
Adapter(AdapterBase* impl);
|
|
87
|
-
~Adapter();
|
|
88
|
-
|
|
89
|
-
Adapter(const Adapter& other);
|
|
90
|
-
Adapter& operator=(const Adapter& other);
|
|
91
|
-
|
|
92
|
-
void SetUseTieredLimits(bool useTieredLimits);
|
|
93
|
-
|
|
94
|
-
// Check that the Adapter is able to support importing external images. This is necessary
|
|
95
|
-
// to implement the swapchain and interop APIs in Chromium.
|
|
96
|
-
bool SupportsExternalImages() const;
|
|
97
|
-
|
|
98
|
-
explicit operator bool() const;
|
|
99
|
-
|
|
100
|
-
// Create a device on this adapter. On an error, nullptr is returned.
|
|
101
|
-
WGPUDevice CreateDevice(const wgpu::DeviceDescriptor* deviceDescriptor);
|
|
102
|
-
WGPUDevice CreateDevice(const WGPUDeviceDescriptor* deviceDescriptor = nullptr);
|
|
103
|
-
|
|
104
|
-
// Returns the underlying WGPUAdapter object.
|
|
105
|
-
WGPUAdapter Get() const;
|
|
106
|
-
|
|
107
|
-
// Reset the backend device object for testing purposes.
|
|
108
|
-
void ResetInternalDeviceForTesting();
|
|
109
|
-
|
|
110
|
-
private:
|
|
111
|
-
AdapterBase* mImpl = nullptr;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
enum BackendValidationLevel { Full, Partial, Disabled };
|
|
115
|
-
|
|
116
|
-
// Can be chained in InstanceDescriptor
|
|
117
|
-
struct DAWN_NATIVE_EXPORT DawnInstanceDescriptor : wgpu::ChainedStruct {
|
|
118
|
-
DawnInstanceDescriptor();
|
|
119
|
-
uint32_t additionalRuntimeSearchPathsCount = 0;
|
|
120
|
-
const char* const* additionalRuntimeSearchPaths;
|
|
121
|
-
dawn::platform::Platform* platform = nullptr;
|
|
122
|
-
|
|
123
|
-
BackendValidationLevel backendValidationLevel = BackendValidationLevel::Disabled;
|
|
124
|
-
bool beginCaptureOnStartup = false;
|
|
125
|
-
|
|
126
|
-
WGPULoggingCallbackInfo loggingCallbackInfo = WGPU_LOGGING_CALLBACK_INFO_INIT;
|
|
127
|
-
|
|
128
|
-
template <typename F,
|
|
129
|
-
typename T,
|
|
130
|
-
typename Cb = wgpu::LoggingCallback<T>,
|
|
131
|
-
typename = std::enable_if_t<std::is_convertible_v<F, Cb*>>>
|
|
132
|
-
void SetLoggingCallback(F callback, T userdata) {
|
|
133
|
-
assert(loggingCallbackInfo.callback == nullptr);
|
|
134
|
-
|
|
135
|
-
loggingCallbackInfo.callback = [](WGPULoggingType type, struct WGPUStringView message,
|
|
136
|
-
void* callback_param, void* userdata_param) {
|
|
137
|
-
auto cb = reinterpret_cast<Cb*>(callback_param);
|
|
138
|
-
(*cb)(static_cast<wgpu::LoggingType>(type), message, static_cast<T>(userdata_param));
|
|
139
|
-
};
|
|
140
|
-
loggingCallbackInfo.userdata1 = reinterpret_cast<void*>(+callback);
|
|
141
|
-
loggingCallbackInfo.userdata2 = reinterpret_cast<void*>(userdata);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
template <typename L,
|
|
145
|
-
typename Cb = wgpu::LoggingCallback<>,
|
|
146
|
-
typename = std::enable_if_t<std::is_convertible_v<L, Cb>>>
|
|
147
|
-
void SetLoggingCallback(L callback) {
|
|
148
|
-
assert(loggingCallbackInfo.callback == nullptr);
|
|
149
|
-
using F = wgpu::LoggingCallback<void>;
|
|
150
|
-
static_assert(std::is_convertible_v<L, F*>, "Logging callback cannot be a binding lambda");
|
|
151
|
-
|
|
152
|
-
loggingCallbackInfo.callback = [](WGPULoggingType type, struct WGPUStringView message,
|
|
153
|
-
void* callback_param, void*) {
|
|
154
|
-
auto cb = reinterpret_cast<F*>(callback_param);
|
|
155
|
-
(*cb)(static_cast<wgpu::LoggingType>(type), message);
|
|
156
|
-
};
|
|
157
|
-
loggingCallbackInfo.userdata1 = reinterpret_cast<void*>(+callback);
|
|
158
|
-
loggingCallbackInfo.userdata2 = nullptr;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Equality operators, mostly for testing. Note that this tests
|
|
162
|
-
// strict pointer-pointer equality if the struct contains member pointers.
|
|
163
|
-
bool operator==(const DawnInstanceDescriptor& rhs) const;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
// Represents a connection to dawn_native and is used for dependency injection, discovering
|
|
167
|
-
// system adapters and injecting custom adapters (like a Swiftshader Vulkan adapter).
|
|
168
|
-
//
|
|
169
|
-
// This is an RAII class for Dawn instances and also controls the lifetime of all adapters
|
|
170
|
-
// for this instance.
|
|
171
|
-
class DAWN_NATIVE_EXPORT Instance {
|
|
172
|
-
public:
|
|
173
|
-
explicit Instance(const WGPUInstanceDescriptor* desc = nullptr);
|
|
174
|
-
explicit Instance(const wgpu::InstanceDescriptor* desc);
|
|
175
|
-
explicit Instance(InstanceBase* impl);
|
|
176
|
-
~Instance();
|
|
177
|
-
|
|
178
|
-
Instance(const Instance& other) = delete;
|
|
179
|
-
Instance& operator=(const Instance& other) = delete;
|
|
180
|
-
|
|
181
|
-
// Discovers and returns a vector of adapters.
|
|
182
|
-
// All systems adapters that can be found are returned if no options are passed.
|
|
183
|
-
// Otherwise, returns adapters based on the `options`. Adapter toggles descriptor can chained
|
|
184
|
-
// after options.
|
|
185
|
-
std::vector<Adapter> EnumerateAdapters(const WGPURequestAdapterOptions* options) const;
|
|
186
|
-
std::vector<Adapter> EnumerateAdapters(
|
|
187
|
-
const wgpu::RequestAdapterOptions* options = nullptr) const;
|
|
188
|
-
|
|
189
|
-
const ToggleInfo* GetToggleInfo(const char* toggleName);
|
|
190
|
-
|
|
191
|
-
// Enables backend validation layers
|
|
192
|
-
void SetBackendValidationLevel(BackendValidationLevel validationLevel);
|
|
193
|
-
|
|
194
|
-
uint64_t GetDeviceCountForTesting() const;
|
|
195
|
-
// Backdoor to get the number of deprecation warnings for testing
|
|
196
|
-
uint64_t GetDeprecationWarningCountForTesting() const;
|
|
197
|
-
|
|
198
|
-
// Returns the underlying WGPUInstance object.
|
|
199
|
-
WGPUInstance Get() const;
|
|
200
|
-
|
|
201
|
-
// Make mImpl->mPlatform point to an object inside Dawn in case it becomes a dangling pointer
|
|
202
|
-
void DisconnectDawnPlatform();
|
|
203
|
-
|
|
204
|
-
private:
|
|
205
|
-
InstanceBase* mImpl = nullptr;
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
// Backend-agnostic API for dawn_native
|
|
209
|
-
DAWN_NATIVE_EXPORT const DawnProcTable& GetProcs();
|
|
210
|
-
|
|
211
|
-
// Query the names of all the toggles that are enabled in device
|
|
212
|
-
DAWN_NATIVE_EXPORT std::vector<const char*> GetTogglesUsed(WGPUDevice device);
|
|
213
|
-
|
|
214
|
-
// Backdoor to get the number of lazy clears for testing
|
|
215
|
-
DAWN_NATIVE_EXPORT size_t GetLazyClearCountForTesting(WGPUDevice device);
|
|
216
|
-
|
|
217
|
-
// Query if texture has been initialized
|
|
218
|
-
DAWN_NATIVE_EXPORT bool IsTextureSubresourceInitialized(
|
|
219
|
-
WGPUTexture texture,
|
|
220
|
-
uint32_t baseMipLevel,
|
|
221
|
-
uint32_t levelCount,
|
|
222
|
-
uint32_t baseArrayLayer,
|
|
223
|
-
uint32_t layerCount,
|
|
224
|
-
WGPUTextureAspect aspect = WGPUTextureAspect_All);
|
|
225
|
-
|
|
226
|
-
// Backdoor to get the order of the ProcMap for testing
|
|
227
|
-
DAWN_NATIVE_EXPORT std::vector<std::string_view> GetProcMapNamesForTesting();
|
|
228
|
-
|
|
229
|
-
DAWN_NATIVE_EXPORT bool DeviceTick(WGPUDevice device);
|
|
230
|
-
|
|
231
|
-
DAWN_NATIVE_EXPORT bool InstanceProcessEvents(WGPUInstance instance);
|
|
232
|
-
|
|
233
|
-
// ErrorInjector functions used for testing only. Defined in dawn_native/ErrorInjector.cpp
|
|
234
|
-
DAWN_NATIVE_EXPORT void EnableErrorInjector();
|
|
235
|
-
DAWN_NATIVE_EXPORT void DisableErrorInjector();
|
|
236
|
-
DAWN_NATIVE_EXPORT void ClearErrorInjector();
|
|
237
|
-
DAWN_NATIVE_EXPORT uint64_t AcquireErrorInjectorCallCount();
|
|
238
|
-
DAWN_NATIVE_EXPORT void InjectErrorAt(uint64_t index);
|
|
239
|
-
|
|
240
|
-
// The different types of external images
|
|
241
|
-
enum ExternalImageType {
|
|
242
|
-
OpaqueFD,
|
|
243
|
-
DmaBuf,
|
|
244
|
-
IOSurface,
|
|
245
|
-
EGLImage,
|
|
246
|
-
GLTexture,
|
|
247
|
-
AHardwareBuffer,
|
|
248
|
-
Last = AHardwareBuffer,
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
// Common properties of external images
|
|
252
|
-
struct DAWN_NATIVE_EXPORT ExternalImageDescriptor {
|
|
253
|
-
public:
|
|
254
|
-
const WGPUTextureDescriptor* cTextureDescriptor; // Must match image creation params
|
|
255
|
-
bool isInitialized; // Whether the texture is initialized on import
|
|
256
|
-
ExternalImageType GetType() const;
|
|
257
|
-
|
|
258
|
-
protected:
|
|
259
|
-
explicit ExternalImageDescriptor(ExternalImageType type);
|
|
260
|
-
|
|
261
|
-
private:
|
|
262
|
-
ExternalImageType mType;
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
struct DAWN_NATIVE_EXPORT ExternalImageExportInfo {
|
|
266
|
-
public:
|
|
267
|
-
bool isInitialized = false; // Whether the texture is initialized after export
|
|
268
|
-
ExternalImageType GetType() const;
|
|
269
|
-
|
|
270
|
-
protected:
|
|
271
|
-
explicit ExternalImageExportInfo(ExternalImageType type);
|
|
272
|
-
|
|
273
|
-
private:
|
|
274
|
-
ExternalImageType mType;
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
DAWN_NATIVE_EXPORT bool CheckIsErrorForTesting(void* objectHandle);
|
|
278
|
-
|
|
279
|
-
DAWN_NATIVE_EXPORT const char* GetObjectLabelForTesting(void* objectHandle);
|
|
280
|
-
|
|
281
|
-
DAWN_NATIVE_EXPORT uint64_t GetAllocatedSizeForTesting(WGPUBuffer buffer);
|
|
282
|
-
|
|
283
|
-
DAWN_NATIVE_EXPORT std::vector<const ToggleInfo*> AllToggleInfos();
|
|
284
|
-
|
|
285
|
-
// Used to query the details of an feature. Return nullptr if featureName is not a valid
|
|
286
|
-
// name of an feature supported in Dawn.
|
|
287
|
-
DAWN_NATIVE_EXPORT const FeatureInfo* GetFeatureInfo(wgpu::FeatureName feature);
|
|
288
|
-
|
|
289
|
-
class DAWN_NATIVE_EXPORT MemoryDump {
|
|
290
|
-
public:
|
|
291
|
-
// Standard attribute |name|s for the AddScalar() and AddString() methods.
|
|
292
|
-
// These match the expected names in Chromium memory-infra instrumentation.
|
|
293
|
-
static const char kNameSize[]; // To represent allocated space.
|
|
294
|
-
static const char kNameObjectCount[]; // To represent number of objects.
|
|
295
|
-
|
|
296
|
-
// Standard attribute |unit|s for the AddScalar() and AddString() methods.
|
|
297
|
-
// These match the expected names in Chromium memory-infra instrumentation.
|
|
298
|
-
static const char kUnitsBytes[]; // Unit name to represent bytes.
|
|
299
|
-
static const char kUnitsObjects[]; // Unit name to represent #objects.
|
|
300
|
-
|
|
301
|
-
MemoryDump() = default;
|
|
302
|
-
|
|
303
|
-
virtual void AddScalar(const char* name,
|
|
304
|
-
const char* key,
|
|
305
|
-
const char* units,
|
|
306
|
-
uint64_t value) = 0;
|
|
307
|
-
|
|
308
|
-
virtual void AddString(const char* name, const char* key, const std::string& value) = 0;
|
|
309
|
-
|
|
310
|
-
MemoryDump(const MemoryDump&) = delete;
|
|
311
|
-
MemoryDump& operator=(const MemoryDump&) = delete;
|
|
312
|
-
|
|
313
|
-
protected:
|
|
314
|
-
virtual ~MemoryDump() = default;
|
|
315
|
-
};
|
|
316
|
-
DAWN_NATIVE_EXPORT void DumpMemoryStatistics(WGPUDevice device, MemoryDump* dump);
|
|
317
|
-
|
|
318
|
-
// Intended for background tracing for UMA that returns the estimated memory usage.
|
|
319
|
-
struct DAWN_NATIVE_EXPORT MemoryUsageInfo {
|
|
320
|
-
// Total memory usage.
|
|
321
|
-
uint64_t totalUsage;
|
|
322
|
-
// Total depth stencil textures' memory.
|
|
323
|
-
uint64_t depthStencilTexturesUsage;
|
|
324
|
-
// Total MSAA textures' memory.
|
|
325
|
-
uint64_t msaaTexturesUsage;
|
|
326
|
-
// Number of MSAA textures.
|
|
327
|
-
uint64_t msaaTexturesCount;
|
|
328
|
-
// Largest MSAA texture's memory.
|
|
329
|
-
uint64_t largestMsaaTextureUsage;
|
|
330
|
-
// Total textures' memory.
|
|
331
|
-
uint64_t texturesUsage;
|
|
332
|
-
// Total buffers' memory.
|
|
333
|
-
uint64_t buffersUsage;
|
|
334
|
-
};
|
|
335
|
-
DAWN_NATIVE_EXPORT MemoryUsageInfo ComputeEstimatedMemoryUsageInfo(WGPUDevice device);
|
|
336
|
-
|
|
337
|
-
// Memory information gathered from backend specific allocators.
|
|
338
|
-
// - memory allocated by clients for objects such as buffers, textures.
|
|
339
|
-
// - heap memory used by the allocator for allocations.
|
|
340
|
-
struct DAWN_NATIVE_EXPORT AllocatorMemoryInfo {
|
|
341
|
-
uint64_t totalUsedMemory = 0;
|
|
342
|
-
uint64_t totalAllocatedMemory = 0;
|
|
343
|
-
uint64_t totalLazyAllocatedMemory = 0;
|
|
344
|
-
uint64_t totalLazyUsedMemory = 0;
|
|
345
|
-
};
|
|
346
|
-
DAWN_NATIVE_EXPORT AllocatorMemoryInfo GetAllocatorMemoryInfo(WGPUDevice device);
|
|
347
|
-
|
|
348
|
-
// Free any unused GPU memory like staging buffers, cached resources, etc. Returns true if there are
|
|
349
|
-
// still objects to delete and ReduceMemoryUsage() should be run again after a short delay to allow
|
|
350
|
-
// submitted work to complete.
|
|
351
|
-
DAWN_NATIVE_EXPORT bool ReduceMemoryUsage(WGPUDevice device);
|
|
352
|
-
|
|
353
|
-
// Perform tasks that are appropriate to do when idle like serializing pipeline
|
|
354
|
-
// caches, etc.
|
|
355
|
-
DAWN_NATIVE_EXPORT void PerformIdleTasks(const wgpu::Device& device);
|
|
356
|
-
|
|
357
|
-
DAWN_NATIVE_EXPORT bool IsDeviceLost(WGPUDevice device);
|
|
358
|
-
|
|
359
|
-
} // namespace dawn::native
|
|
360
|
-
|
|
361
|
-
#endif // INCLUDE_DAWN_NATIVE_DAWNNATIVE_H_
|