Permalink
Browse files

fix bug where hlsl2glsl was leaving duplicates in the uniforms list.

In buildUniformsAndLibFunctions(), std::unique only removes contiguous duplicates, so vector must first be sorted to remove them all.
  • Loading branch information...
1 parent 0d9fd2f commit bbc3aa4a61a5a24876d593c02fd2b84b66b52447 @anchsm anchsm committed Feb 27, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 hlslang/GLSLCodeGen/hlslLinker.cpp
View
3 hlslang/GLSLCodeGen/hlslLinker.cpp
@@ -729,6 +729,9 @@ void HlslLinker::buildUniformsAndLibFunctions(const FunctionSet& calledFunctions
libFunctions.insert( referencedFunctions.begin(), referencedFunctions.end());
}
+ // std::unique only removes contiguous duplicates, so vector must be sorted to remove them all
+ std::sort(constants.begin(), constants.end());
+
// Remove duplicates
constants.resize(std::unique(constants.begin(), constants.end()) - constants.begin());
}

0 comments on commit bbc3aa4

Please sign in to comment.