From ec5ec4201b60b8ba15aaa6208e453225a1d7a291 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 19 Nov 2016 00:01:40 +0200 Subject: [PATCH] Allow redeclarations to override the type of a variable This can be used to e.g. change the sampler type of the diffuse map. At the moment the appropriate sampling function also needs to be overridden since texcoord dimensions are not handled automatically. --- source/programcompiler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/programcompiler.cpp b/source/programcompiler.cpp index 13c73e4a..aef17fa2 100644 --- a/source/programcompiler.cpp +++ b/source/programcompiler.cpp @@ -478,6 +478,7 @@ void ProgramCompiler::DeclarationCombiner::visit(VariableDeclaration &var) VariableDeclaration *&ptr = variables[var.name]; if(ptr) { + ptr->type = var.type; if(var.init_expression) ptr->init_expression = var.init_expression; remove_node = true; -- 2.43.0