Skip to content

Reduce size of block_size_descriptor for decompressor builds#587

Merged
solidpixel merged 3 commits intomainfrom
issue_586
Mar 25, 2026
Merged

Reduce size of block_size_descriptor for decompressor builds#587
solidpixel merged 3 commits intomainfrom
issue_586

Conversation

@solidpixel
Copy link
Contributor

@solidpixel solidpixel commented Mar 25, 2026

This PR reduces the size of the block_size_descriptor structure for compiled decompressor builds which exclude support for compression, significantly reducing memory footprint.

sizeof(block_size_descriptor): 14493 KB
sizeof(decimation_info) * instances: 11038 KB
sizeof(partition_info) * instances: 3361 KB

After pruning unnecessary fields out of the data structures:

sizeof(block_size_descriptor): 3552 KB
sizeof(decimation_info) * instances: 168 KB
sizeof(partition_info) * instances: 3361 KB

Partial fix for #586

@solidpixel solidpixel marked this pull request as draft March 25, 2026 20:22
@solidpixel solidpixel marked this pull request as ready for review March 25, 2026 20:56
@solidpixel solidpixel requested a review from Copilot March 25, 2026 21:01
Copy link

Copilot AI left a comment

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 reduces memory footprint for decompressor-only builds by conditionally excluding compressor-only fields from internal data structures guarded by ASTCENC_DECOMPRESS_ONLY, aligning with the goal in #586.

Changes:

  • Prune compressor-only members from decimation_info and block_size_descriptor when ASTCENC_DECOMPRESS_ONLY is defined.
  • Guard initialization/population code paths in block-size/partition table generation so they compile without the pruned members.
  • Minor housekeeping updates (copyright year bumps).

Reviewed changes

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

File Description
Source/astcenc_partition_tables.cpp Avoid writing coverage-bitmaps in decompress-only builds; suppress an unused parameter.
Source/astcenc_internal.h Compile-time removal of compressor-only fields from decimation_info and block_size_descriptor in decompress-only builds.
Source/astcenc_block_sizes.cpp Guard initialization of pruned decimation_info fields and k-means texel selection for decompress-only builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@solidpixel solidpixel merged commit f9ca147 into main Mar 25, 2026
9 checks passed
@solidpixel solidpixel deleted the issue_586 branch March 25, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants