Fragment position is given as gl_FragCoord not gl_Position

Fix references to gl_Position in Dx12
This commit is contained in:
kd-11 2016-02-09 12:58:35 +03:00
parent f7f4c049fc
commit 843d0ed298
2 changed files with 3 additions and 3 deletions

View File

@ -274,7 +274,7 @@ template<typename T> std::string FragmentProgramDecompiler::GetSRC(T src)
{
static const std::string reg_table[] =
{
"gl_Position",
"gl_FragCoord",
"diff_color", "spec_color",
"fogc",
"tc0", "tc1", "tc2", "tc3", "tc4", "tc5", "tc6", "tc7", "tc8", "tc9",

View File

@ -173,9 +173,9 @@ void D3D12FragmentDecompiler::insertMainStart(std::stringstream & OS)
}
}
// A bit unclean, but works.
OS << " " << "float4 gl_Position = In.Position;" << std::endl;
OS << " " << "float4 gl_FragCoord = In.Position;" << std::endl;
if (m_prog.origin_mode == rsx::window_origin::bottom)
OS << " gl_Position.y = (" << std::to_string(m_prog.height) << " - gl_Position.y);\n";
OS << " gl_FragCoord.y = (" << std::to_string(m_prog.height) << " - gl_FragCoord.y);\n";
// Declare output
for (const ParamType &PT : m_parr.params[PF_PARAM_NONE])
{