Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit bbc3aa4a61a5a24876d593c02fd2b84b66b52447 1 parent 0d9fd2f
Andy S anchsm authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  hlslang/GLSLCodeGen/hlslLinker.cpp
3  hlslang/GLSLCodeGen/hlslLinker.cpp
View
@@ -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());
}
Please sign in to comment.
Something went wrong with that request. Please try again.