Skip to content

Commit

Permalink
Count the channels properly too
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Yurkovich <[email protected]>
  • Loading branch information
jessey-git committed Aug 25, 2023
1 parent 4575a8d commit 6a9c010
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/dds.imageio/ddsinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ GetBaseType(Compression cmp)
static int
GetChannelCount(Compression cmp, bool isNormal)
{
if (isNormal)
return 3;
if (cmp == Compression::DXT5)
return isNormal ? 3 : 4;
if (cmp == Compression::BC5)
return isNormal ? 3 : 2;
if (cmp == Compression::BC4)
return 1;
if (cmp == Compression::BC5)
return 2;
if (cmp == Compression::BC6HU || cmp == Compression::BC6HS)
return 3;
return 4;
Expand Down
6 changes: 3 additions & 3 deletions testsuite/dds/ref/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ oiiotool ERROR: read : "src/crash-1635.dds": Unsupported DDS bit depth: 1048576
Full command line was:
> oiiotool --info -v -a --hash src/crash-1635.dds
Reading src/crash-3950.dds
src/crash-3950.dds : 16 x 1, 3 channel, uint8 dds
SHA-1: 430EFD5F1F3B2D6D48D10C3836D8FD4C83CA47C7
channel list: R, G, B
src/crash-3950.dds : 16 x 1, 4 channel, uint8 dds
SHA-1: EAAFC1B407635293A2F156CCBA32225D37469178
channel list: R, G, B, A
compression: "DXT4"
textureformat: "Plain Texture"

0 comments on commit 6a9c010

Please sign in to comment.