Skip to content

Edge visibility vertex array is never destroyed #13716

Description

@markschlosseratbentley

What happened?

EdgeVisibilityPipelineStage.createQuadEdgeGeometry creates a VertexArray for EXT_mesh_primitive_edge_visibility rendering, but it is never pushed to model._pipelineResources, so destroyPipelineResources() appears to never free it. This is unlike what happens to the main geometry VA, pick IDs, and wireframe buffers.

In theory, a draw-command rebuild will orphan the previous copy; model destroy doesn't free it either. Edge geometry can be somewhat large, so such situations could strand a sizeable amount of GPU memory.

Possible fix: push edgeGeometry.vertexArray into model._pipelineResources in EdgeVisibilityPipelineStage, and confirm VertexArray.destroy() destroys the explicitly-created child buffers.

Reproduction steps

  1. Load a 3D Tiles tileset using EXT_mesh_primitive_edge_visibility with edgeDisplayMode = SURFACES_AND_EDGES.
  2. Instrument WebGL2RenderingContext.prototype.createBuffer/deleteBuffer to count live buffers.
  3. Repeatedly trigger a draw-command rebuild, e.g. toggle tileset.customShader.
  4. Observe: live buffer count grows per rebuild and is never released; deleteBuffer is never called for edge geometry.

Sandcastle example

No response

Environment

Browser: All
CesiumJS Version: Latest (main)
Operating System: All

AI acknowledgment

  • I used AI to generate this issue report.
  • (If the above is checked) I have reviewed the AI-generated content before submitting.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions