From: Mikko Rasa Date: Fri, 18 Nov 2016 22:01:40 +0000 (+0200) Subject: Allow redeclarations to override the type of a variable X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ec5ec4201b60b8ba15aaa6208e453225a1d7a291;p=libs%2Fgl.git 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. --- 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;