From: Mikko Rasa Date: Mon, 8 Nov 2021 13:23:02 +0000 (+0200) Subject: Isolate expressions from surrounding composite access X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=86d5253cd89cf9a40aa43012c5d6ed03ba01ec6c;p=libs%2Fgl.git Isolate expressions from surrounding composite access --- diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index 2dcc285c..e12d0bfc 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -690,6 +690,9 @@ void SpirVGenerator::visit(Swizzle &swizzle) void SpirVGenerator::visit(UnaryExpression &unary) { + if(composite_access) + return visit_isolated(unary); + unary.expression->visit(*this); char oper = unary.oper->token[0]; @@ -774,6 +777,8 @@ void SpirVGenerator::visit(BinaryExpression &binary) visit_isolated(*binary.right); return visit_composite(*binary.left, 0x400000|r_expression_result_id, *binary.type); } + else if(composite_access) + return visit_isolated(binary); if(assignment_source_id) throw internal_error("invalid binary expression in assignment target"); @@ -998,6 +1003,8 @@ void SpirVGenerator::visit(Assignment &assign) void SpirVGenerator::visit(TernaryExpression &ternary) { + if(composite_access) + return visit_isolated(ternary); if(constant_expression) { ternary.condition->visit(*this);