X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Foptimize.cpp;h=55e5da5fddeec0896cbd52b087a87bf928da305d;hb=d4257f651ab8341d926d97d5c85d72ce64f8778b;hp=ed20bb175dcc9277e1ff84e2e1a1734b2279668f;hpb=8bf70f4d445cf63386ad7aafc5b3ebdbd8369939;p=libs%2Fgl.git diff --git a/source/glsl/optimize.cpp b/source/glsl/optimize.cpp index ed20bb17..55e5da5f 100644 --- a/source/glsl/optimize.cpp +++ b/source/glsl/optimize.cpp @@ -646,8 +646,8 @@ void ConstantFolder::visit(RefPtr &expr) literal->token = lexical_cast(r_constant_value.value())+"u"; else if(r_constant_value.check_type()) { - literal->token = lexical_cast(r_constant_value.value()); - if(isnumrc(literal->token)) + literal->token = lexical_cast(r_constant_value.value(), Fmt().precision(8)); + if(literal->token.find('.')==string::npos && literal->token.find('e')==string::npos) literal->token += ".0"; } else @@ -1263,7 +1263,7 @@ void UnusedVariableRemover::record_assignment(const Assignment::Target &target, /* An assignment to the target hides any assignments to the same target or its subfields. */ VariableInfo &var_info = variables[target.declaration]; - for(unsigned i=0; itarget;