[−][src]Crate gfx_shader_watch
Provides ability to change shader source files and have them reload on the fly. Also provides macros to simply include the shader code at compile time when running in release mode.
Examples
#[macro_use] extern crate gfx; #[macro_use] extern crate gfx_shader_watch; use gfx_shader_watch::*; use gfx::Primitive; use gfx::state::Rasterizer; pub fn main() { // {code to setup window / gfx factory etc } // Container has SimplePsoCell or WatcherPsoCell type, depending on compile mode // if you need to refer to the type, use the `debug_watcher_pso_cell_type!` macro let mut pso_cell = debug_watcher_pso_cell!( pipe = mypipeline, vertex_shader = "shader/vert.glsl", fragment_shader = "shader/frag.glsl", factory = factory, primitive = Primitive::TriangleList, rasterizer = Rasterizer::new_fill()).expect("psocell"); let mut running = true; while running { // ... encoder.draw(&slice, pso_cell.pso(), &data); // ... } }
Modules
macros |
Macros
debug_watcher_pso_cell | Returns |
debug_watcher_pso_cell_type | Returns |
Structs
SimplePsoCell | Container with compile time shader source, pipeline state is build on initialisation |
SimplePsoCellBuilder | Builds |
WatcherPsoCell | Container that watches shader files and reloads pipeline state object after modification |
WatcherPsoCellBuilder | Builds |
Traits
PsoCell | Container for pipeline state object and a factory |