Skip to content

WebGPU CopyBufferToBuffer does not work as of version 3.1.65 #22699

@klukaszek

Description

@klukaszek

Version of emscripten/emsdk:
Version >= 3.1.65

Failing command line in full:
There's no problem with the command-line tool here. The issue is at runtime where any WebGPU calls to CopyBufferToBuffer() fail because the buffer ID for the destination buffer seems to not get properly passed to the function from C.

var _wgpuCommandEncoderCopyBufferToBuffer = (encoderId, srcId, srcOffset, dstId, dstoffset, size) => {
commandEncoder = WebGPU.mgrCommandEncoder.get(encoderId); 
var src= WebGPU.mgrBuffer.get(srcId); 
var dst = WebGPU.mgrBuffer.get(dstId);
commandEncoder.copyBufferToBuffer(src, srcOffset, dst, dstoffset, size);
};

This function seems to receive a dstId of 0 which results in WebGPU.mgrBuffer.get(dstId) failing. I have verified the value being passed through the C API and it does represent a valid buffer (and it still works in previous versions of Emscripten).

I originally found this issue because I work with an older version of Emscripten on my machine, but with my deployment, I was working with the latest version. I narrowed down the problem to Emscripten version 3.1.65+ where the CopyBufferToBuffer() function stops working.

I have discussed with @beaufortfrancois in DMs and he suggested looking into the following in case it was the breaking change:
#22301

I'm busy for the next week with school but I thought I would post the issue here in case anyone else is encountering the same problem.

Testing

  • Ubuntu 22.04 (Local Machine)
  • Ubuntu 22.04 (GitHub Runner)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions