Skip to content

Commit 3c071fb

Browse files
authored
Merge pull request #2458 from Kitware/webgpu_update_june06
fix(WebGPU): update webgpu code to the latest chrome canary
2 parents 96f54ad + 847a0ea commit 3c071fb

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)