Skip to content

Commit

Permalink
fix(volumeMapper): Remove variable that prevented caching
Browse files Browse the repository at this point in the history
scalarTextureString didn't have a purpose and prevented caching of GPU resources
  • Loading branch information
bruyeret authored and finetjul committed Apr 11, 2024
1 parent c1197c3 commit c7488b9
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Sources/Rendering/OpenGL/VolumeMapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1663,10 +1663,7 @@ function vtkOpenGLVolumeMapper(publicAPI, model) {
const tex = model._openGLRenderWindow.getGraphicsResourceForObject(scalars);
// rebuild the scalarTexture if the data has changed
toString = `${image.getMTime()}A${scalars.getMTime()}`;
const reBuildTex =
!tex?.vtkObj ||
tex?.hash !== toString ||
model.scalarTextureString !== toString;
const reBuildTex = !tex?.vtkObj || tex?.hash !== toString;
if (reBuildTex) {
// Build the textures
const dims = image.getDimensions();
Expand All @@ -1683,17 +1680,15 @@ function vtkOpenGLVolumeMapper(publicAPI, model) {
scalars,
model.renderable.getPreferSizeOverAccuracy()
);
model.scalarTextureString = toString;
if (scalars) {
model._openGLRenderWindow.setGraphicsResourceForObject(
scalars,
model.scalarTexture,
model.scalarTextureString
toString
);
}
} else {
model.scalarTexture = tex.vtkObj;
model.scalarTextureString = tex.hash;
}

if (!model.tris.getCABO().getElementCount()) {
Expand Down

0 comments on commit c7488b9

Please sign in to comment.