|
|
|
@ -50,10 +50,10 @@ impl CompuSprite {
|
|
|
|
|
|
|
|
|
|
CompuSprite {
|
|
|
|
|
vertices: [
|
|
|
|
|
(position.0, position.1), // top left
|
|
|
|
|
(position.0, position.1), // top left
|
|
|
|
|
(position.0, position.1 + fsize.1), // bottom left
|
|
|
|
|
(position.0 + fsize.0, position.1 + fsize.1), // bottom right
|
|
|
|
|
(position.0, position.1), // top left
|
|
|
|
|
(position.0, position.1), // top left
|
|
|
|
|
(position.0 + fsize.0, position.1 + fsize.1), // bottom right
|
|
|
|
|
(position.0 + fsize.0, position.1), // top right
|
|
|
|
|
],
|
|
|
|
@ -215,15 +215,6 @@ impl CompuState {
|
|
|
|
|
mut command_buffer: AutoCommandBufferBuilder,
|
|
|
|
|
canvas: &Canvas)
|
|
|
|
|
-> AutoCommandBufferBuilder {
|
|
|
|
|
/*
|
|
|
|
|
let mut command_buffer,, = command_buffer.dispatch([100, 100, 1],
|
|
|
|
|
self.compute_kernel.clone().unwrap().clone().get_pipeline(),
|
|
|
|
|
self.compute_image.clone().unwrap().clone()
|
|
|
|
|
.get_descriptor_set(self.compute_kernel.clone().unwrap().clone().get_pipeline()).clone(), ()).unwrap()
|
|
|
|
|
|
|
|
|
|
.copy_buffer_to_image(self.compute_image.clone().unwrap().clone().rw_buffers.get(0).unwrap().clone(),
|
|
|
|
|
self.compute_image.clone().unwrap().clone().get_swap_buffer().clone()).unwrap();
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// i = (Buffer, Kernel)
|
|
|
|
|
for i in compute_frame.pure_compute {
|
|
|
|
@ -260,17 +251,24 @@ impl CompuState {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// i = (Input Buffer, Output Buffer, Kernel)
|
|
|
|
|
// Input buffer -> Kernel -> Output buffer
|
|
|
|
|
for i in compute_frame.swapped_to_buffer {
|
|
|
|
|
let buffer_id = (*i.0).clone() as usize;
|
|
|
|
|
let kernel_id = (*i.1).clone() as usize;
|
|
|
|
|
let input_buffer_id = (*i.0).clone() as usize;
|
|
|
|
|
let output_buffer_id = (*i.1).clone() as usize;
|
|
|
|
|
let kernel_id = (*i.2).clone() as usize;
|
|
|
|
|
|
|
|
|
|
let buffer = self.compute_buffers.get(buffer_id).unwrap();
|
|
|
|
|
let kernel = self.kernels.get(buffer_id).unwrap();
|
|
|
|
|
let input_buffer = self.compute_buffers.get(input_buffer_id).unwrap();
|
|
|
|
|
let output_buffer = self.compute_buffers.get(output_buffer_id).unwrap();
|
|
|
|
|
let kernel = self.kernels.get(kernel_id).unwrap();
|
|
|
|
|
|
|
|
|
|
let p = kernel.clone().get_pipeline();
|
|
|
|
|
let d = buffer.get_descriptor_set(kernel.clone().get_pipeline());
|
|
|
|
|
let pipeline = kernel.clone().get_pipeline();
|
|
|
|
|
let descriptor_set = input_buffer.get_descriptor_set(kernel.clone().get_pipeline());
|
|
|
|
|
|
|
|
|
|
command_buffer = command_buffer.dispatch([100,100,1], p, d, ()).unwrap()
|
|
|
|
|
command_buffer = command_buffer
|
|
|
|
|
.dispatch([100,100,1], pipeline, descriptor_set, ()).unwrap()
|
|
|
|
|
.copy_buffer(
|
|
|
|
|
input_buffer.io_buffers.get(1).unwrap().clone(),
|
|
|
|
|
output_buffer.io_buffers.get(0).unwrap().clone()).unwrap();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
command_buffer
|
|
|
|
|