mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-15 20:01:22 +00:00
Remove some validation for alpha.src/dstFactor
Validation rules revised at https://github.com/gpuweb/gpuweb/issues/2013#issuecomment-897364617 Bug: dawn:1063 Change-Id: I8ae1cd00f75c8049206a8c5f6fcdb879e1b6a469 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61821 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Shrek Shao <shrekshao@google.com> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
This commit is contained in:
parent
31f039350b
commit
5486a2fba5
@ -259,11 +259,6 @@ namespace dawn_native {
|
|||||||
blendFactor == wgpu::BlendFactor::SrcAlphaSaturated;
|
blendFactor == wgpu::BlendFactor::SrcAlphaSaturated;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlendFactorContainsSrc(const wgpu::BlendFactor& blendFactor) {
|
|
||||||
return blendFactor == wgpu::BlendFactor::Src ||
|
|
||||||
blendFactor == wgpu::BlendFactor::OneMinusSrc;
|
|
||||||
}
|
|
||||||
|
|
||||||
MaybeError ValidateColorTargetState(
|
MaybeError ValidateColorTargetState(
|
||||||
DeviceBase* device,
|
DeviceBase* device,
|
||||||
const ColorTargetState* descriptor,
|
const ColorTargetState* descriptor,
|
||||||
@ -312,13 +307,6 @@ namespace dawn_native {
|
|||||||
"Color blending factor is reading alpha but it is missing from "
|
"Color blending factor is reading alpha but it is missing from "
|
||||||
"fragment output");
|
"fragment output");
|
||||||
}
|
}
|
||||||
if (descriptor->blend->alpha.srcFactor != wgpu::BlendFactor::Zero ||
|
|
||||||
BlendFactorContainsSrc(descriptor->blend->alpha.dstFactor) ||
|
|
||||||
BlendFactorContainsSrcAlpha(descriptor->blend->alpha.dstFactor)) {
|
|
||||||
return DAWN_VALIDATION_ERROR(
|
|
||||||
"Alpha blending factor is reading alpha but it is missing from "
|
|
||||||
"fragment output");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -329,15 +329,7 @@ TEST_F(RenderPipelineValidationTest, FragmentOutputComponentCountCompatibility)
|
|||||||
if (BlendFactorContainsSrcAlpha(
|
if (BlendFactorContainsSrcAlpha(
|
||||||
descriptor.cTargets[0].blend->color.srcFactor) ||
|
descriptor.cTargets[0].blend->color.srcFactor) ||
|
||||||
BlendFactorContainsSrcAlpha(
|
BlendFactorContainsSrcAlpha(
|
||||||
descriptor.cTargets[0].blend->color.dstFactor) ||
|
descriptor.cTargets[0].blend->color.dstFactor)) {
|
||||||
descriptor.cTargets[0].blend->alpha.srcFactor !=
|
|
||||||
wgpu::BlendFactor::Zero ||
|
|
||||||
descriptor.cTargets[0].blend->alpha.dstFactor ==
|
|
||||||
wgpu::BlendFactor::Src ||
|
|
||||||
descriptor.cTargets[0].blend->alpha.dstFactor ==
|
|
||||||
wgpu::BlendFactor::OneMinusSrc ||
|
|
||||||
BlendFactorContainsSrcAlpha(
|
|
||||||
descriptor.cTargets[0].blend->alpha.dstFactor)) {
|
|
||||||
valid = componentCount == 4;
|
valid = componentCount == 4;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user