diff --git a/plugins/GSdx/GSRendererSW.cpp b/plugins/GSdx/GSRendererSW.cpp index 5635624a21..de9e28fb58 100644 --- a/plugins/GSdx/GSRendererSW.cpp +++ b/plugins/GSdx/GSRendererSW.cpp @@ -766,6 +766,11 @@ void GSRendererSW::VertexKick(bool skip) dst.c = GSVector4::rgba32(m_v.RGBAQ.u32[0], 7); + if(prim == GS_SPRITE) + { + dst.t.u32[3] = m_v.XYZ.Z; + } + int count = 0; if(GSVertexSW* v = DrawingKick(skip, count)) diff --git a/plugins/GSdx/GSSetupPrimCodeGenerator.x86.avx.cpp b/plugins/GSdx/GSSetupPrimCodeGenerator.x86.avx.cpp index 8620124946..5e2d664bcd 100644 --- a/plugins/GSdx/GSSetupPrimCodeGenerator.x86.avx.cpp +++ b/plugins/GSdx/GSSetupPrimCodeGenerator.x86.avx.cpp @@ -123,6 +123,12 @@ void GSSetupPrimCodeGenerator::Depth() if(m_en.z) { + // uint32 z is bypassed in t.w + + vmovdqa(xmm0, ptr[ecx + offsetof(GSVertexSW, t)]); + vpshufd(xmm0, xmm0, _MM_SHUFFLE(3, 3, 3, 3)); + +/* // GSVector4 z = p.zzzz(); vshufps(xmm0, xmm0, _MM_SHUFFLE(2, 2, 2, 2)); @@ -149,6 +155,7 @@ void GSSetupPrimCodeGenerator::Depth() vcvttps2dq(xmm0, xmm0); } +*/ vmovdqa(ptr[&m_local.p.z], xmm0); } diff --git a/plugins/GSdx/GSSetupPrimCodeGenerator.x86.cpp b/plugins/GSdx/GSSetupPrimCodeGenerator.x86.cpp index 67be7a7b36..5066928b20 100644 --- a/plugins/GSdx/GSSetupPrimCodeGenerator.x86.cpp +++ b/plugins/GSdx/GSSetupPrimCodeGenerator.x86.cpp @@ -128,6 +128,12 @@ void GSSetupPrimCodeGenerator::Depth() if(m_en.z) { + // uint32 z is bypassed in t.w + + movdqa(xmm0, ptr[ecx + offsetof(GSVertexSW, t)]); + pshufd(xmm0, xmm0, _MM_SHUFFLE(3, 3, 3, 3)); + + /* // GSVector4 z = p.zzzz(); shufps(xmm0, xmm0, _MM_SHUFFLE(2, 2, 2, 2)); @@ -154,6 +160,7 @@ void GSSetupPrimCodeGenerator::Depth() cvttps2dq(xmm0, xmm0); } + */ movdqa(ptr[&m_local.p.z], xmm0); }