Remove deprecated depth texture sampling path

Removes deprecated path for sampling depth textures with
float/unfilterable-float. Attempting to do so now results in a
validation error.

Bug: dawn:1021
Change-Id: I112f45e7227ab1caaf0d6ed203194295e7022db2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61861
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This commit is contained in:
Brandon Jones 2021-08-16 19:55:00 +00:00 committed by Dawn LUCI CQ
parent e53a7cc874
commit e1bdfa8d32
2 changed files with 4 additions and 15 deletions

View File

@ -150,15 +150,7 @@ namespace dawn_native {
}
if ((supportedTypes & requiredType) == 0) {
if (IsSubset(SampleTypeBit::Depth, supportedTypes) != 0 &&
IsSubset(requiredType,
SampleTypeBit::Float | SampleTypeBit::UnfilterableFloat)) {
device->EmitDeprecationWarning(
"Using depth textures with 'float' or 'unfilterable-float' texture "
"bindings is deprecated. Use 'depth' instead.");
} else {
return DAWN_VALIDATION_ERROR("Texture component type usage mismatch");
}
return DAWN_VALIDATION_ERROR("Texture component type usage mismatch");
}
if (entry.textureView->GetDimension() != bindingInfo.texture.viewDimension) {

View File

@ -472,12 +472,9 @@ TEST_F(BindGroupValidationTest, TextureSampleType) {
DoTest(false, wgpu::TextureFormat::R32Float, wgpu::TextureSampleType::Uint);
DoTest(false, wgpu::TextureFormat::R32Float, wgpu::TextureSampleType::Sint);
// Test that Depth32Float is only compatible with depth. float/unfilterable-float is deprecated.
// TODO(crbug.com/dawn/1021): Disallow using float/unfilterable-float with depth textures.
EXPECT_DEPRECATION_WARNING(
DoTest(true, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::Float));
EXPECT_DEPRECATION_WARNING(DoTest(true, wgpu::TextureFormat::Depth32Float,
wgpu::TextureSampleType::UnfilterableFloat));
// Test that Depth32Float is only compatible with depth.
DoTest(false, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::Float);
DoTest(false, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::UnfilterableFloat);
DoTest(true, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::Depth);
DoTest(false, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::Uint);
DoTest(false, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::Sint);