Exemplo n.º 1
0
	void RunVertices(int count, int expected_count = -1)
	{
		if (expected_count == -1)
			expected_count = count;
		ResetPointers();
		int actual_count = m_loader->RunVertices(m_src, m_dst, count);
		EXPECT_EQ(actual_count, expected_count);
	}
Exemplo n.º 2
0
	void SetUp() override
	{
		memset(&input_memory[0], 0, sizeof (input_memory));
		memset(&output_memory[0], 0, sizeof (input_memory));

		memset(&m_vtx_desc, 0, sizeof (m_vtx_desc));
		memset(&m_vtx_attr, 0, sizeof (m_vtx_attr));

		ResetPointers();
	}
Exemplo n.º 3
0
	void SetUp() override
	{
		memset(input_memory, 0, sizeof(input_memory));
		memset(output_memory, 0xFF, sizeof(input_memory));

		memset(&m_vtx_desc, 0, sizeof(m_vtx_desc));
		memset(&m_vtx_attr, 0, sizeof(m_vtx_attr));

		m_loader = nullptr;

		ResetPointers();
	}
Exemplo n.º 4
0
void GIDList::clean(void)
{
    IDNode *node = GetHead(), *next_node;

    while(node)
    {
        decc();
        next_node = node->GetNext();
        if(cleanup() == ListBase::active)
            delete node;
        node = next_node;
    }
    ResetPointers();
}
Exemplo n.º 5
0
TEST_F(VertexLoaderTest, PositionDirectU16XYSpeed)
{
	m_vtx_desc.Position = 1;        // Direct
	m_vtx_attr.g0.PosElements = 0;  // XY
	m_vtx_attr.g0.PosFormat = 2;    // U16

	VertexLoaderBase* loader = VertexLoaderBase::CreateVertexLoader(m_vtx_desc, m_vtx_attr);

	ASSERT_EQ(3 * sizeof (float), (u32)loader->m_native_vtx_decl.stride);
	ASSERT_EQ(2 * sizeof (u16), (u32)loader->m_VertexSize);

	for (int i = 0; i < 1000; ++i)
	{
		ResetPointers();
		int count = loader->RunVertices(7, 100000, src, dst);
		src.Skip(100000 * loader->m_VertexSize);
		dst.Skip(count * loader->m_native_vtx_decl.stride);
	}
	delete loader;
}
Exemplo n.º 6
0
TEST_F(VertexLoaderTest, LargeFloatVertexSpeed)
{
	// Enables most attributes in floating point direct mode to test speed.
	m_vtx_desc.PosMatIdx = 1;
	m_vtx_desc.Tex0MatIdx = 1;
	m_vtx_desc.Tex1MatIdx = 1;
	m_vtx_desc.Tex2MatIdx = 1;
	m_vtx_desc.Tex3MatIdx = 1;
	m_vtx_desc.Tex4MatIdx = 1;
	m_vtx_desc.Tex5MatIdx = 1;
	m_vtx_desc.Tex6MatIdx = 1;
	m_vtx_desc.Tex7MatIdx = 1;
	m_vtx_desc.Position = 1;
	m_vtx_desc.Normal = 1;
	m_vtx_desc.Color0 = 1;
	m_vtx_desc.Color1 = 1;
	m_vtx_desc.Tex0Coord = 1;
	m_vtx_desc.Tex1Coord = 1;
	m_vtx_desc.Tex2Coord = 1;
	m_vtx_desc.Tex3Coord = 1;
	m_vtx_desc.Tex4Coord = 1;
	m_vtx_desc.Tex5Coord = 1;
	m_vtx_desc.Tex6Coord = 1;
	m_vtx_desc.Tex7Coord = 1;

	m_vtx_attr.g0.PosElements = 1;        // XYZ
	m_vtx_attr.g0.PosFormat = 4;          // Float
	m_vtx_attr.g0.NormalElements = 1;     // NBT
	m_vtx_attr.g0.NormalFormat = 4;       // Float
	m_vtx_attr.g0.Color0Elements = 1;     // Has Alpha
	m_vtx_attr.g0.Color0Comp = 5;         // RGBA8888
	m_vtx_attr.g0.Color1Elements = 1;     // Has Alpha
	m_vtx_attr.g0.Color1Comp = 5;         // RGBA8888
	m_vtx_attr.g0.Tex0CoordElements = 1;  // ST
	m_vtx_attr.g0.Tex0CoordFormat = 4;    // Float
	m_vtx_attr.g1.Tex1CoordElements = 1;  // ST
	m_vtx_attr.g1.Tex1CoordFormat = 4;    // Float
	m_vtx_attr.g1.Tex2CoordElements = 1;  // ST
	m_vtx_attr.g1.Tex2CoordFormat = 4;    // Float
	m_vtx_attr.g1.Tex3CoordElements = 1;  // ST
	m_vtx_attr.g1.Tex3CoordFormat = 4;    // Float
	m_vtx_attr.g1.Tex4CoordElements = 1;  // ST
	m_vtx_attr.g1.Tex4CoordFormat = 4;    // Float
	m_vtx_attr.g2.Tex5CoordElements = 1;  // ST
	m_vtx_attr.g2.Tex5CoordFormat = 4;    // Float
	m_vtx_attr.g2.Tex6CoordElements = 1;  // ST
	m_vtx_attr.g2.Tex6CoordFormat = 4;    // Float
	m_vtx_attr.g2.Tex7CoordElements = 1;  // ST
	m_vtx_attr.g2.Tex7CoordFormat = 4;    // Float

	VertexLoaderBase* loader = VertexLoaderBase::CreateVertexLoader(m_vtx_desc, m_vtx_attr);

	// This test is only done 100x in a row since it's ~20x slower using the
	// current vertex loader implementation.
	for (int i = 0; i < 100; ++i)
	{
		ResetPointers();
		int count = loader->RunVertices(7, 100000, src, dst);
		src.Skip(100000 * loader->m_VertexSize);
		dst.Skip(count * loader->m_native_vtx_decl.stride);
	}
	delete loader;
}