dotrix
dotrix copied to clipboard
Traited Render System and Reload tracking
Depends on #170
This is a bit of a bigger PR that adds the following:
- Use traits for binding to the pipeline. This means we can bind like this:
instead of this:vec![Binding::texture_cube("CubeMap", Stage::Fragment, cubemap)],vec![Binding::texture_cube("CubeMap", Stage::Fragment, &cubemap.uniform)],- This is achieved with the traits in
dotrix_core::providers::*
- This is achieved with the traits in
- Add a reload system to signal when an asset needs to be rebound to the pipeline.
There are two kinds of reload,
ReloadKind::UpdateandReloadKind::Reloadthe first is when data was updated but not the length of the buffer or dimensions of the texture, the second is when these are changed and when a rebind is required.- This rebind is done automatically during a
bindof the pipeline. Which is now a no-op if no rebind has been signalled as required. We can therefore just bind everyframe and let the underlying system handle checking for the need to rebinding.
- This rebind is done automatically during a
- Also a
dotrix_derivethat adds derive macros to help add reloadable and other traits
Comments are requested as this is kinda far reaching in its effects and we can maybe discuss alternative methods and techniques
Wow! Going to check it out!
I have a few ideas on improvements already but will have to see if they pan out the way I think they will