glslang: include 0 as not being a power of 2

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30613 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2015-04-08 15:51:14 +00:00
parent 24c9cc57ad
commit 837c6380f3
3 changed files with 8 additions and 3 deletions

View file

@ -188,6 +188,9 @@ const int GlslangMaxTokenLength = 1024;
template <class T> bool IsPow2(T powerOf2)
{
if (powerOf2 <= 0)
return false;
return (powerOf2 & (powerOf2 - 1)) == 0;
}