Merge pull request #1491 from kd-11/fs_input_fix

Fragment position is given as gl_FragCoord not gl_Position
This commit is contained in:
vlj 2016-02-13 16:51:56 +01:00
commit 9e3132c3fc
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[] = static const std::string reg_table[] =
{ {
"gl_Position", "gl_FragCoord",
"diff_color", "spec_color", "diff_color", "spec_color",
"fogc", "fogc",
"tc0", "tc1", "tc2", "tc3", "tc4", "tc5", "tc6", "tc7", "tc8", "tc9", "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. // 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) 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 // Declare output
for (const ParamType &PT : m_parr.params[PF_PARAM_NONE]) for (const ParamType &PT : m_parr.params[PF_PARAM_NONE])
{ {