GSDX: fixed an oversight in my shader change gregory caught which removed alpha expansion for the direct sampling case, should probably fix the remaining bugs. Also set the texture sampler to point sampling when the shader will be performing its own bilinear filtering (effect on games unknown but should be an improvement).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5291 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1@gmail.com 2012-06-13 15:36:10 +00:00
parent b8b451340c
commit 0bf64fdffd
2 changed files with 34 additions and 32 deletions

View File

@ -276,6 +276,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
if(tex)
{
const GSLocalMemory::psm_t &psm = GSLocalMemory::m_psm[context->TEX0.PSM];
bool bilinear = m_filter == 2 ? m_vt.IsLinear() : m_filter;
ps_sel.wms = context->CLAMP.WMS;
ps_sel.wmt = context->CLAMP.WMT;
@ -289,7 +290,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
ps_sel.aem = env.TEXA.AEM;
ps_sel.tfx = context->TEX0.TFX;
ps_sel.tcc = context->TEX0.TCC;
ps_sel.ltf = m_filter == 2 ? m_vt.IsLinear() : m_filter;
ps_sel.ltf = bilinear && !(ps_sel.fmt <= 2 && ps_sel.wms < 3 && ps_sel.wmt < 3);
ps_sel.rt = tex->m_target;
ps_sel.spritehack = tex->m_spritehack_t;
@ -321,7 +322,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
ps_ssel.tau = (context->CLAMP.WMS + 3) >> 1;
ps_ssel.tav = (context->CLAMP.WMT + 3) >> 1;
ps_ssel.ltf = ps_sel.ltf;
ps_ssel.ltf = bilinear && ps_sel.fmt <= 2 && ps_sel.wms < 3 && ps_sel.wmt < 3;
}
else
{

View File

@ -358,20 +358,22 @@ float4 sample(float2 st, float q)
}
float4 t;
float4x4 c;
float2 dd;
/*
if(PS_FMT <= FMT_16 && PS_WMS < 2 && PS_WMT < 2)
{
t = sample_c(st);
c[0] = sample_c(st);
}
*/
if(PS_FMT <= FMT_16 && PS_WMS < 3 && PS_WMT < 3)
{
t = sample_c(clampuv(st));
c[0] = sample_c(clampuv(st));
}
else
{
float4 uv;
float2 dd;
if(PS_LTF)
{
@ -385,8 +387,6 @@ float4 sample(float2 st, float q)
uv = wrapuv(uv);
float4x4 c;
if(PS_FMT & FMT_PAL)
{
c = sample_4p(sample_4a(uv));
@ -395,7 +395,9 @@ float4 sample(float2 st, float q)
{
c = sample_4c(uv);
}
}
[unroll]
for (uint i = 0; i < 4; i++)
{
if((PS_FMT & ~FMT_PAL) == FMT_32)
@ -422,7 +424,6 @@ float4 sample(float2 st, float q)
{
t = c[0];
}
}
return t;
}