Expand description
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
ⓘ
use gfx_shader_watch::*;
use gfx::{Primitive, state::Rasterizer};
gfx_defines! {
pipeline mypipeline {
out: gfx::RenderTarget<gfx::format::Rgba8> = "Target0",
}
}
// 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");
encoder.draw(&slice, pso_cell.pso(), &data);
Modules§
Macros§
- debug_
watcher_ pso_ cell - Returns
WatcherPsoCell
instance when compiled in debug mode,SimplePsoCell
instance when compiled in release mode The type itself can be attained similarly with thedebug_watcher_pso_cell_type
macro - debug_
watcher_ pso_ cell_ type - Returns
WatcherPsoCell
type when compiled in debug mode,SimplePsoCell
type when compiled in release mode Type will match that returned bydebug_watcher_pso_cell
macro
Structs§
- Simple
PsoCell - Container with compile time shader source, pipeline state is build on initialisation
- Simple
PsoCell Builder - Builds
SimplePsoCell
- Watcher
PsoCell - Container that watches shader files and reloads pipeline state object after modification
- Watcher
PsoCell Builder - Builds
WatcherPsoCell
Traits§
- PsoCell
- Container for pipeline state object and a factory