Introduce Pipeline trait in wgpu::primitive
Co-authored-by: roguetechh <roguedotllc@gmail.com>
This commit is contained in:
parent
a4829306cb
commit
e937bf2bac
5 changed files with 61 additions and 44 deletions
|
|
@ -128,16 +128,7 @@ impl Primitive {
|
|||
}
|
||||
|
||||
impl shader::Primitive for Primitive {
|
||||
type Renderer = Pipeline;
|
||||
|
||||
fn initialize(
|
||||
&self,
|
||||
device: &wgpu::Device,
|
||||
queue: &wgpu::Queue,
|
||||
format: wgpu::TextureFormat,
|
||||
) -> Pipeline {
|
||||
Pipeline::new(device, queue, format)
|
||||
}
|
||||
type Pipeline = Pipeline;
|
||||
|
||||
fn prepare(
|
||||
&self,
|
||||
|
|
@ -183,3 +174,13 @@ fn rnd_origin() -> Vec3 {
|
|||
rand::thread_rng().gen_range(-4.0..2.0),
|
||||
)
|
||||
}
|
||||
|
||||
impl shader::Pipeline for Pipeline {
|
||||
fn new(
|
||||
device: &wgpu::Device,
|
||||
queue: &wgpu::Queue,
|
||||
format: wgpu::TextureFormat,
|
||||
) -> Pipeline {
|
||||
Self::new(device, queue, format)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue