Fix calculation of number of rows in block DDS formats. Closes #1870

* The number of rows should be the ceiling of the 4-row number, since any
  overlap becomes a whole extra row of blocks.
This commit is contained in:
baldurk
2020-05-07 12:37:06 +01:00
parent ec0cb41c17
commit d0bd2e8da2
+1 -1
View File
@@ -1131,7 +1131,7 @@ dds_data load_dds_from_file(StreamReader *reader)
// pitch/rows are in blocks, not pixels, for block formats.
if(blockFormat)
{
numRows = RDCMAX(1U, numRows / 4);
numRows = RDCMAX(1U, (numRows + 3) / 4);
uint32_t blockSize = (ret.format.type == ResourceFormatType::BC1 ||
ret.format.type == ResourceFormatType::BC4)