comes together fast when you actually use the library correctly. compute works

This commit is contained in:
2020-09-18 00:19:17 -07:00
parent 34b5d7b3d0
commit e7bbf1f1db
3 changed files with 24 additions and 39 deletions

View File

@@ -68,18 +68,13 @@ struct EventSystem;
impl<'a> System<'a> for EventSystem {
type SystemData = (
WriteStorage<'a, Render>,
Write<'a, PersistentState>,
Write<'a, VkProcessor>,
Write<'a, Vec<TrEvent<TrEventExtension>>>
);
fn run(&mut self, (mut draw, mut state, mut vk_processor, event_stack): Self::SystemData) {
// for draw_data in (&mut draw).join() {
// for event in event_stack.iter() {
// draw_data.0.notify(event)
// }
// }
fn run(&mut self, (mut state, mut vk_processor, event_stack): Self::SystemData) {
}
}
@@ -126,7 +121,6 @@ pub fn main() {
let image_dimensions_f: (f32, f32) = ((image_data.1).clone().0 as f32, (image_data.1).clone().1 as f32);
let image_dimensions_u: (u32, u32) = image_data.1;
let compute_buffer: Arc<CompuBufferHandle> =
processor.new_compute_buffer(image_data.0.clone(), image_data.1, 4);
@@ -162,6 +156,12 @@ pub fn main() {
compu_frame: CompuFrame::new((0, 0)),
});
world.create_entity()
.with(Compu { kernels: vec![compute_kernel], buffers: vec![compute_buffer] })// just a drawable
.with(Geometry { size_x: 300.0, size_y: 300.0, rotation: 0.0 })
.with(Images { images: vec![compu_image.clone()], image_resolutions: vec![image_dimensions_u] })
.build();
world.create_entity()
.with(Render { vertices: vec![] })// just a drawable
.with(Position { x: 0.0, y: 0.0, z: 0 })
@@ -170,8 +170,8 @@ pub fn main() {
.build();
world.create_entity()
.with(Render { vertices: vec![] })// just a drawable
.with(Position { x: 600.0, y: 500.0, z: 0 })
.with(Render { vertices: vec![] })
.with(Position { x: 900.0, y: 900.0, z: 0 })
.with(Geometry { size_x: 600.0, size_y: 600.0, rotation: 0.0 })
.with(Images { images: vec![compu_image], image_resolutions: vec![image_dimensions_u] })
.build();
@@ -183,7 +183,6 @@ pub fn main() {
.with(CompuSystem, "compu_s", &["event_s"])
.with(RenderSystem, "render_s", &["event_s", "compu_s"]).build();
let event_loop_proxy = events_loop.create_proxy();
std::thread::spawn(move || {