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

Allow u16 index buffers #168

Merged
merged 2 commits into from
Oct 19, 2022
Merged

Allow u16 index buffers #168

merged 2 commits into from
Oct 19, 2022

Conversation

Nazariglez
Copy link
Owner

closes #163

@Nazariglez Nazariglez marked this pull request as ready for review October 19, 2022 18:54
@jawadsh123
Copy link
Collaborator

looking nice 👌

a slightly tangential observation
with_data for all the three buffers takes different i/p

  • for VertexBufferBuilder it takes &[f32]
  • for IndexBufferBuilder it takes &[u32]
  • for UniformBufferBuilder it takes BufferData

while set_buffer_data is buffer agnostic and always takes BufferData
wondering if there's value in unifying all to BufferData?

@Nazariglez
Copy link
Owner Author

We could. Though I am not sure if it is worth it, taking a trait generates worst error messages, I am not sure about if anyone will need to pass other types to the index buffer or the vertex either, and it will add some complexity to the code too. I guess it's possible, not a big fan of it right now if we don't have a strong use case.

What are your thoughts on it?

PD: Closing but we can keep talking about the types.

@Nazariglez Nazariglez merged commit 157cb1f into develop Oct 19, 2022
@Nazariglez Nazariglez deleted the f/index_u16 branch October 19, 2022 22:21
@jawadsh123
Copy link
Collaborator

don't have a strong case for it, was just wondering for consistency 😅
though now that I think about it more deeply, f32 for vertices and u32 for indices actually make total sense for the general use case
and for the odd outliers, set_buffer_data does it :)

@Nazariglez
Copy link
Owner Author

Yeah, methods that do the same with different types... is weird. I see the problem there. Though it may be fine for now. We can revisit this again at any time if you think we need to. Thanks!

@Nazariglez Nazariglez added this to the v0.8.0 milestone Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use different types of index buffers with Pipelines
2 participants