From: Mikko Rasa Date: Sat, 27 Nov 2021 18:00:27 +0000 (+0200) Subject: Fixes for handling extended alignment in GLSL X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4ecc965177df174ed2d26cfedf24665c8879acda;p=libs%2Fgl.git Fixes for handling extended alignment in GLSL --- diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index 07d4eb07..481f38fb 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -385,7 +385,7 @@ SpirVGenerator::Id SpirVGenerator::get_variable_type_id(const VariableDeclaratio } else size_id = get_constant_id(get_standard_type_id(BasicTypeDeclaration::INT, 1), 1); - return get_array_type_id(*basic->base_type, size_id, true); + return get_array_type_id(*basic->base_type, size_id, basic->extended_alignment); } return get_id(*var.type_declaration); diff --git a/source/glsl/syntax.cpp b/source/glsl/syntax.cpp index 45765f27..d74291bc 100644 --- a/source/glsl/syntax.cpp +++ b/source/glsl/syntax.cpp @@ -224,6 +224,7 @@ BasicTypeDeclaration::BasicTypeDeclaration(const BasicTypeDeclaration &other): kind(other.kind), size(other.size), sign(other.sign), + extended_alignment(other.extended_alignment), base(other.base) // Do not copy base type { } @@ -247,7 +248,8 @@ StructDeclaration::StructDeclaration() StructDeclaration::StructDeclaration(const StructDeclaration &other): TypeDeclaration(other), - members(other.members) + members(other.members), + extended_alignment(other.extended_alignment) // Do not copy interface block { }