It was the gamma being wrong. Interesting how much different this is working than SFML+OpenCL

This commit is contained in:
2019-07-18 23:43:55 -07:00
parent 58f5289a3b
commit e476cb2e4e
4 changed files with 43 additions and 66 deletions

View File

@@ -78,7 +78,7 @@ fn main() {
processor.compile_kernel(String::from("simple-edge.compute"));
processor.compile_shaders(String::from("simple_texture"), &surface);
processor.load_buffers(String::from("funky-bird.jpg"));
processor.load_buffers(String::from("background.jpg"));
let mut timer = Timer::new();

View File

@@ -487,18 +487,10 @@ impl<'a> VkProcessor<'a> {
self.vertex_buffer = Some(vertex_buffer);
let (texture, tex_future) = {
let image = image::load_from_memory_with_format(include_bytes!("../resources/images/funky-bird.jpg"),
ImageFormat::JPEG).unwrap().to_rgba();
println!("{}", image.len());
println!("{}", self.image_buffer.len());
let dimensions = image.dimensions();
let image_data = image.into_raw().clone();
ImmutableImage::from_iter(
image_data.iter().cloned(),
Dimensions::Dim2d { width: dimensions.0, height: dimensions.1 },
self.image_buffer.iter().cloned(),
Dimensions::Dim2d { width: self.xy.0, height: self.xy.1 },
Format::R8G8B8A8Srgb,
self.queue.clone()
// self.image_buffer.iter().cloned(),
@@ -508,10 +500,6 @@ impl<'a> VkProcessor<'a> {
};
let attachment_image = {
let image = image::load_from_memory_with_format(include_bytes!("../resources/images/funky-bird.jpg"),
ImageFormat::JPEG).unwrap().to_rgba();
let dimensions = image.dimensions();
let image_data = image.into_raw().clone();
let mut usage = ImageUsage::none();
usage.transfer_destination = true;
@@ -519,7 +507,7 @@ impl<'a> VkProcessor<'a> {
AttachmentImage::with_usage(
self.device.clone(),
[dimensions.0, dimensions.1],
[self.xy.0, self.xy.1],
Format::R8G8B8A8Uint,
usage)
};