Sitelet https://github.com/gpuweb/gpuweb/issues/821
Skip to content

writeBuffer error if buffer is mapped #821

Description

@kainino0x

I realized while implementing #749 that it requires an exception to be thrown if the buffer is mapped.

I have been thinking for months that we already needed to track the buffer [[state]] on the client-side in a way that was multi-thread-synchronized. However I can't seem to find a good reason for it - map calls return asynchronously, and unmap and writeBuffer can both generate errors asynchronously. (Though note we already have most of the info on the state via the pending promise and the mapped data, anyway.)

Given this, I think writeBuffer should fail asynchronously if the buffer is mapped. This would match unmap() and the map calls.

@kvark

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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