Skip to content

Commit

Permalink
Allow fragment stage to have more outputs than the pipeline has (#2822)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili authored Jun 30, 2022
1 parent 1d8bc57 commit 98597da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
16 changes: 7 additions & 9 deletions wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2774,16 +2774,14 @@ impl<A: HalApi> Device<A> {
},
)?;
}
Some(&None) => {
return Err(
pipeline::CreateRenderPipelineError::InvalidFragmentOutputLocation(*i),
);
}
_ => {
return Err(pipeline::CreateRenderPipelineError::ColorState(
*i as u8,
pipeline::ColorStateError::Missing,
));
log::info!(
"The fragment stage {:?} output @location({}) values are ignored",
fragment_stage
.as_ref()
.map_or("", |stage| stage.entry_point),
i
);
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions wgpu-core/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ pub struct RenderPipelineDescriptor<'a> {

#[derive(Clone, Debug, Error)]
pub enum ColorStateError {
#[error("output is missing")]
Missing,
#[error("format {0:?} is not renderable")]
FormatNotRenderable(wgt::TextureFormat),
#[error("format {0:?} is not blendable")]
Expand Down Expand Up @@ -317,8 +315,6 @@ pub enum CreateRenderPipelineError {
Device(#[from] DeviceError),
#[error("pipeline layout is invalid")]
InvalidLayout,
#[error("fragment output @location({0}) is invalid")]
InvalidFragmentOutputLocation(u32),
#[error("unable to derive an implicit layout")]
Implicit(#[from] ImplicitLayoutError),
#[error("color state [{0}] is invalid")]
Expand Down

0 comments on commit 98597da

Please sign in to comment.