`GPUTexture` missing `readonly attribute`s
Categories
(Core :: Graphics: WebGPU, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox115 | --- | fixed |
People
(Reporter: ErichDonGubler, Assigned: ErichDonGubler)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
If you navigate to https://webgpufundamentals.org/webgpu/lessons/webgpu-perspective-projection.html, multiple errors of the following form can be observed:
GPUDevice.createTexture: Element of sequence<unsigned long> branch of (sequence<unsigned long> or GPUExtent3DDict) is not a finite value, so is out of range for unsigned long.
It turns out that our implementation of WebGPU doesn't populate the readonly attribute
s specified to be on GPUTexture
at all! We should, according to section 6.1 ("GPUTexture
") of the current WebGPU v1 spec. draft (link).
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D176847
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D176848
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
This bug breaks things when visiting https://thimbleberry.dev/. The GPUTexture.format
attribute of the returned texture isn't being populated, i.e.:
Uncaught (in promise) TypeError: GPUDevice.createRenderPipeline: Missing required 'format' member of GPUColorTargetState.
createMosaicPipeline MosaicPipeline.ts:86
memoMemo MemoMemo.ts:44
memoizeWithDevice CacheKeyWithDevice.ts:33
get pipeline MosaicShader.ts:101
Comment 5•2 years ago
|
||
Just to fill in some details:
Those error messages are from GPUDevice.create...
methods, but that's because the caller is passing a descriptor whose fields are initialized with values taken from some other texture. For example, webgpufundamentals.org
is saying:
// Get the current texture from the canvas context and
// set it as the texture to render to.
const canvasTexture = context.getCurrentTexture();
renderPassDescriptor.colorAttachments[0].view = canvasTexture.createView();
// If we don't have a depth texture OR if its size is different
// from the canvasTexture when make a new depth texture
if (!depthTexture ||
depthTexture.width !== canvasTexture.width ||
depthTexture.height !== canvasTexture.height) {
if (depthTexture) {
depthTexture.destroy();
}
depthTexture = device.createTexture({
size: [canvasTexture.width, canvasTexture.height],
format: 'depth24plus',
usage: GPUTextureUsage.RENDER_ATTACHMENT,
});
}
Because canvasTexture.width
/ height
/ etc. are all undefined
, the argument to device.createTexture
is bogus. The error messages are the DOM bindings complaining when they try to build a C++ mozilla::dom::GPUTextureDescriptor
from the JS object.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5e19f3cbd315
https://hg.mozilla.org/mozilla-central/rev/e7fd9323eaad
https://hg.mozilla.org/mozilla-central/rev/7688e7d3bd4e
Description
•