diff --git a/librashader-runtime-d3d11/src/filter_chain.rs b/librashader-runtime-d3d11/src/filter_chain.rs index f6e4122..37a4894 100644 --- a/librashader-runtime-d3d11/src/filter_chain.rs +++ b/librashader-runtime-d3d11/src/filter_chain.rs @@ -269,22 +269,23 @@ impl FilterChainD3D11 { disable_cache, )?; - let ubo_cbuffer = if let Some(ubo) = &reflection.ubo - && ubo.size != 0 - { - let buffer = FilterChainD3D11::create_constant_buffer(device, ubo.size)?; - Some(ConstantBufferBinding { - binding: ubo.binding, - size: ubo.size, - stage_mask: ubo.stage_mask, - buffer, - }) - } else { - None - }; + let ubo_cbuffer = + if let Some(ubo) = &reflection.ubo.as_ref().filter(|ubo| ubo.size != 0) { + let buffer = FilterChainD3D11::create_constant_buffer(device, ubo.size)?; + Some(ConstantBufferBinding { + binding: ubo.binding, + size: ubo.size, + stage_mask: ubo.stage_mask, + buffer, + }) + } else { + None + }; - let push_cbuffer = if let Some(push) = &reflection.push_constant - && push.size != 0 + let push_cbuffer = if let Some(push) = &reflection + .push_constant + .as_ref() + .filter(|push| push.size != 0) { let buffer = FilterChainD3D11::create_constant_buffer(device, push.size)?; Some(ConstantBufferBinding { @@ -518,7 +519,6 @@ impl FilterChainD3D11 { QuadType::Final, )?; - pass.draw( &ctx, index, diff --git a/librashader-runtime-d3d11/src/lib.rs b/librashader-runtime-d3d11/src/lib.rs index 0769379..0452333 100644 --- a/librashader-runtime-d3d11/src/lib.rs +++ b/librashader-runtime-d3d11/src/lib.rs @@ -6,7 +6,6 @@ //! See [`librashader::runtime::d3d11`](https://docs.rs/librashader/latest/librashader/runtime/d3d11/index.html) instead. #![feature(type_alias_impl_trait)] -#![feature(let_chains)] mod draw_quad; mod filter_chain; diff --git a/librashader-runtime-d3d11/src/util.rs b/librashader-runtime-d3d11/src/util.rs index c8ad1ad..6ec51a6 100644 --- a/librashader-runtime-d3d11/src/util.rs +++ b/librashader-runtime-d3d11/src/util.rs @@ -97,8 +97,11 @@ pub fn d3d11_get_closest_format( for supported in format_support_list { unsafe { - if let Ok(supported_format) = device.CheckFormatSupport(*supported) - && (supported_format & format_support_mask) == format_support_mask + if device + .CheckFormatSupport(*supported) + .is_ok_and(|supported_format| { + (supported_format & format_support_mask) == format_support_mask + }) { return *supported; } diff --git a/librashader-runtime-d3d11/tests/triangle.rs b/librashader-runtime-d3d11/tests/triangle.rs index 5d678e8..8f1e272 100644 --- a/librashader-runtime-d3d11/tests/triangle.rs +++ b/librashader-runtime-d3d11/tests/triangle.rs @@ -15,9 +15,9 @@ use librashader_runtime_d3d11::options::FilterChainOptionsD3D11; // const FILTER_PATH: &str = "../test/shaders_slang/crt/crt-royale.slangp"; // const FILTER_PATH: &str = "../test/slang-shaders/test/history.slangp"; -const FILTER_PATH: &str = "../test/shaders_slang/test/feedback.slangp"; +// const FILTER_PATH: &str = "../test/shaders_slang/test/feedback.slangp"; -// const FILTER_PATH: &str = "../test/shaders_slang/crt/crt-royale.slangp"; +const FILTER_PATH: &str = "../test/shaders_slang/crt/crt-royale.slangp"; const IMAGE_PATH: &str = "../triangle.png"; #[test] fn triangle_d3d11_args() {