Skip to content

Fix incorrect padding of accumulated data size rather than current level's size - #1242

Merged
MarkCallow merged 3 commits into
mainfrom
issue1241
Aug 16, 2026
Merged

Fix incorrect padding of accumulated data size rather than current level's size#1242
MarkCallow merged 3 commits into
mainfrom
issue1241

Conversation

@MarkCallow

Copy link
Copy Markdown
Collaborator

The transcode functions were padding the accumulated level sizes. They should have been padding the current level's size before adding it to the accumulated size. This led to a check for an output buffer of sufficient size to fail in the underlying Basis transcoders.

While investigating I observed that the transcode functions were unnecessarily keeping track of level sizes and writing the level index fields of the prototype transcoded texture based on this tracking. The level index is correctly set when the prototype is created. Now it is used to pass write offsets to the underlying Basis transcoders and this PR deletes the unnecessary tracking and level-index writes. A nice simplification.

Fixes #1241.

Set writeOffset from prototype level index. Remove unnecessary setting
of prototype level index values after transcoding an image. They were
already set when the prototype was created.
@MarkCallow MarkCallow changed the title Fix incorrect padding of accumulated level sizes rather than current level's size Fix incorrect padding of accumulated data size rather than current level's size Aug 16, 2026
@MarkCallow
MarkCallow merged commit 2114e2f into main Aug 16, 2026
40 checks passed
@MarkCallow
MarkCallow deleted the issue1241 branch August 16, 2026 23:24
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.

Large NPOT ETC1S RGBA texture validates but fails to transcode

1 participant