Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kevin Griffin
VTK
Commits
9a053a8b
Commit
9a053a8b
authored
1 month ago
by
Jaswant Panchumarti (Kitware)
Browse files
Options
Downloads
Patches
Plain Diff
webgpu: fetch scalars only when necessary
parent
8c0b3014
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Rendering/WebGPU/vtkWebGPUPolyDataMapper.cxx
+17
-4
17 additions, 4 deletions
Rendering/WebGPU/vtkWebGPUPolyDataMapper.cxx
with
17 additions
and
4 deletions
Rendering/WebGPU/vtkWebGPUPolyDataMapper.cxx
+
17
−
4
View file @
9a053a8b
...
...
@@ -198,7 +198,8 @@ void vtkWebGPUPolyDataMapper::RenderPiece(vtkRenderer* renderer, vtkActor* actor
switch
(
wgpuRenderer
->
GetRenderStage
())
{
case
vtkWebGPURenderer
::
RenderStageEnum
::
UpdatingBuffers
:
{
// update (i.e, create and write) GPU buffers if the data is outdated.
{
// update (i.e, create and write) GPU buffers if the data is outdated.
this
->
UpdateMeshGeometryBuffers
(
wgpuRenderWindow
);
auto
*
mesh
=
this
->
CurrentInput
;
vtkTypeUInt32
*
vertexCounts
[
vtkWebGPUCellToPrimitiveConverter
::
NUM_TOPOLOGY_SOURCE_TYPES
];
...
...
@@ -215,7 +216,6 @@ void vtkWebGPUPolyDataMapper::RenderPiece(vtkRenderer* renderer, vtkActor* actor
bool
updateTopologyBindGroup
=
this
->
CellConverter
->
DispatchMeshToPrimitiveComputePipeline
(
wgpuConfiguration
,
mesh
,
displayProperty
->
GetRepresentation
(),
vertexCounts
,
topologyBuffers
,
edgeArrayBuffers
);
// Handle vertex visibility.
if
(
displayProperty
->
GetVertexVisibility
()
&&
// avoids dispatching the cell-to-vertex pipeline again.
...
...
@@ -868,11 +868,16 @@ bool vtkWebGPUPolyDataMapper::GetNeedToRemapScalars(vtkPolyData* mesh)
// so that the previous colors are invalidated.
this
->
LastScalarVisibility
=
this
->
ScalarVisibility
;
this
->
LastScalarMode
=
this
->
ScalarMode
;
vtkDebugMacro
(
<<
"RemapScalar reason: no mesh"
);
return
true
;
}
int
cellFlag
=
0
;
vtkAbstractArray
*
scalars
=
vtkAbstractMapper
::
GetAbstractScalars
(
mesh
,
this
->
ScalarMode
,
this
->
ArrayAccessMode
,
this
->
ArrayId
,
this
->
ArrayName
,
cellFlag
);
vtkAbstractArray
*
scalars
=
nullptr
;
if
(
this
->
ScalarVisibility
)
{
scalars
=
vtkAbstractMapper
::
GetAbstractScalars
(
mesh
,
this
->
ScalarMode
,
this
->
ArrayAccessMode
,
this
->
ArrayId
,
this
->
ArrayName
,
cellFlag
);
}
if
(
!
scalars
)
{
...
...
@@ -886,11 +891,15 @@ bool vtkWebGPUPolyDataMapper::GetNeedToRemapScalars(vtkPolyData* mesh)
if
(
this
->
LastScalarVisibility
!=
this
->
ScalarVisibility
)
{
this
->
LastScalarVisibility
=
this
->
ScalarVisibility
;
vtkDebugMacro
(
<<
"RemapScalar reason: LastScalarVisibility ("
<<
this
->
LastScalarVisibility
<<
") != ScalarVisibility ("
<<
this
->
ScalarVisibility
<<
")"
);
remapScalars
|=
true
;
}
if
(
this
->
LastScalarMode
!=
this
->
ScalarMode
)
{
this
->
LastScalarMode
=
this
->
ScalarMode
;
vtkDebugMacro
(
<<
"RemapScalar reason: LastScalarMode ("
<<
this
->
LastScalarMode
<<
") != ScalarMode ("
<<
this
->
ScalarMode
<<
")"
);
remapScalars
|=
true
;
}
if
(
this
->
ScalarVisibility
)
...
...
@@ -899,10 +908,12 @@ bool vtkWebGPUPolyDataMapper::GetNeedToRemapScalars(vtkPolyData* mesh)
{
if
(
mesh
->
GetCellData
()
->
GetMTime
()
>
this
->
CellAttributesBuildTimestamp
[
CELL_COLORS
])
{
vtkDebugMacro
(
<<
"RemapScalar reason: cell data newer than cell color build tstamp"
);
remapScalars
|=
true
;
}
if
(
this
->
GetLookupTable
()
->
GetMTime
()
>
this
->
CellAttributesBuildTimestamp
[
CELL_COLORS
])
{
vtkDebugMacro
(
<<
"RemapScalar reason: lut newer than cell color build tstamp"
);
remapScalars
|=
true
;
}
}
...
...
@@ -910,10 +921,12 @@ bool vtkWebGPUPolyDataMapper::GetNeedToRemapScalars(vtkPolyData* mesh)
{
if
(
mesh
->
GetPointData
()
->
GetMTime
()
>
this
->
PointAttributesBuildTimestamp
[
POINT_COLORS
])
{
vtkDebugMacro
(
<<
"RemapScalar reason: point data newer than point color build tstamp"
);
remapScalars
|=
true
;
}
if
(
this
->
GetLookupTable
()
->
GetMTime
()
>
this
->
PointAttributesBuildTimestamp
[
POINT_COLORS
])
{
vtkDebugMacro
(
<<
"RemapScalar reason: lut newer than point color build tstamp"
);
remapScalars
|=
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment