|
|
@ -32,7 +32,7 @@ use vulkano::pipeline::viewport::Viewport;
|
|
|
|
use image::ImageFormat;
|
|
|
|
use image::ImageFormat;
|
|
|
|
use vulkano::image::immutable::ImmutableImage;
|
|
|
|
use vulkano::image::immutable::ImmutableImage;
|
|
|
|
use vulkano::image::attachment::AttachmentImage;
|
|
|
|
use vulkano::image::attachment::AttachmentImage;
|
|
|
|
use vulkano::image::{Dimensions, ImageUsage};
|
|
|
|
use vulkano::image::{Dimensions, ImageUsage, ImageAccess, ImageDimensions};
|
|
|
|
use vulkano::format::Format;
|
|
|
|
use vulkano::format::Format;
|
|
|
|
use vulkano::sampler::{Sampler, Filter, MipmapMode, SamplerAddressMode};
|
|
|
|
use vulkano::sampler::{Sampler, Filter, MipmapMode, SamplerAddressMode};
|
|
|
|
use image::flat::NormalForm::ColumnMajorPacked;
|
|
|
|
use image::flat::NormalForm::ColumnMajorPacked;
|
|
|
@ -57,7 +57,7 @@ fn window_size_dependent_setup(
|
|
|
|
|
|
|
|
|
|
|
|
let viewport = Viewport {
|
|
|
|
let viewport = Viewport {
|
|
|
|
origin: [0.0, 0.0],
|
|
|
|
origin: [0.0, 0.0],
|
|
|
|
dimensions: [dimensions[0] as f32, dimensions[1] as f32],
|
|
|
|
dimensions: [dimensions.width() as f32, dimensions.height() as f32],
|
|
|
|
depth_range: 0.0..1.0,
|
|
|
|
depth_range: 0.0..1.0,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
dynamic_state.viewports = Some(vec!(viewport));
|
|
|
|
dynamic_state.viewports = Some(vec!(viewport));
|
|
|
@ -129,6 +129,11 @@ pub struct VkProcessor<'a> {
|
|
|
|
pub vertex_buffer: Option<Arc<(dyn BufferAccess + std::marker::Send + std::marker::Sync + 'static)>>,
|
|
|
|
pub vertex_buffer: Option<Arc<(dyn BufferAccess + std::marker::Send + std::marker::Sync + 'static)>>,
|
|
|
|
pub dynamic_state: DynamicState,
|
|
|
|
pub dynamic_state: DynamicState,
|
|
|
|
pub graphics_image_swap_buffer: Option<std::sync::Arc<vulkano::image::attachment::AttachmentImage>>,
|
|
|
|
pub graphics_image_swap_buffer: Option<std::sync::Arc<vulkano::image::attachment::AttachmentImage>>,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub image_buffer_store : Vec<Box<ImageAccess + Send + Sync>>,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -175,6 +180,8 @@ impl<'a> VkProcessor<'a> {
|
|
|
|
vertex_buffer: Option::None,
|
|
|
|
vertex_buffer: Option::None,
|
|
|
|
dynamic_state: DynamicState { line_width: None, viewports: None, scissors: None },
|
|
|
|
dynamic_state: DynamicState { line_width: None, viewports: None, scissors: None },
|
|
|
|
graphics_image_swap_buffer: None,
|
|
|
|
graphics_image_swap_buffer: None,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
image_buffer_store: vec![]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -330,7 +337,11 @@ impl<'a> VkProcessor<'a> {
|
|
|
|
self.graphics_image_swap_buffer = Some(compute_transfer_image.clone().unwrap());
|
|
|
|
self.graphics_image_swap_buffer = Some(compute_transfer_image.clone().unwrap());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// The image set is the containing object for all texture and image hooks.
|
|
|
|
// The image set is the containing object for all texture and image hooks.
|
|
|
|
|
|
|
|
// todo, make this pull from the image_buffer_store
|
|
|
|
fn get_image_set(&mut self) -> Box<DescriptorSet + Send + Sync> {
|
|
|
|
fn get_image_set(&mut self) -> Box<DescriptorSet + Send + Sync> {
|
|
|
|
|
|
|
|
|
|
|
|
let sampler = Sampler::new(self.device.clone(), Filter::Linear, Filter::Linear,
|
|
|
|
let sampler = Sampler::new(self.device.clone(), Filter::Linear, Filter::Linear,
|
|
|
|