mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Calculate bytesize properly for packed formats in mesh viewer
This commit is contained in:
@@ -101,7 +101,21 @@ namespace renderdocui.Code
|
||||
{
|
||||
get
|
||||
{
|
||||
return format.compByteWidth * format.compCount * matrixdim;
|
||||
uint vecSize = format.compByteWidth * format.compCount;
|
||||
|
||||
if (format.special)
|
||||
{
|
||||
if (format.specialFormat == SpecialFormat.R5G5B5A1 ||
|
||||
format.specialFormat == SpecialFormat.R5G6B5 ||
|
||||
format.specialFormat == SpecialFormat.R4G4B4A4)
|
||||
vecSize = 2;
|
||||
|
||||
if (format.specialFormat == SpecialFormat.R10G10B10A2 ||
|
||||
format.specialFormat == SpecialFormat.R11G11B10)
|
||||
vecSize = 4;
|
||||
}
|
||||
|
||||
return vecSize * matrixdim;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1714,7 +1714,7 @@ namespace renderdocui.Windows
|
||||
var fmt = bufferFormats[el].format;
|
||||
int byteWidth = (int)fmt.compByteWidth;
|
||||
|
||||
int bytesToRead = (int)(fmt.compByteWidth * fmt.compCount);
|
||||
int bytesToRead = (int)bufferFormats[el].ByteSize;
|
||||
|
||||
byte[] bytes = read.ReadBytes(bytesToRead);
|
||||
rawWriter.Write(bytes);
|
||||
|
||||
Reference in New Issue
Block a user