summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/ipc/PWebGPU.ipdl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /dom/webgpu/ipc/PWebGPU.ipdl
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--dom/webgpu/ipc/PWebGPU.ipdl94
1 files changed, 94 insertions, 0 deletions
diff --git a/dom/webgpu/ipc/PWebGPU.ipdl b/dom/webgpu/ipc/PWebGPU.ipdl
new file mode 100644
index 0000000000..98bece449d
--- /dev/null
+++ b/dom/webgpu/ipc/PWebGPU.ipdl
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ * vim: sw=2 ts=8 et :
+ */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+using layers::RGBDescriptor from "mozilla/layers/LayersSurfaces.h";
+using wr::ExternalImageId from "mozilla/webrender/WebRenderAPI.h";
+using RawId from "mozilla/webgpu/WebGPUTypes.h";
+using BufferAddress from "mozilla/webgpu/WebGPUTypes.h";
+using dom::GPURequestAdapterOptions from "mozilla/dom/WebGPUBinding.h";
+using dom::GPUDeviceDescriptor from "mozilla/dom/WebGPUBinding.h";
+using dom::GPUCommandBufferDescriptor from "mozilla/dom/WebGPUBinding.h";
+using webgpu::ffi::WGPUTextureDataLayout from "mozilla/webgpu/ffi/wgpu.h";
+using webgpu::ffi::WGPUTextureCopyView from "mozilla/webgpu/ffi/wgpu.h";
+using webgpu::ffi::WGPUExtent3d from "mozilla/webgpu/ffi/wgpu.h";
+using webgpu::ffi::WGPUHostMap from "mozilla/webgpu/ffi/wgpu.h";
+
+include "mozilla/ipc/ByteBufUtils.h";
+include "mozilla/webgpu/WebGPUSerialize.h";
+include "mozilla/layers/WebRenderMessageUtils.h";
+include protocol PCompositorBridge;
+
+namespace mozilla {
+namespace webgpu {
+
+/**
+ * Represents the connection between a WebGPUChild actor that issues WebGPU
+ * command from the content process, and a WebGPUParent in the compositor
+ * process that runs the commands.
+ */
+async protocol PWebGPU
+{
+ manager PCompositorBridge;
+
+parent:
+ async DeviceAction(RawId selfId, ByteBuf buf);
+ async TextureAction(RawId selfId, RawId aDeviceId, ByteBuf buf);
+ async CommandEncoderAction(RawId selfId, RawId aDeviceId, ByteBuf buf);
+ async BumpImplicitBindGroupLayout(RawId pipelineId, bool isCompute, uint32_t index, RawId assignId);
+
+ async InstanceRequestAdapter(GPURequestAdapterOptions options, RawId[] ids) returns (RawId adapterId);
+ async AdapterRequestDevice(RawId selfId, GPUDeviceDescriptor desc, RawId newId);
+ async AdapterDestroy(RawId selfId);
+ async BufferReturnShmem(RawId selfId, Shmem shmem);
+ async BufferMap(RawId selfId, WGPUHostMap hostMap, uint64_t offset, uint64_t size) returns (Shmem sm);
+ async BufferUnmap(RawId selfId, Shmem shmem, bool flush);
+ async BufferDestroy(RawId selfId);
+ async TextureDestroy(RawId selfId);
+ async TextureViewDestroy(RawId selfId);
+ async SamplerDestroy(RawId selfId);
+ async DeviceDestroy(RawId selfId);
+
+ async CommandEncoderFinish(RawId selfId, RawId deviceId, GPUCommandBufferDescriptor desc);
+ async CommandEncoderDestroy(RawId selfId);
+ async CommandBufferDestroy(RawId selfId);
+ async QueueSubmit(RawId selfId, RawId[] commandBuffers);
+ async QueueWriteBuffer(RawId selfId, RawId bufferId, BufferAddress bufferOffset, Shmem shmem);
+ async QueueWriteTexture(RawId selfId, WGPUTextureCopyView destination, Shmem shmem, WGPUTextureDataLayout layout, WGPUExtent3d extent);
+
+ async BindGroupLayoutDestroy(RawId selfId);
+ async PipelineLayoutDestroy(RawId selfId);
+ async BindGroupDestroy(RawId selfId);
+ async ShaderModuleDestroy(RawId selfId);
+ async ComputePipelineDestroy(RawId selfId);
+ async RenderPipelineDestroy(RawId selfId);
+ async DeviceCreateSwapChain(RawId selfId, RawId queueId, RGBDescriptor desc, RawId[] bufferIds, ExternalImageId externalId);
+ async SwapChainPresent(ExternalImageId externalId, RawId textureId, RawId commandEncoderId);
+ async SwapChainDestroy(ExternalImageId externalId);
+
+ async Shutdown();
+
+child:
+ async Error(RawId aDeviceId, nsCString message);
+ async DropAction(ByteBuf buf);
+ async FreeAdapter(RawId id);
+ async FreeDevice(RawId id);
+ async FreePipelineLayout(RawId id);
+ async FreeShaderModule(RawId id);
+ async FreeBindGroupLayout(RawId id);
+ async FreeBindGroup(RawId id);
+ async FreeCommandBuffer(RawId id);
+ async FreeRenderPipeline(RawId id);
+ async FreeComputePipeline(RawId id);
+ async FreeBuffer(RawId id);
+ async FreeTexture(RawId id);
+ async FreeTextureView(RawId id);
+ async FreeSampler(RawId id);
+ async __delete__();
+};
+
+} // webgpu
+} // mozilla