dotrix icon indicating copy to clipboard operation
dotrix copied to clipboard

Traited Render System and Reload tracking

Open QuantumEntangledAndy opened this issue 3 years ago • 2 comments

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:
    vec![Binding::texture_cube("CubeMap", Stage::Fragment, cubemap)],
    
    instead of this:
    vec![Binding::texture_cube("CubeMap", Stage::Fragment, &cubemap.uniform)],
    
    • This is achieved with the traits in dotrix_core::providers::*
  • Add a reload system to signal when an asset needs to be rebound to the pipeline. There are two kinds of reload, ReloadKind::Update and ReloadKind::Reload the 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 bind of 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.
  • Also a dotrix_derive that 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

QuantumEntangledAndy avatar May 11 '22 02:05 QuantumEntangledAndy

Wow! Going to check it out!

voxelias avatar May 11 '22 09:05 voxelias

I have a few ideas on improvements already but will have to see if they pan out the way I think they will

QuantumEntangledAndy avatar May 11 '22 15:05 QuantumEntangledAndy