/* -*- 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 RawId from "mozilla/webgpu/WebGPUTypes.h"; using BufferAddress from "mozilla/webgpu/WebGPUTypes.h"; using SerialBindGroupLayoutDescriptor from "mozilla/webgpu/WebGPUTypes.h"; using SerialPipelineLayoutDescriptor from "mozilla/webgpu/WebGPUTypes.h"; using SerialBindGroupDescriptor from "mozilla/webgpu/WebGPUTypes.h"; using SerialComputePipelineDescriptor from "mozilla/webgpu/WebGPUTypes.h"; using dom::GPURequestAdapterOptions from "mozilla/dom/WebGPUBinding.h"; using dom::GPUDeviceDescriptor from "mozilla/dom/WebGPUBinding.h"; using dom::GPUBufferDescriptor from "mozilla/dom/WebGPUBinding.h"; using dom::GPUCommandEncoderDescriptor from "mozilla/dom/WebGPUBinding.h"; using dom::GPUCommandBufferDescriptor from "mozilla/dom/WebGPUBinding.h"; using dom::GPUPipelineLayoutDescriptor from "mozilla/dom/WebGPUBinding.h"; using webgpu::ffi::WGPUTextureDescriptor from "mozilla/webgpu/ffi/wgpu.h"; using webgpu::ffi::WGPUTextureViewDescriptor from "mozilla/webgpu/ffi/wgpu.h"; using webgpu::ffi::WGPUSamplerDescriptor from "mozilla/webgpu/ffi/wgpu.h"; include "mozilla/webgpu/WebGPUSerialize.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 InstanceRequestAdapter(GPURequestAdapterOptions options, RawId[] ids) returns (RawId adapterId); async AdapterRequestDevice(RawId selfId, GPUDeviceDescriptor desc, RawId newId); async AdapterDestroy(RawId selfId); async DeviceCreateBuffer(RawId selfId, GPUBufferDescriptor desc, RawId newId); async DeviceDestroy(RawId selfId); async DeviceUnmapBuffer(RawId selfId, RawId bufferId, Shmem shmem); async BufferMapRead(RawId selfId, Shmem shmem) returns (Shmem sm); async BufferDestroy(RawId selfId); async DeviceCreateTexture(RawId selfId, WGPUTextureDescriptor desc, RawId newId); async TextureCreateView(RawId selfId, WGPUTextureViewDescriptor desc, RawId newId); async TextureDestroy(RawId selfId); async TextureViewDestroy(RawId selfId); async DeviceCreateSampler(RawId selfId, WGPUSamplerDescriptor desc, RawId newId); async SamplerDestroy(RawId selfId); async DeviceCreateCommandEncoder(RawId selfId, GPUCommandEncoderDescriptor desc, RawId newId); async CommandEncoderCopyBufferToBuffer(RawId selfId, RawId sourceId, BufferAddress sourceOffset, RawId destinationId, BufferAddress destinationOffset, BufferAddress size); async CommandEncoderRunComputePass(RawId selfId, Shmem shmem); async CommandEncoderRunRenderPass(RawId selfId, Shmem shmem); async CommandEncoderFinish(RawId selfId, GPUCommandBufferDescriptor desc); async CommandEncoderDestroy(RawId selfId); async CommandBufferDestroy(RawId selfId); async QueueSubmit(RawId selfId, RawId[] commandBuffers); async DeviceCreateBindGroupLayout(RawId selfId, SerialBindGroupLayoutDescriptor desc, RawId newId); async BindGroupLayoutDestroy(RawId selfId); async DeviceCreatePipelineLayout(RawId selfId, SerialPipelineLayoutDescriptor desc, RawId newId); async PipelineLayoutDestroy(RawId selfId); async DeviceCreateBindGroup(RawId selfId, SerialBindGroupDescriptor desc, RawId newId); async BindGroupDestroy(RawId selfId); async DeviceCreateShaderModule(RawId selfId, uint32_t[] data, RawId newId); async ShaderModuleDestroy(RawId selfId); async DeviceCreateComputePipeline(RawId selfId, SerialComputePipelineDescriptor desc, RawId newId); async ComputePipelineDestroy(RawId selfId); async RenderPipelineDestroy(RawId selfId); async Shutdown(); child: async __delete__(); }; } // webgpu } // mozilla