BindGroupLayoutInternal: use trivial frontend defaults for viewDimension
Bug: dawn:2475
Change-Id: I7e3b5e33506b10da83f501b52c5361462ddefd1b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/183282
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn/native/BindGroupLayoutInternal.cpp b/src/dawn/native/BindGroupLayoutInternal.cpp
index 52ed614..4c3cc41 100644
--- a/src/dawn/native/BindGroupLayoutInternal.cpp
+++ b/src/dawn/native/BindGroupLayoutInternal.cpp
@@ -397,18 +397,11 @@
} else if (binding->sampler.type != wgpu::SamplerBindingType::Undefined) {
bindingInfo.bindingLayout = binding->sampler;
} else if (binding->texture.sampleType != wgpu::TextureSampleType::Undefined) {
- TextureBindingLayout bindingLayout = binding->texture.WithTrivialFrontendDefaults();
- if (binding->texture.viewDimension == wgpu::TextureViewDimension::Undefined) {
- bindingLayout.viewDimension = wgpu::TextureViewDimension::e2D;
- }
- bindingInfo.bindingLayout = TextureBindingInfo(bindingLayout);
+ bindingInfo.bindingLayout =
+ TextureBindingInfo(binding->texture.WithTrivialFrontendDefaults());
} else if (binding->storageTexture.access != wgpu::StorageTextureAccess::Undefined) {
- StorageTextureBindingLayout bindingLayout =
- binding->storageTexture.WithTrivialFrontendDefaults();
- if (binding->storageTexture.viewDimension == wgpu::TextureViewDimension::Undefined) {
- bindingLayout.viewDimension = wgpu::TextureViewDimension::e2D;
- }
- bindingInfo.bindingLayout = StorageTextureBindingInfo(bindingLayout);
+ bindingInfo.bindingLayout =
+ StorageTextureBindingInfo(binding->storageTexture.WithTrivialFrontendDefaults());
} else if (auto* staticSamplerBindingLayout = binding.Get<StaticSamplerBindingLayout>()) {
StaticSamplerHolderBindingLayout bindingLayout;
bindingLayout.sampler = staticSamplerBindingLayout->sampler;