gl-render-manager: Fix postprocessing shaders. Fixes #10566. Live switching is broken though for some reason.

This commit is contained in:
Henrik Rydgård 2018-01-31 17:23:24 +01:00
parent 5351c9ddb3
commit 982a1710ae
2 changed files with 5 additions and 7 deletions

View File

@ -208,9 +208,6 @@ void FramebufferManagerCommon::SetNumExtraFBOs(int num) {
extraFBOs_.push_back(fbo);
}
currentRenderVfb_ = 0;
// TODO: Should probably not do this bind.
if (num != 0)
draw_->BindFramebufferAsRenderTarget(nullptr, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::KEEP });
}
// Heuristics to figure out the size of FBO to create.

View File

@ -154,7 +154,7 @@ void FramebufferManagerGLES::CompilePostShader() {
std::vector<GLRShader *> shaders;
shaders.push_back(render_->CreateShader(GL_VERTEX_SHADER, vshader, "postshader"));
shaders.push_back(render_->CreateShader(GL_VERTEX_SHADER, fshader, "postshader"));
shaders.push_back(render_->CreateShader(GL_FRAGMENT_SHADER, fshader, "postshader"));
std::vector<GLRProgram::UniformLocQuery> queries;
queries.push_back({ &u_postShaderTex, "tex" });
queries.push_back({ &deltaLoc_, "u_texelDelta" });
@ -164,9 +164,10 @@ void FramebufferManagerGLES::CompilePostShader() {
std::vector<GLRProgram::Initializer> inits;
inits.push_back({ &u_postShaderTex, 0, 0 });
postShaderProgram_ = render_->CreateProgram(shaders, {}, queries, inits, false);
render_->SetUniformI1(&u_postShaderTex, 0);
std::vector<GLRProgram::Semantic> semantics;
semantics.push_back({ 0, "a_position" });
semantics.push_back({ 1, "a_texcoord0" });
postShaderProgram_ = render_->CreateProgram(shaders, semantics, queries, inits, false);
for (auto iter : shaders) {
render_->DeleteShader(iter);
}