Skip to content

Commit 98597da

Browse files
authored
Allow fragment stage to have more outputs than the pipeline has (#2822)
1 parent 1d8bc57 commit 98597da

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

wgpu-core/src/device/mod.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2774,16 +2774,14 @@ impl<A: HalApi> Device<A> {
27742774
},
27752775
)?;
27762776
}
2777-
Some(&None) => {
2778-
return Err(
2779-
pipeline::CreateRenderPipelineError::InvalidFragmentOutputLocation(*i),
2780-
);
2781-
}
27822777
_ => {
2783-
return Err(pipeline::CreateRenderPipelineError::ColorState(
2784-
*i as u8,
2785-
pipeline::ColorStateError::Missing,
2786-
));
2778+
log::info!(
2779+
"The fragment stage {:?} output @location({}) values are ignored",
2780+
fragment_stage
2781+
.as_ref()
2782+
.map_or("", |stage| stage.entry_point),
2783+
i
2784+
);
27872785
}
27882786
}
27892787
}

wgpu-core/src/pipeline.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ pub struct RenderPipelineDescriptor<'a> {
280280

281281
#[derive(Clone, Debug, Error)]
282282
pub enum ColorStateError {
283-
#[error("output is missing")]
284-
Missing,
285283
#[error("format {0:?} is not renderable")]
286284
FormatNotRenderable(wgt::TextureFormat),
287285
#[error("format {0:?} is not blendable")]
@@ -317,8 +315,6 @@ pub enum CreateRenderPipelineError {
317315
Device(#[from] DeviceError),
318316
#[error("pipeline layout is invalid")]
319317
InvalidLayout,
320-
#[error("fragment output @location({0}) is invalid")]
321-
InvalidFragmentOutputLocation(u32),
322318
#[error("unable to derive an implicit layout")]
323319
Implicit(#[from] ImplicitLayoutError),
324320
#[error("color state [{0}] is invalid")]

0 commit comments

Comments
 (0)