merge Vertex and PixelShaderCache into ProgramShaderCache

this is the first step, uniform handling is still missing
This commit is contained in:
degasus
2013-02-13 13:12:19 +01:00
parent 818a376bd4
commit bbc292c210
15 changed files with 389 additions and 716 deletions

View File

@ -20,7 +20,7 @@
#include "VideoConfig.h"
#include "GLUtil.h"
#include "PostProcessing.h"
#include "PixelShaderCache.h"
#include "ProgramShaderCache.h"
namespace OGL
{
@ -29,7 +29,7 @@ namespace PostProcessing
{
static std::string s_currentShader;
static FRAGMENTSHADER s_shader;
static SHADER s_shader;
void Init()
{
@ -63,10 +63,10 @@ bool ApplyShader()
std::string code;
if (File::ReadFileToString(true, s_currentShader.c_str(), code))
{
if (!PixelShaderCache::CompilePixelShader(s_shader, code.c_str()))
{
ERROR_LOG(VIDEO, "Failed to compile post-processing shader %s", s_currentShader.c_str());
}
//if (!ProgramShaderCache::CompileShader(s_shader, "#version130\n...", code.c_str()))
//{
// ERROR_LOG(VIDEO, "Failed to compile post-processing shader %s", s_currentShader.c_str());
//}
}
else
{
@ -78,7 +78,7 @@ bool ApplyShader()
// TODO: Convert PP shaders to GLSL
if (s_shader.glprogid != 0)
{
// SetBothShaders(s_shader, 0);
s_shader.Bind();
return true;
}
else