GSdx: fixed Issue 182 (narrowed the neq alpha test range to +/-0.4f/255, scream if something broke), and re-enabled something to make DATE faster (counting min/max of the vertices outperforms stencil buffer clearing when there are many small primitive batches).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1074 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 2009-04-27 20:17:06 +00:00
parent 7ecc0dd6a3
commit 1245659eee
7 changed files with 1880 additions and 1845 deletions

View File

@ -85,6 +85,7 @@ CRC::Game CRC::m_games[] =
{0x6F8545DB, ICO, US},
{0xB01A4C95, ICO, JP},
{0x5C991F4E, ICO, Unknown},
{0x7ACF7E03, ICO, Unknown},
{0xAEAD1CA3, GT4, JP},
{0x44A61C8F, GT4, Unknown},
{0x0086E35B, GT4, Unknown},
@ -112,10 +113,11 @@ CRC::Game CRC::m_games[] =
{0xEB001875, GodOfWar, EU},
{0xA61A4C6D, GodOfWar, Unknown},
{0xE23D532B, GodOfWar, Unknown},
{0xDF1AF973, GodOfWar, Unknown},
{0x2F123FD8, GodOfWar2, RU},
{0x2F123FD8, GodOfWar2, US},
{0x44A8A22A, GodOfWar2, EU},
{0X4340C7C6, GodOfWar2, Unknown},
{0x4340C7C6, GodOfWar2, Unknown},
{0x5D482F18, JackieChanAdv, Unknown},
{0xf0a6d880, HarvestMoon, US},
{0x75c01a04, NamcoXCapcom, US},

View File

@ -334,8 +334,6 @@ protected:
if(s_save) rt->m_texture.Save(str);
str.Format(_T("c:\\temp2\\_%05d_f%I64d_rz0_%05x_%d.bmp"), s_n-1, m_perfmon.GetFrame(), context->ZBUF.Block(), context->ZBUF.PSM);
if(s_savez) ds->m_texture.Save(str);
// if(s_savez) m_dev.SaveToFileD32S8X24(ds->m_texture, str); // TODO
// if(s_savez) m_dev.SaveToFileD24S8(ds->m_texture, str); // TODO
}
int prim = PRIM->PRIM;

View File

