GRIM: Fix z-depth shader rendering on big-endian hosts

The value read is done in shader on a byte basis so we must set the
expected layout
This commit is contained in:
Le Philousophe 2022-03-21 12:39:13 +01:00
parent 89cfc283ab
commit dda9a66f7a

View File

@ -1275,7 +1275,9 @@ void GfxOpenGLS::createBitmap(BitmapData *bitmap) {
if (val == 0xf81f) {
val = 0;
}
zbufPtr[i] = 0xffff - ((uint32)val) * 0x10000 / 100 / (0x10000 - val);
// This is later read as a LA pair when filling texture
// with L being used as the LSB in fragment shader
zbufPtr[i] = TO_LE_16(0xffff - ((uint32)val) * 0x10000 / 100 / (0x10000 - val));
}
}
}