mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Adjust pitch calculation in saved DDS files to match spec. Closes #2189
* The spec is not particularly clear but this matches the DirectXTex behaviour which is as close to 'official' as we'll get most likely.
This commit is contained in:
@@ -774,7 +774,8 @@ bool write_dds_to_file(FILE *f, const write_dds_data &data)
|
||||
(data.format.type == ResourceFormatType::BC1 || data.format.type == ResourceFormatType::BC4)
|
||||
? 8
|
||||
: 16;
|
||||
header.dwPitchOrLinearSize = RDCMAX(1U, ((header.dwWidth + 3) / 4)) * blockSize;
|
||||
header.dwPitchOrLinearSize =
|
||||
RDCMAX(1U, ((header.dwWidth + 3) / 4)) * blockSize * RDCMAX(1U, data.height / 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user