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

Clean up handling of vertex formats #2674

Merged
merged 3 commits into from
Aug 25, 2024
Merged

Conversation

jellysquid3
Copy link
Member

@jellysquid3 jellysquid3 commented Aug 16, 2024

Minecraft 1.21 makes it unnecessary for us to keep track of our own VertexFormatDescription, because they now have the same information we were trying to unpack/cache.

Additionally, they have also implemented something very similar to our element masking approach for BufferBuilder, so it's no longer possible for mods to create vertex formats with the same element type specified multiple times. Since they don't care, and mods can't do it anymore, we can avoid checking whether a vertex format is not "simple".

To finally get rid of the VertexFormatDescription, the VertexFormat class was extended to store a global identifier, which can then be used to create VertexSerializer identifiers. This isn't really any different from before, but the identifier is stored in the VertexFormat directly now and avoids a hash table lookup.

Minecraft 1.21 makes it unnecessary for us to keep track
of our own VertexFormatDescription.

Additionally, it's no longer possible for mods to create
vertex formats with the same element type specified
multiple times, so we can avoid checking for it.
@jellysquid3 jellysquid3 added T-enhancement Type: Enhancement A-refactor Area: Refactoring labels Aug 16, 2024
@IMS212
Copy link
Member

IMS212 commented Aug 17, 2024

Should CommonVertexAttribute be deleted?

@jellysquid3 jellysquid3 merged commit b94deee into dev Aug 25, 2024
2 checks passed
@jellysquid3 jellysquid3 deleted the patch/cleanup-vertex-format branch October 26, 2024 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-refactor Area: Refactoring T-enhancement Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants