You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
"ShaderParam::create_link is polymorphic" - it is optional now (see the first parameter). When the user knows shader parameters in advance, we need compile-time binding. When he/she doesn't - we need run-time. Currently we support both.
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:
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).When looking for the solutions, we've got to keep in mind the strong points of the current system, in order to avoid regression:
Need some heavy brains here! Summoning @bjz, @cmr, @csherratt, @sectopod, and @bvssvni
The text was updated successfully, but these errors were encountered: