Allowed mismatch sampler/comparison sampler when using SPIRV-Cross

When SPIRV-Cross we always reflect samplers as regular samplers. A
recent change implementing proper validation broke programs using
comparison samplers in that path.

Skip that bit of validation when using SPIRV-Cross, that hack can be
removed once we use Tint unconditionally for reflection.

Also reenables some BGL-ShaderModule compatibility tests with
SPIRV-Cross to cover the "fixed" validation.

Bug: dawn:571
Bug: dawn:367
Change-Id: I2d1a65aaea717b4927ac4e838942547a1b413d33
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56900
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Corentin Wallez
2021-07-05 15:07:49 +00:00
committed by Dawn LUCI CQ
parent 3be120026d
commit 7ae959da60
2 changed files with 12 additions and 8 deletions

View File

@@ -484,7 +484,7 @@ namespace dawn_native {
return std::move(result);
}
MaybeError ValidateCompatibilityWithBindGroupLayout(DeviceBase*,
MaybeError ValidateCompatibilityWithBindGroupLayout(DeviceBase* device,
BindGroupIndex group,
const EntryPointMetadata& entryPoint,
const BindGroupLayoutBase* layout) {
@@ -622,6 +622,13 @@ namespace dawn_native {
}
case BindingInfoType::Sampler:
// Allow mismatched samplers when using SPIRV-Cross since we can't reflect
// data that's precise enough.
// TODO(dawn:571): Remove once we use Tint unconditionnally for reflection.
if (!device->IsToggleEnabled(Toggle::UseTintGenerator)) {
break;
}
if ((layoutInfo.sampler.type == wgpu::SamplerBindingType::Comparison) !=
shaderInfo.sampler.isComparison) {
return DAWN_VALIDATION_ERROR(