diff --git a/design/ErrorHandling.md b/design/ErrorHandling.md index 3744918ece..48ecbea526 100644 --- a/design/ErrorHandling.md +++ b/design/ErrorHandling.md @@ -218,7 +218,7 @@ Instead, `GPUCommandEncoder.finish` returns an invalid object and generates an e #### Promise-Returning - `GPUDevice.createBufferMappedAsync` - - `GPUDevice.getSwapChainPreferredFormat` + - `GPUCanvasContext.getSwapChainPreferredFormat` - `GPUFence.onCompletion` - `GPUBuffer.mapReadAsync` - `GPUBuffer.mapWriteAsync` diff --git a/design/sketch.webidl b/design/sketch.webidl index e95a596b23..4e3c7c37a1 100644 --- a/design/sketch.webidl +++ b/design/sketch.webidl @@ -687,11 +687,16 @@ interface GPUQueue { }; // SwapChain / CanvasContext -interface GPUCanvasContext { +partial interface GPUCanvasContext { + // Calling configureSwapChain a second time invalidates the previous one, + // and all of the textures it’s produced. + GPUSwapChain configureSwapChain(GPUSwapChainDescriptor descriptor); + + Promise getSwapChainPreferredFormat(GPUDevice device); }; dictionary GPUSwapChainDescriptor { - required GPUCanvasContext context; + required GPUDevice device; required GPUTextureFormat format; GPUTextureUsageFlags usage = GPUTextureUsage.OUTPUT_ATTACHMENT; }; @@ -731,13 +736,7 @@ interface GPUDevice { GPUCommandEncoder createCommandEncoder(GPUCommandEncoderDescriptor descriptor); - // Calling createSwapChain a second time for the same GPUCanvasContext - // invalidates the previous one, and all of the textures it’s produced. - GPUSwapChain createSwapChain(GPUSwapChainDescriptor descriptor); - GPUQueue getQueue(); - - Promise getSwapChainPreferredFormat(GPUCanvasContext context); }; dictionary GPUDeviceDescriptor {