Skip to content

Instantly share code, notes, and snippets.

@Triang3l
Created June 28, 2018 14:55
Show Gist options
  • Save Triang3l/afd9d6dd5f76f7c118b98770de827227 to your computer and use it in GitHub Desktop.
Save Triang3l/afd9d6dd5f76f7c118b98770de827227 to your computer and use it in GitHub Desktop.
// Decompiled for Xenia by Triang3l.
DWORD XGSurfaceSize(DWORD Width, DWORD Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSampleType) {
Format = (D3DFORMAT) ((DWORD) Format & 63);
if (MultiSampleType >= D3DMULTISAMPLE_2_SAMPLES /* 1 */) {
Height *= 2;
}
if (MultiSampleType == D3DMULTISAMPLE_4_SAMPLES /* 2 */) {
Width *= 2;
}
DWORD bytesPerPixel = 4;
if (Format == 21 || Format == D3DFMT_A16B16G16R16F /* 32 */ || Format == D3DFMT_G32R32F /* 37 */) {
bytesPerPixel = 8;
}
return Width * Height * BytesPerPixel / 5120;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment