| 17 | TestBufferObjectProvider _testBufferObjectProvider; |
| 18 | |
| 19 | inline void verifyAllocation(render::IGeometryStore& store, render::IGeometryStore::Slot slot, |
| 20 | const std::vector<render::RenderVertex>& vertices, const std::vector<unsigned int>& indices) |
| 21 | { |
| 22 | auto renderParms = store.getBufferAddresses(slot); |
| 23 | |
| 24 | auto expectedIndex = indices.begin(); |
| 25 | auto firstVertex = renderParms.clientBufferStart + renderParms.firstVertex; |
| 26 | |
| 27 | EXPECT_EQ(renderParms.indexCount, indices.size()) << "Index count mismatch"; |
| 28 | |
| 29 | for (auto idxPtr = renderParms.clientFirstIndex; idxPtr < renderParms.clientFirstIndex + renderParms.indexCount; ++idxPtr) |
| 30 | { |
| 31 | auto index = *idxPtr; |
| 32 | EXPECT_EQ(index, *expectedIndex) << "Index disorder"; |
| 33 | |
| 34 | // Pick the vertex from our local expectation |
| 35 | const auto& expectedVertex = vertices.at(index); |
| 36 | |
| 37 | // Pick the vertex from the stored set |
| 38 | const auto& vertex = *(firstVertex + index); |
| 39 | |
| 40 | EXPECT_TRUE(math::isNear(vertex.vertex, expectedVertex.vertex, 0.01)) << "Vertex data mismatch"; |
| 41 | EXPECT_TRUE(math::isNear(vertex.texcoord, expectedVertex.texcoord, 0.01)) << "Texcoord data mismatch"; |
| 42 | EXPECT_TRUE(math::isNear(vertex.normal, expectedVertex.normal, 0.01)) << "Normal data mismatch"; |
| 43 | |
| 44 | ++expectedIndex; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | struct Allocation |
| 49 | { |
no test coverage detected