From 5bace4e64c7496f475614d6454cbc65390579ea5 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 1 Apr 2016 20:45:13 +0200 Subject: [PATCH] Move "shader" module within "pipeline" --- vulkano-shaders/src/lib.rs | 18 +++++++++--------- vulkano/src/lib.rs | 1 - vulkano/src/pipeline/compute_pipeline.rs | 2 +- vulkano/src/pipeline/graphics_pipeline.rs | 4 ++-- vulkano/src/pipeline/mod.rs | 1 + vulkano/src/{ => pipeline}/shader.rs | 0 6 files changed, 13 insertions(+), 13 deletions(-) rename vulkano/src/{ => pipeline}/shader.rs (100%) diff --git a/vulkano-shaders/src/lib.rs b/vulkano-shaders/src/lib.rs index 92474e1c..e8c9c91a 100644 --- a/vulkano-shaders/src/lib.rs +++ b/vulkano-shaders/src/lib.rs @@ -75,7 +75,7 @@ pub fn reflect(name: &str, mut spirv: R) -> Result // writing the header output.push_str(&format!(r#" pub struct {name} {{ - shader: ::std::sync::Arc<::vulkano::shader::ShaderModule>, + shader: ::std::sync::Arc<::vulkano::pipeline::shader::ShaderModule>, }} impl {name} {{ @@ -106,7 +106,7 @@ impl {name} {{ let data = [{spirv_data}]; Ok({name} {{ - shader: try!(::vulkano::shader::ShaderModule::new(device, &data)) + shader: try!(::vulkano::pipeline::shader::ShaderModule::new(device, &data)) }}) }} }} @@ -114,7 +114,7 @@ impl {name} {{ /// Returns the module that was created. #[allow(dead_code)] #[inline] - pub fn module(&self) -> &::std::sync::Arc<::vulkano::shader::ShaderModule> {{ + pub fn module(&self) -> &::std::sync::Arc<::vulkano::pipeline::shader::ShaderModule> {{ &self.shader }} "#, name = name, spirv_data = spirv_data)); @@ -211,22 +211,22 @@ fn write_entry_point(doc: &parse::Spirv, instruction: &parse::Instruction) -> St format!("({}, ::std::borrow::Cow::Borrowed(\"{}\"))", loc, name) }).collect::>().join(", "); - let t = format!("::vulkano::shader::VertexShaderEntryPoint<({input}), Layout>", + let t = format!("::vulkano::pipeline::shader::VertexShaderEntryPoint<({input}), Layout>", input = input); let f = format!("vertex_shader_entry_point(::std::ffi::CStr::from_ptr(NAME.as_ptr() as *const _), Layout, vec![{}])", attributes); (t, f) }, enums::ExecutionModel::ExecutionModelTessellationControl => { - (format!("::vulkano::shader::TessControlShaderEntryPoint"), String::new()) + (format!("::vulkano::pipeline::shader::TessControlShaderEntryPoint"), String::new()) }, enums::ExecutionModel::ExecutionModelTessellationEvaluation => { - (format!("::vulkano::shader::TessEvaluationShaderEntryPoint"), String::new()) + (format!("::vulkano::pipeline::shader::TessEvaluationShaderEntryPoint"), String::new()) }, enums::ExecutionModel::ExecutionModelGeometry => { - (format!("::vulkano::shader::GeometryShaderEntryPoint"), String::new()) + (format!("::vulkano::pipeline::shader::GeometryShaderEntryPoint"), String::new()) }, enums::ExecutionModel::ExecutionModelFragment => { @@ -251,13 +251,13 @@ fn write_entry_point(doc: &parse::Spirv, instruction: &parse::Instruction) -> St if output.is_empty() { output } else { output + "," } }; - let t = format!("::vulkano::shader::FragmentShaderEntryPoint<({output}), Layout>", + let t = format!("::vulkano::pipeline::shader::FragmentShaderEntryPoint<({output}), Layout>", output = output); (t, format!("fragment_shader_entry_point(::std::ffi::CStr::from_ptr(NAME.as_ptr() as *const _), Layout)")) }, enums::ExecutionModel::ExecutionModelGLCompute => { - (format!("::vulkano::shader::ComputeShaderEntryPoint"), + (format!("::vulkano::pipeline::shader::ComputeShaderEntryPoint"), format!("compute_shader_entry_point(::std::ffi::CStr::from_ptr(NAME.as_ptr() as *const _), Layout)")) }, diff --git a/vulkano/src/lib.rs b/vulkano/src/lib.rs index eb9c3c76..2137a9ba 100644 --- a/vulkano/src/lib.rs +++ b/vulkano/src/lib.rs @@ -70,7 +70,6 @@ pub mod memory; pub mod pipeline; //pub mod query; pub mod sampler; -pub mod shader; pub mod swapchain; pub mod sync; diff --git a/vulkano/src/pipeline/compute_pipeline.rs b/vulkano/src/pipeline/compute_pipeline.rs index 4097b90d..2d601daa 100644 --- a/vulkano/src/pipeline/compute_pipeline.rs +++ b/vulkano/src/pipeline/compute_pipeline.rs @@ -14,7 +14,7 @@ use std::sync::Arc; use descriptor_set::Layout; use descriptor_set::LayoutPossibleSuperset; use descriptor_set::PipelineLayout; -use shader::ComputeShaderEntryPoint; +use pipeline::shader::ComputeShaderEntryPoint; use device::Device; use OomError; diff --git a/vulkano/src/pipeline/graphics_pipeline.rs b/vulkano/src/pipeline/graphics_pipeline.rs index 8331d15f..45a74620 100644 --- a/vulkano/src/pipeline/graphics_pipeline.rs +++ b/vulkano/src/pipeline/graphics_pipeline.rs @@ -18,8 +18,6 @@ use descriptor_set::Layout as PipelineLayoutDesc; use descriptor_set::LayoutPossibleSuperset as PipelineLayoutPossibleSuperset; use framebuffer::RenderPass; use framebuffer::Subpass; -use shader::FragmentShaderEntryPoint; -use shader::VertexShaderEntryPoint; use OomError; use VulkanObject; use VulkanPointers; @@ -31,6 +29,8 @@ use pipeline::input_assembly::InputAssembly; use pipeline::multisample::Multisample; use pipeline::raster::DepthBiasControl; use pipeline::raster::Rasterization; +use pipeline::shader::FragmentShaderEntryPoint; +use pipeline::shader::VertexShaderEntryPoint; use pipeline::vertex::Definition as VertexDefinition; use pipeline::vertex::Vertex; use pipeline::viewport::ViewportsState; diff --git a/vulkano/src/pipeline/mod.rs b/vulkano/src/pipeline/mod.rs index e2c827f1..eb3bc3df 100644 --- a/vulkano/src/pipeline/mod.rs +++ b/vulkano/src/pipeline/mod.rs @@ -19,5 +19,6 @@ pub mod cache; pub mod input_assembly; pub mod multisample; pub mod raster; +pub mod shader; pub mod vertex; pub mod viewport; diff --git a/vulkano/src/shader.rs b/vulkano/src/pipeline/shader.rs similarity index 100% rename from vulkano/src/shader.rs rename to vulkano/src/pipeline/shader.rs