fix getUniformInfo(), See Issue #2883 (#2885)

This commit is contained in:
云风
2022-08-24 10:53:49 +08:00
committed by GitHub
parent 549077fc0b
commit 8207645355
2 changed files with 13 additions and 1 deletions

View File

@@ -4103,7 +4103,7 @@ namespace bgfx
PredefinedUniform::Enum predefined = nameToPredefinedUniformEnum(name);
if (PredefinedUniform::Count == predefined && UniformType::End != UniformType::Enum(type) )
{
uniforms[sr.m_num] = createUniform(name, UniformType::Enum(type), regCount);
uniforms[sr.m_num] = createUniform(name, UniformType::Enum(type), num);
sr.m_num++;
}
}

View File

@@ -207,6 +207,18 @@ namespace bgfx { namespace glsl
un.num = num;
un.regIndex = 0;
un.regCount = num;
switch (un.type)
{
case UniformType::Mat3:
un.regCount *= 3;
break;
case UniformType::Mat4:
un.regCount *= 4;
break;
default:
break;
}
uniforms.push_back(un);
}