-
Notifications
You must be signed in to change notification settings - Fork 549
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
Mesh-Program attribute matching on bind #37
Conversation
…e shader loading to error instead of failing on attribute or uniform mismatch.
…te matching logic.
How far are we off being able to have an example for this? |
Looks good! Thoughts @csherratt? |
@bjz an example? Sorry if I'm stating the obvious but this code is active already. It's matching mesh data vs shader inputs on every draw call, including the one we do for the triangle. That sample has only one attribute used, so it is a slightly redundant case... but still a case ;) If you just want a bigger example, then the terrain one will suffice. I think we need #19 badly before implementing it. |
The change as a whole looks good, I think it is ok to merge. |
@kvark Awesome, sounds good |
Mesh-Program attribute matching on bind
@csherratt I'm not sure what would be the best way to deal with unrecognized attributes or uniforms. On the one hand, it's not fatal to the execution. We can either ignore binding the attribute/uniform (possibly by simply not registering it on our side), or mark the whole shader program as invalid (preventing all the draw calls with it). Either an On the other hand, I struggle to see the use case where this error happens on a non-developer machine. And the developer (of the shader) should fix it right away. |
Remove branch v0.5
This PR implements actual shader-mesh binding by matching names. This can be cached (as the next step) with a simple
HashMap
that holds the sequence of attribute indices, but I'd rather have all other matching functionality done first (shader parameters is the major one, and there is also a need to match shader outputs).I had to put a simple handle management in place, to be replaced by a proper one with #22.