Fix rotation when using Apply Shader.
load_preset() duped prg[0] too early, before prg[0].mvp was set. This caused MVP to not be set correctly, not allowing rotation to work correctly when using pass-through last shader.
This commit is contained in:
parent
49e4020437
commit
c8fa2483bb
|
@ -647,12 +647,6 @@ static bool load_preset(const char *path)
|
||||||
RARCH_WARN("Too many shaders ... Capping shader amount to %d.\n", RARCH_CG_MAX_SHADERS - 3);
|
RARCH_WARN("Too many shaders ... Capping shader amount to %d.\n", RARCH_CG_MAX_SHADERS - 3);
|
||||||
cg_shader->passes = RARCH_CG_MAX_SHADERS - 3;
|
cg_shader->passes = RARCH_CG_MAX_SHADERS - 3;
|
||||||
}
|
}
|
||||||
// If we aren't using last pass non-FBO shader,
|
|
||||||
// this shader will be assumed to be "fixed-function".
|
|
||||||
// Just use prg[0] for that pass, which will be
|
|
||||||
// pass-through.
|
|
||||||
prg[cg_shader->passes + 1] = prg[0];
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < cg_shader->passes; i++)
|
for (unsigned i = 0; i < cg_shader->passes; i++)
|
||||||
{
|
{
|
||||||
if (!load_shader(path, i))
|
if (!load_shader(path, i))
|
||||||
|
@ -828,10 +822,15 @@ bool gl_cg_init(const char *path)
|
||||||
}
|
}
|
||||||
|
|
||||||
prg[0].mvp = cgGetNamedParameter(prg[0].vprg, "modelViewProj");
|
prg[0].mvp = cgGetNamedParameter(prg[0].vprg, "modelViewProj");
|
||||||
|
|
||||||
for (unsigned i = 1; i <= cg_shader->passes; i++)
|
for (unsigned i = 1; i <= cg_shader->passes; i++)
|
||||||
set_program_attributes(i);
|
set_program_attributes(i);
|
||||||
|
|
||||||
|
// If we aren't using last pass non-FBO shader,
|
||||||
|
// this shader will be assumed to be "fixed-function".
|
||||||
|
// Just use prg[0] for that pass, which will be
|
||||||
|
// pass-through.
|
||||||
|
prg[cg_shader->passes + 1] = prg[0];
|
||||||
|
|
||||||
cgGLBindProgram(prg[1].fprg);
|
cgGLBindProgram(prg[1].fprg);
|
||||||
cgGLBindProgram(prg[1].vprg);
|
cgGLBindProgram(prg[1].vprg);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue