Adapt `wgpu_server_queue_submit` to the new submission index type. Use corrected spelling `WGPUTextureFormat_Rg11b10UFloat`. Assign queue ids explicitly, rather than deriving them from device ids: - `wgpu_bindings::client::IdentityHub`: add an `IdentityManager` for queues. Initialize it in `IdentityHub::default`. - `dom::webgpu::DeviceRequest`: hold separate `mDeviceId` and `mQueueId` members. - `wgpu_client_make_device_id`: rename to `wgpu_client_make_device_queue_id`, and have it allocate both a device id and a queue id. - `PWebGPU` protocol's `AdapterRequestDevice` request: explicitly pass an id for the new queue. - `WebGPUChild::AdapterRequestDevice`: pass through the queue id from `wgpu_client_make_device_queue_id` through to `SendAdapterRequestDevice`, and also return it as `DeviceRequest::mQueueId`. - `WebGPUParent::RecvAdapterRequestDevice`: accept a queue id, and pass it along to `ffi::wgpu_server_adapter_request_device`. - `wgpu_server_adapter_request_device`: take a new argument specifying the new queue's id, and pass that along to `global.adapter_request_device`. - `dom::webgpu::Adapter::RequestDevice`: given the `DeviceRequest` returned by `WebGPUChild::AdapterRequestDevice`, pass the ids for both the new device and the new queue to `dom::webgpu::Device::Device`. - Let `dom::webgpu::Device::Device` take a new argument explicitly specifying the device's queue's id. Differential Revision: https://phabricator.services.mozilla.com/D219356
108 lines
5.2 KiB
Plaintext
108 lines
5.2 KiB
Plaintext
/* -*- 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 mozilla::layers::RGBDescriptor from "mozilla/layers/LayersSurfaces.h";
|
|
using mozilla::layers::RemoteTextureId from "mozilla/layers/LayersTypes.h";
|
|
using mozilla::layers::RemoteTextureOwnerId from "mozilla/layers/LayersTypes.h";
|
|
using mozilla::layers::RemoteTextureTxnType from "mozilla/layers/LayersTypes.h";
|
|
using mozilla::layers::RemoteTextureTxnId from "mozilla/layers/LayersTypes.h";
|
|
using mozilla::webgpu::RawId from "mozilla/webgpu/WebGPUTypes.h";
|
|
using mozilla::dom::GPUErrorFilter from "mozilla/dom/WebGPUBinding.h";
|
|
using mozilla::dom::GPURequestAdapterOptions from "mozilla/dom/WebGPUBinding.h";
|
|
using mozilla::dom::GPUCommandBufferDescriptor from "mozilla/dom/WebGPUBinding.h";
|
|
using mozilla::dom::GPUBufferDescriptor from "mozilla/dom/WebGPUBinding.h";
|
|
using mozilla::webgpu::PopErrorScopeResult from "mozilla/webgpu/WebGPUTypes.h";
|
|
using mozilla::webgpu::WebGPUCompilationMessage from "mozilla/webgpu/WebGPUTypes.h";
|
|
[MoveOnly] using class mozilla::ipc::UnsafeSharedMemoryHandle from "mozilla/ipc/RawShmem.h";
|
|
using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";
|
|
|
|
include "mozilla/ipc/ByteBufUtils.h";
|
|
include "mozilla/layers/LayersMessageUtils.h";
|
|
include "mozilla/webgpu/WebGPUSerialize.h";
|
|
include "mozilla/layers/WebRenderMessageUtils.h";
|
|
include protocol PCanvasManager;
|
|
include PWebGPUTypes;
|
|
|
|
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 PCanvasManager;
|
|
|
|
parent:
|
|
async DeviceAction(RawId selfId, ByteBuf buf);
|
|
async DeviceActionWithAck(RawId selfId, ByteBuf buf) returns (bool dummy);
|
|
async TextureAction(RawId selfId, RawId aDeviceId, ByteBuf buf);
|
|
async CommandEncoderAction(RawId selfId, RawId aDeviceId, ByteBuf buf);
|
|
async RenderPass(RawId selfId, RawId aDeviceId, ByteBuf buf);
|
|
async ComputePass(RawId selfId, RawId aDeviceId, ByteBuf buf);
|
|
async BumpImplicitBindGroupLayout(RawId pipelineId, bool isCompute, uint32_t index, RawId assignId);
|
|
|
|
async DeviceCreateBuffer(RawId deviceId, RawId bufferId, GPUBufferDescriptor desc, UnsafeSharedMemoryHandle shm);
|
|
|
|
async InstanceRequestAdapter(GPURequestAdapterOptions options, RawId[] ids) returns (ByteBuf byteBuf);
|
|
async AdapterRequestDevice(
|
|
RawId adapterId,
|
|
ByteBuf descriptorBuf,
|
|
RawId newDeviceId,
|
|
RawId newQueueId
|
|
) returns (bool success);
|
|
async AdapterDrop(RawId selfId);
|
|
// TODO: We want to return an array of compilation messages.
|
|
async DeviceCreateShaderModule(RawId selfId, RawId bufferId, nsString label, nsCString code) returns (WebGPUCompilationMessage[] messages);
|
|
async BufferMap(RawId deviceId, RawId bufferId, uint32_t aMode, uint64_t offset, uint64_t size) returns (BufferMapResult result);
|
|
async BufferUnmap(RawId deviceId, RawId bufferId, bool flush);
|
|
async BufferDestroy(RawId selfId);
|
|
async BufferDrop(RawId selfId);
|
|
async TextureDestroy(RawId selfId, RawId deviceId);
|
|
async TextureDrop(RawId selfId);
|
|
async TextureViewDrop(RawId selfId);
|
|
async SamplerDrop(RawId selfId);
|
|
async DeviceDestroy(RawId selfId);
|
|
async DeviceDrop(RawId selfId);
|
|
|
|
async CommandEncoderFinish(RawId selfId, RawId deviceId, GPUCommandBufferDescriptor desc);
|
|
async CommandEncoderDrop(RawId selfId);
|
|
async RenderBundleDrop(RawId selfId);
|
|
async QueueSubmit(RawId selfId, RawId aDeviceId, RawId[] commandBuffers, RawId[] textureIds);
|
|
async QueueOnSubmittedWorkDone(RawId selfId) returns (void_t ok);
|
|
async QueueWriteAction(RawId selfId, RawId aDeviceId, ByteBuf buf, UnsafeSharedMemoryHandle shmem);
|
|
|
|
async BindGroupLayoutDrop(RawId selfId);
|
|
async PipelineLayoutDrop(RawId selfId);
|
|
async BindGroupDrop(RawId selfId);
|
|
async ShaderModuleDrop(RawId selfId);
|
|
async ComputePipelineDrop(RawId selfId);
|
|
async RenderPipelineDrop(RawId selfId);
|
|
async ImplicitLayoutDrop(RawId implicitPlId, RawId[] implicitBglIds);
|
|
async DeviceCreateSwapChain(RawId selfId, RawId queueId, RGBDescriptor desc, RawId[] bufferIds, RemoteTextureOwnerId ownerId, bool useExternalTextureInSwapChain);
|
|
async SwapChainPresent(RawId textureId, RawId commandEncoderId, RemoteTextureId remoteTextureId, RemoteTextureOwnerId remoteTextureOwnerId);
|
|
async SwapChainDrop(RemoteTextureOwnerId ownerId, RemoteTextureTxnType txnType, RemoteTextureTxnId txnId);
|
|
|
|
async DevicePushErrorScope(RawId selfId, GPUErrorFilter aFilter);
|
|
async DevicePopErrorScope(RawId selfId) returns (PopErrorScopeResult result);
|
|
|
|
// Generate an error on the Device timeline for `deviceId`.
|
|
// The `message` parameter is interpreted as UTF-8.
|
|
async GenerateError(RawId? deviceId, GPUErrorFilter type, nsCString message);
|
|
|
|
child:
|
|
async UncapturedError(RawId? aDeviceId, nsCString message);
|
|
async DropAction(ByteBuf buf);
|
|
async DeviceLost(RawId aDeviceId, uint8_t? reason, nsCString message);
|
|
async __delete__();
|
|
};
|
|
|
|
} // webgpu
|
|
} // mozilla
|