Skip to content

Commit

Permalink
fix bug where hlsl2glsl was leaving duplicates in the uniforms list.
Browse files Browse the repository at this point in the history
In buildUniformsAndLibFunctions(), std::unique only removes contiguous duplicates, so vector must first be sorted to remove them all.
  • Loading branch information
anchsm committed Feb 27, 2013
1 parent 0d9fd2f commit bbc3aa4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hlslang/GLSLCodeGen/hlslLinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit bbc3aa4

Please sign in to comment.