From 62246f75c8825f55c4c34ef753a3d29afb94f9fb Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Mon, 22 Feb 2016 21:53:46 +0100 Subject: [PATCH] d3d12/gl: Supports SSA in Fragment Shader. --- rpcs3/Emu/RSX/D3D12/D3D12FragmentProgramDecompiler.cpp | 3 +++ rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/rpcs3/Emu/RSX/D3D12/D3D12FragmentProgramDecompiler.cpp b/rpcs3/Emu/RSX/D3D12/D3D12FragmentProgramDecompiler.cpp index 811dd8caf1..5cf7c69190 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12FragmentProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12FragmentProgramDecompiler.cpp @@ -169,6 +169,8 @@ void D3D12FragmentDecompiler::insertMainStart(std::stringstream & OS) continue; } } + if (PI.name == "ssa") + continue; OS << " " << PT.type << " " << PI.name << " = In." << PI.name << ";" << std::endl; } } @@ -176,6 +178,7 @@ void D3D12FragmentDecompiler::insertMainStart(std::stringstream & OS) OS << " " << "float4 gl_FragCoord = In.Position;" << std::endl; if (m_prog.origin_mode == rsx::window_origin::bottom) OS << " gl_FragCoord.y = (" << std::to_string(m_prog.height) << " - gl_FragCoord.y);\n"; + OS << " float4 ssa = is_front_face ? float4(1., 1., 1., 1.) : float4(-1., -1., -1., -1.);\n"; // Declare output for (const ParamType &PT : m_parr.params[PF_PARAM_NONE]) { diff --git a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp index 3ef0038315..f332ab2175 100644 --- a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp @@ -116,6 +116,8 @@ void GLFragmentDecompilerThread::insertMainStart(std::stringstream & OS) OS << ";" << std::endl; } } + + OS << " vec4 ssa = gl_FrontFacing ? vec4(1.) : vec4(-1.);\n"; } void GLFragmentDecompilerThread::insertMainEnd(std::stringstream & OS)