diff --git a/src/main.rs b/src/main.rs index ef0c8f6..647fbfc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ mod vulkan; +mod shader; fn main() { vulkan::init(); diff --git a/src/vulkan/composite.rs b/src/shader/composite.rs similarity index 100% rename from src/vulkan/composite.rs rename to src/shader/composite.rs diff --git a/src/shader/mod.rs b/src/shader/mod.rs index 2aede5f..ca75ecc 100644 --- a/src/shader/mod.rs +++ b/src/shader/mod.rs @@ -7,7 +7,7 @@ use vulkano::pipeline::graphics::vertex_input::Vertex; use vulkano::pipeline::graphics::viewport::ViewportState; use vulkano::pipeline::GraphicsPipeline; use vulkano::render_pass::{RenderPass, Subpass}; -use crate::Vertex2d; +use crate::vulkan::Vertex2d; pub fn create_program(render_pass: &Arc, device: &Arc) -> Arc { diff --git a/src/vulkan/mod.rs b/src/vulkan/mod.rs index b64d66e..9a1c2d2 100644 --- a/src/vulkan/mod.rs +++ b/src/vulkan/mod.rs @@ -1,4 +1,3 @@ -mod composite; use std::sync::Arc; use vulkano::device::{Device, DeviceCreateInfo, DeviceExtensions, Properties, Queue, QueueCreateInfo, QueueFlags}; @@ -26,7 +25,7 @@ use winit::event::{Event, WindowEvent}; // guarantees*. #[derive(BufferContents, Vertex)] #[repr(C)] -struct Vertex2d { +pub(crate) struct Vertex2d { #[format(R32G32_SFLOAT)] position: [f32; 2], #[format(R32G32_SFLOAT)] @@ -153,7 +152,7 @@ pub fn init() { // that, we store the submission of the previous frame here. let mut previous_frame_end = Some(sync::now(device.clone()).boxed()); - let pipeline = composite::create_program(&render_pass, &device); + let pipeline = crate::shader::create_program(&render_pass, &device); event_loop.run(move |event, _, control_flow| { match event {