ogl: implement useful constant buffer upload

this will remove the additional memcpy introduced in my last commit
This commit is contained in:
degasus
2013-10-07 17:19:47 +02:00
parent 4377618438
commit 7c14463d11
9 changed files with 75 additions and 110 deletions

View File

@ -27,20 +27,5 @@ namespace OGL
// Renderer functions
void Renderer::SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f)
{
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
{
ProgramShaderCache::SetMultiPSConstant4fv(const_number, f, count);
return;
}
ProgramShaderCache::PCacheEntry tmp = ProgramShaderCache::GetShaderProgram();
for (unsigned int a = 0; a < 10; ++a)
{
u32 offset = PSVar_Loc[a].reg - const_number;
if(offset >= count) return;
u32 size = std::min(tmp.shader.UniformSize[a], count-offset);
if(size > 0)
glUniform4fv(tmp.shader.UniformLocations[a], size, f + 4*offset);
}
}
} // namespace OGL