Skip to content

Commit a7d290e

Browse files
committed
fix(WebGPU): update webgpu code to the latest chrome canary
Fix the canvas creation call to use the new width, height, alhpha mode. Get the preferred format from the gpu now.
1 parent 3273e25 commit a7d290e

File tree

1 file changed

+4
-2
lines changed
  • Sources/Rendering/WebGPU/RenderWindow

1 file changed

+4
-2
lines changed

Sources/Rendering/WebGPU/RenderWindow/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function vtkWebGPURenderWindow(publicAPI, model) {
6868
publicAPI.recreateSwapChain = () => {
6969
if (model.context) {
7070
model.context.unconfigure();
71-
const presentationFormat = model.context.getPreferredFormat(
71+
const presentationFormat = navigator.gpu.getPreferredCanvasFormat(
7272
model.adapter
7373
);
7474

@@ -77,8 +77,10 @@ function vtkWebGPURenderWindow(publicAPI, model) {
7777
model.context.configure({
7878
device: model.device.getHandle(),
7979
format: presentationFormat,
80+
alphaMode: 'premultiplied',
8081
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_DST,
81-
size: model.size,
82+
width: model.size[0],
83+
height: model.size[1],
8284
});
8385
model._configured = true;
8486
}

0 commit comments

Comments
 (0)