{{{
  // Helper functions for code generation
  globalThis.html5_gpu = {
    makeImportExport: (snake_case) => {
      return `
LibraryHTML5WebGPU.emscripten_webgpu_import_${snake_case}__deps = ['$WebGPU', '$JsValStore'];
LibraryHTML5WebGPU.emscripten_webgpu_import_${snake_case} = (ptr) =>
  WebGPU._tableInsert(JsValStore.get(ptr));

LibraryHTML5WebGPU.emscripten_webgpu_export_${snake_case}__deps = ['$WebGPU', '$JsValStore'];
LibraryHTML5WebGPU.emscripten_webgpu_export_${snake_case} = (ptr) =>
  JsValStore.add(WebGPU._tableGet(ptr));`
    },
  };
  null;
}}}

var LibraryHTML5WebGPU = {
  $JsValStore: {
    values: {},
    next_id: 1,

    add(js_val) {
      var id;
      do {
        id = JsValStore.next_id++;
        if (JsValStore.next_id > 2147483647) JsValStore.next_id = 1; // Wraparound signed int32.
      } while (id in JsValStore.values);

      JsValStore.values[id] = js_val;
      return id;
    },
    remove(id) {
#if ASSERTIONS
      assert(id in JsValStore.values);
#endif
      delete JsValStore.values[id];
    },
    get(id) {
#if ASSERTIONS
      assert(id === 0 || id in JsValStore.values);
#endif
      return JsValStore.values[id];
    },
  },

  emscripten_webgpu_release_js_handle__deps: ['$JsValStore'],
  emscripten_webgpu_release_js_handle: (id) => JsValStore.remove(id),

  emscripten_webgpu_get_device__deps: ['$WebGPU','wgpuDeviceAddRef'],
  emscripten_webgpu_get_device: () => {
#if ASSERTIONS
    assert(Module['preinitializedWebGPUDevice']);
#endif
    if (WebGPU.preinitializedDeviceId === undefined) {
      WebGPU.preinitializedDeviceId = WebGPU.importJsDevice(Module['preinitializedWebGPUDevice']);
    }
    _wgpuDeviceAddRef(WebGPU.preinitializedDeviceId);
    return WebGPU.preinitializedDeviceId;
  },
};

{{{ html5_gpu.makeImportExport('surface') }}}
{{{ html5_gpu.makeImportExport('swap_chain') }}}

{{{ html5_gpu.makeImportExport('device') }}}
{{{ html5_gpu.makeImportExport('queue') }}}

{{{ html5_gpu.makeImportExport('command_buffer') }}}
{{{ html5_gpu.makeImportExport('command_encoder') }}}
{{{ html5_gpu.makeImportExport('render_pass_encoder') }}}
{{{ html5_gpu.makeImportExport('compute_pass_encoder') }}}

{{{ html5_gpu.makeImportExport('bind_group') }}}
{{{ html5_gpu.makeImportExport('buffer') }}}
{{{ html5_gpu.makeImportExport('sampler') }}}
{{{ html5_gpu.makeImportExport('texture') }}}
{{{ html5_gpu.makeImportExport('texture_view') }}}
{{{ html5_gpu.makeImportExport('query_set') }}}

{{{ html5_gpu.makeImportExport('bind_group_layout') }}}
{{{ html5_gpu.makeImportExport('pipeline_layout') }}}
{{{ html5_gpu.makeImportExport('render_pipeline') }}}
{{{ html5_gpu.makeImportExport('compute_pipeline') }}}
{{{ html5_gpu.makeImportExport('shader_module') }}}

{{{ html5_gpu.makeImportExport('render_bundle_encoder') }}}
{{{ html5_gpu.makeImportExport('render_bundle') }}}

mergeInto(LibraryManager.library, LibraryHTML5WebGPU);
