Skip to content

Expose KTX2 encoder thread count in CLI - #102

Merged
HeDo88TH merged 1 commit into
OpenDroneMap:masterfrom
Xananthium:feat/ktx2-threads
Jul 30, 2026
Merged

Expose KTX2 encoder thread count in CLI#102
HeDo88TH merged 1 commit into
OpenDroneMap:masterfrom
Xananthium:feat/ktx2-threads

Conversation

@Xananthium

Copy link
Copy Markdown
Contributor

Summary

  • expose the existing GltfConverterOptions.Ktx2Threads setting as --ktx2-threads
  • keep 0 as the unchanged one-thread-per-texture default
  • reject negative values and positive values without --texture-format Ktx2
  • document per-texture threading and the risk of oversubscription because tile conversion is already parallel

This is a KTX2-specific, backward-compatible seam related to #8; it does not attempt to cap the other parallel pipeline stages.

Validation

  • dotnet test Obj2Tiles.sln --configuration Release --verbosity minimal
    • Obj2Tiles.Library.Test: 135 passed
    • Obj2Tiles.Test: 85 passed
  • focused option contract: 5 passed
  • real native libktx smoke conversion with --ktx2-threads 2: exit 0, tileset.json plus two B3DM outputs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR exposes the existing per-texture libktx encoder thread setting (GltfConverterOptions.Ktx2Threads) through the Obj2Tiles CLI as --ktx2-threads, with validation and documentation to avoid misuse and oversubscription while the tiling pipeline already runs in parallel.

Changes:

  • Adds --ktx2-threads to CLI options and wires it into GltfConverterOptions.Ktx2Threads when --texture-format Ktx2 is selected.
  • Validates that --ktx2-threads is non-negative and rejects positive values unless --texture-format Ktx2 is set.
  • Documents the option and adds focused option-contract tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
README.md Documents --ktx2-threads and explains oversubscription risk alongside existing KTX2 docs.
Obj2Tiles/Program.cs Propagates Ktx2Threads into glTF conversion options and enforces CLI validation rules.
Obj2Tiles/Options.cs Adds the --ktx2-threads option with default 0 and CLI help text.
Obj2Tiles.Test/Ktx2ThreadsOptionsTests.cs Adds parsing/validation tests to lock down the CLI contract.
Obj2Gltf/GltfConverterOptions.cs Updates the XML doc comment to match actual per-texture thread semantics.

@HeDo88TH
HeDo88TH merged commit 12ab56f into OpenDroneMap:master Jul 30, 2026
1 check passed
@HeDo88TH HeDo88TH added the enhancement New feature or request label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants