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

Current problems with shader parameters #312

Closed
kvark opened this issue Aug 29, 2014 · 1 comment
Closed

Current problems with shader parameters #312

kvark opened this issue Aug 29, 2014 · 1 comment

Comments

@kvark
Copy link
Member

kvark commented Aug 29, 2014

I know we've come a long way to the current structure of shader parameters. We've definitely got an interesting approach working, but now as the dust settles down I can see the problems to still be solved:

  • The existence of a hidden link structure for any parameter structure. It forces us to have a typedef for the batch types. It all works smooth but not straightforward to understand. We need it more streamlined. Even something like let batch: RefBatch<MyParam> = context.batch(...) would be much better.
  • ShaderParam::create_link is polymorphic in compile time. It is good for user-provided structures, because it allows to create a batch without having an instance of the parameter structure. However, it prevents efficient serializable formats for shader parameters (where we'd want run-time checks instead of compile-time).
  • User structures enforce types of simple uniforms in compile time, but the textures are completely unprotected. It would be best to have the compile-time enforcement of sorts there, if possible, or at least run-time checks at the place of parameter setup, and not during the draw call. Our calls should not fail!

When looking for the solutions, we've got to keep in mind the strong points of the current system, in order to avoid regression:

  • User structure is totally controlled by the user (we don't change it with an attribute).
  • Simple uniforms are compile-time enforced.

Need some heavy brains here! Summoning @bjz, @cmr, @csherratt, @sectopod, and @bvssvni

@kvark
Copy link
Member Author

kvark commented Jan 30, 2015

This is mostly resolved:

@kvark kvark closed this as completed Jan 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant