fix(dds): Fix broken reading of volumetric DDS files by emulating tiles#5133
Conversation
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>
jessey-git
left a comment
There was a problem hiding this comment.
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.
|
Yeah, 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. |
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.