ogl: implement useful constant buffer upload
this will remove the additional memcpy introduced in my last commit
This commit is contained in:
1 parent
4377618438
commit
7c14463d11
9 files changed
+75
-110
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user