Standardise layout of packed texture formats on disk/network

* We preserve each API's interpretation of bit order for packed formats like
  RGBA4 or R5G6B5 when displaying the raw data in the UI, but when we need to
  proxy it or save to disk, we always transform to D3D's order as standard.
* This allows us to proxy them reliably because we always have a standard bit
  order and APIs that need a different order transform when fetching data to the
  standard format, or setting proxy data from the standard format.
This commit is contained in:
baldurk
2020-05-18 11:04:06 +01:00
parent 5eb80370fd
commit f622ac36d6
17 changed files with 279 additions and 71 deletions
+4 -4
View File
@@ -1029,17 +1029,17 @@ void RenderDoc::ResamplePixels(const FramePixels &in, RDCThumb &out)
{
uint16_t *src565 = (uint16_t *)src;
Vec3f unorm = ConvertFromB5G6R5(*src565);
dst[0] = (byte)(unorm.z * 255.0f);
dst[0] = (byte)(unorm.x * 255.0f);
dst[1] = (byte)(unorm.y * 255.0f);
dst[2] = (byte)(unorm.x * 255.0f);
dst[2] = (byte)(unorm.z * 255.0f);
}
else if(in.buf5551)
{
uint16_t *src5551 = (uint16_t *)src;
Vec4f unorm = ConvertFromB5G5R5A1(*src5551);
dst[0] = (byte)(unorm.z * 255.0f);
dst[0] = (byte)(unorm.x * 255.0f);
dst[1] = (byte)(unorm.y * 255.0f);
dst[2] = (byte)(unorm.x * 255.0f);
dst[2] = (byte)(unorm.z * 255.0f);
}
else if(in.bgra)
{