Open Bug 2023418 Opened 20 days ago Updated 18 days ago

WebGPU GPUBuffer.mapAsync() not working

Categories

(Core :: Graphics: WebGPU, defect, P1)

Firefox 150
defect

Tracking

()

Tracking Status
firefox150 --- affected

People

(Reporter: jujjyl, Unassigned)

References

(Depends on 1 open bug)

Details

STR:

<!DOCTYPE html>
<html>
<body>
<script type="module">
const kExpectedValue = 0xDEADBEEF;

const adapter = await navigator.gpu.requestAdapter();
const device = await adapter.requestDevice();

const buffer = device.createBuffer({
  size: 256,
  usage: GPUBufferUsage.MAP_READ | GPUBufferUsage.COPY_DST,
});

device.queue.writeBuffer(buffer, 0, new Uint32Array([kExpectedValue]));

await buffer.mapAsync(GPUMapMode.READ);

const mapped = new Uint32Array(buffer.getMappedRange());
console.assert(mapped[0] === kExpectedValue, `Expected 0x${kExpectedValue.toString(16)}, got 0x${mapped[0].toString(16)}`);
buffer.unmap();
</script>
</body>
</html>

It looks like GPUBuffer.mapAsync() is not playing ball on WebGPU. The above works in Chrome, but fails in Firefox (asserts, and prints got 0).

See Also: → 1994733

Looks like the work is happening in Bug 1994733 and this Bug can be a dependency.

Severity: -- → S3
Depends on: 1994733
Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.