Expose KTX2 encoder thread count in CLI - #102
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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-threadsto CLI options and wires it intoGltfConverterOptions.Ktx2Threadswhen--texture-format Ktx2is selected. - Validates that
--ktx2-threadsis non-negative and rejects positive values unless--texture-format Ktx2is 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GltfConverterOptions.Ktx2Threadssetting as--ktx2-threads0as the unchanged one-thread-per-texture default--texture-format Ktx2This 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 minimalObj2Tiles.Library.Test: 135 passedObj2Tiles.Test: 85 passed--ktx2-threads 2: exit 0,tileset.jsonplus two B3DM outputs