From b98d86a9403703ec72b2bbfbace801c57fa35e79 Mon Sep 17 00:00:00 2001 From: chyyran Date: Sat, 10 Feb 2024 20:46:35 -0500 Subject: [PATCH] reflect: allow specifying output toolchain --- librashader-cache/src/compilation.rs | 52 ++++++++++++------- librashader-reflect/src/back/cross.rs | 10 ++-- librashader-reflect/src/back/dxil.rs | 8 +-- librashader-reflect/src/back/mod.rs | 18 +++---- librashader-reflect/src/back/spirv.rs | 4 +- librashader-reflect/src/back/wgsl/mod.rs | 2 +- librashader-reflect/src/reflect/cross.rs | 52 ++++++++++++------- librashader-reflect/src/reflect/mod.rs | 1 - librashader-reflect/src/reflect/naga/mod.rs | 4 +- librashader-reflect/src/reflect/presets.rs | 19 +++---- librashader-runtime-d3d11/src/filter_chain.rs | 15 ++++-- librashader-runtime-d3d12/src/filter_chain.rs | 27 ++++++---- .../src/filter_chain/filter_impl.rs | 15 ++++-- librashader-runtime-vk/src/filter_chain.rs | 15 ++++-- librashader-runtime-wgpu/src/filter_chain.rs | 6 ++- 15 files changed, 148 insertions(+), 100 deletions(-) diff --git a/librashader-cache/src/compilation.rs b/librashader-cache/src/compilation.rs index 06148cd..54a7c7b 100644 --- a/librashader-cache/src/compilation.rs +++ b/librashader-cache/src/compilation.rs @@ -66,11 +66,14 @@ where } #[cfg(all(target_os = "windows", feature = "d3d"))] -impl FromCompilation> for DXIL { - type Target = >::Target; - type Options = >::Options; - type Context = >::Context; - type Output = >::Output; +impl FromCompilation, T> for DXIL +where + DXIL: FromCompilation, +{ + type Target = >::Target; + type Options = >::Options; + type Context = >::Context; + type Output = >::Output; fn from_compilation( compile: CachedCompilation, @@ -79,11 +82,14 @@ impl FromCompilation> for DXIL { } } -impl FromCompilation> for HLSL { - type Target = >::Target; - type Options = >::Options; - type Context = >::Context; - type Output = >::Output; +impl FromCompilation, T> for HLSL +where + HLSL: FromCompilation, +{ + type Target = >::Target; + type Options = >::Options; + type Context = >::Context; + type Output = >::Output; fn from_compilation( compile: CachedCompilation, @@ -92,11 +98,14 @@ impl FromCompilation> for HLSL { } } -impl FromCompilation> for GLSL { - type Target = >::Target; - type Options = >::Options; - type Context = >::Context; - type Output = >::Output; +impl FromCompilation, T> for GLSL +where + GLSL: FromCompilation, +{ + type Target = >::Target; + type Options = >::Options; + type Context = >::Context; + type Output = >::Output; fn from_compilation( compile: CachedCompilation, @@ -105,11 +114,14 @@ impl FromCompilation> for GLSL { } } -impl FromCompilation> for SPIRV { - type Target = >::Target; - type Options = >::Options; - type Context = >::Context; - type Output = >::Output; +impl FromCompilation, T> for SPIRV +where + SPIRV: FromCompilation, +{ + type Target = >::Target; + type Options = >::Options; + type Context = >::Context; + type Output = >::Output; fn from_compilation( compile: CachedCompilation, diff --git a/librashader-reflect/src/back/cross.rs b/librashader-reflect/src/back/cross.rs index 54cdcd3..cac4567 100644 --- a/librashader-reflect/src/back/cross.rs +++ b/librashader-reflect/src/back/cross.rs @@ -2,7 +2,7 @@ use crate::back::targets::{GLSL, HLSL}; use crate::back::{CompileShader, CompilerBackend, FromCompilation}; use crate::error::ShaderReflectError; use crate::front::SpirvCompilation; -use crate::reflect::cross::{CompiledProgram, GlslReflect, HlslReflect, SpirvCross}; +use crate::reflect::cross::{CompiledProgram, SpirvCross}; use crate::reflect::{ReflectShader, ShaderOutputCompiler}; /// The GLSL version to target. @@ -19,7 +19,7 @@ pub struct CrossGlslContext { pub artifact: CompiledProgram, } -impl FromCompilation for GLSL { +impl FromCompilation> for GLSL { type Target = GLSL; type Options = GlslVersion; type Context = CrossGlslContext; @@ -30,9 +30,7 @@ impl FromCompilation for GLSL { compile: SpirvCompilation, ) -> Result, ShaderReflectError> { let backend = SpirvCross::::create_reflection(compile)?; - Ok(CompilerBackend { - backend, - }) + Ok(CompilerBackend { backend }) } } @@ -42,7 +40,7 @@ pub struct CrossHlslContext { pub artifact: CompiledProgram, } -impl FromCompilation for HLSL { +impl FromCompilation> for HLSL { type Target = HLSL; type Options = Option; type Context = CrossHlslContext; diff --git a/librashader-reflect/src/back/dxil.rs b/librashader-reflect/src/back/dxil.rs index 274cd3b..ffb16ce 100644 --- a/librashader-reflect/src/back/dxil.rs +++ b/librashader-reflect/src/back/dxil.rs @@ -9,14 +9,14 @@ use spirv_to_dxil::{ use crate::back::targets::{OutputTarget, DXIL}; use crate::error::{ShaderCompileError, ShaderReflectError}; use crate::front::SpirvCompilation; -use crate::reflect::cross::GlslReflect; -use crate::reflect::{ReflectShader, ShaderOutputCompiler}; +use crate::reflect::cross::{GlslReflect, SpirvCross}; +use crate::reflect::ReflectShader; impl OutputTarget for DXIL { type Output = DxilObject; } -impl FromCompilation for DXIL { +impl FromCompilation> for DXIL { type Target = DXIL; type Options = Option; type Context = (); @@ -26,7 +26,7 @@ impl FromCompilation for DXIL { fn from_compilation( compile: SpirvCompilation, ) -> Result, ShaderReflectError> { - let reflect = GlslReflect::new().create_reflection(compile)?; + let reflect = GlslReflect::try_from(&compile)?; let vertex = compile.vertex; let fragment = compile.fragment; Ok(CompilerBackend { diff --git a/librashader-reflect/src/back/mod.rs b/librashader-reflect/src/back/mod.rs index d89664f..4dde377 100644 --- a/librashader-reflect/src/back/mod.rs +++ b/librashader-reflect/src/back/mod.rs @@ -42,26 +42,26 @@ pub trait CompileShader { /// /// This trait is automatically implemented for reflected outputs that have [`FromCompilation`](crate::back::FromCompilation) implement /// for a given target that also implement [`CompileShader`](crate::back::CompileShader) for that target. -pub trait CompileReflectShader: +pub trait CompileReflectShader: CompileShader< T, - Options = >::Options, - Context = >::Context, + Options = >::Options, + Context = >::Context, > + ReflectShader where - T: FromCompilation, + T: FromCompilation, { } -impl CompileReflectShader for O +impl CompileReflectShader for O where T: OutputTarget, - T: FromCompilation, + T: FromCompilation, O: ReflectShader, O: CompileShader< T, - Options = >::Options, - Context = >::Context, + Options = >::Options, + Context = >::Context, >, { } @@ -83,7 +83,7 @@ where } /// A trait for reflectable compilations that can be transformed into an object ready for reflection or compilation. -pub trait FromCompilation { +pub trait FromCompilation { /// The target that the transformed object is expected to compile for. type Target: OutputTarget; /// Options provided to the compiler. diff --git a/librashader-reflect/src/back/spirv.rs b/librashader-reflect/src/back/spirv.rs index 7a7910e..d720267 100644 --- a/librashader-reflect/src/back/spirv.rs +++ b/librashader-reflect/src/back/spirv.rs @@ -2,7 +2,7 @@ use crate::back::targets::SPIRV; use crate::back::{CompileShader, CompilerBackend, FromCompilation, ShaderCompilerOutput}; use crate::error::{ShaderCompileError, ShaderReflectError}; use crate::front::SpirvCompilation; -use crate::reflect::cross::GlslReflect; +use crate::reflect::cross::{GlslReflect, SpirvCross}; use crate::reflect::semantics::ShaderSemantics; use crate::reflect::{ReflectShader, ShaderReflection}; @@ -13,7 +13,7 @@ pub(crate) struct WriteSpirV { pub(crate) fragment: Vec, } -impl FromCompilation for SPIRV { +impl FromCompilation> for SPIRV { type Target = SPIRV; type Options = Option<()>; type Context = (); diff --git a/librashader-reflect/src/back/wgsl/mod.rs b/librashader-reflect/src/back/wgsl/mod.rs index 27b0f91..6c9db9b 100644 --- a/librashader-reflect/src/back/wgsl/mod.rs +++ b/librashader-reflect/src/back/wgsl/mod.rs @@ -22,7 +22,7 @@ pub struct WgslCompileOptions { pub sampler_bind_group: u32, } -impl FromCompilation for WGSL { +impl FromCompilation for WGSL { type Target = WGSL; type Options = WgslCompileOptions; type Context = NagaWgslContext; diff --git a/librashader-reflect/src/reflect/cross.rs b/librashader-reflect/src/reflect/cross.rs index 4fd463f..2d78d2f 100644 --- a/librashader-reflect/src/reflect/cross.rs +++ b/librashader-reflect/src/reflect/cross.rs @@ -1,5 +1,3 @@ -use std::borrow::Borrow; -use std::marker::PhantomData; use crate::error::{SemanticsErrorKind, ShaderCompileError, ShaderReflectError}; use crate::front::SpirvCompilation; use crate::reflect::semantics::{ @@ -9,18 +7,19 @@ use crate::reflect::semantics::{ MAX_BINDINGS_COUNT, MAX_PUSH_BUFFER_SIZE, }; use crate::reflect::{align_uniform_size, ReflectShader, ShaderOutputCompiler}; +use std::borrow::Borrow; +use std::marker::PhantomData; use std::ops::Deref; -use spirv_cross::spirv::{Ast, Decoration, Module, Resource, ShaderResources, Type}; +use spirv_cross::spirv::{Ast, Decoration, Module, Resource, ShaderResources, Type}; use spirv_cross::{glsl, hlsl, ErrorCode}; use crate::back::cross::{CrossGlslContext, CrossHlslContext, HlslShaderModel}; -use crate::back::targets::{GLSL, HLSL, OutputTarget}; +use crate::back::targets::{OutputTarget, DXIL, GLSL, HLSL, SPIRV}; use crate::back::{CompileShader, ShaderCompilerOutput}; use crate::reflect::helper::{SemanticErrorBlame, TextureData, UboData}; - -pub trait SpirvCrossTarget { +trait SpirvCrossTarget { type CrossTarget: spirv_cross::spirv::Target; } @@ -28,30 +27,43 @@ impl SpirvCrossTarget for HLSL { type CrossTarget = spirv_cross::hlsl::Target; } +impl SpirvCrossTarget for SPIRV { + type CrossTarget = spirv_cross::glsl::Target; +} impl SpirvCrossTarget for GLSL { type CrossTarget = spirv_cross::glsl::Target; } +impl SpirvCrossTarget for DXIL { + type CrossTarget = spirv_cross::glsl::Target; +} + +#[allow(private_bounds)] pub struct SpirvCross(PhantomData); -pub(crate) type HlslReflect = CrossReflect; pub(crate) type GlslReflect = CrossReflect; impl -ShaderOutputCompiler for SpirvCross + ShaderOutputCompiler for SpirvCross // where Spv: spirv_cross::spirv::Target, // Ast: spirv_cross::spirv::Compile, // Ast: spirv_cross::spirv::Parse, -where CrossReflect<::CrossTarget> - : CompileShader, +where + CrossReflect<::CrossTarget>: + CompileShader, ::CrossTarget: spirv_cross::spirv::Target, - Ast<::CrossTarget>: spirv_cross::spirv::Compile<::CrossTarget>, - Ast<::CrossTarget>: spirv_cross::spirv::Parse<::CrossTarget>, + Ast<::CrossTarget>: + spirv_cross::spirv::Compile<::CrossTarget>, + Ast<::CrossTarget>: + spirv_cross::spirv::Parse<::CrossTarget>, { - fn create_reflection(compiled: SpirvCompilation) - -> Result, - ShaderReflectError> { + fn create_reflection( + compiled: SpirvCompilation, + ) -> Result< + impl ReflectShader + CompileShader, + ShaderReflectError, + > { let compiled = compiled.borrow(); let vertex_module = Module::from_words(&compiled.vertex); let fragment_module = Module::from_words(&compiled.fragment); @@ -65,9 +77,11 @@ where CrossReflect<::CrossTarget> // This is "probably" OK. unsafe impl Send for CrossReflect -where Ast: spirv_cross::spirv::Compile, - Ast: spirv_cross::spirv::Parse, -{} +where + Ast: spirv_cross::spirv::Compile, + Ast: spirv_cross::spirv::Parse, +{ +} pub(crate) struct CrossReflect where @@ -100,8 +114,6 @@ where pub fragment: CompiledAst, } - - impl ValidateTypeSemantics for UniqueSemantics { fn validate_type(&self, ty: &Type) -> Option { let (Type::Float { diff --git a/librashader-reflect/src/reflect/mod.rs b/librashader-reflect/src/reflect/mod.rs index a3a425d..fed049a 100644 --- a/librashader-reflect/src/reflect/mod.rs +++ b/librashader-reflect/src/reflect/mod.rs @@ -1,4 +1,3 @@ -use std::borrow::Borrow; use crate::error::ShaderReflectError; use semantics::ShaderSemantics; diff --git a/librashader-reflect/src/reflect/naga/mod.rs b/librashader-reflect/src/reflect/naga/mod.rs index f719705..a35d983 100644 --- a/librashader-reflect/src/reflect/naga/mod.rs +++ b/librashader-reflect/src/reflect/naga/mod.rs @@ -1,7 +1,7 @@ mod lower_samplers; -use std::borrow::Borrow; use crate::error::{SemanticsErrorKind, ShaderReflectError}; +use std::borrow::Borrow; use crate::back::targets::OutputTarget; use crate::back::CompileShader; @@ -36,7 +36,7 @@ where compile: SpirvCompilation, ) -> Result< impl ReflectShader + CompileShader, - ShaderReflectError + ShaderReflectError, > { fn lower_fragment_shader(words: &[u32]) -> Vec { let mut loader = rspirv::dr::Loader::new(); diff --git a/librashader-reflect/src/reflect/presets.rs b/librashader-reflect/src/reflect/presets.rs index 91a278f..13c0cd0 100644 --- a/librashader-reflect/src/reflect/presets.rs +++ b/librashader-reflect/src/reflect/presets.rs @@ -18,11 +18,12 @@ use rustc_hash::FxHashMap; /// ```rust /// #![feature(type_alias_impl_trait)] /// use librashader_reflect::back::CompileReflectShader; -/// use librashader_reflect::back::targets::SPIRV; +/// use librashader_reflect::back::targets::{GLSL, SPIRV}; /// use librashader_reflect::front::SpirvCompilation; +/// use librashader_reflect::reflect::cross::SpirvCross; /// use librashader_reflect::reflect::presets::ShaderPassArtifact; /// -/// type VulkanPassMeta = ShaderPassArtifact>; +/// type VulkanPassMeta = ShaderPassArtifact>>; /// ``` /// /// This allows a runtime to not name the backing type of the compiled artifact if not necessary. @@ -35,12 +36,12 @@ impl CompilePresetTarget for T {} pub trait CompilePresetTarget: OutputTarget { /// Compile passes of a shader preset given the applicable /// shader output target, compilation type, and resulting error. - fn compile_preset_passes( + fn compile_preset_passes( passes: Vec, textures: &[TextureConfig], ) -> Result< ( - Vec>::Output>>, + Vec>::Output>>, ShaderSemantics, ), E, @@ -48,24 +49,24 @@ pub trait CompilePresetTarget: OutputTarget { where I: ShaderReflectObject, Self: Sized, - Self: FromCompilation, + Self: FromCompilation, C: ShaderInputCompiler, E: From, E: From, E: From, { - compile_preset_passes::(passes, textures) + compile_preset_passes::(passes, textures) } } /// Compile passes of a shader preset given the applicable /// shader output target, compilation type, and resulting error. -fn compile_preset_passes( +fn compile_preset_passes( passes: Vec, textures: &[TextureConfig], ) -> Result< ( - Vec>::Output>>, + Vec>::Output>>, ShaderSemantics, ), E, @@ -73,7 +74,7 @@ fn compile_preset_passes( where I: ShaderReflectObject, T: OutputTarget, - T: FromCompilation, + T: FromCompilation, C: ShaderInputCompiler, E: From, E: From, diff --git a/librashader-runtime-d3d11/src/filter_chain.rs b/librashader-runtime-d3d11/src/filter_chain.rs index 9f24ab8..6a59a6f 100644 --- a/librashader-runtime-d3d11/src/filter_chain.rs +++ b/librashader-runtime-d3d11/src/filter_chain.rs @@ -25,6 +25,7 @@ use crate::{error, util, D3D11OutputView}; use librashader_cache::cache_shader_object; use librashader_cache::CachedCompilation; use librashader_presets::context::VideoDriver; +use librashader_reflect::reflect::cross::SpirvCross; use librashader_reflect::reflect::presets::{CompilePresetTarget, ShaderPassArtifact}; use librashader_runtime::binding::{BindingUtil, TextureInput}; use librashader_runtime::framebuffer::FramebufferInit; @@ -73,18 +74,22 @@ pub(crate) struct FilterCommon { pub(crate) draw_quad: DrawQuad, } -type ShaderPassMeta = ShaderPassArtifact + Send>; +type ShaderPassMeta = + ShaderPassArtifact> + Send>; fn compile_passes( shaders: Vec, textures: &[TextureConfig], disable_cache: bool, ) -> Result<(Vec, ShaderSemantics), FilterChainError> { let (passes, semantics) = if !disable_cache { - HLSL::compile_preset_passes::, FilterChainError>( - shaders, &textures, - )? + HLSL::compile_preset_passes::< + Glslang, + CachedCompilation, + SpirvCross, + FilterChainError, + >(shaders, &textures)? } else { - HLSL::compile_preset_passes::( + HLSL::compile_preset_passes::, FilterChainError>( shaders, &textures, )? }; diff --git a/librashader-runtime-d3d12/src/filter_chain.rs b/librashader-runtime-d3d12/src/filter_chain.rs index 0c4665f..4e1dd6c 100644 --- a/librashader-runtime-d3d12/src/filter_chain.rs +++ b/librashader-runtime-d3d12/src/filter_chain.rs @@ -48,6 +48,7 @@ use windows::Win32::System::Threading::{CreateEventA, WaitForSingleObject, INFIN use librashader_cache::CachedCompilation; use librashader_presets::context::VideoDriver; +use librashader_reflect::reflect::cross::SpirvCross; use librashader_runtime::framebuffer::FramebufferInit; use librashader_runtime::render_target::RenderTarget; use librashader_runtime::scaling::ScaleFramebuffer; @@ -145,18 +146,21 @@ impl Drop for FrameResiduals { } type DxilShaderPassMeta = - ShaderPassArtifact + Send>; + ShaderPassArtifact> + Send>; fn compile_passes_dxil( shaders: Vec, textures: &[TextureConfig], disable_cache: bool, ) -> Result<(Vec, ShaderSemantics), FilterChainError> { let (passes, semantics) = if !disable_cache { - DXIL::compile_preset_passes::, FilterChainError>( - shaders, &textures, - )? + DXIL::compile_preset_passes::< + Glslang, + CachedCompilation, + SpirvCross, + FilterChainError, + >(shaders, &textures)? } else { - DXIL::compile_preset_passes::( + DXIL::compile_preset_passes::, FilterChainError>( shaders, &textures, )? }; @@ -164,18 +168,21 @@ fn compile_passes_dxil( Ok((passes, semantics)) } type HlslShaderPassMeta = - ShaderPassArtifact + Send>; + ShaderPassArtifact> + Send>; fn compile_passes_hlsl( shaders: Vec, textures: &[TextureConfig], disable_cache: bool, ) -> Result<(Vec, ShaderSemantics), FilterChainError> { let (passes, semantics) = if !disable_cache { - HLSL::compile_preset_passes::, FilterChainError>( - shaders, &textures, - )? + HLSL::compile_preset_passes::< + Glslang, + CachedCompilation, + SpirvCross, + FilterChainError, + >(shaders, &textures)? } else { - HLSL::compile_preset_passes::( + HLSL::compile_preset_passes::, FilterChainError>( shaders, &textures, )? }; diff --git a/librashader-runtime-gl/src/filter_chain/filter_impl.rs b/librashader-runtime-gl/src/filter_chain/filter_impl.rs index 12254b4..4e45912 100644 --- a/librashader-runtime-gl/src/filter_chain/filter_impl.rs +++ b/librashader-runtime-gl/src/filter_chain/filter_impl.rs @@ -20,6 +20,7 @@ use librashader_reflect::front::{Glslang, SpirvCompilation}; use librashader_reflect::reflect::semantics::{ShaderSemantics, UniformMeta}; use librashader_cache::CachedCompilation; +use librashader_reflect::reflect::cross::SpirvCross; use librashader_reflect::reflect::presets::{CompilePresetTarget, ShaderPassArtifact}; use librashader_reflect::reflect::ReflectShader; use librashader_runtime::binding::BindingUtil; @@ -97,18 +98,22 @@ impl FilterChainImpl { } } -type ShaderPassMeta = ShaderPassArtifact>; +type ShaderPassMeta = + ShaderPassArtifact>>; fn compile_passes( shaders: Vec, textures: &[TextureConfig], disable_cache: bool, ) -> Result<(Vec, ShaderSemantics), FilterChainError> { let (passes, semantics) = if !disable_cache { - GLSL::compile_preset_passes::, FilterChainError>( - shaders, &textures, - )? + GLSL::compile_preset_passes::< + Glslang, + CachedCompilation, + SpirvCross, + FilterChainError, + >(shaders, &textures)? } else { - GLSL::compile_preset_passes::( + GLSL::compile_preset_passes::, FilterChainError>( shaders, &textures, )? }; diff --git a/librashader-runtime-vk/src/filter_chain.rs b/librashader-runtime-vk/src/filter_chain.rs index 6f6a7c0..12a029a 100644 --- a/librashader-runtime-vk/src/filter_chain.rs +++ b/librashader-runtime-vk/src/filter_chain.rs @@ -34,6 +34,7 @@ use std::sync::Arc; use librashader_cache::CachedCompilation; use librashader_presets::context::VideoDriver; +use librashader_reflect::reflect::cross::SpirvCross; use librashader_runtime::framebuffer::FramebufferInit; use librashader_runtime::render_target::RenderTarget; use librashader_runtime::scaling::ScaleFramebuffer; @@ -207,7 +208,9 @@ impl Drop for FrameResiduals { } } -type ShaderPassMeta = ShaderPassArtifact + Send>; +type ShaderPassMeta = ShaderPassArtifact< + impl CompileReflectShader> + Send, +>; fn compile_passes( shaders: Vec, textures: &[TextureConfig], @@ -217,12 +220,16 @@ fn compile_passes( SPIRV::compile_preset_passes::< Glslang, CachedCompilation, + SpirvCross, FilterChainError, >(shaders, &textures)? } else { - SPIRV::compile_preset_passes::( - shaders, &textures, - )? + SPIRV::compile_preset_passes::< + Glslang, + SpirvCompilation, + SpirvCross, + FilterChainError, + >(shaders, &textures)? }; Ok((passes, semantics)) diff --git a/librashader-runtime-wgpu/src/filter_chain.rs b/librashader-runtime-wgpu/src/filter_chain.rs index f8ce13e..a7f7cc0 100644 --- a/librashader-runtime-wgpu/src/filter_chain.rs +++ b/librashader-runtime-wgpu/src/filter_chain.rs @@ -21,6 +21,7 @@ use crate::buffer::WgpuStagedBuffer; use crate::draw_quad::DrawQuad; use librashader_common::{FilterMode, ImageFormat, Size, Viewport, WrapMode}; use librashader_reflect::back::wgsl::WgslCompileOptions; +use librashader_reflect::reflect::naga::Naga; use librashader_runtime::framebuffer::FramebufferInit; use librashader_runtime::render_target::RenderTarget; use librashader_runtime::scaling::ScaleFramebuffer; @@ -37,13 +38,14 @@ use crate::options::{FilterChainOptionsWgpu, FrameOptionsWgpu}; use crate::samplers::SamplerSet; use crate::texture::{InputImage, OwnedImage}; -type ShaderPassMeta = ShaderPassArtifact + Send>; +type ShaderPassMeta = + ShaderPassArtifact + Send>; fn compile_passes( shaders: Vec, textures: &[TextureConfig], ) -> Result<(Vec, ShaderSemantics), FilterChainError> { let (passes, semantics) = - WGSL::compile_preset_passes::( + WGSL::compile_preset_passes::( shaders, &textures, )?; Ok((passes, semantics))