Support loading legacy DDS files using mixed channel formats #501
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The legacy DDS file formats
D3DFMT_A2W10V10U10
,D3DFMT_L6V5U5
, andD3DFMT_X8L8V8U8
were originally not implemented because no DXGI format has a mix of signed/unsigned channels the way these legacy Direct3D 9 formats were made (the L and A channels are unsigned, the UVW channels are signed). They are also tied to legacy "BumpMap" technology, so generally weren't not considered that relevant to modern Direct3D.There is a customer request that the library support loading these formats. For this PR, the unsigned values are remapped to the unorm range through biasing the value (i.e. effectively the same as x2 bias, but not applied to the L or A channels).