Backported: GLES2 fix octahedral half float unpacking

The strides in _unpack_half_floats() were incorrectly calculated in the case where octahedral normals and tangents were in use.
- lawnjelly
c6a428b3d6
This commit is contained in:
Relintai 2023-02-07 01:01:48 +01:00
parent 33ab320721
commit 30d7a3c5a7

View File

@ -2120,6 +2120,11 @@ static PoolVector<uint8_t> _unpack_half_floats(const PoolVector<uint8_t> &array,
if (!(p_format & RS::ARRAY_COMPRESS_TANGENT && p_format & RS::ARRAY_COMPRESS_NORMAL)) { if (!(p_format & RS::ARRAY_COMPRESS_TANGENT && p_format & RS::ARRAY_COMPRESS_NORMAL)) {
src_size[RS::ARRAY_NORMAL] = 8; src_size[RS::ARRAY_NORMAL] = 8;
dst_size[RS::ARRAY_NORMAL] = 8; dst_size[RS::ARRAY_NORMAL] = 8;
// These must be incremented manually,
// as we are modifying a previous attribute size.
src_stride += 4;
dst_stride += 4;
} }
src_size[i] = 0; src_size[i] = 0;
dst_size[i] = 0; dst_size[i] = 0;