electrobun 1.18.4-beta.6 → 2.0.1-beta.13
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/LICENSE +21 -0
- package/README.md +31 -170
- package/bin/electrobun.cjs +230 -153
- package/package.json +18 -49
- package/bun.lock +0 -119
- package/dist/api/browser/builtinrpcSchema.ts +0 -19
- package/dist/api/browser/global.d.ts +0 -36
- package/dist/api/browser/index.ts +0 -234
- package/dist/api/browser/webviewtag.ts +0 -88
- package/dist/api/browser/wgputag.ts +0 -48
- package/dist/api/bun/ElectrobunConfig.ts +0 -530
- package/dist/api/bun/__tests__/ffi-contract.test.ts +0 -105
- package/dist/api/bun/core/ApplicationMenu.ts +0 -70
- package/dist/api/bun/core/BrowserView.ts +0 -419
- package/dist/api/bun/core/BrowserWindow.ts +0 -400
- package/dist/api/bun/core/BuildConfig.ts +0 -71
- package/dist/api/bun/core/ContextMenu.ts +0 -75
- package/dist/api/bun/core/GpuWindow.ts +0 -289
- package/dist/api/bun/core/Paths.ts +0 -5
- package/dist/api/bun/core/Socket.ts +0 -22
- package/dist/api/bun/core/Tray.ts +0 -197
- package/dist/api/bun/core/Updater.ts +0 -1162
- package/dist/api/bun/core/Utils.ts +0 -487
- package/dist/api/bun/core/WGPUView.ts +0 -167
- package/dist/api/bun/core/menuRoles.ts +0 -181
- package/dist/api/bun/events/ApplicationEvents.ts +0 -22
- package/dist/api/bun/events/event.ts +0 -29
- package/dist/api/bun/events/eventEmitter.ts +0 -45
- package/dist/api/bun/events/trayEvents.ts +0 -11
- package/dist/api/bun/events/webviewEvents.ts +0 -39
- package/dist/api/bun/events/windowEvents.ts +0 -23
- package/dist/api/bun/index.ts +0 -298
- package/dist/api/bun/preload/.generated/compiled.ts +0 -8
- package/dist/api/bun/preload/build.ts +0 -65
- package/dist/api/bun/preload/dragRegions.ts +0 -41
- package/dist/api/bun/preload/encryption.ts +0 -86
- package/dist/api/bun/preload/events.ts +0 -171
- package/dist/api/bun/preload/globals.d.ts +0 -45
- package/dist/api/bun/preload/index-sandboxed.ts +0 -28
- package/dist/api/bun/preload/index.ts +0 -77
- package/dist/api/bun/preload/internalRpc.ts +0 -80
- package/dist/api/bun/preload/overlaySync.ts +0 -107
- package/dist/api/bun/preload/webviewTag.ts +0 -451
- package/dist/api/bun/preload/wgpuTag.ts +0 -246
- package/dist/api/bun/proc/linux.md +0 -43
- package/dist/api/bun/proc/native.ts +0 -3385
- package/dist/api/bun/webGPU.ts +0 -346
- package/dist/api/bun/webgpuAdapter.ts +0 -3011
- package/dist/api/shared/bun-version.ts +0 -3
- package/dist/api/shared/cef-version.ts +0 -5
- package/dist/api/shared/electrobun-version.ts +0 -2
- package/dist/api/shared/naming.test.ts +0 -327
- package/dist/api/shared/naming.ts +0 -188
- package/dist/api/shared/platform.ts +0 -48
- package/dist/api/shared/rpc.ts +0 -541
- package/dist/main.js +0 -168
- package/dist/preload-full.js +0 -913
- package/dist/preload-sandboxed.js +0 -111
- package/dist/zig-sdk/electrobun.zig +0 -1993
- package/src/cli/bun.lockb +0 -0
- package/src/cli/index.ts +0 -5689
- package/src/cli/package-lock.json +0 -81
- package/src/cli/package.json +0 -11
package/dist/api/bun/webGPU.ts
DELETED
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
import { existsSync } from "fs";
|
|
2
|
-
import { join, dirname } from "path";
|
|
3
|
-
import { dlopen, suffix, FFIType } from "bun:ffi";
|
|
4
|
-
|
|
5
|
-
// NOTE: WGPUStringView is passed by value in the C API. Bun FFI does not support
|
|
6
|
-
// by-value structs, so WGPUStringView parameters are exposed as pointers for now.
|
|
7
|
-
// If you need these calls, add a small C shim that accepts a pointer and
|
|
8
|
-
// forwards by value. WGPUFuture is a single u64 and is mapped to FFIType.u64.
|
|
9
|
-
const WGPU_SYMBOLS = {
|
|
10
|
-
wgpuCreateInstance: { args: [FFIType.ptr], returns: FFIType.ptr },
|
|
11
|
-
wgpuGetInstanceFeatures: { args: [FFIType.ptr], returns: FFIType.void },
|
|
12
|
-
wgpuGetInstanceLimits: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
13
|
-
wgpuHasInstanceFeature: { args: [FFIType.u32], returns: FFIType.u32 },
|
|
14
|
-
wgpuGetProcAddress: { args: [FFIType.ptr], returns: FFIType.ptr },
|
|
15
|
-
wgpuAdapterCreateDevice: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
16
|
-
wgpuAdapterGetFeatures: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
17
|
-
wgpuAdapterGetFormatCapabilities: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.u32 },
|
|
18
|
-
wgpuAdapterGetInfo: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
19
|
-
wgpuAdapterGetInstance: { args: [FFIType.ptr], returns: FFIType.ptr },
|
|
20
|
-
wgpuAdapterGetLimits: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
21
|
-
wgpuAdapterHasFeature: { args: [FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
22
|
-
wgpuAdapterRequestDevice: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u64 },
|
|
23
|
-
wgpuAdapterAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
24
|
-
wgpuAdapterRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
25
|
-
wgpuAdapterInfoFreeMembers: { args: [FFIType.ptr], returns: FFIType.void },
|
|
26
|
-
wgpuAdapterPropertiesMemoryHeapsFreeMembers: { args: [FFIType.ptr], returns: FFIType.void },
|
|
27
|
-
wgpuAdapterPropertiesSubgroupMatrixConfigsFreeMembers: { args: [FFIType.ptr], returns: FFIType.void },
|
|
28
|
-
wgpuBindGroupSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
29
|
-
wgpuBindGroupAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
30
|
-
wgpuBindGroupRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
31
|
-
wgpuBindGroupLayoutSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
32
|
-
wgpuBindGroupLayoutAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
33
|
-
wgpuBindGroupLayoutRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
34
|
-
wgpuBufferCreateTexelView: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
35
|
-
wgpuBufferDestroy: { args: [FFIType.ptr], returns: FFIType.void },
|
|
36
|
-
wgpuBufferGetConstMappedRange: { args: [FFIType.ptr, FFIType.u64, FFIType.u64], returns: FFIType.ptr },
|
|
37
|
-
wgpuBufferGetMappedRange: { args: [FFIType.ptr, FFIType.u64, FFIType.u64], returns: FFIType.ptr },
|
|
38
|
-
wgpuBufferGetMapState: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
39
|
-
wgpuBufferGetSize: { args: [FFIType.ptr], returns: FFIType.u64 },
|
|
40
|
-
wgpuBufferGetUsage: { args: [FFIType.ptr], returns: FFIType.u64 },
|
|
41
|
-
wgpuBufferMapAsync: { args: [FFIType.ptr, FFIType.u64, FFIType.u64, FFIType.u64, FFIType.ptr], returns: FFIType.u64 },
|
|
42
|
-
wgpuBufferReadMappedRange: { args: [FFIType.ptr, FFIType.u64, FFIType.ptr, FFIType.u64], returns: FFIType.u32 },
|
|
43
|
-
wgpuBufferSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
44
|
-
wgpuBufferUnmap: { args: [FFIType.ptr], returns: FFIType.void },
|
|
45
|
-
wgpuBufferWriteMappedRange: { args: [FFIType.ptr, FFIType.u64, FFIType.ptr, FFIType.u64], returns: FFIType.u32 },
|
|
46
|
-
wgpuBufferAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
47
|
-
wgpuBufferRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
48
|
-
wgpuCommandBufferSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
49
|
-
wgpuCommandBufferAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
50
|
-
wgpuCommandBufferRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
51
|
-
wgpuCommandEncoderBeginComputePass: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
52
|
-
wgpuCommandEncoderBeginRenderPass: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
53
|
-
wgpuCommandEncoderClearBuffer: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64, FFIType.u64], returns: FFIType.void },
|
|
54
|
-
wgpuCommandEncoderCopyBufferToBuffer: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64, FFIType.ptr, FFIType.u64, FFIType.u64], returns: FFIType.void },
|
|
55
|
-
wgpuCommandEncoderCopyBufferToTexture: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
56
|
-
wgpuCommandEncoderCopyTextureToBuffer: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
57
|
-
wgpuCommandEncoderCopyTextureToTexture: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
58
|
-
wgpuCommandEncoderFinish: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
59
|
-
wgpuCommandEncoderInjectValidationError: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
60
|
-
wgpuCommandEncoderInsertDebugMarker: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
61
|
-
wgpuCommandEncoderPopDebugGroup: { args: [FFIType.ptr], returns: FFIType.void },
|
|
62
|
-
wgpuCommandEncoderPushDebugGroup: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
63
|
-
wgpuCommandEncoderResolveQuerySet: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
64
|
-
wgpuCommandEncoderSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
65
|
-
wgpuCommandEncoderWriteBuffer: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
66
|
-
wgpuCommandEncoderWriteTimestamp: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32], returns: FFIType.void },
|
|
67
|
-
wgpuCommandEncoderAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
68
|
-
wgpuCommandEncoderRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
69
|
-
wgpuComputePassEncoderDispatchWorkgroups: { args: [FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32], returns: FFIType.void },
|
|
70
|
-
wgpuComputePassEncoderDispatchWorkgroupsIndirect: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
71
|
-
wgpuComputePassEncoderEnd: { args: [FFIType.ptr], returns: FFIType.void },
|
|
72
|
-
wgpuComputePassEncoderInsertDebugMarker: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
73
|
-
wgpuComputePassEncoderPopDebugGroup: { args: [FFIType.ptr], returns: FFIType.void },
|
|
74
|
-
wgpuComputePassEncoderPushDebugGroup: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
75
|
-
wgpuComputePassEncoderSetBindGroup: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u64, FFIType.ptr], returns: FFIType.void },
|
|
76
|
-
wgpuComputePassEncoderSetImmediates: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
77
|
-
wgpuComputePassEncoderSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
78
|
-
wgpuComputePassEncoderSetPipeline: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
79
|
-
wgpuComputePassEncoderSetResourceTable: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
80
|
-
wgpuComputePassEncoderWriteTimestamp: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32], returns: FFIType.void },
|
|
81
|
-
wgpuComputePassEncoderAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
82
|
-
wgpuComputePassEncoderRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
83
|
-
wgpuComputePipelineGetBindGroupLayout: { args: [FFIType.ptr, FFIType.u32], returns: FFIType.ptr },
|
|
84
|
-
wgpuComputePipelineSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
85
|
-
wgpuComputePipelineAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
86
|
-
wgpuComputePipelineRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
87
|
-
wgpuDawnDrmFormatCapabilitiesFreeMembers: { args: [FFIType.ptr], returns: FFIType.void },
|
|
88
|
-
wgpuDeviceCreateBindGroup: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
89
|
-
wgpuDeviceCreateBindGroupLayout: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
90
|
-
wgpuDeviceCreateBuffer: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
91
|
-
wgpuDeviceCreateCommandEncoder: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
92
|
-
wgpuDeviceCreateComputePipeline: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
93
|
-
wgpuDeviceCreateComputePipelineAsync: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u64 },
|
|
94
|
-
wgpuDeviceCreateErrorBuffer: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
95
|
-
wgpuDeviceCreateErrorExternalTexture: { args: [FFIType.ptr], returns: FFIType.ptr },
|
|
96
|
-
wgpuDeviceCreateErrorShaderModule: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
97
|
-
wgpuDeviceCreateErrorTexture: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
98
|
-
wgpuDeviceCreateExternalTexture: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
99
|
-
wgpuDeviceCreatePipelineLayout: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
100
|
-
wgpuDeviceCreateQuerySet: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
101
|
-
wgpuDeviceCreateRenderBundleEncoder: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
102
|
-
wgpuDeviceCreateRenderPipeline: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
103
|
-
wgpuDeviceCreateRenderPipelineAsync: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u64 },
|
|
104
|
-
wgpuDeviceCreateResourceTable: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
105
|
-
wgpuDeviceCreateSampler: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
106
|
-
wgpuDeviceCreateShaderModule: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
107
|
-
wgpuDeviceCreateTexture: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
108
|
-
wgpuDeviceDestroy: { args: [FFIType.ptr], returns: FFIType.void },
|
|
109
|
-
wgpuDeviceForceLoss: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.void },
|
|
110
|
-
wgpuDeviceGetAdapter: { args: [FFIType.ptr], returns: FFIType.ptr },
|
|
111
|
-
wgpuDeviceGetAdapterInfo: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
112
|
-
wgpuDeviceGetAHardwareBufferProperties: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
113
|
-
wgpuDeviceGetFeatures: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
114
|
-
wgpuDeviceGetLimits: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
115
|
-
wgpuDeviceGetLostFuture: { args: [FFIType.ptr], returns: FFIType.u64 },
|
|
116
|
-
wgpuDeviceGetQueue: { args: [FFIType.ptr], returns: FFIType.ptr },
|
|
117
|
-
wgpuDeviceHasFeature: { args: [FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
118
|
-
wgpuDeviceImportSharedBufferMemory: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
119
|
-
wgpuDeviceImportSharedFence: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
120
|
-
wgpuDeviceImportSharedTextureMemory: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
121
|
-
wgpuDeviceInjectError: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.void },
|
|
122
|
-
wgpuDevicePopErrorScope: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u64 },
|
|
123
|
-
wgpuDevicePushErrorScope: { args: [FFIType.ptr, FFIType.u32], returns: FFIType.void },
|
|
124
|
-
wgpuDeviceSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
125
|
-
wgpuDeviceSetLoggingCallback: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
126
|
-
wgpuDeviceTick: { args: [FFIType.ptr], returns: FFIType.void },
|
|
127
|
-
wgpuDeviceValidateTextureDescriptor: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
128
|
-
wgpuDeviceAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
129
|
-
wgpuDeviceRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
130
|
-
wgpuExternalTextureDestroy: { args: [FFIType.ptr], returns: FFIType.void },
|
|
131
|
-
wgpuExternalTextureExpire: { args: [FFIType.ptr], returns: FFIType.void },
|
|
132
|
-
wgpuExternalTextureRefresh: { args: [FFIType.ptr], returns: FFIType.void },
|
|
133
|
-
wgpuExternalTextureSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
134
|
-
wgpuExternalTextureAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
135
|
-
wgpuExternalTextureRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
136
|
-
wgpuInstanceCreateSurface: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
137
|
-
wgpuInstanceGetWGSLLanguageFeatures: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
138
|
-
wgpuInstanceHasWGSLLanguageFeature: { args: [FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
139
|
-
wgpuInstanceProcessEvents: { args: [FFIType.ptr], returns: FFIType.void },
|
|
140
|
-
wgpuInstanceRequestAdapter: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u64 },
|
|
141
|
-
wgpuInstanceWaitAny: { args: [FFIType.ptr, FFIType.u64, FFIType.ptr, FFIType.u64], returns: FFIType.u32 },
|
|
142
|
-
wgpuInstanceAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
143
|
-
wgpuInstanceRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
144
|
-
wgpuPipelineLayoutSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
145
|
-
wgpuPipelineLayoutAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
146
|
-
wgpuPipelineLayoutRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
147
|
-
wgpuQuerySetDestroy: { args: [FFIType.ptr], returns: FFIType.void },
|
|
148
|
-
wgpuQuerySetGetCount: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
149
|
-
wgpuQuerySetGetType: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
150
|
-
wgpuQuerySetSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
151
|
-
wgpuQuerySetAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
152
|
-
wgpuQuerySetRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
153
|
-
wgpuQueueCopyExternalTextureForBrowser: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
154
|
-
wgpuQueueCopyTextureForBrowser: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
155
|
-
wgpuQueueOnSubmittedWorkDone: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u64 },
|
|
156
|
-
wgpuQueueSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
157
|
-
wgpuQueueSubmit: { args: [FFIType.ptr, FFIType.u64, FFIType.ptr], returns: FFIType.void },
|
|
158
|
-
wgpuQueueWriteBuffer: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
159
|
-
wgpuQueueWriteTexture: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u64, FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
160
|
-
wgpuQueueAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
161
|
-
wgpuQueueRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
162
|
-
wgpuRenderBundleSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
163
|
-
wgpuRenderBundleAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
164
|
-
wgpuRenderBundleRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
165
|
-
wgpuRenderBundleEncoderDraw: { args: [FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.u32], returns: FFIType.void },
|
|
166
|
-
wgpuRenderBundleEncoderDrawIndexed: { args: [FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.i32, FFIType.u32], returns: FFIType.void },
|
|
167
|
-
wgpuRenderBundleEncoderDrawIndexedIndirect: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
168
|
-
wgpuRenderBundleEncoderDrawIndirect: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
169
|
-
wgpuRenderBundleEncoderFinish: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
170
|
-
wgpuRenderBundleEncoderInsertDebugMarker: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
171
|
-
wgpuRenderBundleEncoderPopDebugGroup: { args: [FFIType.ptr], returns: FFIType.void },
|
|
172
|
-
wgpuRenderBundleEncoderPushDebugGroup: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
173
|
-
wgpuRenderBundleEncoderSetBindGroup: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u64, FFIType.ptr], returns: FFIType.void },
|
|
174
|
-
wgpuRenderBundleEncoderSetImmediates: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
175
|
-
wgpuRenderBundleEncoderSetIndexBuffer: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u64, FFIType.u64], returns: FFIType.void },
|
|
176
|
-
wgpuRenderBundleEncoderSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
177
|
-
wgpuRenderBundleEncoderSetPipeline: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
178
|
-
wgpuRenderBundleEncoderSetResourceTable: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
179
|
-
wgpuRenderBundleEncoderSetVertexBuffer: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u64, FFIType.u64], returns: FFIType.void },
|
|
180
|
-
wgpuRenderBundleEncoderAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
181
|
-
wgpuRenderBundleEncoderRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
182
|
-
wgpuRenderPassEncoderBeginOcclusionQuery: { args: [FFIType.ptr, FFIType.u32], returns: FFIType.void },
|
|
183
|
-
wgpuRenderPassEncoderDraw: { args: [FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.u32], returns: FFIType.void },
|
|
184
|
-
wgpuRenderPassEncoderDrawIndexed: { args: [FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.i32, FFIType.u32], returns: FFIType.void },
|
|
185
|
-
wgpuRenderPassEncoderDrawIndexedIndirect: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
186
|
-
wgpuRenderPassEncoderDrawIndirect: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
187
|
-
wgpuRenderPassEncoderEnd: { args: [FFIType.ptr], returns: FFIType.void },
|
|
188
|
-
wgpuRenderPassEncoderEndOcclusionQuery: { args: [FFIType.ptr], returns: FFIType.void },
|
|
189
|
-
wgpuRenderPassEncoderExecuteBundles: { args: [FFIType.ptr, FFIType.u64, FFIType.ptr], returns: FFIType.void },
|
|
190
|
-
wgpuRenderPassEncoderInsertDebugMarker: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
191
|
-
wgpuRenderPassEncoderMultiDrawIndexedIndirect: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64, FFIType.u32, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
192
|
-
wgpuRenderPassEncoderMultiDrawIndirect: { args: [FFIType.ptr, FFIType.ptr, FFIType.u64, FFIType.u32, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
193
|
-
wgpuRenderPassEncoderPixelLocalStorageBarrier: { args: [FFIType.ptr], returns: FFIType.void },
|
|
194
|
-
wgpuRenderPassEncoderPopDebugGroup: { args: [FFIType.ptr], returns: FFIType.void },
|
|
195
|
-
wgpuRenderPassEncoderPushDebugGroup: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
196
|
-
wgpuRenderPassEncoderSetBindGroup: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u64, FFIType.ptr], returns: FFIType.void },
|
|
197
|
-
wgpuRenderPassEncoderSetBlendConstant: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
198
|
-
wgpuRenderPassEncoderSetImmediates: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
199
|
-
wgpuRenderPassEncoderSetIndexBuffer: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u64, FFIType.u64], returns: FFIType.void },
|
|
200
|
-
wgpuRenderPassEncoderSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
201
|
-
wgpuRenderPassEncoderSetPipeline: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
202
|
-
wgpuRenderPassEncoderSetResourceTable: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
203
|
-
wgpuRenderPassEncoderSetScissorRect: { args: [FFIType.ptr, FFIType.u32, FFIType.u32, FFIType.u32, FFIType.u32], returns: FFIType.void },
|
|
204
|
-
wgpuRenderPassEncoderSetStencilReference: { args: [FFIType.ptr, FFIType.u32], returns: FFIType.void },
|
|
205
|
-
wgpuRenderPassEncoderSetVertexBuffer: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr, FFIType.u64, FFIType.u64], returns: FFIType.void },
|
|
206
|
-
wgpuRenderPassEncoderSetViewport: { args: [FFIType.ptr, FFIType.f32, FFIType.f32, FFIType.f32, FFIType.f32, FFIType.f32, FFIType.f32], returns: FFIType.void },
|
|
207
|
-
wgpuRenderPassEncoderWriteTimestamp: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32], returns: FFIType.void },
|
|
208
|
-
wgpuRenderPassEncoderAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
209
|
-
wgpuRenderPassEncoderRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
210
|
-
wgpuRenderPipelineGetBindGroupLayout: { args: [FFIType.ptr, FFIType.u32], returns: FFIType.ptr },
|
|
211
|
-
wgpuRenderPipelineSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
212
|
-
wgpuRenderPipelineAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
213
|
-
wgpuRenderPipelineRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
214
|
-
wgpuResourceTableDestroy: { args: [FFIType.ptr], returns: FFIType.void },
|
|
215
|
-
wgpuResourceTableGetSize: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
216
|
-
wgpuResourceTableInsertBinding: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
217
|
-
wgpuResourceTableRemoveBinding: { args: [FFIType.ptr, FFIType.u32], returns: FFIType.u32 },
|
|
218
|
-
wgpuResourceTableUpdate: { args: [FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.u32 },
|
|
219
|
-
wgpuResourceTableAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
220
|
-
wgpuResourceTableRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
221
|
-
wgpuSamplerSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
222
|
-
wgpuSamplerAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
223
|
-
wgpuSamplerRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
224
|
-
wgpuShaderModuleGetCompilationInfo: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u64 },
|
|
225
|
-
wgpuShaderModuleSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
226
|
-
wgpuShaderModuleAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
227
|
-
wgpuShaderModuleRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
228
|
-
wgpuSharedBufferMemoryBeginAccess: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
229
|
-
wgpuSharedBufferMemoryCreateBuffer: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
230
|
-
wgpuSharedBufferMemoryEndAccess: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
231
|
-
wgpuSharedBufferMemoryGetProperties: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
232
|
-
wgpuSharedBufferMemoryIsDeviceLost: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
233
|
-
wgpuSharedBufferMemorySetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
234
|
-
wgpuSharedBufferMemoryAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
235
|
-
wgpuSharedBufferMemoryRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
236
|
-
wgpuSharedBufferMemoryEndAccessStateFreeMembers: { args: [FFIType.ptr], returns: FFIType.void },
|
|
237
|
-
wgpuSharedFenceExportInfo: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
238
|
-
wgpuSharedFenceAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
239
|
-
wgpuSharedFenceRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
240
|
-
wgpuSharedTextureMemoryBeginAccess: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
241
|
-
wgpuSharedTextureMemoryCreateTexture: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
242
|
-
wgpuSharedTextureMemoryEndAccess: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
243
|
-
wgpuSharedTextureMemoryGetProperties: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
244
|
-
wgpuSharedTextureMemoryIsDeviceLost: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
245
|
-
wgpuSharedTextureMemorySetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
246
|
-
wgpuSharedTextureMemoryAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
247
|
-
wgpuSharedTextureMemoryRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
248
|
-
wgpuSharedTextureMemoryEndAccessStateFreeMembers: { args: [FFIType.ptr], returns: FFIType.void },
|
|
249
|
-
wgpuSupportedFeaturesFreeMembers: { args: [FFIType.ptr], returns: FFIType.void },
|
|
250
|
-
wgpuSupportedInstanceFeaturesFreeMembers: { args: [FFIType.ptr], returns: FFIType.void },
|
|
251
|
-
wgpuSupportedWGSLLanguageFeaturesFreeMembers: { args: [FFIType.ptr], returns: FFIType.void },
|
|
252
|
-
wgpuSurfaceConfigure: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
253
|
-
wgpuSurfaceGetCapabilities: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.u32 },
|
|
254
|
-
wgpuSurfaceGetCurrentTexture: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
255
|
-
wgpuSurfacePresent: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
256
|
-
wgpuSurfaceSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
257
|
-
wgpuSurfaceUnconfigure: { args: [FFIType.ptr], returns: FFIType.void },
|
|
258
|
-
wgpuSurfaceAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
259
|
-
wgpuSurfaceRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
260
|
-
wgpuSurfaceCapabilitiesFreeMembers: { args: [FFIType.ptr], returns: FFIType.void },
|
|
261
|
-
wgpuTexelBufferViewSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
262
|
-
wgpuTexelBufferViewAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
263
|
-
wgpuTexelBufferViewRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
264
|
-
wgpuTextureCreateErrorView: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
265
|
-
wgpuTextureCreateView: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.ptr },
|
|
266
|
-
wgpuTextureDestroy: { args: [FFIType.ptr], returns: FFIType.void },
|
|
267
|
-
wgpuTextureGetDepthOrArrayLayers: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
268
|
-
wgpuTextureGetDimension: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
269
|
-
wgpuTextureGetFormat: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
270
|
-
wgpuTextureGetHeight: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
271
|
-
wgpuTextureGetMipLevelCount: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
272
|
-
wgpuTextureGetSampleCount: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
273
|
-
wgpuTextureGetTextureBindingViewDimension: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
274
|
-
wgpuTextureGetUsage: { args: [FFIType.ptr], returns: FFIType.u64 },
|
|
275
|
-
wgpuTextureGetWidth: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
276
|
-
wgpuTexturePin: { args: [FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
277
|
-
wgpuTextureSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
278
|
-
wgpuTextureSetOwnershipForMemoryDump: { args: [FFIType.ptr, FFIType.u64], returns: FFIType.void },
|
|
279
|
-
wgpuTextureUnpin: { args: [FFIType.ptr], returns: FFIType.void },
|
|
280
|
-
wgpuTextureAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
281
|
-
wgpuTextureRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
282
|
-
wgpuTextureViewSetLabel: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.void },
|
|
283
|
-
wgpuTextureViewAddRef: { args: [FFIType.ptr], returns: FFIType.void },
|
|
284
|
-
wgpuTextureViewRelease: { args: [FFIType.ptr], returns: FFIType.void },
|
|
285
|
-
} as const;
|
|
286
|
-
|
|
287
|
-
const WGPU_LIB_NAMES: Record<string, string[]> = {
|
|
288
|
-
darwin: ["libwebgpu_dawn.dylib"],
|
|
289
|
-
win32: ["webgpu_dawn.dll", "libwebgpu_dawn.dll"],
|
|
290
|
-
linux: ["libwebgpu_dawn.so"],
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
function findWgpuLibraryPath(): string | null {
|
|
294
|
-
const envPath = process.env["ELECTROBUN_WGPU_PATH"];
|
|
295
|
-
if (envPath && existsSync(envPath)) return envPath;
|
|
296
|
-
|
|
297
|
-
const names = WGPU_LIB_NAMES[process.platform] ?? ["libwebgpu_dawn." + suffix];
|
|
298
|
-
for (const name of names) {
|
|
299
|
-
const cwdCandidate = join(process.cwd(), name);
|
|
300
|
-
if (existsSync(cwdCandidate)) return cwdCandidate;
|
|
301
|
-
const execDir = dirname(process.execPath);
|
|
302
|
-
const macCandidate = join(execDir, "..", "MacOS", name);
|
|
303
|
-
if (existsSync(macCandidate)) return macCandidate;
|
|
304
|
-
const resCandidate = join(execDir, "..", "Resources", name);
|
|
305
|
-
if (existsSync(resCandidate)) return resCandidate;
|
|
306
|
-
const execCandidate = join(execDir, name);
|
|
307
|
-
if (existsSync(execCandidate)) return execCandidate;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
return null;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export const native = (() => {
|
|
314
|
-
const libPath = findWgpuLibraryPath();
|
|
315
|
-
if (!libPath) {
|
|
316
|
-
return {
|
|
317
|
-
available: false,
|
|
318
|
-
path: null as string | null,
|
|
319
|
-
symbols: {} as Record<string, never>,
|
|
320
|
-
close: () => {},
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
try {
|
|
325
|
-
const lib = dlopen(libPath, WGPU_SYMBOLS);
|
|
326
|
-
return {
|
|
327
|
-
available: true,
|
|
328
|
-
path: libPath,
|
|
329
|
-
symbols: lib.symbols,
|
|
330
|
-
close: lib.close,
|
|
331
|
-
};
|
|
332
|
-
} catch {
|
|
333
|
-
return {
|
|
334
|
-
available: false,
|
|
335
|
-
path: libPath,
|
|
336
|
-
symbols: {} as Record<string, never>,
|
|
337
|
-
close: () => {},
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
})();
|
|
341
|
-
|
|
342
|
-
const WGPU = {
|
|
343
|
-
native,
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
export default WGPU;
|