diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-09-22 09:10:54 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-22 09:10:54 +0530 |
commit | 0cb00a6e89d83d4e16e6616f7af8819bd894b0da (patch) | |
tree | ceb2411d41cd36fd9c13488b7bbfc31ecef0e0a8 /ext/webgpu/01_webgpu.js | |
parent | 9be8dce0c7f8deaeff5523735e0867194ec04c59 (diff) |
BREAKING(webgpu/unstable): move `width` and `height` options to `UnsafeWindowSurface` constructor (#24200)
Fixes https://github.com/denoland/deno/issues/23508
`width` and `height` are required to configure the wgpu surface because
Deno is headless and depends on user to create a window. The options
were non-standard extension of `GPUCanvasConfiguration#configure`.
This PR adds a required options parameter with the `width` and `height`
options to `Deno.UnsafeWindowSurface` constructor.
```typescript
// Old, non-standard extension of GPUCanvasConfiguration
const surface = new Deno.UnsafeWindowSurface("x11", displayHandle, windowHandle);
const context = surface.getContext();
context.configure({ width: 600, height: 800, /* ... */ });
```
```typescript
// New
const surface = new Deno.UnsafeWindowSurface({
system: "x11",
windowHandle,
displayHandle,
width: 600,
height: 800,
});
const context = surface.getContext();
context.configure({ /* ... */ });
```
Diffstat (limited to 'ext/webgpu/01_webgpu.js')
-rw-r--r-- | ext/webgpu/01_webgpu.js | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/ext/webgpu/01_webgpu.js b/ext/webgpu/01_webgpu.js index f292aeec1..719877750 100644 --- a/ext/webgpu/01_webgpu.js +++ b/ext/webgpu/01_webgpu.js @@ -7435,16 +7435,6 @@ const dictMembersGPUCanvasConfiguration = [ converter: webidl.converters["GPUPresentMode"], }, { - key: "width", - converter: webidl.converters["long"], - required: true, - }, - { - key: "height", - converter: webidl.converters["long"], - required: true, - }, - { key: "viewFormats", converter: webidl.createSequenceConverter( webidl.converters["GPUTextureFormat"], |