VideoLoader: remove VAT_*_FRACBITS

They are used to remove the flush amounts, but as we don't
flush anymore on vertex loader changes (only on native
vertex format right now), this optimization is now unneeded.

This will allow us to hard code the frac factors within the
vertex loaders.
This commit is contained in:
degasus
2014-12-11 22:39:58 +01:00
parent 9b2909357b
commit ec28a80e00
6 changed files with 40 additions and 50 deletions

View File

@ -119,6 +119,7 @@ VertexLoader::VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr)
VertexLoader_TextCoord::Init();
m_VtxDesc = vtx_desc;
m_vat = vtx_attr;
SetVAT(vtx_attr);
#ifdef USE_VERTEX_LOADER_JIT
@ -444,21 +445,10 @@ void VertexLoader::WriteSetVariable(int bits, void *address, OpArg value)
}
#endif
void VertexLoader::SetupRunVertices(const VAT& vat, int primitive, int const count)
void VertexLoader::SetupRunVertices(int primitive, int const count)
{
m_numLoadedVertices += count;
// Load position and texcoord scale factors.
m_VtxAttr.PosFrac = vat.g0.PosFrac;
m_VtxAttr.texCoord[0].Frac = vat.g0.Tex0Frac;
m_VtxAttr.texCoord[1].Frac = vat.g1.Tex1Frac;
m_VtxAttr.texCoord[2].Frac = vat.g1.Tex2Frac;
m_VtxAttr.texCoord[3].Frac = vat.g1.Tex3Frac;
m_VtxAttr.texCoord[4].Frac = vat.g2.Tex4Frac;
m_VtxAttr.texCoord[5].Frac = vat.g2.Tex5Frac;
m_VtxAttr.texCoord[6].Frac = vat.g2.Tex6Frac;
m_VtxAttr.texCoord[7].Frac = vat.g2.Tex7Frac;
posScale[0] = posScale[1] = posScale[2] = posScale[3] = fractionTable[m_VtxAttr.PosFrac];
if (m_native_components & VB_HAS_UVALL)
for (int i = 0; i < 8; i++)
@ -468,7 +458,7 @@ void VertexLoader::SetupRunVertices(const VAT& vat, int primitive, int const cou
// Prepare bounding box
if (!g_ActiveConfig.backend_info.bSupportsBBox)
BoundingBox::Prepare(vat, primitive, m_VtxDesc, m_native_vtx_decl);
BoundingBox::Prepare(m_vat, primitive, m_VtxDesc, m_native_vtx_decl);
}
void VertexLoader::ConvertVertices ( int count )
@ -491,11 +481,11 @@ void VertexLoader::ConvertVertices ( int count )
#endif
}
int VertexLoader::RunVertices(const VAT& vat, int primitive, int count, DataReader src, DataReader dst)
int VertexLoader::RunVertices(int primitive, int count, DataReader src, DataReader dst)
{
dst.WritePointer(&g_vertex_manager_write_ptr);
src.WritePointer(&g_video_buffer_read_ptr);
SetupRunVertices(vat, primitive, count);
SetupRunVertices(primitive, count);
ConvertVertices(count);
return count;
}