On Tue Mar 5 14:07:21 2024 +0000, Matteo Bruni wrote:
I have been confused about this image data for a bit. The first row is alright, but there is no way that the others are what they claim to be:
[0x1f, 0xf8] -> this sets the first and last color components to "1.0", the middle one to 0. [0xff, 0x07] -> this sets the first two (LSB to MSB) components to "1.0", last to 0. Notice also how the last row has the same color data as the first.
Problem is, the tests pass and trying to "fix" the colors obviously broke the test. Turns out, this is a combination of "comment misdirection" and slight test confusion. The uncompressed texture uses D3DFMT_A8R8G8B8, which is a BGRA format - channels are sort of "reversed". So the last (MSB -> LSB) component in the expected value isn't alpha but blue. Which means the second block is purple and the third one is cyan. The last one is transparent blue. So, I'd either fix the comments to match the actual colors or (probably slightly preferable) fix the image and expected data to match the comment.
Thanks for taking the time to investigate this, hopefully I didn't waste too much of your time. The code comments should now match the test data. :) Switching between DXGI and D3DFORMATs had me confused WRT endianness.