Skip to content

Commit

Permalink
Accelerate texture compression
Browse files Browse the repository at this point in the history
  • Loading branch information
hasenbanck committed Jan 8, 2025
1 parent 3558e9b commit d08fcb3
Show file tree
Hide file tree
Showing 12 changed files with 176 additions and 395 deletions.
7 changes: 7 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Steam Hardware survey: https://store.steampowered.com/hwsurvey/Steam-Hardware-Software-Survey-Welcome-to-Steam
[target.'cfg(target_arch="x86_64")']
rustflags = ["-C", "target-feature=+aes,+avx,+avx2,+cmpxchg16b,+fma,+sse3,+ssse3,+sse4.1,+sse4.2"]

# On linux nighly Rust uses rust-lld, which runs into problems with linking C++ code.
[target.x86_64-unknown-linux-gnu]
rustflags = ["-Zlinker-features=-lld"]
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ cpal = "0.15"
derive-new = "0.7"
encoding_rs = "0.8"
etherparse = "0.16"
fast_image_resize = "5.1"
fast-srgb8 = "1"
flate2 = { version = "1", default-features = false }
glidesort = "0.1"
Expand Down
1 change: 1 addition & 0 deletions korangar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ chrono = { workspace = true }
cosmic-text = { workspace = true, features = ["std", "fontconfig"] }
derive-new = { workspace = true }
encoding_rs = { workspace = true }
fast_image_resize = { workspace = true, features = ["image", "rayon"] }
flate2 = { workspace = true, features = ["zlib-rs"] }
hashbrown = { workspace = true }
glidesort = { workspace = true }
Expand Down
1 change: 0 additions & 1 deletion korangar/src/graphics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pub use self::engine::{GraphicsEngine, GraphicsEngineDescriptor};
pub use self::error::error_handler;
pub use self::frame_pacer::*;
pub use self::instruction::*;
pub use self::passes::{Lanczos3Drawer, MipMapRenderPassContext};
pub use self::picker_target::PickerTarget;
pub use self::projection::*;
pub use self::settings::*;
Expand Down
112 changes: 0 additions & 112 deletions korangar/src/graphics/passes/mipmap/lanczos3.rs

This file was deleted.

85 changes: 0 additions & 85 deletions korangar/src/graphics/passes/mipmap/mod.rs

This file was deleted.

51 changes: 0 additions & 51 deletions korangar/src/graphics/passes/mipmap/shader/lanczos3.wgsl

This file was deleted.

3 changes: 1 addition & 2 deletions korangar/src/graphics/passes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mod directional_shadow;
mod forward;
mod interface;
mod light_culling;
mod mipmap;

mod picker;
mod point_shadow;
mod postprocessing;
Expand All @@ -16,7 +16,6 @@ pub(crate) use directional_shadow::*;
pub(crate) use forward::*;
pub(crate) use interface::*;
pub(crate) use light_culling::*;
pub use mipmap::*;
pub(crate) use picker::*;
pub(crate) use point_shadow::*;
pub(crate) use postprocessing::*;
Expand Down
6 changes: 6 additions & 0 deletions korangar/src/graphics/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ pub enum TextureCompression {
BC7,
}

impl TextureCompression {
pub fn is_uncompressed(&self) -> bool {
*self == TextureCompression::Off
}
}

impl From<TextureCompression> for TextureFormat {
fn from(value: TextureCompression) -> Self {
match value {
Expand Down
Loading

0 comments on commit d08fcb3

Please sign in to comment.