rsx: Add support for non-projective shadow sampling

- Fixes missing shadows in persona 5

vk: Enable polygon depth bias a.k.a polygonOffset
- Fixes shadow acne in persona 5
This commit is contained in:
kd-11 2017-09-18 20:58:51 +03:00
parent 3836b40bf7
commit 6b96a2022a
8 changed files with 37 additions and 2 deletions

View file

@ -519,6 +519,12 @@ bool FragmentProgramDecompiler::handle_tex_srb(u32 opcode)
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SAMPLE1D));
return true;
case rsx::texture_dimension_extended::texture_dimension_2d:
if (DstExpectsSca() && (m_prog.shadow_textures & (1 << dst.tex_num)))
{
m_shadow_sampled_textures |= (1 << dst.tex_num);
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SHADOW2D) + ".r", false); //No swizzle mask on shadow lookup
return true;
}
if (m_prog.redirected_textures & (1 << dst.tex_num))
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SAMPLE2D_DEPTH_RGBA));
else
@ -547,7 +553,7 @@ bool FragmentProgramDecompiler::handle_tex_srb(u32 opcode)
if (DstExpectsSca() && (m_prog.shadow_textures & (1 << dst.tex_num)))
{
m_shadow_sampled_textures |= (1 << dst.tex_num);
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SAMPLE2D_PROJ) + ".r", false); //No swizzle mask on shadow lookup
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SHADOW2D_PROJ) + ".r", false); //No swizzle mask on shadow lookup
}
else
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SAMPLE2D_PROJ));