diff --git a/spec/index.bs b/spec/index.bs index 3dd76940e4..be5f9659ab 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -6816,10 +6816,12 @@ Issue: Because timestamp query provides high-resolution GPU timestamp, we need t interface GPUCanvasContext { GPUSwapChain configureSwapChain(GPUSwapChainDescriptor descriptor); - Promise getSwapChainPreferredFormat(GPUDevice device); + GPUTextureFormat getSwapChainPreferredFormat(GPUAdapter adapter); }; +{{GPUCanvasContext}} has the following methods: +
: configureSwapChain(descriptor) :: @@ -6829,19 +6831,28 @@ interface GPUCanvasContext { textures it has produced.
- **Called on:** {{GPUCanvasContext}} this. + **Called on:** {{GPUCanvasContext}} |this|. **Arguments:**
-                descriptor: Description of the {{GPUSwapChain}} to configure.
+                |descriptor|: Description of the {{GPUSwapChain}} to configure.
             
**Returns:** {{GPUSwapChain}} - Issue: Describe {{GPUCanvasContext/configureSwapChain()}} algorithm steps. + 1. Issue the following steps on the [=Device timeline=] of |this|: +
+ 1. If any of the following conditions are unsatisfied, generate a validation error and stop. +
+ - |descriptor|.{{GPUSwapChainDescriptor/device}} is a [=valid=] {{GPUDevice}}. + - [=Supported swap chain formats=] [=set/contains=] |descriptor|.{{GPUSwapChainDescriptor/format}}. +
+ + Issue: Describe remaining {{GPUCanvasContext/configureSwapChain()}} algorithm steps. +
- : getSwapChainPreferredFormat(device) + : getSwapChainPreferredFormat(adapter) :: Returns an optimal {{GPUTextureFormat}} to use for swap chains with this context and the given device. @@ -6850,16 +6861,25 @@ interface GPUCanvasContext { **Called on:** {{GPUCanvasContext}} this. **Arguments:** -
-                device: Device the swap chain format should be queried for.
+            
+                |adapter|: Adapter the swap chain format should be queried for.
             
- **Returns:** {{Promise}}<{{GPUTextureFormat}}> + **Returns:** {{GPUTextureFormat}} - Issue: Describe {{GPUCanvasContext/getSwapChainPreferredFormat()}} algorithm steps. +
+ 1. Return an optimal {{GPUTextureFormat}} to use when creating a {{GPUSwapChain}} + with the given |adapter|. Must be one of the [=supported swap chain formats=]. +
+The supported swap chain formats are a [=set=] of {{GPUTextureFormat}}s that must be +supported when specified as a {{GPUSwapChainDescriptor}}.{{GPUSwapChainDescriptor/format}} regardless +of the given {{GPUSwapChainDescriptor}}.{{GPUSwapChainDescriptor/device}}, initially set to: +«{{GPUTextureFormat/"bgra8unorm"}}, {{GPUTextureFormat/"bgra8unorm-srgb"}}, +{{GPUTextureFormat/"rgba8unorm"}}, {{GPUTextureFormat/"rgba8unorm-srgb"}}». +