From 816600382e92a4efb8dad715cf98e9d170f4e29a Mon Sep 17 00:00:00 2001 From: Yuri Rubinsky Date: Sun, 9 Oct 2022 06:32:50 +0300 Subject: Fix incorrect offset for vec3 datatypes in `_fill_std140_ubo_empty` --- servers/rendering/renderer_rd/storage_rd/material_storage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'servers/rendering/renderer_rd/storage_rd') diff --git a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp index 1fecac9045..f0b8d006cb 100644 --- a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp @@ -903,7 +903,9 @@ _FORCE_INLINE_ static void _fill_std140_ubo_empty(ShaderLanguage::DataType type, case ShaderLanguage::TYPE_BVEC3: case ShaderLanguage::TYPE_IVEC3: case ShaderLanguage::TYPE_UVEC3: - case ShaderLanguage::TYPE_VEC3: + case ShaderLanguage::TYPE_VEC3: { + memset(data, 0, 12 * p_array_size); + } break; case ShaderLanguage::TYPE_BVEC4: case ShaderLanguage::TYPE_IVEC4: case ShaderLanguage::TYPE_UVEC4: -- cgit v1.2.3