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

Spec requires mappedAtCreation to still work after device is destroyed #5102

@kainino0x

Description

@kainino0x

device.destroy() unmaps all buffers. However, you can still call device.createBuffer(), and if mappedAtCreation is true, that's supposed to return a buffer (unless it runs out of memory).

This doesn't make very much sense because it means that destroying the device a second time can still have effects (destroy is not idempotent): it unmaps any mappedAtCreation buffers that were created after the first destroy. We already don't allow mapAsync to work on a lost or destroyed device (though we do require mappedAtCreation to work on a lost, non-destroyed device).

I tried testing what the spec says; currently, browser behavior is unsurprisingly inconsistent - though chromium (somehow) passes them.

Metadata

Metadata

Assignees

Labels

apiWebGPU API

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions