fmt: cleanup unused items

This commit is contained in:
chyyran 2022-11-21 17:47:38 -05:00
parent b017127b9d
commit 1978350d97
7 changed files with 9 additions and 18 deletions

View file

@ -43,10 +43,6 @@ pub fn read_source(path: impl AsRef<Path>) -> Result<String, PreprocessError> {
Ok(output)
}
fn mark_line(line_no: usize, comment: &str, output: &mut String) {
output.push_line(&format!("#line {} \"{}\"", line_no, comment))
}
fn preprocess(
lines: Lines,
file_name: impl AsRef<Path>,

View file

@ -1,8 +1,3 @@
use crate::back::{CompileShader, ShaderCompilerOutput};
use crate::error::{ShaderCompileError, ShaderReflectError};
use crate::reflect::{ReflectShader, ShaderReflection};
use crate::reflect::semantics::ReflectSemantics;
pub trait OutputTarget {
type Output;
}
@ -26,7 +21,8 @@ mod test {
use crate::back::FromCompilation;
use crate::back::targets::GLSL;
use crate::front::shaderc::GlslangCompilation;
pub fn huh(value: GlslangCompilation) {
#[allow(dead_code)]
pub fn test_compile(value: GlslangCompilation) {
let _x = GLSL::from_compilation(value).unwrap();
}
}

View file

@ -850,6 +850,7 @@ mod test {
use librashader_preprocess::ShaderSource;
use spirv_cross::glsl;
use spirv_cross::glsl::{CompilerOptions, Version};
use crate::front::shaderc::GlslangCompilation;
#[test]
pub fn test_into() {
@ -865,7 +866,7 @@ mod test {
}),
);
}
let spirv = crate::front::shaderc::compile_spirv(&result).unwrap();
let spirv = GlslangCompilation::compile(&result).unwrap();
let mut reflect = CrossReflect::<glsl::Target>::try_from(spirv).unwrap();
let _shader_reflection = reflect
.reflect(

View file

@ -3,7 +3,6 @@ use crate::reflect::semantics::{
SemanticMap, TextureImage, TextureSemantics, TextureSizeMeta, VariableMeta, VariableSemantics,
};
use rustc_hash::FxHashMap;
use std::str::FromStr;
use semantics::ReflectSemantics;
pub mod cross;

View file

@ -19,7 +19,6 @@ use librashader_reflect::reflect::ReflectShader;
use rustc_hash::FxHashMap;
use spirv_cross::spirv::Decoration;
use std::collections::VecDeque;
use std::error::Error;
use std::path::Path;
use librashader_reflect::back::{CompilerBackend, CompileShader, FromCompilation};
use librashader_reflect::front::shaderc::GlslangCompilation;

View file

@ -224,9 +224,9 @@ impl FilterPass {
gl::BindBuffer(gl::ARRAY_BUFFER, parent.draw_quad.vbo);
/// the provided pointers are of OpenGL provenance with respect to the buffer bound to quad_vbo,
/// and not a known provenance to the Rust abstract machine, therefore we give it invalid pointers.
/// that are inexpressible in Rust
// the provided pointers are of OpenGL provenance with respect to the buffer bound to quad_vbo,
// and not a known provenance to the Rust abstract machine, therefore we give it invalid pointers.
// that are inexpressible in Rust
gl::VertexAttribPointer(
0,
2,

View file

@ -84,8 +84,8 @@ impl Framebuffer {
return Ok(self.size);
}
let mut width = 0f32;
let mut height = 0f32;
let width;
let height;
match scaling.x {
Scaling {