Open kvark opened 9 years ago
Alternatively, one can just use RefCell
to cache programs inside the Technique
implementation to hack around &self
.
Another problem is that creating new programs on the fly requires &mut Factory
, which is nowhere near. I need to ether change the interface to include it as a param (with &mut self
), or find another way.
Technique
interface assumes it's an immutable thing. With shader composting, we might not want to pre-compile all the programs in advance (even though it would work now, and it's not a bad idea to prevent hitches on the way). If a technique wants to link shader programs, it also probably wants to cache them.It's just a matter of changing
self
onTechnique::compile
, we can do it in a backward-compatible manner later.