@kitware/vtk.js 24.5.4 → 24.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/Common/Core/CellArray.js +14 -3
  2. package/Common/Core/Math/index.js +1 -1
  3. package/Common/Core/Math.js +1 -1
  4. package/Common/DataModel/Triangle.js +1 -1
  5. package/Common/Transform/LandmarkTransform.js +1 -1
  6. package/Filters/Core/PolyDataNormals.js +1 -1
  7. package/Filters/General/OBBTree.js +1 -1
  8. package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
  9. package/Filters/Sources/CircleSource.js +1 -1
  10. package/Filters/Sources/PointSource.js +1 -1
  11. package/Filters/Texture/TextureMapToPlane.js +1 -1
  12. package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +1 -1
  13. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
  14. package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
  15. package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
  16. package/Interaction/Style/InteractorStyleTrackballCamera.js +1 -1
  17. package/Interaction/Widgets/PiecewiseGaussianWidget.js +1 -1
  18. package/Proxy/Core/View2DProxy.js +1 -1
  19. package/Rendering/Core/ColorTransferFunction.js +1 -1
  20. package/Rendering/Core/Coordinate.js +1 -1
  21. package/Rendering/Core/CubeAxesActor.js +1 -1
  22. package/Rendering/Core/Glyph3DMapper.js +1 -1
  23. package/Rendering/Core/ImageMapper.js +1 -1
  24. package/Rendering/Core/Mapper.js +2 -2
  25. package/Rendering/Core/Prop3D.js +1 -1
  26. package/Rendering/Core/RenderWindowInteractor.js +1 -1
  27. package/Rendering/Core/Renderer.js +1 -1
  28. package/Rendering/Core/ScalarBarActor.js +1 -1
  29. package/Rendering/Core/VolumeMapper.js +1 -1
  30. package/Rendering/OpenGL/PolyDataMapper2D.js +5 -3
  31. package/Rendering/OpenGL/Texture.js +1 -1
  32. package/Rendering/WebGPU/BindGroup.js +1 -1
  33. package/Rendering/WebGPU/BufferManager/Constants.js +1 -1
  34. package/Rendering/WebGPU/BufferManager.js +149 -263
  35. package/Rendering/WebGPU/CellArrayMapper.js +46 -73
  36. package/Rendering/WebGPU/Device.js +97 -57
  37. package/Rendering/WebGPU/Glyph3DMapper.js +2 -0
  38. package/Rendering/WebGPU/ImageMapper.js +1 -5
  39. package/Rendering/WebGPU/IndexBuffer.js +397 -0
  40. package/Rendering/WebGPU/RenderEncoder.js +1 -1
  41. package/Rendering/WebGPU/SimpleMapper.js +7 -1
  42. package/Rendering/WebGPU/SphereMapper.js +29 -31
  43. package/Rendering/WebGPU/StickMapper.js +38 -42
  44. package/Rendering/WebGPU/StorageBuffer.js +0 -1
  45. package/Rendering/WebGPU/Texture.js +0 -2
  46. package/Rendering/WebGPU/TextureManager.js +37 -7
  47. package/Rendering/WebGPU/UniformBuffer.js +0 -1
  48. package/Rendering/WebGPU/VertexInput.js +7 -2
  49. package/Rendering/WebGPU/VolumePass.js +16 -8
  50. package/Rendering/WebGPU/VolumePassFSQ.js +1 -5
  51. package/Widgets/Manipulators/LineManipulator.js +1 -1
  52. package/Widgets/Representations/PolyLineRepresentation.js +1 -1
  53. package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
  54. package/Widgets/Widgets3D/AngleWidget.js +1 -1
  55. package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
  56. package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
  57. package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
  58. package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
  59. package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
  60. package/index.d.ts +2 -2
  61. package/package.json +1 -1
@@ -121,9 +121,11 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
121
121
  model.shaderReplacements.set('replaceShaderPosition', publicAPI.replaceShaderPosition);
