Skip to content

Commit

Permalink
fix(renderwindow): get GPU memory statistics from all views
Browse files Browse the repository at this point in the history
  • Loading branch information
sankhesh committed Oct 14, 2023
1 parent ec0999d commit 5e6191a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/Rendering/Core/RenderWindow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ function vtkRenderWindow(publicAPI, model) {
};

publicAPI.getStatistics = () => {
const results = { propCount: 0, invisiblePropCount: 0 };
results.gpuMemoryMB = model._views[0].getGraphicsMemoryInfo() / 1e6;
const results = { propCount: 0, invisiblePropCount: 0, gpuMemoryMB: 0 };
model._views.forEach((v) => {
results.gpuMemoryMB += v.getGraphicsMemoryInfo() / 1e6;

This comment has been minimized.

Copy link
@finetjul

finetjul Oct 24, 2023

Member

@sankhesh getGraphicsMemoryInfo() does not exist for WebGPU render window hence there is a crash for any webgpu example. e.g. https://kitware.github.io/vtk-js/examples/PBR/index.html?viewAPI=WebGPU

This comment has been minimized.

Copy link
@sankhesh

sankhesh Oct 25, 2023

Author Collaborator

Thanks @finetjul. Ref: #2942

});
model.renderers.forEach((ren) => {
const props = ren.getViewProps();
const gren = model._views[0].getViewNodeFor(ren);
Expand Down

0 comments on commit 5e6191a

Please sign in to comment.