I'm trying to understand the code below
Quote: float4 v = DefaultBitBltPos();
v = DefaultBitBltTex();
v.x = 1;
v.y = 2;
v.z = PSMT_IS16Z(psm) ? 1.0f : 0.0f;
v.w = g_filog32;
It does not make much sense why v is assigned twice. This code is found at ZZDepthTargets.cpp
float4 CRenderTarget:
efaultBitBltPos()
{
float4 v = float4(1, -1, 0.5f / (float)RW(fbw), 0.5f / (float)RH(fbh));
v *= 1.0f / 32767.0f;
ZZshSetParameter4fv(pvsBitBlt.prog, pvsBitBlt.sBitBltPos, v, "g_sBitBltPos");
return v;
}
// Used to transform texture coordinates from GS (when 0,0 is upper left) to
// OpenGL (0,0 - lower left).
float4 CRenderTarget:
efaultBitBltTex()
{
// I really sure that -0.5 is correct, because OpenGL have no half-offset
// issue, DirectX known for.
float4 v = float4(1, -1, 0.5f / (float)RW(fbw), -0.5f / (float)RH(fbh));
ZZshSetParameter4fv(pvsBitBlt.prog, pvsBitBlt.sBitBltTex, v, "g_sBitBltTex");
return v;
}