-
Notifications
You must be signed in to change notification settings - Fork 0
/
instance.c3i
44 lines (29 loc) · 1.25 KB
/
instance.c3i
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module webgpu;
distinct Instance = void*;
fn Surface Instance.createSurface(Instance instance,
SurfaceDescriptor* descriptor) @extern("wgpuInstanceCreateSurface");
fn Instance createInstance(InstanceDescriptor* descriptor = null) @extern("wgpuCreateInstance");
fn void Instance.hasWGSLLanguageFeature(Instance instance, WgslFeatureName feature) @extern("wgpuInstanceHasWGSLLanguageFeature");
fn void Instance.processEvents(Instance instance) @extern("wgpuInstanceProcessEvents");
fn void Instance.requestAdapterAsync(Instance instance, RequestAdapterOptions* options,
RequestAdapterCallback callback, UserData data) @extern("wgpuInstanceRequestAdapter");
fn void Instance.reference(Instance instance) @extern("wgpuInstanceReference");
fn void Instance.release(Instance instance) @extern("wgpuInstanceRelease");
def RequestAdapterCallback = fn void(RequestAdapterStatus status,
Adapter adapter, ZString message, UserData result);
struct InstanceDescriptor {
ChainedStruct* next;
}
enum RequestAdapterStatus {
SUCCESS,
UNAVAILABLE,
ERROR,
UNKNOWN
}
enum WgslFeatureName {
UNDEFINED,
READONLY_AND_READWRITE_STORAGE_TEXTURES,
PACKED_4X8_INTEGER_DOT_PRODUCT,
UNRESTRICTED_POINTER_PARAMETERS,
POINTER_COMPOSITE_ACCESS
}