forked shade_runner and added compiler options. Going to add buttons along with a workflow for picking swatches

This commit is contained in:
2019-07-07 01:00:26 -07:00
parent 942ff4035d
commit 820b99ae4e
5 changed files with 50 additions and 5 deletions

View File

@@ -15,8 +15,9 @@ use image::{DynamicImage, ImageBuffer};
use image::GenericImageView;
use vulkano::descriptor::pipeline_layout::PipelineLayout;
use image::GenericImage;
use shade_runner::ComputeLayout;
use shade_runner::{ComputeLayout, CompileError};
use vulkano::descriptor::descriptor_set::PersistentDescriptorSetBuf;
use shaderc::CompileOptions;
pub struct VkProcessor<'a> {
pub instance: Arc<Instance>,
@@ -68,8 +69,15 @@ impl<'a> VkProcessor<'a> {
compute_path.push(PathBuf::from("resources/shaders/"));
compute_path.push(PathBuf::from(filename));
let mut options = CompileOptions::new().ok_or(CompileError::CreateCompiler).unwrap();
options.add_macro_definition("SETTING_POS_X", Some("0"));
options.add_macro_definition("SETTING_POS_Y", Some("1"));
options.add_macro_definition("SETTING_BUCKETS_START", Some("2"));
options.add_macro_definition("SETTING_BUCKETS_LEN", Some("2"));
let shader =
sr::load_compute(compute_path)
sr::load_compute_with_options(compute_path, options)
.expect("Failed to compile");
let vulkano_entry =