commit 9b1a02828ca2685d455014bf28ca8bcc466b040c
parent 2e369bd40bf09284da5816c366761c2ff55b8c41
Author: Jim Blandy <jimb@red-bean.com>
Date: Wed, 15 Oct 2025 23:02:41 +0000
Bug 1992032: Build WebGPU external textures directly from the shmem. r=webgpu-reviewers,teoxoy
In `mozilla::webgpu::ExternalTextureSourceHost::Create`, when the data
is received as a `SurfaceDescriptorBuffer`, simply fetch the address
directly from the `Shmem`; don't call `GetAddressFromDescriptor`.
Differential Revision: https://phabricator.services.mozilla.com/D268286
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/dom/webgpu/ExternalTexture.cpp b/dom/webgpu/ExternalTexture.cpp
@@ -430,12 +430,11 @@ ExternalTextureSourceHost::ExternalTextureSourceHost(
case layers::SurfaceDescriptor::TSurfaceDescriptorBuffer: {
const layers::SurfaceDescriptorBuffer& bufferDesc =
sd.get_SurfaceDescriptorBuffer();
+ ipc::Shmem& bufferShmem = bufferDesc.data().get_Shmem();
auto source =
CreateFromBufferDesc(aParent, aDeviceId, aQueueId, aDesc,
- bufferDesc.desc(), GetAddressFromDescriptor(sd));
- if (bufferDesc.data().type() == layers::MemoryOrShmem::TShmem) {
- aParent->DeallocShmem(bufferDesc.data().get_Shmem());
- }
+ bufferDesc.desc(), bufferShmem.get<uint8_t>());
+ aParent->DeallocShmem(bufferShmem);
return source;
} break;