From c6a428b3d6b50e67f33607fad025fcf5f30314e3 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Mon, 16 Jan 2023 11:55:06 +0000 Subject: [PATCH] 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. --- drivers/gles2/rasterizer_storage_gles2.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index ce1e360443d2..15865afeaab2 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -2120,6 +2120,11 @@ static PoolVector _unpack_half_floats(const PoolVector &array, if (!(p_format & VS::ARRAY_COMPRESS_TANGENT && p_format & VS::ARRAY_COMPRESS_NORMAL)) { src_size[VS::ARRAY_NORMAL] = 8; dst_size[VS::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; dst_size[i] = 0;