| // Copyright 2024 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. |
| |
| // |
| // This file and library_webgpu.js together implement <webgpu/webgpu.h>. |
| // |
| |
| #include <webgpu/webgpu.h> |
| |
| #include <cassert> |
| |
| // |
| // WebGPU function definitions, with methods organized by "class". Note these |
| // don't need to be extern "C" because they are already declared in webgpu.h. |
| // |
| |
| // Standalone (non-method) functions |
| |
| WGPUInstance wgpuCreateInstance(const WGPUInstanceDescriptor* descriptor) { |
| assert(descriptor == nullptr); // descriptor not implemented yet |
| return reinterpret_cast<WGPUInstance>(1); |
| } |
| |
| // Instance |
| |
| void wgpuInstanceReference(WGPUInstance) { /* no-op for now */ } |
| void wgpuInstanceRelease(WGPUInstance) { /* no-op for now */ } |