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

Index buffer support for Vertex Buffers #122

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

JustSid
Copy link
Contributor

@JustSid JustSid commented Aug 14, 2020

This adds index buffer support for Vertex Buffer objects. I'm using this to prototype some things outside of our game engine, where a compute shader produces a bunch of vertex data and we have a static index buffer for it (that got imported from a file). Although it's not unreasonable to think that generating a index buffer in a compute shader is another use case. Either way, it was something that I felt was missing for my use case.

Also, I realize that this failed the CI check. Unfortunately I have no idea how to parse the output, so I was hoping you could help me with it. The test shows files that I didn't even touch as re-formatted, and there is a ton of noise (I think?) in there that makes it hard to figure out what exactly it would like to have changed.

@dfranx
Copy link
Owner

dfranx commented Aug 14, 2020

Thank you so much for the PR. I'll give it a try tomorrow.
Also, don't worry about the CI, I have to fix it. It's complaining about my code, haven't run clang-format in a long time..

@JustSid
Copy link
Contributor Author

JustSid commented Aug 14, 2020

Cool! If you are more comfortable that way, you are more then welcome to fix the formatting upstream and I'll pull them and adjust any issues that are left in the PR.

@JustSid
Copy link
Contributor Author

JustSid commented Aug 14, 2020

I added two crash fixes. The first one is saving a Vertex Buffer object that didn't have buffers associated with it. The other is in the preview UI, where it tries to calculate the bounding volume for the vertex buffer. Same deal here, if there is no buffer associated with it, it'll crash.

@dfranx
Copy link
Owner

dfranx commented Aug 15, 2020

I did a small test. I love this change, thank you so much!
Though, there's one problem. The debugger isn't working correctly when using index buffer. It doesn't properly detect which vertices are selected (upper right triangle should be selected in the picture below). If you don't want to bother with that issue, I could fix it once I find more free time.
image

As for the formatting issue, I'll just merge this pull request once it's ready and run clang-format on the whole source code.

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.

2 participants