The entry point takes a borrow of the shader module which is then cloned by the pipeline. So I gotta keep the shader, entry, and modules in a high scope

This commit is contained in:
2019-07-20 04:45:49 -07:00
parent 2327a7f05f
commit 321f30b4cc
3 changed files with 307 additions and 4 deletions

View File

@@ -40,6 +40,10 @@ use image::flat::NormalForm::ColumnMajorPacked;
mod compute_kernel;
use crate::vkprocessor::compute_kernel::ComputeKernel;
mod shader_kernels;
use crate::vkprocessor::shader_kernels::ShaderKernels;
#[derive(Default, Debug, Clone)]
struct tVertex { position: [f32; 2] }
@@ -68,7 +72,7 @@ fn window_size_dependent_setup(
}
#[repr(C)]
#[derive(Clone)]
#[derive(Default, Debug, Clone)]
struct SimpleSpecializationConstants {
first_constant: i32,
second_constant: u32,
@@ -176,7 +180,6 @@ impl<'a> VkProcessor<'a> {
pub fn compile_kernel(&mut self, filename: String) {
self.compute_kernel = Some(ComputeKernel::new(filename, self.device.clone()));
self.compute_pipeline = Some(self.compute_kernel.clone().unwrap().get_pipeline());
}