@ -493,34 +493,48 @@ void GSRendererHW10::SetupDATE(Texture& rt, Texture& ds)
{
if(!m_context->TEST.DATE) return; // || (::GetAsyncKeyState(VK_CONTROL) & 0x8000)
// sfex3 (after the capcom logo), vf4 (first menu fading in), ffxii shadows, rumble roses shadows
// sfex3 (after the capcom logo), vf4 (first menu fading in), ffxii shadows, rumble roses shadows, persona4 shadows
GSVector4 mm;
// TODO
mm = GSVector4(-1, -1, 1, 1);
/*
MinMaxXY(mm);
int w = rt.GetWidth();
int h = rt.GetHeight();
// if(m_count < 100)
{
GSVector4 pmin(65535, 65535, 0, 0);
GSVector4 pmax = GSVector4::zero();
float sx = 2.0f * rt.m_scale.x / (w * 16);
float sy = 2.0f * rt.m_scale.y / (h * 16);
float ox = (float)(int)m_context->XYOFFSET.OFX;
float oy = (float)(int)m_context->XYOFFSET.OFY;
for(int i = 0, j = m_count; i < j; i++)
{
GSVector4 p(GSVector4i(m_vertices[i].m128i[0]).uph16());
mm.x = (mm.x - ox) * sx - 1;
mm.y = (mm.y - oy) * sy - 1;
mm.z = (mm.z - ox) * sx - 1;
mm.w = (mm.w - oy) * sy - 1;
pmin = p.minv(pmin);
pmax = p.maxv(pmax);
}
mm += pmin.xyxy(pmax);
int w = rt.GetWidth();
int h = rt.GetHeight();
float sx = 2.0f * rt.m_scale.x / (w * 16);
float sy = 2.0f * rt.m_scale.y / (h * 16);
float ox = (float)(int)m_context->XYOFFSET.OFX;
float oy = (float)(int)m_context->XYOFFSET.OFY;
mm.x = (mm.x - ox) * sx - 1;
mm.y = (mm.y - oy) * sy - 1;
mm.z = (mm.z - ox) * sx - 1;
mm.w = (mm.w - oy) * sy - 1;
if(mm.x < -1) mm.x = -1;
if(mm.y < -1) mm.y = -1;
if(mm.z > +1) mm.z = +1;
if(mm.w > +1) mm.w = +1;
}
if(mm.x < -1) mm.x = -1;
if(mm.y < -1) mm.y = -1;
if(mm.z > +1) mm.z = +1;
if(mm.w > +1) mm.w = +1;
*/
GSVector4 uv = (mm + 1.0f) / 2.0f;
//

View File

@ -79,8 +79,8 @@ void GSRendererHW9::VertexKick(bool skip)
{
Vertex& dst = m_vl.AddTail();
dst.p.x = (float)m_v.XYZ.X;
dst.p.y = (float)m_v.XYZ.Y;
dst.p.x = (float)(int)m_v.XYZ.X;
dst.p.y = (float)(int)m_v.XYZ.Y;
dst.p.z = (float)m_v.XYZ.Z;
dst.c0 = m_v.RGBAQ.ai32[0];
@ -469,34 +469,48 @@ void GSRendererHW9::SetupDATE(Texture& rt, Texture& ds)
{
if(!m_context->TEST.DATE) return; // || (::GetAsyncKeyState(VK_CONTROL) & 0x8000)
// sfex3 (after the capcom logo), vf4 (first menu fading in), ffxii shadows, rumble roses shadows
// sfex3 (after the capcom logo), vf4 (first menu fading in), ffxii shadows, rumble roses shadows, persona4 shadows
GSVector4 mm;
// TODO
mm = GSVector4(-1, -1, 1, 1);
/*
MinMaxXY(mm);
int w = rt.GetWidth();
int h = rt.GetHeight();
// if(m_count < 100)
{
GSVector4 pmin(65535, 65535, 0, 0);
GSVector4 pmax = GSVector4::zero();
float sx = 2.0f * rt.m_scale.x / (w * 16);
float sy = 2.0f * rt.m_scale.y / (h * 16);
float ox = (float)(int)m_context->XYOFFSET.OFX;
float oy = (float)(int)m_context->XYOFFSET.OFY;
for(int i = 0, j = m_count; i < j; i++)
{
GSVector4 p(m_vertices[i].p);
mm.x = (mm.x - ox) * sx - 1;
mm.y = (mm.y - oy) * sy - 1;
mm.z = (mm.z - ox) * sx - 1;
mm.w = (mm.w - oy) * sy - 1;
pmin = p.minv(pmin);
pmax = p.maxv(pmax);
}
mm += pmin.xyxy(pmax);
int w = rt.GetWidth();
int h = rt.GetHeight();
float sx = 2.0f * rt.m_scale.x / (w * 16);
float sy = 2.0f * rt.m_scale.y / (h * 16);
float ox = (float)(int)m_context->XYOFFSET.OFX;
float oy = (float)(int)m_context->XYOFFSET.OFY;
mm.x = (mm.x - ox) * sx - 1;
mm.y = (mm.y - oy) * sy - 1;
mm.z = (mm.z - ox) * sx - 1;
mm.w = (mm.w - oy) * sy - 1;
if(mm.x < -1) mm.x = -1;
if(mm.y < -1) mm.y = -1;
if(mm.z > +1) mm.z = +1;
if(mm.w > +1) mm.w = +1;
}
if(mm.x < -1) mm.x = -1;
if(mm.y < -1) mm.y = -1;
if(mm.z > +1) mm.z = +1;
if(mm.w > +1) mm.w = +1;
*/
GSVector4 uv = (mm + 1.0f) / 2.0f;
//

File diff suppressed because it is too large Load Diff

View File

@ -458,7 +458,7 @@ PS_OUTPUT ps_main(PS_INPUT input)
}
else if(ATST == 4) // e
{
clip(0.9f/256 - abs(c.a - AREF));
clip(0.5f / 256 - abs(c.a - AREF));
}
else if(ATST == 5 || ATST == 6) // ge, g
{
@ -466,7 +466,7 @@ PS_OUTPUT ps_main(PS_INPUT input)
}
else if(ATST == 7) // ne
{
clip(abs(c.a - AREF) - 0.9f/256);
clip(abs(c.a - AREF) - 0.4f / 255); // FIXME: 0.5f is too much
}
}

View File

@ -285,7 +285,7 @@ float4 ps_main(PS_INPUT input) : COLOR
}
else if(ATST == 4) // e
{
clip(0.9f/256 - abs(c.a - AREF));
clip(0.5f / 256 - abs(c.a - AREF));
}
else if(ATST == 5 || ATST == 6) // ge, g
{
@ -293,7 +293,7 @@ float4 ps_main(PS_INPUT input) : COLOR
}
else if(ATST == 7) // ne
{
clip(abs(c.a - AREF) - 0.9f/256);
clip(abs(c.a - AREF) - 0.4f / 255); // FIXME: 0.5f is too much
}
}