| ); | |
| // Double check that the struct info was generated from the right header. | |
| // (The include directory option of gen_struct_info.py affects this.) | |
| if (!('WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER' in structInfo32.structs)) { | |
| throw new Error('struct_info32 generation error - need webgpu.h from Dawn, got it from Emscripten'); | |
| } | |
| if (!('WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER' in structInfo64.structs)) { | |
| throw new Error('struct_info64 generation error - need webgpu.h from Dawn, got it from Emscripten'); | |
| } | |
| // Make sure we aren't inheriting any of the webgpu.h struct info from | |
| // Emscripten's copy. | |
| for (const k of Object.keys(C_STRUCTS)) { | |
| if (k.startsWith('WGPU')) { | |
| delete C_STRUCTS[k]; | |
| } | |
| } | |
| const WGPU_STRUCTS = (MEMORY64 ? structInfo64 : structInfo32).structs; | |
| for (const [k, v] of Object.entries(WGPU_STRUCTS)) { | |
| C_STRUCTS[k] = v; | |
| } | |
| globalThis.__HAVE_EMDAWNWEBGPU_STRUCT_INFO = true; | |
| null; | |
| }}} |