Skip to content
This repository
Browse code

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 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. +3 0  hlslang/GLSLCodeGen/hlslLinker.cpp
3  hlslang/GLSLCodeGen/hlslLinker.cpp
@@ -729,6 +729,9 @@ void HlslLinker::buildUniformsAndLibFunctions(const FunctionSet& calledFunctions
729 729 libFunctions.insert( referencedFunctions.begin(), referencedFunctions.end());
730 730 }
731 731
  732 + // std::unique only removes contiguous duplicates, so vector must be sorted to remove them all
  733 + std::sort(constants.begin(), constants.end());
  734 +
732 735 // Remove duplicates
733 736 constants.resize(std::unique(constants.begin(), constants.end()) - constants.begin());
734 737 }

0 comments on commit bbc3aa4

Please sign in to comment.
Something went wrong with that request. Please try again.