mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
ogl: implement useful constant buffer upload
this will remove the additional memcpy introduced in my last commit
This commit is contained in:
@ -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