Skip to content

Commit 75fe99a

Browse files
finetjulfloryst
authored andcommitted
fix(webgpu): fix crash when WebGPU render window is rendered empty
1 parent afdf1cd commit 75fe99a

File tree

1 file changed

+7
-0
lines changed
  • Sources/Rendering/WebGPU/PolyDataMapper

1 file changed

+7
-0
lines changed

Sources/Rendering/WebGPU/PolyDataMapper/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import vtkViewNode from 'vtk.js/Sources/Rendering/SceneGraph/ViewNode';
55

66
import { registerOverride } from 'vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory';
77

8+
import { vtkErrorMacro } from 'vtk.js/Sources/macros';
9+
810
const { PrimitiveTypes } = vtkWebGPUBufferManager;
911

1012
// ----------------------------------------------------------------------------
@@ -34,6 +36,11 @@ function vtkWebGPUPolyDataMapper(publicAPI, model) {
3436
};
3537

3638
publicAPI.updateCellArrayMappers = (poly) => {
39+
if (!poly) {
40+
vtkErrorMacro('No input!');
41+
return;
42+
}
43+
3744
const prims = [
3845
poly.getVerts(),
3946
poly.getLines(),

0 commit comments

Comments
 (0)