VertexLoaderManager: assimilate GetVertexSize()

This commit is contained in:
Tillmann Karras 2015-01-31 09:23:50 +01:00
parent d50b330d57
commit 1aac65f988
3 changed files with 14 additions and 31 deletions

View file

@ -265,28 +265,18 @@ u8* OpcodeDecoder_Run(DataReader src, u32* cycles, bool in_display_list)
if (src.size() < 2)
goto end;
u16 num_vertices = src.Read<u16>();
int bytes = VertexLoaderManager::RunVertices(
cmd_byte & GX_VAT_MASK, // Vertex loader index (0 - 7)
(cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT,
num_vertices,
src,
g_bSkipCurrentFrame,
is_preprocess);
if (is_preprocess)
{
size_t size = num_vertices * VertexLoaderManager::GetVertexSize(cmd_byte & GX_VAT_MASK, is_preprocess);
if (src.size() < size)
goto end;
src.Skip(size);
}
else
{
int bytes = VertexLoaderManager::RunVertices(
cmd_byte & GX_VAT_MASK, // Vertex loader index (0 - 7)
(cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT,
num_vertices,
src,
g_bSkipCurrentFrame);
if (bytes < 0)
goto end;
if (bytes < 0)
goto end;
else
src.Skip(bytes);
}
src.Skip(bytes);
// 4 GPU ticks per vertex, 3 CPU ticks per GPU tick
totalCycles += num_vertices * 4 * 3 + 6;