Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch ci to kesak/turtle #111

Merged
merged 4 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ jobs:
- name: install dependencies
run: |
sudo apt-get update -y -qq
sudo add-apt-repository ppa:kisak/kisak-mesa -y
sudo add-apt-repository ppa:kisak/turtle -y
sudo apt-get update
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- name: Test
run: xvfb-run cargo test

Expand Down
4 changes: 2 additions & 2 deletions src/compose/comment_strip_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ impl<'a> Iterator for CommentReplaceIter<'a> {

pub trait CommentReplaceExt<'a> {
/// replace WGSL and GLSL comments with whitespace characters
fn replace_comments(&'a mut self) -> CommentReplaceIter;
fn replace_comments(&'a mut self) -> CommentReplaceIter<'a>;
}

impl<'a> CommentReplaceExt<'a> for Lines<'a> {
fn replace_comments(&'a mut self) -> CommentReplaceIter {
fn replace_comments(&'a mut self) -> CommentReplaceIter<'a> {
CommentReplaceIter {
lines: self,
state: CommentState::None,
Expand Down
2 changes: 1 addition & 1 deletion src/compose/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ impl Composer {
auto: &'a mut u32,
}

impl<'a> regex::Replacer for AutoBindingReplacer<'a> {
impl regex::Replacer for AutoBindingReplacer<'_> {
fn replace_append(&mut self, _: &regex::Captures<'_>, dst: &mut String) {
dst.push_str(&format!("@binding({})", self.auto));
*self.auto += 1;
Expand Down
26 changes: 13 additions & 13 deletions src/compose/preprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,9 +1036,9 @@ defined
let PreprocessorMetaData {
defines: shader_defs,
..
} = processor.get_preprocessor_metadata(&WGSL, true).unwrap();
} = processor.get_preprocessor_metadata(WGSL, true).unwrap();
println!("defines: {:?}", shader_defs);
let result = processor.preprocess(&WGSL, &shader_defs).unwrap();
let result = processor.preprocess(WGSL, &shader_defs).unwrap();
assert_eq!(result.preprocessed_source, EXPECTED);
}

Expand Down Expand Up @@ -1079,9 +1079,9 @@ bool: false
let PreprocessorMetaData {
defines: shader_defs,
..
} = processor.get_preprocessor_metadata(&WGSL, true).unwrap();
} = processor.get_preprocessor_metadata(WGSL, true).unwrap();
println!("defines: {:?}", shader_defs);
let result = processor.preprocess(&WGSL, &shader_defs).unwrap();
let result = processor.preprocess(WGSL, &shader_defs).unwrap();
assert_eq!(result.preprocessed_source, EXPECTED);
}

Expand Down Expand Up @@ -1113,7 +1113,7 @@ fn vertex(
}
";
let processor = Preprocessor::default();
let result = processor.preprocess(&WGSL_ELSE_IFDEF, &[].into()).unwrap();
let result = processor.preprocess(WGSL_ELSE_IFDEF, &[].into()).unwrap();
assert_eq!(
result
.preprocessed_source
Expand Down Expand Up @@ -1190,7 +1190,7 @@ fn vertex(
";
let processor = Preprocessor::default();
let result = processor
.preprocess(&WGSL_ELSE_IFDEF_NO_ELSE_FALLBACK, &[].into())
.preprocess(WGSL_ELSE_IFDEF_NO_ELSE_FALLBACK, &[].into())
.unwrap();
assert_eq!(
result
Expand Down Expand Up @@ -1239,7 +1239,7 @@ fn vertex(
let processor = Preprocessor::default();
let result = processor
.preprocess(
&WGSL_ELSE_IFDEF,
WGSL_ELSE_IFDEF,
&[("TEXTURE".to_string(), ShaderDefValue::Bool(true))].into(),
)
.unwrap();
Expand Down Expand Up @@ -1287,7 +1287,7 @@ fn vertex(
let processor = Preprocessor::default();
let result = processor
.preprocess(
&WGSL_ELSE_IFDEF,
WGSL_ELSE_IFDEF,
&[("SECOND_TEXTURE".to_string(), ShaderDefValue::Bool(true))].into(),
)
.unwrap();
Expand Down Expand Up @@ -1335,7 +1335,7 @@ fn vertex(
let processor = Preprocessor::default();
let result = processor
.preprocess(
&WGSL_ELSE_IFDEF,
WGSL_ELSE_IFDEF,
&[("THIRD_TEXTURE".to_string(), ShaderDefValue::Bool(true))].into(),
)
.unwrap();
Expand Down Expand Up @@ -1383,7 +1383,7 @@ fn vertex(
let processor = Preprocessor::default();
let result = processor
.preprocess(
&WGSL_ELSE_IFDEF,
WGSL_ELSE_IFDEF,
&[
("SECOND_TEXTURE".to_string(), ShaderDefValue::Bool(true)),
("THIRD_TEXTURE".to_string(), ShaderDefValue::Bool(true)),
Expand Down Expand Up @@ -1441,7 +1441,7 @@ fn vertex(
let processor = Preprocessor::default();
let result = processor
.preprocess(
&WGSL_COMPLICATED_ELSE_IFDEF,
WGSL_COMPLICATED_ELSE_IFDEF,
&[("IS_DEFINED".to_string(), ShaderDefValue::Bool(true))].into(),
)
.unwrap();
Expand Down Expand Up @@ -1475,7 +1475,7 @@ fail 3

const EXPECTED: &str = r"ok";
let processor = Preprocessor::default();
let result = processor.preprocess(&INPUT, &[].into()).unwrap();
let result = processor.preprocess(INPUT, &[].into()).unwrap();
assert_eq!(
result
.preprocessed_source
Expand Down Expand Up @@ -1507,7 +1507,7 @@ fail 3
const EXPECTED: &str = r"ok";
let processor = Preprocessor::default();
let result = processor
.preprocess(&INPUT, &[("x".to_owned(), ShaderDefValue::Int(2))].into())
.preprocess(INPUT, &[("x".to_owned(), ShaderDefValue::Int(2))].into())
.unwrap();
assert_eq!(
result
Expand Down
2 changes: 1 addition & 1 deletion src/compose/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub enum Token<'a> {
Whitespace(&'a str, usize),
}

impl<'a> Token<'a> {
impl Token<'_> {
pub fn pos(&self) -> usize {
match self {
Token::Identifier(_, pos) | Token::Other(_, pos) | Token::Whitespace(_, pos) => *pos,
Expand Down
2 changes: 1 addition & 1 deletion src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ impl<'a> DerivedModule<'a> {
}
}

impl<'a> From<DerivedModule<'a>> for naga::Module {
impl From<DerivedModule<'_>> for naga::Module {
fn from(derived: DerivedModule) -> Self {
naga::Module {
types: derived.types,
Expand Down
Loading