Skip to content

Commit

Permalink
Revert "Adjust fragment state blend factor and write mask validation (#…
Browse files Browse the repository at this point in the history
…3217)" (#3218)

This reverts commit 114229d.
  • Loading branch information
kainino0x authored Dec 8, 2023
1 parent 114229d commit 3cbe1f7
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/webgpu/api/validation/render_pipeline/fragment_state.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ g.test('pipeline_output_targets')
g.test('pipeline_output_targets,blend')
.desc(
`On top of requirements from pipeline_output_targets, when blending is enabled and alpha channel is read indicated by any blend factor, an extra requirement is added:
- fragment output must have an alpha channel (i.e. it must be vec4), otherwise writeMask must be 0.
- fragment output must be vec4.
`
)
.params(u =>
Expand All @@ -382,14 +382,6 @@ g.test('pipeline_output_targets,blend')
...u.combine('alphaSrcFactor', kBlendFactors),
...u.combine('alphaDstFactor', kBlendFactors),
] as const)
.expand('writeMask', function* (p) {
yield 0;
for (let i = 0; i < p.componentCount; i++) {
yield 1 << i;
}
// default full mask
yield 0xf;
})
)
.beforeAllSubcases(t => {
const { format } = t.params;
Expand All @@ -406,7 +398,6 @@ g.test('pipeline_output_targets,blend')
colorDstFactor,
alphaSrcFactor,
alphaDstFactor,
writeMask,
} = t.params;
const info = kTextureFormatInfo[format];

Expand All @@ -418,7 +409,6 @@ g.test('pipeline_output_targets,blend')
color: { srcFactor: colorSrcFactor, dstFactor: colorDstFactor },
alpha: { srcFactor: alphaSrcFactor, dstFactor: alphaDstFactor },
},
writeMask,
},
],
fragmentShaderCode: getFragmentShaderCodeWithOutput([
Expand All @@ -432,6 +422,6 @@ g.test('pipeline_output_targets,blend')
const _success =
info.color.type === sampleType &&
componentCount >= kTexelRepresentationInfo[format].componentOrder.length &&
(meetsExtraBlendingRequirement || writeMask === 0);
meetsExtraBlendingRequirement;
t.doCreateRenderPipelineTest(isAsync, _success, descriptor);
});

0 comments on commit 3cbe1f7

Please sign in to comment.