Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Bottom level categories:

#### General

- BREAKING: Migrated from the `maxInterStageShaderComponents` limit to `maxInterStageShaderVariables`, which changes validation in a way that should not affect most programs. This follows the latest changes of the WebGPU spec. By @ErichDonGubler in [#8652](https://github.com/gfx-rs/wgpu/pull/8652).
- BREAKING: Migrated from the `maxInterStageShaderComponents` limit to `maxInterStageShaderVariables`, which changes validation in a way that should not affect most programs. This follows the latest changes of the WebGPU spec. By @ErichDonGubler in [#8652](https://github.com/gfx-rs/wgpu/pull/8652), [#8792](https://github.com/gfx-rs/wgpu/pull/8792).
- Fixed validation of the texture format in GPUDepthStencilState when neither depth nor stencil is actually enabled. By @andyleiserson in [#8766](https://github.com/gfx-rs/wgpu/pull/8766).

#### GLES
Expand Down
10 changes: 10 additions & 0 deletions cts_runner/test.lst
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ webgpu:api,validation,render_pipeline,depth_stencil_state:stencil_write:*
webgpu:api,validation,render_pipeline,inter_stage:max_shader_variable_location:isAsync=false;*
//FAIL: webgpu:api,validation,render_pipeline,inter_stage:max_shader_variable_location:isAsync=true;*
// https://github.com/gfx-rs/wgpu/pull/8712
webgpu:api,validation,render_pipeline,inter_stage:max_variables_count,input:isAsync=false;numVariablesDelta=0;useExtraBuiltinInputs=false
webgpu:api,validation,render_pipeline,inter_stage:max_variables_count,input:isAsync=false;numVariablesDelta=0;useExtraBuiltinInputs=true
webgpu:api,validation,render_pipeline,inter_stage:max_variables_count,input:isAsync=false;numVariablesDelta=1;useExtraBuiltinInputs=false
//FAIL: webgpu:api,validation,render_pipeline,inter_stage:max_variables_count,input:isAsync=false;numVariablesDelta=-1;useExtraBuiltinInputs=true
// https://github.com/gpuweb/cts/pull/4546
webgpu:api,validation,render_pipeline,inter_stage:max_variables_count,input:isAsync=true;numVariablesDelta=0;useExtraBuiltinInputs=false
webgpu:api,validation,render_pipeline,inter_stage:max_variables_count,input:isAsync=true;numVariablesDelta=0;useExtraBuiltinInputs=true
webgpu:api,validation,render_pipeline,inter_stage:max_variables_count,input:isAsync=true;numVariablesDelta=1;useExtraBuiltinInputs=false
//FAIL: webgpu:api,validation,render_pipeline,inter_stage:max_variables_count,input:isAsync=true;numVariablesDelta=-1;useExtraBuiltinInputs=true
// https://github.com/gpuweb/cts/pull/4546
webgpu:api,validation,render_pipeline,inter_stage:max_variables_count,output:*
webgpu:api,validation,resource_usages,buffer,in_pass_encoder:*
// FAIL: 2 other cases in resource_usages,texture,in_pass_encoder. https://github.com/gfx-rs/wgpu/issues/3126
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ impl Interface {
for output in entry_point.inputs.iter() {
match *output {
Varying::Local { ref iv, location } => {
if location >= max_fragment_shader_input_variables {
if location >= self.limits.max_inter_stage_shader_variables {
return Err(StageError::FragmentInputLocationTooLarge {
location,
var: iv.clone(),
Expand Down
17 changes: 13 additions & 4 deletions wgpu-core/src/validation/shader_io_deductions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl MaxFragmentShaderInputDeduction {
| InterStageBuiltIn::ViewIndex
| InterStageBuiltIn::PointCoord => 1,
InterStageBuiltIn::Barycentric => 3,
InterStageBuiltIn::Position => 4,
InterStageBuiltIn::Position => 0,
},
}
}
Expand All @@ -58,6 +58,7 @@ impl MaxFragmentShaderInputDeduction {
use naga::BuiltIn;

Some(Self::InterStageBuiltIn(match builtin {
BuiltIn::Position { .. } => InterStageBuiltIn::Position,
BuiltIn::FrontFacing => InterStageBuiltIn::FrontFacing,
BuiltIn::SampleIndex => InterStageBuiltIn::SampleIndex,
BuiltIn::SampleMask => InterStageBuiltIn::SampleMask,
Expand All @@ -67,7 +68,6 @@ impl MaxFragmentShaderInputDeduction {

BuiltIn::PointCoord => InterStageBuiltIn::PointCoord,
BuiltIn::Barycentric => InterStageBuiltIn::Barycentric,
BuiltIn::Position { .. } => InterStageBuiltIn::Position,
BuiltIn::ViewIndex => InterStageBuiltIn::ViewIndex,

BuiltIn::BaseInstance
Expand Down Expand Up @@ -107,6 +107,7 @@ impl MaxFragmentShaderInputDeduction {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum InterStageBuiltIn {
// Standard for WebGPU
Position,
FrontFacing,
SampleIndex,
SampleMask,
Expand All @@ -117,7 +118,6 @@ pub enum InterStageBuiltIn {
// Non-standard
PointCoord,
Barycentric,
Position,
ViewIndex,
}

Expand Down Expand Up @@ -147,9 +147,18 @@ where
.filter(|(_, effective_deduction)| *effective_deduction > 0);
if relevant_deductions.clone().next().is_some() {
writeln!(f, "; note that some deductions apply during validation:")?;
let mut wrote_something = false;
for deduction in deductions {
writeln!(f, "\n- {deduction:?}: {}", accessor(deduction))?;
let deducted_amount = accessor(deduction);
if deducted_amount > 0 {
writeln!(f, "\n- {deduction:?}: {}", accessor(deduction))?;
wrote_something = true;
}
}
debug_assert!(
wrote_something,
"no substantial deductions found in error display"
);
}
Ok(())
})
Expand Down