Bug 1754302 - WebGPU should consistently use GetCurrentSerialEventTarget instead of GetMainThreadSerialEventTarget. r=kvark

This is necessary for when WebGPU objects are accessed from a worker
thread instead of the main thread. It should be otherwise a
non-functional change.

Differential Revision: https://phabricator.services.mozilla.com/D138206
This commit is contained in:
Andrew Osmond 2022-02-09 22:01:48 +00:00
Родитель 0745b128da
Коммит 8170056817
3 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -114,7 +114,7 @@ already_AddRefed<dom::Promise> Buffer::MapAsync(
}
mappingPromise->Then(
GetMainThreadSerialEventTarget(), __func__,
GetCurrentSerialEventTarget(), __func__,
[promise, self](ipc::Shmem&& aShmem) {
self->mMapped->mShmem = std::move(aShmem);
promise->MaybeResolve(0);

Просмотреть файл

@ -247,7 +247,7 @@ already_AddRefed<dom::Promise> Device::CreateComputePipelineAsync(
context->mParentId = mId;
mBridge->DeviceCreateComputePipelineAsync(context.get(), aDesc)
->Then(
GetMainThreadSerialEventTarget(), __func__,
GetCurrentSerialEventTarget(), __func__,
[self = RefPtr{this}, context, promise](RawId aId) {
RefPtr<ComputePipeline> object = new ComputePipeline(
self, aId, context->mImplicitPipelineLayoutId,
@ -274,7 +274,7 @@ already_AddRefed<dom::Promise> Device::CreateRenderPipelineAsync(
context->mParentId = mId;
mBridge->DeviceCreateRenderPipelineAsync(context.get(), aDesc)
->Then(
GetMainThreadSerialEventTarget(), __func__,
GetCurrentSerialEventTarget(), __func__,
[self = RefPtr{this}, context, promise](RawId aId) {
RefPtr<RenderPipeline> object = new RenderPipeline(
self, aId, context->mImplicitPipelineLayoutId,
@ -351,7 +351,7 @@ already_AddRefed<dom::Promise> Device::PopErrorScope(ErrorResult& aRv) {
auto errorPromise = mBridge->SendDevicePopErrorScope(mId);
errorPromise->Then(
GetMainThreadSerialEventTarget(), __func__,
GetCurrentSerialEventTarget(), __func__,
[self = RefPtr{this}, promise](const MaybeScopedError& aMaybeError) {
if (aMaybeError) {
if (aMaybeError->operationError) {

Просмотреть файл

@ -60,7 +60,7 @@ already_AddRefed<dom::Promise> Instance::RequestAdapter(
RefPtr<Instance> instance = this;
mBridge->InstanceRequestAdapter(aOptions)->Then(
GetMainThreadSerialEventTarget(), __func__,
GetCurrentSerialEventTarget(), __func__,
[promise, instance](ipc::ByteBuf aInfoBuf) {
ffi::WGPUAdapterInformation info = {};
ffi::wgpu_client_adapter_extract_info(ToFFI(&aInfoBuf), &info);