gl/vk: Flip wpos if origin != top

This commit is contained in:
kd-11 2016-09-27 12:54:35 +03:00 committed by raven02
parent 4f74cbe510
commit 38562155d4
4 changed files with 15 additions and 3 deletions

View file

@ -250,6 +250,12 @@ void GLFragmentDecompilerThread::insertMainStart(std::stringstream & OS)
}
OS << " vec4 ssa = gl_FrontFacing ? vec4(1.) : vec4(-1.);\n";
OS << " vec4 wpos = gl_FragCoord;\n";
//Flip wpos in Y
//We could optionally export wpos from the VS, but this is so much easier
if (m_prog.origin_mode == rsx::window_origin::bottom)
OS << " wpos.y = " << std::to_string(m_prog.height) << " - wpos.y;\n";
for (const ParamType& PT : m_parr.params[PF_PARAM_UNIFORM])
{