From 940065ff034471bc4759ac4910ad36619a45428b Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 22 Oct 2020 17:45:53 -0400 Subject: [PATCH 1/5] Multi-queue synchronization --- spec/index.bs | 151 +++++++++++++++++++------------------------------- 1 file changed, 57 insertions(+), 94 deletions(-) diff --git a/spec/index.bs b/spec/index.bs index d1701d95c0..9fbdb1c606 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -2018,6 +2018,8 @@ dictionary GPUTextureViewDescriptor : GPUObjectDescriptorBase { }; +Issue: derive from `GPUTextureSubresourceRange` + Issue: Make this a standalone algorithm used in the createView algorithm. Issue: The references to GPUTextureDescriptor here should actually refer to @@ -6321,11 +6323,37 @@ dictionary GPURenderBundleEncoderDescriptor : GPUObjectDescriptorBase { # Queues # {#queues} - -### Creation ### {#fence-creation} - - -
- : createFence(descriptor) + : wait(queue, value) :: - Creates a {{GPUFence}}. + Waits for the |queue| reaching |value| on the [=Queue timeline=]. If |value| is undefined, + the |queue|.{{GPUQueue/lastSignaledValue}} is used instead. -
- **Called on:** {{GPUQueue}} this. + All the resource transitions from |queue| targeting |this| will be considered done on the [=Queue timeline=] + after this call, and relevant resources can be used on |this|. - **Arguments:** -
-                descriptor: Description of the {{GPUFence}} to create.
-            
- - **Returns:** {{GPUFence}} - - Issue: Describe {{GPUQueue/createFence()}} algorithm steps. -
-
- -### Completion ### {#fence-signaling} - -Completion of a fence is signaled from the {{GPUQueue}} that created it. - -
- : signal(fence, signalValue) + : signal() :: - Signals the given fence, increasing it's completed value to `signalValue`. - -
- **Called on:** {{GPUQueue}} this. - - **Arguments:** -
-                |fence|: The fence to signal.
-                signalValue: The value to increase |fence|'s completion value to.
-            
- - **Returns:** {{undefined}} - - Issue: Describe {{GPUQueue/signal()}} algorithm steps. -
-
- -The completion of the fence and the value it completes with can be observed from the {{GPUFence}}. - -
- : getCompletedValue() - :: - Returns the largest signalled value completion value for the fence that has propagated to + Returns the largest signalled value for the queue that has propagated to the [=content timeline=]. -
- **Called on:** {{GPUFence}} this. - - **Returns:** {{GPUFenceValue}} - - Issue: Describe {{GPUFence/getCompletedValue()}} algorithm steps. -
- - : onCompletion(completionValue) + : onCompletion(signalValue) :: - Returns a {{Promise}} that resolves once the fence's completion value ≥ `completionValue`. + Returns a {{Promise}} that resolves once the queue reaches `signalValue` + (or |this|.{{GPUQueue/lastSignaledValue}}) if undefined) on the [=content timeline=]. -
- **Called on:** {{GPUFence}} this. - - **Arguments:** -
-                completionValue: The completion value that the fence must meet or exceed before
-                    resolving the returned {{Promise}}
-            
- - **Returns:** {{Promise}}<{{undefined}}> - - Issue: Describe {{GPUFence/onCompletion()}} algorithm steps. -
- Queries {#queries} ================ @@ -6907,7 +6871,6 @@ partial interface GPUDevice { + +### Creation ### {#fence-creation} + + + +
+ : createFence(descriptor) + :: + Creates a {{GPUFence}}. + +
+ **Called on:** {{GPUQueue}} this. + + **Arguments:** +
+                descriptor: Description of the {{GPUFence}} to create.
+            
+ + **Returns:** {{GPUFence}} + + Issue: Describe {{GPUQueue/createFence()}} algorithm steps. +
+
+ +### Completion ### {#fence-signaling} + +Completion of a fence is signaled from the {{GPUQueue}} that created it. - : onCompletion(signalValue) +
+ : signal(fence, signalValue) :: - Returns a {{Promise}} that resolves once the queue reaches `signalValue` - (or |this|.{{GPUQueue/lastSignaledValue}}) if undefined) on the [=content timeline=]. + Signals the given fence, increasing it's completed value to `signalValue`. + +
+ **Called on:** {{GPUQueue}} this. + + **Arguments:** +
+                |fence|: The fence to signal.
+                signalValue: The value to increase |fence|'s completion value to.
+            
+ + **Returns:** {{undefined}} + Issue: Describe {{GPUQueue/signal()}} algorithm steps. +
+The completion of the fence and the value it completes with can be observed from the {{GPUFence}}. + +
+ : getCompletedValue() + :: + Returns the largest signalled value completion value for the fence that has propagated to + the [=content timeline=]. + +
+ **Called on:** {{GPUFence}} this. + + **Returns:** {{GPUFenceValue}} + + Issue: Describe {{GPUFence/getCompletedValue()}} algorithm steps. +
+ + : onCompletion(completionValue) + :: + Returns a {{Promise}} that resolves once the fence's completion value ≥ `completionValue`. +
+ **Called on:** {{GPUFence}} this. + + **Arguments:** +
+                completionValue: The completion value that the fence must meet or exceed before
+                    resolving the returned {{Promise}}
+            
+ + **Returns:** {{Promise}}<{{undefined}}> + + Issue: Describe {{GPUFence/onCompletion()}} algorithm steps. +
+
+ + Queries {#queries} ================ @@ -6870,6 +6961,7 @@ partial interface GPUDevice {