mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-13 06:52:58 -06:00

The upload in the backend isn't done, it's just pushed by the mostly removed SetMulti*SConstant4fv. Also no optimizations was done on VideoCommon side, but I can start now :-) Sorry for the hacky way, but I think this is a nice (working) snapshot for a much bigger change.
46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
// Copyright 2013 Dolphin Emulator Project
|
|
// Licensed under GPLv2
|
|
// Refer to the license.txt file included.
|
|
|
|
#include <math.h>
|
|
|
|
#include "Globals.h"
|
|
#include "VideoConfig.h"
|
|
#include "Statistics.h"
|
|
|
|
#include "GLUtil.h"
|
|
|
|
#include "Render.h"
|
|
#include "VertexShaderGen.h"
|
|
#include "VertexShaderManager.h"
|
|
#include "ProgramShaderCache.h"
|
|
#include "VertexManager.h"
|
|
#include "VertexLoader.h"
|
|
#include "XFMemory.h"
|
|
#include "ImageWrite.h"
|
|
#include "FileUtil.h"
|
|
#include "Debugger.h"
|
|
|
|
namespace OGL
|
|
{
|
|
|
|
void Renderer::SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float *f)
|
|
{
|
|
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
|
|
{
|
|
ProgramShaderCache::SetMultiVSConstant4fv(const_number, f, count);
|
|
return;
|
|
}
|
|
ProgramShaderCache::PCacheEntry tmp = ProgramShaderCache::GetShaderProgram();
|
|
for (unsigned int a = 0; a < 9; ++a)
|
|
{
|
|
u32 offset = VSVar_Loc[a].reg - const_number;
|
|
if(offset >= count) return;
|
|
u32 size = std::min(tmp.shader.UniformSize[a+10], count-offset);
|
|
if(size > 0)
|
|
glUniform4fv(tmp.shader.UniformLocations[a+10], size, f + 4*offset);
|
|
}
|
|
}
|
|
|
|
} // namespace OGL
|