Skip to content

Commit 8f346e1

Browse files
committed
* Properly format the source code.
* Prepare shader information to be shown in gui.
1 parent 56774fd commit 8f346e1

38 files changed

+8816
-8218
lines changed

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# From: https://docs.github.com/en/github/getting-started-with-github/configuring-git-to-handle-line-endings
2+
# Set the default behavior for line endings.
3+
* text=auto eol=lf
4+
5+
# Declare files that will always have CRLF line endings on checkout.
6+
*.sln text eol=crlf
7+
8+
# Denote all files that are truly binary and should not be modified.
9+
*.png binary
10+
*.jpg binary
11+
*.ttf binary

Cargo.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ use-compiled-tools = ["spirv-builder/use-compiled-tools"]
1212

1313
[dependencies]
1414
shared = { path = "shared" }
15+
shadertoys-shaders = { path = "shaders" }
1516
futures = { version = "0.3", default-features = false, features = [
1617
"std",
17-
"executor"
18-
] }
19-
wgpu = { version = "25.0.0", features = [
20-
"spirv",
21-
"vulkan-portability"
18+
"executor",
2219
] }
20+
wgpu = { version = "25.0.0", features = ["spirv", "vulkan-portability"] }
2321
winit = { git = "https://github.com/rust-windowing/winit.git", rev = "cdbdd974fbf79b82b3fb1a4bc84ed717312a3bd2" }
24-
bytemuck = "1.20.0"
22+
bytemuck = "1.23.0"
2523
env_logger = "0.11.6"
2624
ouroboros = "0.18.5"
2725

@@ -53,7 +51,51 @@ opt-level = 3
5351
[profile.release.package."shadertoys-shaders"]
5452
opt-level = 0
5553

54+
[workspace.lints.clippy]
55+
let_and_return = "allow"
56+
needless_lifetimes = "allow"
57+
option_if_let_else = "allow"
58+
# see: https://github.com/bevyengine/bevy/pull/15375#issuecomment-2366966219
59+
too_long_first_doc_paragraph = "allow"
60+
missing_panics_doc = "allow"
61+
doc-markdown = "allow"
62+
63+
nursery = { priority = -1, level = "warn" }
64+
pedantic = { priority = -1, level = "warn" }
65+
doc_markdown = "warn"
66+
manual_let_else = "warn"
67+
match_same_arms = "warn"
68+
redundant_closure_for_method_calls = "warn"
69+
redundant_else = "warn"
70+
semicolon_if_nothing_returned = "warn"
71+
type_complexity = "allow"
72+
undocumented_unsafe_blocks = "warn"
73+
unwrap_or_default = "warn"
74+
75+
ptr_as_ptr = "warn"
76+
ptr_cast_constness = "warn"
77+
ref_as_ptr = "warn"
78+
79+
std_instead_of_core = "warn"
80+
std_instead_of_alloc = "warn"
81+
alloc_instead_of_core = "warn"
82+
5683
[workspace.lints.rust]
84+
nonstandard-style = "warn"
85+
future-incompatible = "warn"
86+
missing_docs = "allow" # TODO: warn
87+
unused = { priority = -1, level = "warn" }
88+
rust_2018_idioms = { priority = -1, level = "warn" }
89+
rust-2024-compatibility = "warn"
90+
array-into-iter = "warn"
91+
bare-trait-objects = "warn"
92+
ellipsis-inclusive-range-patterns = "warn"
93+
non-fmt-panics = "warn"
94+
explicit-outlives-requirements = "warn"
95+
unused-extern-crates = "warn"
96+
unsafe_code = "allow" # TODO: forbid
97+
unsafe_op_in_unsafe_fn = "warn"
98+
unused_qualifications = "warn"
5799
unexpected_cfgs = { level = "allow", check-cfg = [
58-
'cfg(target_arch, values("spirv"))'
100+
'cfg(target_arch, values("spirv"))',
59101
] }

build.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ use spirv_builder::{MetadataPrintout, SpirvBuilder};
22
use std::error::Error;
33

44
fn build_shader(path_to_crate: &str) -> Result<(), Box<dyn Error>> {
5-
let builder = SpirvBuilder::new(path_to_crate, "spirv-unknown-vulkan1.2")
6-
.print_metadata(MetadataPrintout::Full);
5+
let builder = SpirvBuilder::new(path_to_crate, "spirv-unknown-vulkan1.2")
6+
.print_metadata(MetadataPrintout::Full);
77

8-
let _result = builder.build()?;
9-
Ok(())
8+
let _result = builder.build()?;
9+
Ok(())
1010
}
1111

1212
fn main() -> Result<(), Box<dyn Error>> {
13-
build_shader("shaders")?;
14-
Ok(())
13+
build_shader("shaders")?;
14+
Ok(())
1515
}

clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
check-private-items = true

rustfmt.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
match_block_trailing_comma = true
2+
tab_spaces = 2
3+
condense_wildcard_suffixes = false
4+
newline_style = "Unix"
5+
6+
# The options below are unstable
7+
unstable_features = true
8+
imports_granularity = "Crate"
9+
normalize_comments = false # Often doesn't do what you want
10+
11+
# these options seem poorly implemented and cause churn, so, try to avoid them
12+
# wrap_comments = true
13+
# comment_width = 100

0 commit comments

Comments
 (0)