这是indexloc提供的服务,不要输入任何密码
Skip to content

Try-catching getMappedRange is useful but shouldn't be #3013

@kainino0x

Description

@kainino0x

If you want to know the map state of a GPUBuffer, you can track the state yourself and update it each time you createBuffer/mapAsync/unmap. This is a fine pattern. However in some cases, if you happen to also need to getMappedRange, you can use the exception thrown from getMappedRange() instead. This isn't great because it (1) encourages authors to depend on exception results, and (2) doesn't allow distinguishing from other errors in getMappedRange() (except by looking at the exception message which is implementation-defined and non-stable).

There are two things we could do about this (either or both):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions