forked from emscripten-core/emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtml5_webgpu.h
More file actions
55 lines (41 loc) · 1.8 KB
/
html5_webgpu.h
File metadata and controls
55 lines (41 loc) · 1.8 KB
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
45
46
47
48
49
50
51
52
53
54
55
/*
* Copyright 2020 The Emscripten Authors. All rights reserved.
* Emscripten is available under two separate licenses, the MIT license and the
* University of Illinois/NCSA Open Source License. Both these licenses can be
* found in the LICENSE file.
*/
#pragma once
#include <webgpu/webgpu.h>
#ifdef __cplusplus
extern "C" {
#endif
WGPUDevice emscripten_webgpu_get_device(void);
void emscripten_webgpu_release_js_handle(int js_handle);
#define WEBGPU_MAKE_IMPORT_EXPORT(snake_case, CamelCase) \
WGPU##CamelCase emscripten_webgpu_import_##snake_case(int); \
int emscripten_webgpu_export_##snake_case(WGPU##CamelCase);
WEBGPU_MAKE_IMPORT_EXPORT(surface, Surface)
WEBGPU_MAKE_IMPORT_EXPORT(swap_chain, SwapChain)
WEBGPU_MAKE_IMPORT_EXPORT(device, Device)
WEBGPU_MAKE_IMPORT_EXPORT(queue, Queue)
WEBGPU_MAKE_IMPORT_EXPORT(command_buffer, CommandBuffer)
WEBGPU_MAKE_IMPORT_EXPORT(command_encoder, CommandEncoder)
WEBGPU_MAKE_IMPORT_EXPORT(render_passEncoder, RenderPassEncoder)
WEBGPU_MAKE_IMPORT_EXPORT(compute_passEncoder, ComputePassEncoder)
WEBGPU_MAKE_IMPORT_EXPORT(bind_group, BindGroup)
WEBGPU_MAKE_IMPORT_EXPORT(buffer, Buffer)
WEBGPU_MAKE_IMPORT_EXPORT(sampler, Sampler)
WEBGPU_MAKE_IMPORT_EXPORT(texture, Texture)
WEBGPU_MAKE_IMPORT_EXPORT(texture_view, TextureView)
WEBGPU_MAKE_IMPORT_EXPORT(query_set, QuerySet)
WEBGPU_MAKE_IMPORT_EXPORT(bind_group_layout, BindGroupLayout)
WEBGPU_MAKE_IMPORT_EXPORT(pipeline_layout, PipelineLayout)
WEBGPU_MAKE_IMPORT_EXPORT(render_pipeline, RenderPipeline)
WEBGPU_MAKE_IMPORT_EXPORT(compute_pipeline, ComputePipeline)
WEBGPU_MAKE_IMPORT_EXPORT(shader_module, ShaderModule)
WEBGPU_MAKE_IMPORT_EXPORT(render_bundle_encoder, RenderBundleEncoder)
WEBGPU_MAKE_IMPORT_EXPORT(render_bundle, RenderBundle)
#undef WEBGPU_MAKE_IMPORT_EXPORT
#ifdef __cplusplus
} // ~extern "C"
#endif