Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require UINT32 type in Geometry::AppendIndicesU32 #490

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

footballhead
Copy link
Collaborator

@footballhead footballhead commented Jul 5, 2024

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.

Unlike AppendIndex and friends, AppendIndices32 doesn't account for
INDEX_TYPE_UNDEFINED. This seems like an oversight. The condition has
been fixed and tests have been added.
@footballhead footballhead changed the title Require UINT32 type in Geometry::AppendIndices32 Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants