mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 23:41:19 +01:00
4377618438
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.
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
// Copyright 2013 Dolphin Emulator Project
|
|
// Licensed under GPLv2
|
|
// Refer to the license.txt file included.
|
|
|
|
#include "Globals.h"
|
|
|
|
#include "GLUtil.h"
|
|
|
|
#include <cmath>
|
|
|
|
#include "Statistics.h"
|
|
#include "VideoConfig.h"
|
|
#include "ImageWrite.h"
|
|
#include "Common.h"
|
|
#include "Render.h"
|
|
#include "VertexShaderGen.h"
|
|
#include "ProgramShaderCache.h"
|
|
#include "PixelShaderManager.h"
|
|
#include "OnScreenDisplay.h"
|
|
#include "StringUtil.h"
|
|
#include "FileUtil.h"
|
|
#include "Debugger.h"
|
|
|
|
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
|