From 98597da1ec44be4c0722454c99f051a257760dc8 Mon Sep 17 00:00:00 2001 From: Jinlei Li Date: Thu, 30 Jun 2022 11:36:11 +0800 Subject: [PATCH] Allow fragment stage to have more outputs than the pipeline has (#2822) --- wgpu-core/src/device/mod.rs | 16 +++++++--------- wgpu-core/src/pipeline.rs | 4 ---- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index e2475be84a..5c89c09430 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -2774,16 +2774,14 @@ impl Device { }, )?; } - 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 + ); } } } diff --git a/wgpu-core/src/pipeline.rs b/wgpu-core/src/pipeline.rs index 8c31d23e89..ca30e56a2e 100644 --- a/wgpu-core/src/pipeline.rs +++ b/wgpu-core/src/pipeline.rs @@ -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")] @@ -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")]