Introduce Pipeline trait in wgpu::primitive

Co-authored-by: roguetechh <roguedotllc@gmail.com>
This commit is contained in:
Héctor Ramón Jiménez 2025-11-25 09:36:25 +01:00
parent a4829306cb
commit e937bf2bac
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 61 additions and 44 deletions

View file

@ -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)
}
}