ogl: fix ubo workaround

This commit is contained in:
degasus
2013-08-23 17:52:47 +02:00
parent 1469342f83
commit c9e13f6b7a
4 changed files with 37 additions and 12 deletions

View File

@ -33,9 +33,12 @@ void SetVSConstant4fvByName(const char * name, unsigned int offset, const float
{
if (tmp.shader.UniformLocations[a] == -1)
return;
else if (tmp.shader.UniformSize[a] <= offset)
return;
else
{
glUniform4fv(tmp.shader.UniformLocations[a] + offset, count, f);
unsigned int maxcount= tmp.shader.UniformSize[a]-offset;
glUniform4fv(tmp.shader.UniformLocations[a] + offset, std::min(count, maxcount), f);
return;
}
}