122
122
 
123
123
  publicAPI.replaceShaderNormal = function (hash, pipeline, vertexInput) {
124
- if (vertexInput.hasAttribute('normalMC')) {
124
+ var normalBuffer = vertexInput.getBuffer('normalMC');
125
+
126
+ if (normalBuffer) {
125
127
  var vDesc = pipeline.getShaderDescription('vertex');
126
- vDesc.addOutput('vec3<f32>', 'normalVC');
128
+ vDesc.addOutput('vec3<f32>', 'normalVC', normalBuffer.getArrayInformation()[0].interpolation);
127
129
  var code = vDesc.getCode();
128
130
  code = vtkWebGPUShaderCache.substitute(code, '//VTK::Normal::Impl', [' output.normalVC = normalize((rendererUBO.WCVCNormals * mapperUBO.MCWCNormals * normalMC).xyz);']).result;
129
131
  vDesc.setCode(code);
@@ -165,9 +167,10 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
165
167
  return;
166
168
  }
167
169
 
168
- if (!vertexInput.hasAttribute('colorVI')) return;
170
+ var colorBuffer = vertexInput.getBuffer('colorVI');
171
+ if (!colorBuffer) return;
169
172
  var vDesc = pipeline.getShaderDescription('vertex');
170
- vDesc.addOutput('vec4<f32>', 'color');
173
+ vDesc.addOutput('vec4<f32>', 'color', colorBuffer.getArrayInformation()[0].interpolation);
171
174
  var code = vDesc.getCode();
172
175
  code = vtkWebGPUShaderCache.substitute(code, '//VTK::Color::Impl', [' output.color = colorVI;']).result;
173
176
  vDesc.setCode(code);
@@ -276,37 +279,46 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
276
279
  }
277
280
 
278
281
  var vertexInput = model.vertexInput;
279
- var hash = "R".concat(representation, "P").concat(primType); // hash = all things that can change the values on the buffer
282
+ var points = pd.getPoints();
283
+ var indexBuffer; // get the flat mapping indexBuffer for the cells
284
+
285
+ if (cells) {
286
+ var buffRequest = {
287
+ hash: "R".concat(representation, "P").concat(primType).concat(cells.getMTime()),
288
+ usage: BufferUsage.Index,
289
+ cells: cells,
290
+ numberOfPoints: points.getNumberOfPoints(),
291
+ primitiveType: primType,
292
+ representation: representation
293
+ };
294
+ indexBuffer = device.getBufferManager().getBuffer(buffRequest);
295
+ vertexInput.setIndexBuffer(indexBuffer);
296
+ } else {
297
+ vertexInput.setIndexBuffer(null);
298
+ } // hash = all things that can change the values on the buffer
280
299
  // since mtimes are unique we can use
281
- // - cells mtime - because cells drive how we pack
282
- // - rep (point/wireframe/surface) - again because of packing
300
+ // - indexBuffer mtime - because cells drive how we pack
283
301
  // - relevant dataArray mtime - the source data
284
302
  // - shift - not currently captured
285
303
  // - scale - not currently captured
286
304
  // - format
287
305
  // - usage
288
306
  // - packExtra - covered by format
289
- // - prim type (vert/lines/polys/strips) - covered by cells mtime
290
307
  // points
291
308
 
292
- var points = pd.getPoints();
293
309
 
294
310
  if (points) {
295
311
  var shift = model.WebGPUActor.getBufferShift(model.WebGPURenderer);
296
- var buffRequest = {
297
- owner: points,
312
+ var _buffRequest = {
313
+ hash: "".concat(points.getMTime(), "I").concat(indexBuffer.getMTime()).concat(shift.join(), "float32x4"),
298
314
  usage: BufferUsage.PointArray,
299
315
  format: 'float32x4',
300
- time: Math.max(points.getMTime(), cells.getMTime(), model.WebGPUActor.getKeyMatricesTime().getMTime()),
301
- hash: hash,
302
316
  dataArray: points,
303
- cells: cells,
304
- primitiveType: primType,
305
- representation: representation,
317
+ indexBuffer: indexBuffer,
306
318
  shift: shift,
307
319
  packExtra: true
308
320
  };
309
- var buff = device.getBufferManager().getBuffer(buffRequest);
321
+ var buff = device.getBufferManager().getBuffer(_buffRequest);
310
322
  vertexInput.addBuffer(buff, ['vertexBC']);
311
323
  } else {
312
324
  vertexInput.removeBufferIfPresent('vertexBC');
@@ -317,33 +329,29 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
317
329
 
318
330
  if (usage === BufferUsage.Triangles || usage === BufferUsage.Strips) {
319
331
  var normals = pd.getPointData().getNormals();
320
- var _buffRequest = {
332
+ var _buffRequest2 = {
321
333
  format: 'snorm8x4',
322
- hash: hash,
323
- cells: cells,
324
- representation: representation,
325
- primitiveType: primType,
334
+ indexBuffer: indexBuffer,
326
335
  packExtra: true,
327
336
  shift: 0,
328
337
  scale: 127
329
338
  };
330
339
 
331
340
  if (normals) {
332
- _buffRequest.owner = normals;
333
- _buffRequest.dataArray = normals;
334
- _buffRequest.time = Math.max(normals.getMTime(), cells.getMTime());
335
- _buffRequest.usage = BufferUsage.PointArray;
341
+ _buffRequest2.hash = "".concat(normals.getMTime(), "I").concat(indexBuffer.getMTime(), "snorm8x4");
342
+ _buffRequest2.dataArray = normals;
343
+ _buffRequest2.usage = BufferUsage.PointArray;
336
344
 
337
- var _buff = device.getBufferManager().getBuffer(_buffRequest);
345
+ var _buff = device.getBufferManager().getBuffer(_buffRequest2);
338
346
 
339
347
  vertexInput.addBuffer(_buff, ['normalMC']);
340
348
  } else if (primType === PrimitiveTypes.Triangles) {
341
- _buffRequest.owner = points;
342
- _buffRequest.dataArray = points;
343
- _buffRequest.time = Math.max(points.getMTime(), cells.getMTime());
344
- _buffRequest.usage = BufferUsage.NormalsFromPoints;
349
+ _buffRequest2.hash = "PFN".concat(points.getMTime(), "I").concat(indexBuffer.getMTime(), "snorm8x4");
350
+ _buffRequest2.dataArray = points;
351
+ _buffRequest2.cells = cells;
352
+ _buffRequest2.usage = BufferUsage.NormalsFromPoints;
345
353
 
346
- var _buff2 = device.getBufferManager().getBuffer(_buffRequest);
354
+ var _buff2 = device.getBufferManager().getBuffer(_buffRequest2);
347
355
 
348
356
  vertexInput.addBuffer(_buff2, ['normalMC']);
349
357
  } else {
@@ -367,21 +375,17 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
367
375
  haveCellScalars = true;
368
376
  }
369
377
 
370
- var _buffRequest2 = {
371
- owner: c,
378
+ var _buffRequest3 = {
372
379
  usage: BufferUsage.PointArray,
373
380
  format: 'unorm8x4',
374
- time: Math.max(c.getMTime(), cells.getMTime(), points.getMTime()),
375
- hash: hash + haveCellScalars,
381
+ hash: "".concat(haveCellScalars).concat(c.getMTime(), "I").concat(indexBuffer.getMTime(), "unorm8x4"),
376
382
  dataArray: c,
377
- cells: cells,
378
- primitiveType: primType,
379
- representation: representation,
383
+ indexBuffer: indexBuffer,
380
384
  cellData: haveCellScalars,
381
385
  cellOffset: 0
382
386
  };
383
387
 
384
- var _buff3 = device.getBufferManager().getBuffer(_buffRequest2);
388
+ var _buff3 = device.getBufferManager().getBuffer(_buffRequest3);
385
389
 
386
390
  vertexInput.addBuffer(_buff3, ['colorVI']);
387
391
  haveColors = true;
@@ -401,20 +405,7 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
401
405
  }
402
406
 
403
407
  if (tcoords && !edges) {
404
- // console.log(`tcoords ${tcoords.getMTime()}`);
405
- var _buffRequest3 = {
406
- owner: tcoords,
407
- usage: BufferUsage.PointArray,
408
- format: 'float32x2',
409
- time: Math.max(tcoords.getMTime(), cells.getMTime()),
410
- hash: hash,
411
- dataArray: tcoords,
412
- cells: cells,
413
- primitiveType: primType,
414
- representation: representation
415
- };
416
-
417
- var _buff4 = device.getBufferManager().getBuffer(_buffRequest3);
408
+ var _buff4 = device.getBufferManager().getBufferForPointArray(tcoords, vertexInput.getIndexBuffer());
418
409
 
419
410
  vertexInput.addBuffer(_buff4, ['tcoord']);
420
411
  } else {
@@ -459,25 +450,7 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
459
450
 
460
451
  for (var _i = 0; _i < newTextures.length; _i++) {
461
452
  var srcTexture = newTextures[_i];
462
- var treq = {
463
- time: srcTexture.getMTime()
464
- };
465
-
466
- if (srcTexture.getInputData()) {
467
- treq.imageData = srcTexture.getInputData();
468
- treq.owner = treq.imageData.getPointData().getScalars();
469
- } else if (srcTexture.getImage()) {
470
- treq.image = srcTexture.getImage();
471
- treq.owner = treq.image;
472
- } else if (srcTexture.getJsImageData()) {
473
- treq.jsImageData = srcTexture.getJsImageData();
474
- treq.owner = treq.jsImageData;
475
- } else if (srcTexture.getCanvas()) {
476
- treq.canvas = srcTexture.getCanvas();
477
- treq.owner = treq.canvas;
478
- }
479
-
480
- var newTex = model.device.getTextureManager().getTexture(treq);
453
+ var newTex = model.device.getTextureManager().getTextureForVTKTexture(srcTexture);
481
454
 
482
455
  if (newTex.getReady()) {
483
456
  // is this a new texture
@@ -1,8 +1,83 @@
1
+ import _typeof from '@babel/runtime/helpers/typeof';
2
+ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
3
+ import _createClass from '@babel/runtime/helpers/createClass';
4
+ import _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized';
5
+ import _inherits from '@babel/runtime/helpers/inherits';
6
+ import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
7
+ import _get from '@babel/runtime/helpers/get';
8
+ import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
9
+ import _wrapNativeSuper from '@babel/runtime/helpers/wrapNativeSuper';
1
10
  import { newInstance as newInstance$1, obj, setGet, get } from '../../macros.js';
2
11
  import vtkWebGPUBufferManager from './BufferManager.js';
3
12
  import vtkWebGPUShaderCache from './ShaderCache.js';
4
13
  import vtkWebGPUTextureManager from './TextureManager.js';
5
14
 
15
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
16
+
17
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
18
+ /**
19
+ * provide a simple WeakRefMap class to share device objects based on
20
+ * hash values so that buffers/textures etc can be shared betwen mappers.
21
+ * This is roughly based on WeakLRUCache but without the actual caching
22
+ * behavior. This is just a map of key -> WeakRef(value)
23
+ */
24
+
25
+ /* eslint-disable no-undef */
26
+
27
+ var WeakRefMap = /*#__PURE__*/function (_Map) {
28
+ _inherits(WeakRefMap, _Map);
29
+
30
+ var _super = _createSuper(WeakRefMap);
31
+
32
+ function WeakRefMap() {
33
+ var _thisSuper, _thisSuper2, _this;
34
+
35
+ _classCallCheck(this, WeakRefMap);
36
+
37
+ _this = _super.call(this);
38
+ _this.registry = new FinalizationRegistry(function (key) {
39
+ var entry = _get((_thisSuper = _assertThisInitialized(_this), _getPrototypeOf(WeakRefMap.prototype)), "get", _thisSuper).call(_thisSuper, key);
40
+
41
+ if (entry && entry.deref && entry.deref() === undefined) _get((_thisSuper2 = _assertThisInitialized(_this), _getPrototypeOf(WeakRefMap.prototype)), "delete", _thisSuper2).call(_thisSuper2, key);
42
+ });
43
+ return _this;
44
+ }
45
+
46
+ _createClass(WeakRefMap, [{
47
+ key: "getValue",
48
+ value: function getValue(key) {
49
+ var entry = _get(_getPrototypeOf(WeakRefMap.prototype), "get", this).call(this, key);
50
+
51
+ if (entry) {
52
+ var value = entry.deref();
53
+ if (value !== undefined) return value;
54
+
55
+ _get(_getPrototypeOf(WeakRefMap.prototype), "delete", this).call(this, key);
56
+ }
57
+
58
+ return undefined;
59
+ }
60
+ }, {
61
+ key: "setValue",
62
+ value: function setValue(key, value) {
63
+ var entry;
64
+
65
+ if (value && _typeof(value) === 'object') {
66
+ entry = new WeakRef(value);
67
+ this.registry.register(value, key);
68
+
69
+ _get(_getPrototypeOf(WeakRefMap.prototype), "set", this).call(this, key, entry);
70
+ } // else entry is undefined
71
+
72
+
73
+ return entry;
74
+ }
75
+ }]);
76
+
77
+ return WeakRefMap;
78
+ }( /*#__PURE__*/_wrapNativeSuper(Map));
79
+ /* eslint-enable no-undef */
80
+ // ----------------------------------------------------------------------------
6
81
  // vtkWebGPUDevice methods
7
82
  // ----------------------------------------------------------------------------
8
83
 
@@ -92,72 +167,34 @@ function vtkWebGPUDevice(publicAPI, model) {
92
167
  }; // The Device has an object cache that can be used to cache buffers,
93
168
  // textures and other objects that can be shared. The basic approach is to
94
169
  // call getCachedObject with a request and a create function. The request
95
- // must have two fields a hash and an owner. The owner is what the weak
96
- // map uses to hold onto the cached object. When the owner is deleted the
97
- // cached object will be freed from the cache. The cache lookup just
98
- // returns any entry that has a matching owner and hash. If a match isn't
99
- // found then the create function is called with any extra arguments.
100
- //
101
- // For best memory management it is important that the owner be as close
102
- // to the underlying object as possible. For example for a point data buffer
103
- // you would want the actual vtkDataArray to be the owner, not the polydata
104
- // or even worse the actor. As the points data array could be freed wihtout
105
- // the polydata or actor being freed.
170
+ // is based on a hash. The cache lookup just returns any entry that has a
171
+ // matching hash. If a match isn't found then the create function is
172
+ // called with any extra arguments.
106
173
  // is the object already cached?
107
174
 
108
175
 
109
- publicAPI.hasCachedObject = function (owner, hash) {
110
- if (!owner) {
111
- return false;
112
- } // if a matching request already exists then return true
113
-
114
-
115
- if (model.objectCache.has(owner)) {
116
- var objects = model.objectCache.get(owner);
117
-
118
- for (var i = 0; i < objects.length; i++) {
119
- if (hash === objects[i].hash) {
120
- return true;
121
- }
122
- }
123
- }
124
-
125
- return false;
176
+ publicAPI.hasCachedObject = function (hash) {
177
+ return model.objectCache.getValue(hash);
126
178
  };
127
179
 
128
- publicAPI.getCachedObject = function (owner, hash, creator) {
129
- if (!owner || !hash) {
130
- vtkErrorMacro('attempt to cache an object without an owner or hash');
180
+ publicAPI.getCachedObject = function (hash, creator) {
181
+ if (!hash) {
182
+ vtkErrorMacro('attempt to cache an object without a hash');
131
183
  return null;
132
- } // if a matching request already exists then return the cached object
133
-
134
-
135
- if (model.objectCache.has(owner)) {
136
- var _objects = model.objectCache.get(owner);
137
-
138
- for (var i = 0; i < _objects.length; i++) {
139
- if (hash === _objects[i].hash) {
140
- return _objects[i].object;
141
- }
142
- }
143
- } // otherwise create the object and cache it
184
+ }
144
185
 
186
+ var existingValue = model.objectCache.getValue(hash);
145
187
 
146
- for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
147
- args[_key - 3] = arguments[_key];
188
+ if (existingValue) {
189
+ return existingValue;
148
190
  }
149
191
 
150
- var createdObject = creator.apply(void 0, args);
151
-
152
- if (!model.objectCache.has(owner)) {
153
- model.objectCache.set(owner, []);
192
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
193
+ args[_key - 2] = arguments[_key];
154
194
  }
155
195
 
156
- var objects = model.objectCache.get(owner);
157
- objects.push({
158
- hash: hash,
159
- object: createdObject
160
- });
196
+ var createdObject = creator.apply(void 0, args);
197
+ model.objectCache.setValue(hash, createdObject);
161
198
  return createdObject;
162
199
  };
163
200
  } // ----------------------------------------------------------------------------
@@ -180,9 +217,12 @@ function extend(publicAPI, model) {
180
217
 
181
218
  obj(publicAPI, model);
182
219
  setGet(publicAPI, model, ['handle']);
183
- get(publicAPI, model, ['bufferManager', 'shaderCache', 'textureManager']); // this is a cache, and a cache with GC pretty much means WeakMap
220
+ get(publicAPI, model, ['bufferManager', 'shaderCache', 'textureManager']); // this is a weak ref cache implementation, we create it without
221
+ // an expirer (so it is strictly based on garbage collection and
222
+ // objects are not held if there are no external references)
223
+ // model.objectCache = new WeakLRUCache({ expirer: false });
184
224
 
185
- model.objectCache = new WeakMap();
225
+ model.objectCache = new WeakRefMap();
186
226
  model.shaderCache = vtkWebGPUShaderCache.newInstance();
187
227
  model.shaderCache.setDevice(publicAPI);
188
228
  model.bindGroupLayouts = [];
@@ -203,4 +243,4 @@ var vtkWebGPUDevice$1 = {
203
243
  extend: extend
204
244
  };
205
245
 
206
- export { vtkWebGPUDevice$1 as default, extend, newInstance };
246
+ export { WeakRefMap, vtkWebGPUDevice$1 as default, extend, newInstance };
@@ -102,6 +102,8 @@ function vtkWebGPUGlyph3DMapper(publicAPI, model) {
102
102
 
103
103
  publicAPI.buildPass = function (prepass) {
104
104
  if (prepass) {
105
+ model.WebGPUActor = publicAPI.getFirstAncestorOfType('vtkWebGPUActor');
106
+
105
107
  if (!model.renderable.getStatic()) {
106
108
  model.renderable.update();
107
109
  }
@@ -265,11 +265,7 @@ function vtkWebGPUImageMapper(publicAPI, model) {
265
265
 
266
266
  publicAPI.updateBuffers = function () {
267
267
  superClassUpdateBuffers();
268
- var treq = {
269
- imageData: model.currentInput,
270
- owner: model.currentInput.getPointData().getScalars()
271
- };
272
- var newTex = model.device.getTextureManager().getTexture(treq);
268
+ var newTex = model.device.getTextureManager().getTextureForImageData(model.currentInput);
273
269
  var tViews = model.textureViews;
274
270
 
275
271
  if (!tViews[0] || tViews[0].getTexture() !== newTex) {