GL: Use pipeline cache

This commit is contained in:
vlj 2015-05-16 01:10:27 +02:00 committed by Vincent Lejeune
parent 145f411324
commit 2a7c65c019
8 changed files with 115 additions and 249 deletions

View file

@ -105,10 +105,10 @@ std::string GLFragmentDecompilerThread::AddConst()
auto data = vm::ptr<u32>::make(m_addr + m_size + 4 * sizeof(u32));
m_offset = 2 * 4 * sizeof(u32);
u32 x = GetData(data[0]);
u32 y = GetData(data[1]);
u32 z = GetData(data[2]);
u32 w = GetData(data[3]);
u32 x = 0;//GetData(data[0]);
u32 y = 0;//GetData(data[1]);
u32 z = 0;//GetData(data[2]);
u32 w = 0;//GetData(data[3]);
return m_parr.AddParam(PARAM_UNIFORM, "vec4", name,
std::string("vec4(") + std::to_string((float&)x) + ", " + std::to_string((float&)y)
+ ", " + std::to_string((float&)z) + ", " + std::to_string((float&)w) + ")");
@ -612,7 +612,7 @@ void GLFragmentDecompilerThread::Task()
m_code_level = 1;
m_shader = BuildCode();
main.clear();
m_parr.params.clear();
// m_parr.params.clear();
}
GLFragmentProgram::GLFragmentProgram()
@ -672,7 +672,7 @@ void GLFragmentProgram::DecompileAsync(RSXFragmentProgram& prog)
void GLFragmentProgram::Compile()
{
if (id)
if (id)
{
glDeleteShader(id);
}
@ -706,6 +706,15 @@ void GLFragmentProgram::Compile()
LOG_NOTICE(RSX, shader.c_str()); // Log the text of the shader that failed to compile
Emu.Pause(); // Pause the emulator, we can't really continue from here
}
for (const GLParamType& PT : parr.params)
{
if (PT.flag != PARAM_UNIFORM) continue;
for (const GLParamItem PI : PT.items)
{
size_t offset = atoi(PI.name.c_str() + 2);
FragmentConstantOffsetCache.push_back(offset);
}
}
}
void GLFragmentProgram::Delete()