Fix default viewDimension in deprecated BGLEntry path.

The handling of the default view dimension in the deprecated bind group
layout entry path was checking the viewDimension of the new
sub-descriptor instead of the deprecated viewDimension member. This
meant that viewDimension was always defaulted and "2D".

This commit fixes the issue by looking at the correct viewDimension member
and adds a regression deprecation test.

Bug: dawn:620

Change-Id: Icc133b6d80ba3d88bae30dc9138f1d74e14d12c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36841
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Corentin Wallez
2021-01-07 17:33:44 +00:00
committed by Commit Bot service account
parent 400a5e2710
commit 00fcab636a
2 changed files with 48 additions and 6 deletions

View File

@@ -443,8 +443,7 @@ namespace dawn_native {
case wgpu::BindingType::SampledTexture:
bindingInfo.bindingType = BindingInfoType::Texture;
bindingInfo.texture.viewDimension = binding.viewDimension;
if (binding.texture.viewDimension ==
wgpu::TextureViewDimension::Undefined) {
if (binding.viewDimension == wgpu::TextureViewDimension::Undefined) {
bindingInfo.texture.viewDimension = wgpu::TextureViewDimension::e2D;
}
@@ -469,8 +468,7 @@ namespace dawn_native {
bindingInfo.storageTexture.access = wgpu::StorageTextureAccess::ReadOnly;
bindingInfo.storageTexture.format = binding.storageTextureFormat;
bindingInfo.storageTexture.viewDimension = binding.viewDimension;
if (binding.storageTexture.viewDimension ==
wgpu::TextureViewDimension::Undefined) {
if (binding.viewDimension == wgpu::TextureViewDimension::Undefined) {
bindingInfo.storageTexture.viewDimension =
wgpu::TextureViewDimension::e2D;
}
@@ -480,8 +478,7 @@ namespace dawn_native {
bindingInfo.storageTexture.access = wgpu::StorageTextureAccess::WriteOnly;
bindingInfo.storageTexture.format = binding.storageTextureFormat;
bindingInfo.storageTexture.viewDimension = binding.viewDimension;
if (binding.storageTexture.viewDimension ==
wgpu::TextureViewDimension::Undefined) {
if (binding.viewDimension == wgpu::TextureViewDimension::Undefined) {
bindingInfo.storageTexture.viewDimension =
wgpu::TextureViewDimension::e2D;
}