GSdx-d3d11: Add support for depth convert format in texture sampler.

Idea is to allot partial support of depth fmt on the new depth convert
format, this way we can utilize channel shuffle on Red, Blue or gXbY
channels with depth shader conversion.

Terminator 3 hits this code path and seems to fix a transparent wall.
Other games will probably benefit from this as well.
This commit is contained in:
lightningterror 2018-12-12 19:03:08 +01:00
parent 3a9ff840cf
commit 7215618621
1 changed files with 11 additions and 0 deletions

View File

@ -240,6 +240,17 @@ void GSRendererDX::EmulateTextureSampler(const GSTextureCache::Source* tex)
bilinear &= m_vt.IsLinear();
}
// Depth format
if (tex->m_texture->GetType() == GSTexture::DepthStencil)
{
// Require a float conversion if the texure is a depth format
m_ps_sel.depth_fmt = (psm.bpp == 16) ? 2 : 1;
// m_vs_sel.int_fst = !PRIM->FST; // select float/int coordinate
// Don't force interpolation on depth format
bilinear &= m_vt.IsLinear();
}
GSVector4 half_offset = RealignTargetTextureCoordinate(tex);
vs_cb.Texture_Scale_Offset.z = half_offset.x;
vs_cb.Texture_Scale_Offset.w = half_offset.y;