New issue
Advanced search Search tips
Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 7
Components:
OS: ----
Pri: 1
Type: Feature

Blocking:
issue 22



Sign in to add a comment
link

Issue 26: Implement fences following WebGPUFence

Reported by cwallez@chromium.org, Oct 22 Project Member

Issue description

The WebGPU interface for fences is defined here: https://github.com/gpuweb/gpuweb/blob/master/design/TimelineFences.md

This will require figuring out how javascript promises will translate to C/C++ concepts, and modifying the wire to keep known state on the client side.
 

Comment 1 by cwallez@chromium.org, Oct 22

Project Member
Owner: ----

Comment 2 by enga@chromium.org, Nov 13

Owner: enga@chromium.org
I'll start taking a look at this

Comment 3 by enga@google.com, Nov 14

Can Dawn have functions that are not in WebGPU?

I'd like to add a Fence::SetCompletionCallback which the WireServer will set on fence creation so it can send completed values to the WireClient.

Fence::GetCompletedValue is amazingly our first method that does not return an object

Comment 4 by cwallez@chromium.org, Nov 14

Project Member
We can have functions not in WebGPU but we should avoid them if possible. In this case some difference from WebGPU is warranted because C doesn't have a concept of promise.

That said I don't think we need to have a global fence callback because the wire server can register the callback just after we signal a fence. If you want we could iterate on a design doc for this to make sure all the interactions we care about are supported.

Comment 5 by enga@chromium.org, Nov 14

Oh right, I realize what you mean. Regardless, a design doc sounds like a good idea to be sure. I made one here: https://docs.google.com/document/d/1JdbokPFCGKYUBXi1gO8OipzDAqoQfrBm7QIIkOzGNL0/

Comment 6 by cwallez@chromium.org, Nov 23

Project Member
Blocking: 22

Comment 7 by cwallez@chromium.org, Nov 27

Project Member
Labels: Pri-1

Comment 8 by bugdroid1@chromium.org, Nov 28

Project Member
The following revision refers to this bug:
  https://dawn.googlesource.com/dawn/+/e06d57d338f501f295b493c626d5f819187165ab

commit e06d57d338f501f295b493c626d5f819187165ab
Author: Austin Eng <enga@chromium.org>
Date: Wed Nov 28 17:30:12 2018

Factor SerialQueue into SerialQueue and SerialMap

This change moves most of SerialQueue into SerialStorage
and factors it to make SerialMap and SerialQueue. SerialMap
does not enforce that items are Enqueue'd in monotonically
increasing order. This is useful for implement timeline fences
because OnCompletion callbacks may be added in an arbitrary order.

Bug:  dawn:26 
Change-Id: I03376117311112b0b94ed887a31974f36c4a5464
Reviewed-on: https://dawn-review.googlesource.com/c/2720
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>

[add] https://crrev.com/e06d57d338f501f295b493c626d5f819187165ab/src/common/SerialStorage.h
[modify] https://crrev.com/e06d57d338f501f295b493c626d5f819187165ab/BUILD.gn
[modify] https://crrev.com/e06d57d338f501f295b493c626d5f819187165ab/src/common/SerialQueue.h
[add] https://crrev.com/e06d57d338f501f295b493c626d5f819187165ab/src/tests/unittests/SerialMapTests.cpp
[add] https://crrev.com/e06d57d338f501f295b493c626d5f819187165ab/src/common/SerialMap.h

Comment 9 by bugdroid1@chromium.org, Dec 1

Project Member
The following revision refers to this bug:
  https://dawn.googlesource.com/dawn/+/8b07e43dadf8cf49fa0aafe3343748b4ec079160

commit 8b07e43dadf8cf49fa0aafe3343748b4ec079160
Author: Austin Eng <enga@chromium.org>
Date: Sat Dec 01 03:20:19 2018

Let DeviceBase know about Completed and LastSubmitted command Serials

This is needed to implement the timeline fence signal tracker in the frontend

Bug:  dawn:26 
Change-Id: Id6eb2afb81385de5093b57c5cb23ace93c8aab1b
Reviewed-on: https://dawn-review.googlesource.com/c/2741
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>

[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/metal/DeviceMTL.mm
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/opengl/DeviceGL.h
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/vulkan/DeviceVk.h
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/d3d12/DeviceD3D12.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/opengl/QueueGL.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/d3d12/DeviceD3D12.h
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/opengl/DeviceGL.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/vulkan/DeviceVk.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/Device.h
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/vulkan/BufferVk.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/d3d12/CommandAllocatorManager.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/null/NullBackend.h
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/metal/DeviceMTL.h
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/d3d12/DescriptorHeapAllocator.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/null/NullBackend.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/vulkan/FencedDeleter.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/d3d12/CommandBufferD3D12.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/d3d12/ResourceAllocator.cpp
[modify] https://crrev.com/8b07e43dadf8cf49fa0aafe3343748b4ec079160/src/dawn_native/d3d12/BufferD3D12.cpp

Comment 10 by bugdroid1@chromium.org, Dec 3

Project Member
The following revision refers to this bug:
  https://dawn.googlesource.com/dawn/+/f0b761f116f663dbe344d70a785219af49f537d5

commit f0b761f116f663dbe344d70a785219af49f537d5
Author: Austin Eng <enga@chromium.org>
Date: Mon Dec 03 16:57:34 2018

Implement timeline fences in Dawn

This change implements timeline fences in Dawn.
It includes methods and descriptor members to eventually
support multi-queue, but does not implement them.

Bug:  dawn:26 
Change-Id: I81d5fee6acef402fe099227a034d9669a89ab6c3
Reviewed-on: https://dawn-review.googlesource.com/c/2460
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>

[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/generator/templates/api.h
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/dawn_native/Forward.h
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/generator/templates/dawn_wire/WireServer.cpp
[add] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/tests/end2end/FenceTests.cpp
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/generator/templates/dawn_wire/WireCmd.h
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/generator/templates/dawn_wire/WireClient.cpp
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/dawn_wire/WireCmd.h
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/dawn_native/Queue.cpp
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/generator/templates/mock_api.cpp
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/dawn_native/Device.h
[add] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/dawn_native/FenceSignalTracker.h
[add] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/dawn_native/FenceSignalTracker.cpp
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/BUILD.gn
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/dawn.json
[add] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/tests/unittests/validation/FenceValidationTests.cpp
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/tests/unittests/WireTests.cpp
[add] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/dawn_native/Fence.h
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/generator/templates/mock_api.h
[add] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/dawn_native/Fence.cpp
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/dawn_native/Queue.h
[modify] https://crrev.com/f0b761f116f663dbe344d70a785219af49f537d5/src/dawn_native/Device.cpp

Comment 11 by enga@chromium.org, Jan 7

Status: Fixed (was: Accepted)

Sign in to add a comment