Skip to content

Question about WGPUBindGroupLayoutEntry struct mismatch with webgpu.h from Google Dawn #24703

@DomagojKudek

Description

@DomagojKudek

When trying to build a Dawn web-gpu-based project with Emscripten targeting a wasm build and using dear ImGui, the built app complains about the "assert(entryPtr);" line on one of ImGuis WGPUBindGroupLayoutEntries.

App.js :

function makeEntry(entryPtr) {
       assert(entryPtr);
       // bindingArraySize is not specced and thus not implemented yet. We don't pass it through
       // because if we did, then existing apps using this version of the bindings could break when
       // browsers start accepting bindingArraySize.
       var bindingArraySize = HEAPU32[(((entryPtr)+(16))>>2)];
       assert(bindingArraySize == 0 || bindingArraySize == 1);
 
       return {
         "binding":
           HEAPU32[(((entryPtr)+(4))>>2)],
         "visibility":
           HEAPU32[(((entryPtr)+(8))>>2)],
         "buffer": makeBufferEntry(entryPtr + 24),
         "sampler": makeSamplerEntry(entryPtr + 48),
         "texture": makeTextureEntry(entryPtr + 56),
         "storageTexture": makeStorageTextureEntry(entryPtr + 72),
       };
     }

When looking at the included emscripten webgpu header file:

typedef struct WGPUBindGroupLayoutEntry {

It seems that it's missing the bindingArraySize in the WGPUBindGroupLayoutEntry struct compared to Dawn's webgpu.h file.

Is that the issue for my problem, or is something else at play that's not related to Emscripten itself?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions