-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Version the class for easier future expansion! Let's call it `TextureOpt_v2` and we make a `using` alias so that the name `TextureOpt` means this. We can then revise the struct in the future by not losing link compatibility. * The macro OIIO_TEXTUREOPT_VERSION (now 2) can be used to test which is the current version. * Get rid of TextureOpt-local enums by finally switching to the freestanding ones in the Tex namespace. (We've wanted to do this for a long time, but couldn't break compatibility.) Preserve API compatibility for now with clever use of `static constexpr` and `using`. * Make more efficient use of space in the TextureOpt by: field order rearrangement to eliminate empty space, switching a couple of the enums that needed only a few values to be `class enum xxx : uint8_t` so they take only 1 byte instead of 4, switch `anisotropic` to be 16 bits (do we really need an anisotropic ratio > 65535?), elimiate the time and samples fields which have never been used (they were reserved for shadow maps, which we never implemented). I think this set of changes is minimally onerous to downstream projects for the 3.0 release, while laying a path forward (via the versioning) to allow future changes to the struct to happen with a lower pain threshold. I don't claim that this perfectly preserves downstream source compatibility, but the fact that outside of these changes to delcarations in texture.h, only 8 lines in the entire rest of the OIIO codebase needed to change to accommodate them. So I think that the impact downstream will be minimal. (OSL might be the exception, since its LLVM code generation is exquisitely sensitive to the exact layout of the TextureOpt struct, but I'm working on those changes, too.) --------- Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information
Showing
5 changed files
with
91 additions
and
115 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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