Skip to content

perf: remove unused channel copies in HeightmapToNormalMap #935

Done

Description

@barrulus

Follow-up to #783.

Evidence level: source-only candidate. This was found during the bounded source audit of Hesiod 377f63701bd75e5ea40589b76604d44d214555f4 and HighMap d73e05adee1a04cc1e955d3f3162398a37f1c17d. The focused allocation captures measured ExportAsset and the texture-quilting nodes; they do not establish the allocation overlap or peak savings claimed by other code paths. Profile this specific path before promising a memory reduction.

Finding and proposed work

The callback copies normal texture channels into nx, ny and nz, but never reads those copies. Output reconstruction uses tn.channel(nch) directly. Remove the unused copies while preserving channel ordering and alpha.

The nominal redundant payload is three float arrays at the callback's shape; this is a source estimate, not a measured global peak or a claim that each callback uses the whole terrain.

Source locations

Acceptance

  • Verify unchanged RGBA output for representative slopes, flat inputs, and supported tile/storage settings.
  • Confirm the three copy allocations disappear in an instrumented callback.
  • Record allocation and native RSS comparisons without assuming equal savings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

theme: performance-memory

Type

No type

Fields

Priority

None yet

Effort

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions