From: Mikko Rasa Date: Sun, 7 Nov 2021 17:15:14 +0000 (+0200) Subject: Compute correct size for SPIR-V structs if the last member is an array X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6cee6c490ded0981c4da3f9f4ec74a41555e1a4e;p=libs%2Fgl.git Compute correct size for SPIR-V structs if the last member is an array --- diff --git a/source/core/module.cpp b/source/core/module.cpp index b542f77e..6d0122c0 100644 --- a/source/core/module.cpp +++ b/source/core/module.cpp @@ -191,7 +191,10 @@ void SpirVModule::reflect() last_member = lm; } - s.size = last_offset+get_type_size(last_member->type); + unsigned last_size = get_type_size(last_member->type); + if(last_member->array_size) + last_size += last_member->array_stride*(last_member->array_size-1); + s.size = last_offset+last_size; s.size = (s.size+15)&~15; }