.
This commit is contained in:
20
src/main.rs
20
src/main.rs
@@ -87,7 +87,7 @@ pub fn main() {
|
||||
let mut accumulator_time: f32 = 0.0;
|
||||
let mut current_time: f32 = timer.elap_time();
|
||||
|
||||
let image_data = load_raw(String::from("funky-bird.jpg"));
|
||||
let image_data = load_raw(String::from("ford2.jpg"));
|
||||
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 compu_sprite1: CompuSprite =
|
||||
@@ -95,9 +95,6 @@ pub fn main() {
|
||||
// Swap image to render the result to. Must match dimensions
|
||||
processor.new_swap_image(image_dimensions_u));
|
||||
|
||||
|
||||
// Demo gpu toolpath generation
|
||||
|
||||
// Need to
|
||||
let compute_buffer: Arc<CompuBufferHandle> =
|
||||
processor.new_compute_buffer(image_data.0.clone(), image_data.1, 4);
|
||||
@@ -149,6 +146,16 @@ pub fn main() {
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Events loop is borrowed from the surface
|
||||
events_loop.run(move |event, _, control_flow| {
|
||||
match event {
|
||||
@@ -163,15 +170,12 @@ pub fn main() {
|
||||
let mut canvas_frame = CanvasFrame::default();
|
||||
canvas_frame.draw(&funky_sprite);
|
||||
canvas_frame.draw(&text_sprite);
|
||||
// canvas_frame.draw(&rect);
|
||||
canvas_frame.draw(&compu_sprite1);
|
||||
|
||||
let mut compu_frame = CompuFrame::new();
|
||||
//compu_frame.add(compute_buffer.clone(), compute_kernel.clone());
|
||||
compu_frame.add_with_image_swap(compute_buffer.clone(), compute_kernel.clone(), &compu_sprite1);
|
||||
compu_frame.add(compute_buffer.clone(), compute_kernel.clone());
|
||||
|
||||
canvas_frame.draw(&compu_sprite1);
|
||||
|
||||
{
|
||||
let g = hprof::enter("Run");
|
||||
processor.run(&surface.clone(),
|
||||
|
||||
Reference in New Issue
Block a user