Closed footballhead closed 4 months ago
Unlike AppendIndex and friends, AppendIndicesU32 doesn't account for INDEX_TYPE_UNDEFINED. Consider:
AppendIndex
AppendIndicesU32
INDEX_TYPE_UNDEFINED
Geometry geometry; Geometry::Create(GeometryCreateInfo{}.IndexType(grfx::INDEX_TYPE_UNDEFINED).AddPosition(), &geometry); std::array<uint32_t, 3> data = {0, 1, 2) geometry.AppendIndicesU32(data.size(), data.data()); EXPECT_EQ(geometry.GetIndexBuffer()->GetSize(), 0);
This test would fail since the data would be written to the index buffer!
This seems like an oversight. The condition has been fixed and tests have been added.
Unlike
AppendIndex
and friends,AppendIndicesU32
doesn't account forINDEX_TYPE_UNDEFINED
. Consider:This test would fail since the data would be written to the index buffer!
This seems like an oversight. The condition has been fixed and tests have been added.