Struct truck_rendimpl::PolygonShaders
source · pub struct PolygonShaders { /* private fields */ }
Expand description
shaders for rendering polygons
Implementations§
source§impl PolygonShaders
impl PolygonShaders
sourcepub const fn new(
vertex_module: Arc<ShaderModule>,
vertex_entry: &'static str,
fragment_module: Arc<ShaderModule>,
fragment_entry: &'static str,
tex_fragment_module: Arc<ShaderModule>,
tex_fragment_entry: &'static str
) -> Self
pub const fn new(
vertex_module: Arc<ShaderModule>,
vertex_entry: &'static str,
fragment_module: Arc<ShaderModule>,
fragment_entry: &'static str,
tex_fragment_module: Arc<ShaderModule>,
tex_fragment_entry: &'static str
) -> Self
Constructor
Parameters
vertex_module
: vertex shader modulevertex_entry
: entry point of vertex shader modulefragment_module
: fragment shader module without texturefragment_entry
: entry point of fragment shader module without texturetex_fragment_module
: fragment shader module with texturetex_fragment_entry
: entry point of fragment shader module with texture
Examples found in repository?
src/instance_creator.rs (lines 40-47)
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
pub fn default(device: &Device) -> Self {
let source = include_str!("shaders/microfacet-module.wgsl").to_string()
+ include_str!("shaders/polygon.wgsl");
let shader_module = Arc::new(device.create_shader_module(ShaderModuleDescriptor {
source: ShaderSource::Wgsl(source.into()),
label: None,
}));
Self::new(
Arc::clone(&shader_module),
"vs_main",
Arc::clone(&shader_module),
"nontex_main",
Arc::clone(&shader_module),
"tex_main",
)
}
Trait Implementations§
source§impl Clone for PolygonShaders
impl Clone for PolygonShaders
source§fn clone(&self) -> PolygonShaders
fn clone(&self) -> PolygonShaders
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more