gfx_scene icon indicating copy to clipboard operation
gfx_scene copied to clipboard

Support for shader compositing

Open kvark opened this issue 10 years ago • 2 comments

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 on Technique::compile, we can do it in a backward-compatible manner later.

kvark avatar Feb 23 '15 17:02 kvark

Alternatively, one can just use RefCell to cache programs inside the Technique implementation to hack around &self.

kvark avatar Mar 15 '15 20:03 kvark

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.

kvark avatar May 04 '15 21:05 kvark