Make depth format with filtering sample an error.
We added a deprecation warning in 132. Now we're making
it an error like the spec requires.
Bug: 379788112
Change-Id: I6bb63d9bf7b762fd94272a973119094d871b8875
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/226294
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Gregg Tavares <gman@chromium.org>
diff --git a/src/dawn/native/ShaderModule.cpp b/src/dawn/native/ShaderModule.cpp
index 1bee8ba..9ed810d 100644
--- a/src/dawn/native/ShaderModule.cpp
+++ b/src/dawn/native/ShaderModule.cpp
@@ -1366,24 +1366,11 @@
DAWN_INVALID_IF(
sampledTextureBindingInfo.sampleType != wgpu::TextureSampleType::Float &&
- // TODO(crbug.com/376497143): remove Depth as it's invalid WebGPU. See deprecation
- // warning below.
- sampledTextureBindingInfo.sampleType != wgpu::TextureSampleType::Depth &&
sampledTextureBindingInfo.sampleType != kInternalResolveAttachmentSampleType,
"Texture binding (group:%u, binding:%u) is %s but used statically with a sampler "
"(group:%u, binding:%u) that's %s",
pair.texture.group, pair.texture.binding, sampledTextureBindingInfo.sampleType,
pair.sampler.group, pair.sampler.binding, wgpu::SamplerBindingType::Filtering);
-
- // TODO(crbug.com/376497143): remove this deprecation warning.
- if (sampledTextureBindingInfo.sampleType == wgpu::TextureSampleType::Depth) {
- const char* msg =
- "Using a TextureType::Depth with SamplerType::Filtering is deprecated."
- "TextureType::Depth can only be used with SamplerType::NonFiltering or "
- "SamplerType::Comparison.";
- device->EmitWarningOnce(msg);
- device->GetInstance()->EmitDeprecationWarning(msg);
- }
}
// Validate compatibility of the pixel local storage.
diff --git a/src/dawn/tests/unittests/validation/BindGroupValidationTests.cpp b/src/dawn/tests/unittests/validation/BindGroupValidationTests.cpp
index 22e0d21..6db82b1 100644
--- a/src/dawn/tests/unittests/validation/BindGroupValidationTests.cpp
+++ b/src/dawn/tests/unittests/validation/BindGroupValidationTests.cpp
@@ -3434,20 +3434,18 @@
})");
}
- // TODO(crbug.com/376497143): switch this to an error. depth with filtering sampler is
- // deprecated. Test that a filtering sampler can be used to sample a depth texture.
+ // Test that a filtering sampler can not be used to sample a depth texture.
{
- ++mLastWarningCount;
wgpu::BindGroupLayout bindGroupLayout = utils::MakeBindGroupLayout(
device, {{0, wgpu::ShaderStage::Fragment, wgpu::SamplerBindingType::Filtering},
{1, wgpu::ShaderStage::Fragment, wgpu::TextureSampleType::Depth}});
- CreateFragmentPipeline(&bindGroupLayout, R"(
+ ASSERT_DEVICE_ERROR(CreateFragmentPipeline(&bindGroupLayout, R"(
@group(0) @binding(0) var mySampler: sampler;
@group(0) @binding(1) var myTexture: texture_depth_2d;
@fragment fn main() {
_ = textureSample(myTexture, mySampler, vec2f(0.0, 0.0));
- })");
+ })"));
}
// Test that a non-filtering sampler can be used to sample a depth texture.