rt(wgpu): use Option::filter
instead of let_chains
This commit is contained in:
parent
2661effab4
commit
57f9a13ee7
|
@ -180,8 +180,11 @@ impl FilterPass {
|
||||||
|
|
||||||
render_pass.set_bind_group(1, &sampler_bind_group, &[]);
|
render_pass.set_bind_group(1, &sampler_bind_group, &[]);
|
||||||
|
|
||||||
if let Some(push) = &self.reflection.push_constant
|
if let Some(push) = &self
|
||||||
&& !has_pcb_buffer
|
.reflection
|
||||||
|
.push_constant
|
||||||
|
.as_ref()
|
||||||
|
.filter(|_| !has_pcb_buffer)
|
||||||
{
|
{
|
||||||
let mut stage_mask = ShaderStages::empty();
|
let mut stage_mask = ShaderStages::empty();
|
||||||
if push.stage_mask.contains(BindingStage::FRAGMENT) {
|
if push.stage_mask.contains(BindingStage::FRAGMENT) {
|
||||||
|
|
|
@ -56,8 +56,10 @@ impl PipelineLayoutObjects {
|
||||||
|
|
||||||
let mut push_constant_range = Vec::new();
|
let mut push_constant_range = Vec::new();
|
||||||
|
|
||||||
if let Some(push_meta) = reflection.push_constant.as_ref()
|
if let Some(push_meta) = reflection
|
||||||
&& !push_meta.stage_mask.is_empty()
|
.push_constant
|
||||||
|
.as_ref()
|
||||||
|
.filter(|push_meta| !push_meta.stage_mask.is_empty())
|
||||||
{
|
{
|
||||||
let push_mask = util::binding_stage_to_wgpu_stage(push_meta.stage_mask);
|
let push_mask = util::binding_stage_to_wgpu_stage(push_meta.stage_mask);
|
||||||
|
|
||||||
|
@ -80,8 +82,10 @@ impl PipelineLayoutObjects {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(ubo_meta) = reflection.ubo.as_ref()
|
if let Some(ubo_meta) = reflection
|
||||||
&& !ubo_meta.stage_mask.is_empty()
|
.ubo
|
||||||
|
.as_ref()
|
||||||
|
.filter(|ubo_meta| !ubo_meta.stage_mask.is_empty())
|
||||||
{
|
{
|
||||||
let ubo_mask = util::binding_stage_to_wgpu_stage(ubo_meta.stage_mask);
|
let ubo_mask = util::binding_stage_to_wgpu_stage(ubo_meta.stage_mask);
|
||||||
main_bindings.push(BindGroupLayoutEntry {
|
main_bindings.push(BindGroupLayoutEntry {
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
//! See [`librashader::runtime::wgpu`](https://docs.rs/librashader/latest/librashader/runtime/wgpu/index.html) instead.
|
//! See [`librashader::runtime::wgpu`](https://docs.rs/librashader/latest/librashader/runtime/wgpu/index.html) instead.
|
||||||
#![deny(unsafe_op_in_unsafe_fn)]
|
#![deny(unsafe_op_in_unsafe_fn)]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
#![feature(let_chains)]
|
|
||||||
|
|
||||||
mod buffer;
|
mod buffer;
|
||||||
mod draw_quad;
|
mod draw_quad;
|
||||||
|
|
|
@ -124,7 +124,8 @@ impl<'a> State<'a> {
|
||||||
//
|
//
|
||||||
// let preset = ShaderPreset::try_parse("../test/basic.slangp").unwrap();
|
// let preset = ShaderPreset::try_parse("../test/basic.slangp").unwrap();
|
||||||
//
|
//
|
||||||
let preset = ShaderPreset::try_parse("../test/shaders_slang/test/feedback.slangp").unwrap();
|
let preset =
|
||||||
|
ShaderPreset::try_parse("../test/shaders_slang/crt/crt-royale.slangp").unwrap();
|
||||||
|
|
||||||
// let preset = ShaderPreset::try_parse(
|
// let preset = ShaderPreset::try_parse(
|
||||||
// "../test/shaders_slang/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp",
|
// "../test/shaders_slang/bezel/Mega_Bezel/Presets/MBZ__0__SMOOTH-ADV.slangp",
|
||||||
|
|
Loading…
Reference in a new issue