WebAssembly / WebAssembly/wasi-webgpu

Consider removing present method becuase of incompatibility with the web

Open
#54 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I think we should consider removing the present() method from graphics-context because it's not really going to work on the web.

The web doesn't let you "present", you just write to the texture that's going the be presented next, and the browser presents it whenever it's ready to do so.

In the name of being compatible with the web platform, we should consider removing it. This would mean that the native hosts will now have to manage presenting on their own.

I'd just point out that it's probably possible to emulate preset behavior by not actually returning the "current-texture" returned by the browser, and instead provide our own texture that we use to copy onto the real "current-texture" when the user calls present. However, this would introduce a bunch of unnecessary overhead, so I don't think we should go there.

(@seanisom I'd love to get your thoughts)

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.

Research direction

Start with graphics-context/graphics-context.wit, especially the present() method linked in the issue, and review how the graphics-context interface maps to web presentation. Done means deciding whether present() is removed and documenting or applying the corresponding native-host responsibility, with compatibility implications resolved.

Written by the indexing model from the issue text.

Assessment

Domain
api, web-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.