Skip to content

fix(dds): Fix broken reading of volumetric DDS files by emulating tiles#5133

Merged
lgritz merged 1 commit intoAcademySoftwareFoundation:mainfrom
lgritz:lg-dds-volume
Apr 8, 2026
Merged

fix(dds): Fix broken reading of volumetric DDS files by emulating tiles#5133
lgritz merged 1 commit intoAcademySoftwareFoundation:mainfrom
lgritz:lg-dds-volume

Conversation

@lgritz
Copy link
Copy Markdown
Collaborator

@lgritz lgritz commented Apr 7, 2026

Fixes #5132.

Reading DDS volumetric files used to work, but was broken by PR #4669 last year, the one where we added all the span-oriented API calls.

At that time, I did not realize/remember that DDS files could be volumetric, observed that all the (other) volumetric files only supported tiled access, and so in the course of that API refactor, I removed the z parameter from the new read_scanlines API.

I don't want to break ABI compatibility again for this, so the solution I came up with in this PR is just to make DDS volume files report themselves as "tiled", with each tile being (width x 1 x 1), i.e. what used to be one scanline, and it all just works out.

@lgritz lgritz requested a review from jessey-git April 7, 2026 07:22
Fixes AcademySoftwareFoundation#5132.

Reading DDS volumetric files used to work, but was broken by PR AcademySoftwareFoundation#4669
last year, the one where we added all the span-oriented API calls.

At that time, I did not realize/remember that DDS files could be
volumetric, observed that all the (other) volumetric files only
supported tiled access, and so in the course of that API refactor, I
removed the z parameter from the new read_scanlines API.

I don't want to break ABI compatibility again for this, so the
solution I came up with in this PR is just to make DDS volume files
report themselves as "tiled", with each tile being (width x 1 x 1),
i.e. what used to be one scanline, and it all just works out.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Copy link
Copy Markdown
Contributor

@jessey-git jessey-git left a comment

Choose a reason for hiding this comment

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

Huh, that does work. I can confirm the full scenario is fixed with this as well (the full report was using OIIO's python to read in the volumetric dds file and then covert it to a real volume using openvdb's python API)

I also double-checked that we don't check supports("tiles") for input anywhere that could trip up this slight of hand. Seems the "tiles" check is reserved for output only so we should be ok by just setting the tile_* fields.

@lgritz
Copy link
Copy Markdown
Collaborator Author

lgritz commented Apr 8, 2026

Yeah, supports("tiles") is for output, because you need to know before you start if that output type lets you write tiles or not.

For input, you just open the file, and you only care if the file you're reading IS tiled (revealed if spec.tile_width is nonzero), not if the format could support tiles.

@lgritz lgritz merged commit 70c6fc1 into AcademySoftwareFoundation:main Apr 8, 2026
30 checks passed
@lgritz lgritz deleted the lg-dds-volume branch April 8, 2026 18:12
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.

DDS read of volumetric files is broken

2 participants