WebAssembly / WebAssembly/wasi-webgpu

Open question: How to deal with buffers that need lots of reads/writes

Open
#2 10 comments 0 reactions 2 assignees View on GitHub

@MendyBerger is already working on this.

Since Mar 1, 2024.

Dominant language
Rust
Stars
220
Forks
15
PR merge metrics
No merged PRs in 30d

Description

There are a few cases where we'll have buffers that need to take lots of reads/writes, and are not in linear memory.
Examples include gpu-buffer when mapped to CPU, and frame-buffers.
How should we go about those?
Here are some options I've thought of, none of them seem particularly good to me:

  • Just copy everything over as list<u8>. Obviously slow.
  • Have an external resource, with .get()/.set() methods. Prob slow since every .get()/.set() will have to cross the wasm boundary, but might still be best option with current capabilities.
  • Find some magic way to map it to linear memory. Don't think this is actually possible.

Thoughts anyone?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.