diff --git a/Cargo.lock b/Cargo.lock index da567ba8..32c407ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -522,15 +522,6 @@ dependencies = [ "vec_map", ] -[[package]] -name = "cmake" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b858541263efe664aead4a5209a4ae5c5d2811167d4ed4ee0944503f8d2089" -dependencies = [ - "cc", -] - [[package]] name = "codespan-reporting" version = "0.12.0" @@ -1339,7 +1330,6 @@ dependencies = [ "obj-rs", "pollster", "rand", - "shaderc", "wgpu", "windows", "winit", @@ -2374,26 +2364,6 @@ dependencies = [ "serde", ] -[[package]] -name = "shaderc" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6e2c757b804157350d8d79d718c756899226016486aab07a11dddf8741111a0" -dependencies = [ - "libc", - "shaderc-sys", -] - -[[package]] -name = "shaderc-sys" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a36f3465fce5830d33a58846b9c924f510a1e92bac181834c13b38405efe983b" -dependencies = [ - "cmake", - "libc", -] - [[package]] name = "sharded-slab" version = "0.1.4" diff --git a/README.md b/README.md index c2160553..f15f305b 100644 --- a/README.md +++ b/README.md @@ -80,8 +80,6 @@ cargo add lambda-rs #### Required external dependencies * All platforms - * `cmake >= 3.20.0` is needed to build shaderc from source. - * `ninja` is needed to build shaderc from source. * `git` is needed to clone the project and manage it's dependencies. * `git-lfs` is needed for asset files. * `rust >= 1.60` is needed for compiling lambda and all of it's crates. diff --git a/crates/lambda-rs-platform/Cargo.toml b/crates/lambda-rs-platform/Cargo.toml index 6053338b..98888a0a 100644 --- a/crates/lambda-rs-platform/Cargo.toml +++ b/crates/lambda-rs-platform/Cargo.toml @@ -12,7 +12,6 @@ path = "src/lib.rs" [dependencies] winit = "=0.29.15" -shaderc = { version = "=0.7", optional = true, default-features = false } naga = { version = "=28.0.0", optional = true, default-features = false, features = [ "spv-out", "glsl-in", @@ -37,11 +36,6 @@ mockall = "=0.14.0" default = ["wgpu", "shader-backend-naga"] shader-backend-naga = ["dep:naga"] -shader-backend-shaderc = ["dep:shaderc"] -shader-backend-shaderc-build-from-source = [ - "shader-backend-shaderc", - "shaderc/build-from-source", -] wgpu = [ "dep:wgpu", diff --git a/crates/lambda-rs-platform/src/lib.rs b/crates/lambda-rs-platform/src/lib.rs index faefca66..2fe95071 100644 --- a/crates/lambda-rs-platform/src/lib.rs +++ b/crates/lambda-rs-platform/src/lib.rs @@ -12,7 +12,6 @@ pub mod obj; pub mod rand; pub mod shader; -pub mod shaderc; #[cfg(feature = "wgpu")] pub mod wgpu; pub mod winit; diff --git a/crates/lambda-rs-platform/src/shader/mod.rs b/crates/lambda-rs-platform/src/shader/mod.rs index 572fdc68..88a0b1c8 100644 --- a/crates/lambda-rs-platform/src/shader/mod.rs +++ b/crates/lambda-rs-platform/src/shader/mod.rs @@ -9,27 +9,8 @@ pub use types::{ #[cfg(feature = "shader-backend-naga")] mod naga; -#[cfg(feature = "shader-backend-shaderc")] -mod shaderc_backend; - #[cfg(feature = "shader-backend-naga")] pub use naga::{ ShaderCompiler, ShaderCompilerBuilder, }; -#[cfg(all( - feature = "shader-backend-naga", - feature = "shader-backend-shaderc" -))] -pub use naga::{ - ShaderCompiler, - ShaderCompilerBuilder, -}; -#[cfg(all( - not(feature = "shader-backend-naga"), - feature = "shader-backend-shaderc" -))] -pub use shaderc_backend::{ - ShaderCompiler, - ShaderCompilerBuilder, -}; diff --git a/crates/lambda-rs-platform/src/shader/shaderc_backend.rs b/crates/lambda-rs-platform/src/shader/shaderc_backend.rs deleted file mode 100644 index f92bebce..00000000 --- a/crates/lambda-rs-platform/src/shader/shaderc_backend.rs +++ /dev/null @@ -1,120 +0,0 @@ -use std::io::Read; - -use shaderc; - -use super::{ - ShaderKind, - VirtualShader, -}; - -/// Builder for the shaderc platform shader compiler. -pub struct ShaderCompilerBuilder {} - -impl ShaderCompilerBuilder { - pub fn new() -> Self { - Self {} - } - - pub fn build(self) -> ShaderCompiler { - let compiler = - shaderc::Compiler::new().expect("Failed to create shaderc compiler."); - - let options = shaderc::CompileOptions::new() - .expect("Failed to create shaderc compile options."); - - ShaderCompiler { - compiler, - default_options: options, - } - } -} - -/// A low level shader compiler to be used for compiling shaders into SPIR-V binary. -pub struct ShaderCompiler { - compiler: shaderc::Compiler, - default_options: shaderc::CompileOptions<'static>, -} - -impl ShaderCompiler { - pub fn compile_into_binary(&mut self, shader: &VirtualShader) -> Vec { - match shader { - VirtualShader::File { - path, - kind, - name, - entry_point, - } => self.compile_file_into_binary( - path.as_str(), - name.as_str(), - entry_point.as_str(), - *kind, - ), - VirtualShader::Source { - source, - kind, - name, - entry_point, - } => self.compile_string_into_binary( - source.as_str(), - name.as_str(), - entry_point.as_str(), - *kind, - ), - } - } - - fn compile_file_into_binary( - &mut self, - path: &str, - name: &str, - entry_point: &str, - shader_kind: ShaderKind, - ) -> Vec { - let mut opened_shader_file = std::fs::File::open(path).unwrap(); - let mut shader_source = String::new(); - opened_shader_file - .read_to_string(&mut shader_source) - .unwrap(); - - let compiled_shader = self - .compiler - .compile_into_spirv( - &shader_source, - map_shader_kind(shader_kind), - path, - entry_point, - Some(&self.default_options), - ) - .expect("Failed to compile the shader."); - compiled_shader.as_binary().to_vec() - } - - fn compile_string_into_binary( - &mut self, - shader_source: &str, - name: &str, - entry_point: &str, - shader_kind: ShaderKind, - ) -> Vec { - let compiled_shader = self - .compiler - .compile_into_spirv( - shader_source, - map_shader_kind(shader_kind), - name, - entry_point, - Some(&self.default_options), - ) - .expect("Failed to compile the shader."); - - compiled_shader.as_binary().to_vec() - } -} - -fn map_shader_kind(kind: ShaderKind) -> shaderc::ShaderKind { - match kind { - ShaderKind::Vertex => shaderc::ShaderKind::Vertex, - ShaderKind::Fragment => shaderc::ShaderKind::Fragment, - ShaderKind::Compute => shaderc::ShaderKind::Compute, - } -} diff --git a/crates/lambda-rs-platform/src/shaderc.rs b/crates/lambda-rs-platform/src/shaderc.rs deleted file mode 100644 index f375f999..00000000 --- a/crates/lambda-rs-platform/src/shaderc.rs +++ /dev/null @@ -1,12 +0,0 @@ -//! Deprecated re-exports for code that still references the legacy shaderc module. - -#[deprecated( - since = "2023.1.31", - note = "Use `lambda_platform::shader` instead of `lambda_platform::shaderc`." -)] -pub use crate::shader::{ - ShaderCompiler, - ShaderCompilerBuilder, - ShaderKind, - VirtualShader, -}; diff --git a/crates/lambda-rs/Cargo.toml b/crates/lambda-rs/Cargo.toml index 4a7330dc..800dad08 100644 --- a/crates/lambda-rs/Cargo.toml +++ b/crates/lambda-rs/Cargo.toml @@ -31,11 +31,6 @@ with-wgpu-vulkan=["with-wgpu", "lambda-rs-platform/wgpu-with-vulkan"] with-wgpu-metal=["with-wgpu", "lambda-rs-platform/wgpu-with-metal"] with-wgpu-dx12=["with-wgpu", "lambda-rs-platform/wgpu-with-dx12"] with-wgpu-gl=["with-wgpu", "lambda-rs-platform/wgpu-with-gl"] -with-shaderc=["lambda-rs-platform/shader-backend-shaderc"] -with-shaderc-build-from-source=[ - "with-shaderc", - "lambda-rs-platform/shader-backend-shaderc-build-from-source", -] # ------------------------------ RENDER VALIDATION ----------------------------- # Granular, opt-in validation flags for release builds. Debug builds enable diff --git a/crates/lambda-rs/src/render/shader.rs b/crates/lambda-rs/src/render/shader.rs index 9bf84e50..16d0960c 100644 --- a/crates/lambda-rs/src/render/shader.rs +++ b/crates/lambda-rs/src/render/shader.rs @@ -5,8 +5,8 @@ //! GLSL source or file path + metadata) into a SPIR‑V binary suitable for //! pipeline creation. //! -//! Use the platform’s shader backend configured for the workspace (e.g., naga -//! or shaderc) without exposing backend‑specific types in the public API. +//! Use the platform’s shader backend configured for the workspace (naga) +//! without exposing backend‑specific types in the public API. // Expose the platform shader compiler abstraction pub use lambda_platform::shader::{ diff --git a/docs/features.md b/docs/features.md index c0c4f3a4..f5f0492d 100644 --- a/docs/features.md +++ b/docs/features.md @@ -3,13 +3,13 @@ title: "Cargo Features Overview" document_id: "features-2025-11-17" status: "living" created: "2025-11-17T23:59:00Z" -last_updated: "2025-12-22T00:00:00Z" -version: "0.1.5" +last_updated: "2026-01-25T00:00:00Z" +version: "0.1.6" engine_workspace_version: "2023.1.30" wgpu_version: "26.0.1" shader_backend_default: "naga" winit_version: "0.29.10" -repo_commit: "58e7dd9f9b98b05302b8b4cfe4d653e61796c153" +repo_commit: "229960fd426cf605c7513002b36e3942f14a3140" owners: ["lambda-sh"] reviewers: ["engine", "rendering"] tags: ["guide", "features", "validation", "cargo"] @@ -39,7 +39,6 @@ This document enumerates the primary Cargo features exposed by the workspace rel ## Shader Backends - `lambda-rs-platform` - `shader-backend-naga` (default): uses `naga` for shader handling. - - `shader-backend-shaderc`: uses `shaderc`; optional `shader-backend-shaderc-build-from-source`. ## Render Validation @@ -86,6 +85,8 @@ Usage examples - `cargo test -p lambda-rs --features render-validation-msaa` ## Changelog +- 0.1.6 (2026-01-25): Remove the deprecated legacy shader backend + documentation. - 0.1.5 (2025-12-22): Align `lambda-rs` Cargo feature umbrella composition with the documented render-validation feature set, including `render-validation-pass-compat` and `render-validation-render-targets`.