GSdx: fix for Vexx, a few vertices were bogus, s/t/q all zero.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5098 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 2012-02-14 19:26:04 +00:00
parent 5d9a5b6ee6
commit f53d70c483
1 changed files with 15 additions and 11 deletions

View File

@ -444,18 +444,14 @@ void GSState::GIFPackedRegHandlerRGBA(const GIFPackedReg* RESTRICT r)
void GSState::GIFPackedRegHandlerSTQ(const GIFPackedReg* RESTRICT r) void GSState::GIFPackedRegHandlerSTQ(const GIFPackedReg* RESTRICT r)
{ {
#if defined(_M_AMD64) GSVector4i st = GSVector4i::loadl(&r->u64[0]);
GSVector4i q = GSVector4i::loadl(&r->u64[1]);
m_v.ST.u64 = r->u64[0]; GSVector4i::storel(&m_v.ST, st);
#else q = q.blend8(GSVector4i::cast(GSVector4::m_one), q == GSVector4i::zero()); // character shadow in Vexx, q = 0 (st also 0 on the first 16 vertices), setting it to 1.0f to avoid div by zero later
GSVector4i v = GSVector4i::loadl(r); *(int*)&m_q = GSVector4i::store(q);
GSVector4i::storel(&m_v.ST.u64, v);
#endif
m_q = r->STQ.Q;
#ifdef Offset_ST #ifdef Offset_ST
GIFRegTEX0 TEX0 = m_context->TEX0; GIFRegTEX0 TEX0 = m_context->TEX0;
@ -539,6 +535,8 @@ void GSState::GIFPackedRegHandlerSTQRGBAXYZF2(const GIFPackedReg* RESTRICT r, ui
GSVector4i q = GSVector4i::loadl(&r[0].u64[1]); GSVector4i q = GSVector4i::loadl(&r[0].u64[1]);
GSVector4i rgba = (GSVector4i::load<false>(&r[1]) & GSVector4i::x000000ff()).ps32().pu16(); GSVector4i rgba = (GSVector4i::load<false>(&r[1]) & GSVector4i::x000000ff()).ps32().pu16();
q = q.blend8(GSVector4i::cast(GSVector4::m_one), q == GSVector4i::zero()); // see GIFPackedRegHandlerSTQ
m_v.m[0] = st.upl64(rgba.upl32(q)); // TODO: only store the last one m_v.m[0] = st.upl64(rgba.upl32(q)); // TODO: only store the last one
GSVector4i xy = GSVector4i::loadl(&r[2].u64[0]); GSVector4i xy = GSVector4i::loadl(&r[2].u64[0]);
@ -569,6 +567,8 @@ void GSState::GIFPackedRegHandlerSTQRGBAXYZ2(const GIFPackedReg* RESTRICT r, uin
GSVector4i q = GSVector4i::loadl(&r[0].u64[1]); GSVector4i q = GSVector4i::loadl(&r[0].u64[1]);
GSVector4i rgba = (GSVector4i::load<false>(&r[1]) & GSVector4i::x000000ff()).ps32().pu16(); GSVector4i rgba = (GSVector4i::load<false>(&r[1]) & GSVector4i::x000000ff()).ps32().pu16();
q = q.blend8(GSVector4i::cast(GSVector4::m_one), q == GSVector4i::zero()); // see GIFPackedRegHandlerSTQ
m_v.m[0] = st.upl64(rgba.upl32(q)); // TODO: only store the last one m_v.m[0] = st.upl64(rgba.upl32(q)); // TODO: only store the last one
GSVector4i xy = GSVector4i::loadl(&r[2].u64[0]); GSVector4i xy = GSVector4i::loadl(&r[2].u64[0]);
@ -638,7 +638,11 @@ void GSState::GIFRegHandlerPRIM(const GIFReg* RESTRICT r)
void GSState::GIFRegHandlerRGBAQ(const GIFReg* RESTRICT r) void GSState::GIFRegHandlerRGBAQ(const GIFReg* RESTRICT r)
{ {
m_v.RGBAQ = (GSVector4i)r->RGBAQ; GSVector4i rgbaq = (GSVector4i)r->RGBAQ;
rgbaq = rgbaq.upl32(rgbaq.blend8(GSVector4i::cast(GSVector4::m_one), rgbaq == GSVector4i::zero()).yyyy()); // see GIFPackedRegHandlerSTQ
m_v.RGBAQ = rgbaq;
} }
void GSState::GIFRegHandlerST(const GIFReg* RESTRICT r) void GSState::GIFRegHandlerST(const GIFReg* RESTRICT r)