From 4ecc965177df174ed2d26cfedf24665c8879acda Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 27 Nov 2021 20:00:27 +0200 Subject: [PATCH] Fixes for handling extended alignment in GLSL --- source/glsl/spirv.cpp | 2 +- source/glsl/syntax.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 { } -- 2.43.0