Skip to content

Commit

Permalink
[workspace] Upgrade vtk_internal to latest commit (#21799)
Browse files Browse the repository at this point in the history
- Remove patches that have been upstreamed to VTK.
- Add more printouts when verbose mode has been enabled.
- Prune out some new dependencies that cause trouble / waste.
- Adjust image loading to avoid a VTK segfault.

Co-authored-by: Jeremy Nimmer <jeremy.nimmer@tri.global>
  • Loading branch information
BetsyMcPhail and jwnimmer-tri authored Aug 22, 2024
1 parent 923a09a commit e9102a8
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 308 deletions.
3 changes: 3 additions & 0 deletions systems/sensors/image_io_load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ ImageIo::LoaderTools ImageIo::MakeLoaderTools(
}
tools.reader->AddObserver(vtkCommand::ErrorEvent, tools.reader_observer);
tools.reader->Update();
if (tools.errors->size() > 0) {
return tools;
}
// Note that we do NOT call ImageLowerLeftOff() here. That means that the
// lower left pixel is (0, 0), counting upwards moving up the image.
tools.loader->SetInputConnection(tools.reader->GetOutputPort(0));
Expand Down
72 changes: 0 additions & 72 deletions tools/workspace/vtk_internal/patches/camera_copy.patch

This file was deleted.

155 changes: 0 additions & 155 deletions tools/workspace/vtk_internal/patches/gltf_parser.patch

This file was deleted.

76 changes: 0 additions & 76 deletions tools/workspace/vtk_internal/patches/gltf_quiet_image_errors.patch

This file was deleted.

7 changes: 2 additions & 5 deletions tools/workspace/vtk_internal/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,13 @@ def vtk_internal_repository(
# TODO(jwnimmer-tri) Once there's a tagged release with support for
# VTK_ABI_NAMESPACE, we should switch to an official version number
# here. That probably means waiting for the VTK 10 release.
commit = "4746dce06afabf2dc678d3f2eefd87cb41a90b05",
sha256 = "eb2295327504fe6ecb79b7fcf692e9ae969b2a89a2c51bfc3c0bbfa885f5a092", # noqa
commit = "f196cc1e9042b5637928c2ea87570b773b8745c8",
sha256 = "e8147b0073224190c6ad3d0816576d1795bf233e8d7dcd4457890f8217d08872", # noqa
build_file = ":package.BUILD.bazel",
patches = [
":patches/camera_copy.patch",
":patches/common_core_nobacktrace.patch",
":patches/common_core_version.patch",
":patches/fix_illumination_bugs.patch",
":patches/gltf_parser.patch",
":patches/gltf_quiet_image_errors.patch",
":patches/io_image_formats.patch",
":patches/mr11117.patch",
":patches/nerf_pegtl.patch",
Expand Down
5 changes: 5 additions & 0 deletions tools/workspace/vtk_internal/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ def modules_closure(module_names, *, max_depth = 10):
continue
if dep_name in ignore:
continue
if _VERBOSE:
print("Modules closure: {} uses {}".format(
name,
dep_name,
))
next_worklist.append(dep_name)
worklist = next_worklist
if worklist:
Expand Down
9 changes: 9 additions & 0 deletions tools/workspace/vtk_internal/settings.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ MODULE_SETTINGS = {
"VTK::ImagingSources",
],
},
"VTK::FiltersReduction": {
# VTK uses this module internally but we don't need to customize it.
},
"VTK::FiltersSources": {
"visibility": ["//visibility:public"],
"srcs_glob_exclude": [
Expand Down Expand Up @@ -426,6 +429,9 @@ MODULE_SETTINGS = {
"IO/Legacy/vtkDataReader.cxx",
"IO/Legacy/vtkUnstructuredGridReader.cxx",
],
"module_deps_ignore": [
"VTK::IOCellGrid",
],
},
"VTK::ImagingCore": {
"visibility": ["//visibility:public"],
Expand Down Expand Up @@ -471,6 +477,8 @@ MODULE_SETTINGS = {
"srcs_glob_exclude": [
# This is configure-time setup code, not library code.
"**/vtkProbe*",
# This file uses codegen'd embedded vtp files. We don't need it.
"**/*vtkOpenGLAvatar*",
# Avoid building unnecessary VTK::RenderingHyperTreeGrid.
"**/*HyperTreeGrid*",
# Exclude all renderers by default; we'll incorporate the necessary
Expand Down Expand Up @@ -517,6 +525,7 @@ MODULE_SETTINGS = {
],
}),
"module_deps_ignore": [
"VTK::IOXML",
"VTK::RenderingHyperTreeGrid",
],
},
Expand Down

0 comments on commit e9102a8

Please sign in to comment.