2019-11-14 07:59:56 +03:00
|
|
|
/* -*- 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/. */
|
|
|
|
|
2020-04-07 01:29:18 +03:00
|
|
|
using layers::RGBDescriptor from "mozilla/layers/LayersSurfaces.h";
|
|
|
|
using wr::ExternalImageId from "mozilla/webrender/WebRenderAPI.h";
|
2019-11-14 07:59:56 +03:00
|
|
|
using RawId from "mozilla/webgpu/WebGPUTypes.h";
|
2020-01-24 19:27:09 +03:00
|
|
|
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";
|
2020-03-03 19:37:02 +03:00
|
|
|
using SerialRenderPipelineDescriptor from "mozilla/webgpu/WebGPUTypes.h";
|
2020-04-13 16:42:15 +03:00
|
|
|
using SerialTextureDescriptor from "mozilla/webgpu/WebGPUTypes.h";
|
2019-11-14 07:59:56 +03:00
|
|
|
using dom::GPURequestAdapterOptions from "mozilla/dom/WebGPUBinding.h";
|
|
|
|
using dom::GPUDeviceDescriptor from "mozilla/dom/WebGPUBinding.h";
|
2019-12-10 20:07:18 +03:00
|
|
|
using dom::GPUBufferDescriptor from "mozilla/dom/WebGPUBinding.h";
|
2020-01-22 10:31:51 +03:00
|
|
|
using dom::GPUCommandEncoderDescriptor from "mozilla/dom/WebGPUBinding.h";
|
|
|
|
using dom::GPUCommandBufferDescriptor from "mozilla/dom/WebGPUBinding.h";
|
2020-01-24 19:27:09 +03:00
|
|
|
using dom::GPUPipelineLayoutDescriptor from "mozilla/dom/WebGPUBinding.h";
|
2020-04-15 05:28:51 +03:00
|
|
|
using webgpu::ffi::WGPUSamplerDescriptor from "mozilla/webgpu/ffi/wgpu.h";
|
2020-02-24 23:12:16 +03:00
|
|
|
using webgpu::ffi::WGPUTextureViewDescriptor from "mozilla/webgpu/ffi/wgpu.h";
|
2020-04-13 16:59:24 +03:00
|
|
|
using webgpu::ffi::WGPUBufferCopyView 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";
|
2019-11-14 07:59:56 +03:00
|
|
|
|
|
|
|
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);
|
2020-01-22 10:31:51 +03:00
|
|
|
async AdapterDestroy(RawId selfId);
|
2019-12-10 20:07:18 +03:00
|
|
|
async DeviceCreateBuffer(RawId selfId, GPUBufferDescriptor desc, RawId newId);
|
2019-11-14 07:59:56 +03:00
|
|
|
async DeviceDestroy(RawId selfId);
|
2020-04-15 00:26:45 +03:00
|
|
|
async DeviceUnmapBuffer(RawId selfId, RawId bufferId, Shmem shmem, bool flush);
|
2020-01-22 10:31:51 +03:00
|
|
|
async BufferMapRead(RawId selfId, Shmem shmem) returns (Shmem sm);
|
2019-12-10 20:07:18 +03:00
|
|
|
async BufferDestroy(RawId selfId);
|
2020-04-13 16:42:15 +03:00
|
|
|
async DeviceCreateTexture(RawId selfId, SerialTextureDescriptor desc, RawId newId);
|
2020-02-24 23:12:16 +03:00
|
|
|
async TextureCreateView(RawId selfId, WGPUTextureViewDescriptor desc, RawId newId);
|
|
|
|
async TextureDestroy(RawId selfId);
|
|
|
|
async TextureViewDestroy(RawId selfId);
|
2020-04-15 05:28:51 +03:00
|
|
|
async DeviceCreateSampler(RawId selfId, WGPUSamplerDescriptor desc, RawId newId);
|
2020-02-24 23:12:16 +03:00
|
|
|
async SamplerDestroy(RawId selfId);
|
2020-01-22 10:31:51 +03:00
|
|
|
async DeviceCreateCommandEncoder(RawId selfId, GPUCommandEncoderDescriptor desc, RawId newId);
|
2020-01-24 19:27:09 +03:00
|
|
|
async CommandEncoderCopyBufferToBuffer(RawId selfId, RawId sourceId, BufferAddress sourceOffset, RawId destinationId, BufferAddress destinationOffset, BufferAddress size);
|
2020-04-13 16:59:24 +03:00
|
|
|
async CommandEncoderCopyBufferToTexture(RawId selfId, WGPUBufferCopyView source, WGPUTextureCopyView destination, WGPUExtent3d extent);
|
|
|
|
async CommandEncoderCopyTextureToBuffer(RawId selfId, WGPUTextureCopyView source, WGPUBufferCopyView destination, WGPUExtent3d extent);
|
|
|
|
async CommandEncoderCopyTextureToTexture(RawId selfId, WGPUTextureCopyView source, WGPUTextureCopyView destination, WGPUExtent3d extent);
|
2020-01-22 10:31:51 +03:00
|
|
|
async CommandEncoderRunComputePass(RawId selfId, Shmem shmem);
|
2020-02-19 22:25:30 +03:00
|
|
|
async CommandEncoderRunRenderPass(RawId selfId, Shmem shmem);
|
2020-01-22 10:31:51 +03:00
|
|
|
async CommandEncoderFinish(RawId selfId, GPUCommandBufferDescriptor desc);
|
|
|
|
async CommandEncoderDestroy(RawId selfId);
|
|
|
|
async CommandBufferDestroy(RawId selfId);
|
|
|
|
async QueueSubmit(RawId selfId, RawId[] commandBuffers);
|
2020-01-24 19:27:09 +03:00
|
|
|
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);
|
2020-03-03 19:37:02 +03:00
|
|
|
async DeviceCreateRenderPipeline(RawId selfId, SerialRenderPipelineDescriptor desc, RawId newId);
|
2020-02-19 22:25:30 +03:00
|
|
|
async RenderPipelineDestroy(RawId selfId);
|
2020-04-07 01:29:18 +03:00
|
|
|
async DeviceCreateSwapChain(RawId selfId, RawId queueId, RGBDescriptor desc, RawId[] bufferIds, ExternalImageId externalId);
|
|
|
|
async SwapChainPresent(ExternalImageId externalId, RawId textureId, RawId commandEncoderId);
|
|
|
|
async SwapChainDestroy(ExternalImageId externalId);
|
2019-11-14 07:59:56 +03:00
|
|
|
async Shutdown();
|
|
|
|
|
|
|
|
child:
|
2020-03-23 10:54:08 +03:00
|
|
|
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);
|
2019-11-14 07:59:56 +03:00
|
|
|
async __delete__();
|
|
|
|
};
|
|
|
|
|
|
|
|
} // webgpu
|
|
|
|
} // mozilla
|