bigwheels
bigwheels copied to clipboard
Require UINT32 type in Geometry::AppendIndicesU32
Unlike AppendIndex
and friends, AppendIndicesU32
doesn't account for INDEX_TYPE_UNDEFINED
. Consider:
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.