Merge BindGroupLayout and ShaderModule BindingInfos

This moves BindGroupLayoutBase::BindingInfo into the dawn_native
namespace and changes ShaderModule::BindingInfo to extend it with
SPIR-V ids.

Bug: dawn:354
Change-Id: I6a2187e94c0200bee729cf8290f74e4f8c648334
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17920
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index ab51de4..ee3e71e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -175,6 +175,7 @@
     "src/dawn_native/BindGroupLayout.cpp",
     "src/dawn_native/BindGroupLayout.h",
     "src/dawn_native/BindGroupTracker.h",
+    "src/dawn_native/BindingInfo.h",
     "src/dawn_native/BuddyAllocator.cpp",
     "src/dawn_native/BuddyAllocator.h",
     "src/dawn_native/BuddyMemoryAllocator.cpp",
diff --git a/src/dawn_native/BindGroup.cpp b/src/dawn_native/BindGroup.cpp
index c21ae23..74db217 100644
--- a/src/dawn_native/BindGroup.cpp
+++ b/src/dawn_native/BindGroup.cpp
@@ -64,7 +64,7 @@
         MaybeError ValidateTextureBinding(const DeviceBase* device,
                                           const BindGroupBinding& binding,
                                           wgpu::TextureUsage requiredUsage,
-                                          const BindGroupLayoutBase::BindingInfo& bindingInfo) {
+                                          const BindingInfo& bindingInfo) {
             if (binding.textureView == nullptr || binding.sampler != nullptr ||
                 binding.buffer != nullptr) {
                 return DAWN_VALIDATION_ERROR("expected texture binding");
@@ -146,8 +146,7 @@
             }
             bindingsSet.set(bindingIndex);
 
-            const BindGroupLayoutBase::BindingInfo& bindingInfo =
-                descriptor->layout->GetBindingInfo(bindingIndex);
+            const BindingInfo& bindingInfo = descriptor->layout->GetBindingInfo(bindingIndex);
 
             // Perform binding-type specific validation.
             switch (bindingInfo.type) {
diff --git a/src/dawn_native/BindGroupAndStorageBarrierTracker.h b/src/dawn_native/BindGroupAndStorageBarrierTracker.h
index 34bbe2e..3b0849f 100644
--- a/src/dawn_native/BindGroupAndStorageBarrierTracker.h
+++ b/src/dawn_native/BindGroupAndStorageBarrierTracker.h
@@ -41,8 +41,7 @@
 
                 for (BindingIndex bindingIndex = 0; bindingIndex < layout->GetBindingCount();
                      ++bindingIndex) {
-                    const BindGroupLayoutBase::BindingInfo& bindingInfo =
-                        layout->GetBindingInfo(bindingIndex);
+                    const BindingInfo& bindingInfo = layout->GetBindingInfo(bindingIndex);
 
                     if ((bindingInfo.visibility & wgpu::ShaderStage::Compute) == 0) {
                         continue;
diff --git a/src/dawn_native/BindGroupLayout.cpp b/src/dawn_native/BindGroupLayout.cpp
index f6cc49b..cf11439 100644
--- a/src/dawn_native/BindGroupLayout.cpp
+++ b/src/dawn_native/BindGroupLayout.cpp
@@ -171,14 +171,13 @@
 
     namespace {
 
-        void HashCombineBindingInfo(size_t* hash, const BindGroupLayoutBase::BindingInfo& info) {
+        void HashCombineBindingInfo(size_t* hash, const BindingInfo& info) {
             HashCombine(hash, info.hasDynamicOffset, info.multisampled, info.visibility, info.type,
                         info.textureComponentType, info.textureDimension,
                         info.storageTextureFormat);
         }
 
-        bool operator!=(const BindGroupLayoutBase::BindingInfo& a,
-                        const BindGroupLayoutBase::BindingInfo& b) {
+        bool operator!=(const BindingInfo& a, const BindingInfo& b) {
             return a.hasDynamicOffset != b.hasDynamicOffset ||          //
                    a.multisampled != b.multisampled ||                  //
                    a.visibility != b.visibility ||                      //
@@ -219,8 +218,7 @@
 
         // This is a utility function to help ASSERT that the BGL-binding comparator places buffers
         // first.
-        bool CheckBufferBindingsFirst(const BindGroupLayoutBase::BindingInfo* bindings,
-                                      BindingIndex count) {
+        bool CheckBufferBindingsFirst(const BindingInfo* bindings, BindingIndex count) {
             ASSERT(count <= kMaxBindingsPerGroup);
 
             BindingIndex lastBufferIndex = 0;
@@ -266,7 +264,8 @@
             const BindGroupLayoutBinding& binding = sortedBindings[i];
             mBindingInfo[i].type = binding.type;
             mBindingInfo[i].visibility = binding.visibility;
-            mBindingInfo[i].textureComponentType = binding.textureComponentType;
+            mBindingInfo[i].textureComponentType =
+                Format::TextureComponentTypeToFormatType(binding.textureComponentType);
             mBindingInfo[i].storageTextureFormat = binding.storageTextureFormat;
 
             switch (binding.type) {
diff --git a/src/dawn_native/BindGroupLayout.h b/src/dawn_native/BindGroupLayout.h
index abe50f4..21a7912 100644
--- a/src/dawn_native/BindGroupLayout.h
+++ b/src/dawn_native/BindGroupLayout.h
@@ -18,10 +18,10 @@
 #include "common/Constants.h"
 #include "common/Math.h"
 #include "common/SlabAllocator.h"
+#include "dawn_native/BindingInfo.h"
 #include "dawn_native/CachedObject.h"
 #include "dawn_native/Error.h"
 #include "dawn_native/Forward.h"
-#include "dawn_native/IntegerTypes.h"
 
 #include "dawn_native/dawn_platform.h"
 
@@ -51,15 +51,6 @@
         ~BindGroupLayoutBase() override;
 
         static BindGroupLayoutBase* MakeError(DeviceBase* device);
-        struct BindingInfo {
-            wgpu::ShaderStage visibility;
-            wgpu::BindingType type;
-            wgpu::TextureComponentType textureComponentType;
-            wgpu::TextureViewDimension textureDimension;
-            wgpu::TextureFormat storageTextureFormat;
-            bool hasDynamicOffset;
-            bool multisampled;
-        };
 
         // A map from the BindingNumber to its packed BindingIndex.
         using BindingMap = std::map<BindingNumber, BindingIndex>;
diff --git a/src/dawn_native/IntegerTypes.h b/src/dawn_native/BindingInfo.h
similarity index 63%
rename from src/dawn_native/IntegerTypes.h
rename to src/dawn_native/BindingInfo.h
index 0455935..51f37b9 100644
--- a/src/dawn_native/IntegerTypes.h
+++ b/src/dawn_native/BindingInfo.h
@@ -12,8 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#ifndef DAWNNATIVE_INTEGERTYPES_H_
-#define DAWNNATIVE_INTEGERTYPES_H_
+#ifndef DAWNNATIVE_BINDINGINFO_H_
+#define DAWNNATIVE_BINDINGINFO_H_
+
+#include "dawn_native/Format.h"
+#include "dawn_native/dawn_platform.h"
 
 #include <cstdint>
 
@@ -28,6 +31,16 @@
     // Binding numbers get mapped to a packed range of indices
     using BindingIndex = uint32_t;
 
+    struct BindingInfo {
+        wgpu::ShaderStage visibility;
+        wgpu::BindingType type;
+        Format::Type textureComponentType = Format::Type::Float;
+        wgpu::TextureViewDimension textureDimension = wgpu::TextureViewDimension::Undefined;
+        wgpu::TextureFormat storageTextureFormat = wgpu::TextureFormat::Undefined;
+        bool hasDynamicOffset = false;
+        bool multisampled = false;
+    };
+
 }  // namespace dawn_native
 
-#endif  // DAWNNATIVE_INTEGERTYPES_H_
+#endif  // DAWNNATIVE_BINDINGINFO_H_
diff --git a/src/dawn_native/CMakeLists.txt b/src/dawn_native/CMakeLists.txt
index 117a631..0e9bbf6 100644
--- a/src/dawn_native/CMakeLists.txt
+++ b/src/dawn_native/CMakeLists.txt
@@ -35,6 +35,7 @@
     "BindGroupLayout.cpp"
     "BindGroupLayout.h"
     "BindGroupTracker.h"
+    "BindingInfo.h"
     "BuddyAllocator.cpp"
     "BuddyAllocator.h"
     "BuddyMemoryAllocator.cpp"
diff --git a/src/dawn_native/Format.cpp b/src/dawn_native/Format.cpp
index d4c0e16..0bd879b 100644
--- a/src/dawn_native/Format.cpp
+++ b/src/dawn_native/Format.cpp
@@ -73,13 +73,13 @@
         return aspect != Color;
     }
 
-    bool Format::HasComponentType(wgpu::TextureComponentType componentType) const {
+    bool Format::HasComponentType(Type componentType) const {
         // Depth stencil textures need to be special cased but we don't support sampling them yet.
         if (aspect != Color) {
             return false;
         }
 
-        return TextureComponentTypeToFormatType(componentType) == type;
+        return componentType == type;
     }
 
     size_t Format::GetIndex() const {
diff --git a/src/dawn_native/Format.h b/src/dawn_native/Format.h
index 3d2c48a..82b40d8 100644
--- a/src/dawn_native/Format.h
+++ b/src/dawn_native/Format.h
@@ -65,7 +65,7 @@
         bool HasDepth() const;
         bool HasStencil() const;
         bool HasDepthOrStencil() const;
-        bool HasComponentType(wgpu::TextureComponentType componentType) const;
+        bool HasComponentType(Type componentType) const;
 
         // The index of the format in the list of all known formats: a unique number for each format
         // in [0, kKnownFormatCount)
diff --git a/src/dawn_native/PipelineLayout.cpp b/src/dawn_native/PipelineLayout.cpp
index a7c74a7..46a132b 100644
--- a/src/dawn_native/PipelineLayout.cpp
+++ b/src/dawn_native/PipelineLayout.cpp
@@ -144,7 +144,7 @@
             for (uint32_t group = 0; group < info.size(); ++group) {
                 for (const auto& it : info[group]) {
                     BindingNumber bindingNumber = it.first;
-                    const ShaderModuleBase::BindingInfo& bindingInfo = it.second;
+                    const ShaderModuleBase::ShaderBindingInfo& bindingInfo = it.second;
 
                     if (bindingInfo.multisampled) {
                         return DAWN_VALIDATION_ERROR("Multisampled textures not supported (yet)");
diff --git a/src/dawn_native/ProgrammablePassEncoder.cpp b/src/dawn_native/ProgrammablePassEncoder.cpp
index cc17a72..02075e2 100644
--- a/src/dawn_native/ProgrammablePassEncoder.cpp
+++ b/src/dawn_native/ProgrammablePassEncoder.cpp
@@ -132,7 +132,7 @@
                 }
 
                 for (BindingIndex i = 0; i < dynamicOffsetCount; ++i) {
-                    const BindGroupLayoutBase::BindingInfo& bindingInfo = layout->GetBindingInfo(i);
+                    const BindingInfo& bindingInfo = layout->GetBindingInfo(i);
 
                     // BGL creation sorts bindings such that the dynamic buffer bindings are first.
                     // ASSERT that this true.
diff --git a/src/dawn_native/ShaderModule.cpp b/src/dawn_native/ShaderModule.cpp
index 39324b8..b688f12 100644
--- a/src/dawn_native/ShaderModule.cpp
+++ b/src/dawn_native/ShaderModule.cpp
@@ -379,12 +379,12 @@
                 }
 
                 const auto& it = mBindingInfo[binding.set].emplace(BindingNumber(binding.binding),
-                                                                   BindingInfo{});
+                                                                   ShaderBindingInfo{});
                 if (!it.second) {
                     return DAWN_VALIDATION_ERROR("Shader has duplicate bindings");
                 }
 
-                BindingInfo* info = &it.first->second;
+                ShaderBindingInfo* info = &it.first->second;
                 info->id = binding.id;
                 info->base_type_id = binding.base_type_id;
                 info->type = ToWGPUBindingType(binding.binding_type);
@@ -558,14 +558,15 @@
                     return DAWN_VALIDATION_ERROR("Bind group index over limits in the SPIRV");
                 }
 
-                const auto& it = mBindingInfo[set].emplace(bindingNumber, BindingInfo{});
+                const auto& it = mBindingInfo[set].emplace(bindingNumber, ShaderBindingInfo{});
                 if (!it.second) {
                     return DAWN_VALIDATION_ERROR("Shader has duplicate bindings");
                 }
 
-                BindingInfo* info = &it.first->second;
+                ShaderBindingInfo* info = &it.first->second;
                 info->id = resource.id;
                 info->base_type_id = resource.base_type_id;
+
                 switch (bindingType) {
                     case wgpu::BindingType::SampledTexture: {
                         spirv_cross::SPIRType::ImageType imageType =
@@ -747,7 +748,7 @@
         // corresponding binding in the BindGroupLayout, if it exists.
         for (const auto& it : mBindingInfo[group]) {
             BindingNumber bindingNumber = it.first;
-            const auto& moduleInfo = it.second;
+            const ShaderBindingInfo& moduleInfo = it.second;
 
             const auto& bindingIt = bindingMap.find(bindingNumber);
             if (bindingIt == bindingMap.end()) {
@@ -755,17 +756,15 @@
             }
             BindingIndex bindingIndex(bindingIt->second);
 
-            const BindGroupLayoutBase::BindingInfo& bindingInfo =
-                layout->GetBindingInfo(bindingIndex);
-            const auto& layoutBindingType = bindingInfo.type;
+            const BindingInfo& bindingInfo = layout->GetBindingInfo(bindingIndex);
 
-            if (layoutBindingType != moduleInfo.type) {
+            if (bindingInfo.type != moduleInfo.type) {
                 // Binding mismatch between shader and bind group is invalid. For example, a
                 // writable binding in the shader with a readonly storage buffer in the bind group
                 // layout is invalid. However, a readonly binding in the shader with a writable
                 // storage buffer in the bind group layout is valid.
                 bool validBindingConversion =
-                    layoutBindingType == wgpu::BindingType::StorageBuffer &&
+                    bindingInfo.type == wgpu::BindingType::StorageBuffer &&
                     moduleInfo.type == wgpu::BindingType::ReadonlyStorageBuffer;
                 if (!validBindingConversion) {
                     return false;
@@ -776,11 +775,9 @@
                 return false;
             }
 
-            switch (layoutBindingType) {
+            switch (bindingInfo.type) {
                 case wgpu::BindingType::SampledTexture: {
-                    Format::Type layoutTextureComponentType =
-                        Format::TextureComponentTypeToFormatType(bindingInfo.textureComponentType);
-                    if (layoutTextureComponentType != moduleInfo.textureComponentType) {
+                    if (bindingInfo.textureComponentType != moduleInfo.textureComponentType) {
                         return false;
                     }
 
diff --git a/src/dawn_native/ShaderModule.h b/src/dawn_native/ShaderModule.h
index 1797155..0653bbf 100644
--- a/src/dawn_native/ShaderModule.h
+++ b/src/dawn_native/ShaderModule.h
@@ -16,11 +16,11 @@
 #define DAWNNATIVE_SHADERMODULE_H_
 
 #include "common/Constants.h"
+#include "dawn_native/BindingInfo.h"
 #include "dawn_native/CachedObject.h"
 #include "dawn_native/Error.h"
 #include "dawn_native/Format.h"
 #include "dawn_native/Forward.h"
-#include "dawn_native/IntegerTypes.h"
 #include "dawn_native/PerStage.h"
 
 #include "dawn_native/dawn_platform.h"
@@ -50,18 +50,19 @@
 
         MaybeError ExtractSpirvInfo(const spirv_cross::Compiler& compiler);
 
-        struct BindingInfo {
+        struct ShaderBindingInfo : BindingInfo {
             // The SPIRV ID of the resource.
             uint32_t id;
             uint32_t base_type_id;
-            wgpu::BindingType type;
-            // Match the defaults in BindGroupLayoutDescriptor
-            wgpu::TextureViewDimension textureDimension = wgpu::TextureViewDimension::Undefined;
-            Format::Type textureComponentType = Format::Type::Float;
-            bool multisampled = false;
-            wgpu::TextureFormat storageTextureFormat = wgpu::TextureFormat::Undefined;
+
+          private:
+            // Disallow access to unused members.
+            using BindingInfo::hasDynamicOffset;
+            using BindingInfo::visibility;
         };
-        using ModuleBindingInfo = std::array<std::map<BindingNumber, BindingInfo>, kMaxBindGroups>;
+
+        using ModuleBindingInfo =
+            std::array<std::map<BindingNumber, ShaderBindingInfo>, kMaxBindGroups>;
 
         const ModuleBindingInfo& GetBindingInfo() const;
         const std::bitset<kMaxVertexAttributes>& GetUsedVertexAttributes() const;
diff --git a/src/dawn_native/d3d12/BindGroupD3D12.cpp b/src/dawn_native/d3d12/BindGroupD3D12.cpp
index 92a1445..1bbe058 100644
--- a/src/dawn_native/d3d12/BindGroupD3D12.cpp
+++ b/src/dawn_native/d3d12/BindGroupD3D12.cpp
@@ -86,7 +86,7 @@
         ID3D12Device* d3d12Device = device->GetD3D12Device().Get();
 
         for (BindingIndex bindingIndex = 0; bindingIndex < bgl->GetBindingCount(); ++bindingIndex) {
-            const BindGroupLayoutBase::BindingInfo& bindingInfo = bgl->GetBindingInfo(bindingIndex);
+            const BindingInfo& bindingInfo = bgl->GetBindingInfo(bindingIndex);
 
             // It's not necessary to create descriptors in descriptor heap for dynamic
             // resources. So skip allocating descriptors in descriptor heaps for dynamic
diff --git a/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp b/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp
index 7d07611..0def96c 100644
--- a/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp
+++ b/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp
@@ -47,7 +47,7 @@
           mBindGroupAllocator(MakeFrontendBindGroupAllocator<BindGroup>(4096)) {
         for (BindingIndex bindingIndex = GetDynamicBufferCount(); bindingIndex < GetBindingCount();
              ++bindingIndex) {
-            const BindGroupLayoutBase::BindingInfo& bindingInfo = GetBindingInfo(bindingIndex);
+            const BindingInfo& bindingInfo = GetBindingInfo(bindingIndex);
 
             // For dynamic resources, Dawn uses root descriptor in D3D12 backend.
             // So there is no need to allocate the descriptor from descriptor heap.
@@ -101,7 +101,7 @@
         descriptorOffsets[Sampler] = 0;
 
         for (BindingIndex bindingIndex = 0; bindingIndex < GetBindingCount(); ++bindingIndex) {
-            const BindGroupLayoutBase::BindingInfo& bindingInfo = GetBindingInfo(bindingIndex);
+            const BindingInfo& bindingInfo = GetBindingInfo(bindingIndex);
 
             if (bindingInfo.hasDynamicOffset) {
                 // Dawn is using values in mBindingOffsets to decide register number in HLSL.
diff --git a/src/dawn_native/d3d12/PipelineLayoutD3D12.cpp b/src/dawn_native/d3d12/PipelineLayoutD3D12.cpp
index 14e71f5..868e083 100644
--- a/src/dawn_native/d3d12/PipelineLayoutD3D12.cpp
+++ b/src/dawn_native/d3d12/PipelineLayoutD3D12.cpp
@@ -133,7 +133,7 @@
             for (BindingIndex dynamicBindingIndex = 0;
                  dynamicBindingIndex < bindGroupLayout->GetDynamicBufferCount();
                  ++dynamicBindingIndex) {
-                const BindGroupLayoutBase::BindingInfo& bindingInfo =
+                const BindingInfo& bindingInfo =
                     bindGroupLayout->GetBindingInfo(dynamicBindingIndex);
 
                 D3D12_ROOT_PARAMETER* rootParameter = &rootParameters[parameterIndex];
diff --git a/src/dawn_native/d3d12/PipelineLayoutD3D12.h b/src/dawn_native/d3d12/PipelineLayoutD3D12.h
index bbe3659..5b71137 100644
--- a/src/dawn_native/d3d12/PipelineLayoutD3D12.h
+++ b/src/dawn_native/d3d12/PipelineLayoutD3D12.h
@@ -15,7 +15,7 @@
 #ifndef DAWNNATIVE_D3D12_PIPELINELAYOUTD3D12_H_
 #define DAWNNATIVE_D3D12_PIPELINELAYOUTD3D12_H_
 
-#include "dawn_native/IntegerTypes.h"
+#include "dawn_native/BindingInfo.h"
 #include "dawn_native/PipelineLayout.h"
 #include "dawn_native/d3d12/d3d12_platform.h"
 
diff --git a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp
index 758af39..14c4f5d 100644
--- a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp
+++ b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp
@@ -97,7 +97,7 @@
             const auto& bindingOffsets = bgl->GetBindingOffsets();
             const auto& groupBindingInfo = moduleBindingInfo[group];
             for (const auto& it : groupBindingInfo) {
-                const BindingInfo& bindingInfo = it.second;
+                const ShaderBindingInfo& bindingInfo = it.second;
                 BindingNumber bindingNumber = it.first;
                 BindingIndex bindingIndex = bgl->GetBindingIndex(bindingNumber);
 
diff --git a/src/dawn_native/metal/CommandBufferMTL.mm b/src/dawn_native/metal/CommandBufferMTL.mm
index 1f5b84f..21851cd 100644
--- a/src/dawn_native/metal/CommandBufferMTL.mm
+++ b/src/dawn_native/metal/CommandBufferMTL.mm
@@ -500,7 +500,7 @@
                 // call here.
                 for (BindingIndex bindingIndex = 0;
                      bindingIndex < group->GetLayout()->GetBindingCount(); ++bindingIndex) {
-                    const BindGroupLayoutBase::BindingInfo& bindingInfo =
+                    const BindingInfo& bindingInfo =
                         group->GetLayout()->GetBindingInfo(bindingIndex);
 
                     bool hasVertStage =
diff --git a/src/dawn_native/metal/PipelineLayoutMTL.mm b/src/dawn_native/metal/PipelineLayoutMTL.mm
index 0dc1b52..c98d576 100644
--- a/src/dawn_native/metal/PipelineLayoutMTL.mm
+++ b/src/dawn_native/metal/PipelineLayoutMTL.mm
@@ -31,7 +31,7 @@
             for (uint32_t group : IterateBitSet(GetBindGroupLayoutsMask())) {
                 for (BindingIndex bindingIndex = 0;
                      bindingIndex < GetBindGroupLayout(group)->GetBindingCount(); ++bindingIndex) {
-                    const BindGroupLayoutBase::BindingInfo& bindingInfo =
+                    const BindingInfo& bindingInfo =
                         GetBindGroupLayout(group)->GetBindingInfo(bindingIndex);
                     if (!(bindingInfo.visibility & StageBit(stage))) {
                         continue;
diff --git a/src/dawn_native/metal/ShaderModuleMTL.mm b/src/dawn_native/metal/ShaderModuleMTL.mm
index aa0ca02..bb2d4f0 100644
--- a/src/dawn_native/metal/ShaderModuleMTL.mm
+++ b/src/dawn_native/metal/ShaderModuleMTL.mm
@@ -138,7 +138,7 @@
                 BindingNumber bindingNumber = it.first;
                 BindingIndex bindingIndex = it.second;
 
-                const BindGroupLayoutBase::BindingInfo& bindingInfo =
+                const BindingInfo& bindingInfo =
                     layout->GetBindGroupLayout(group)->GetBindingInfo(bindingIndex);
 
                 for (auto stage : IterateStages(bindingInfo.visibility)) {
diff --git a/src/dawn_native/opengl/CommandBufferGL.cpp b/src/dawn_native/opengl/CommandBufferGL.cpp
index a43281d..65d41df 100644
--- a/src/dawn_native/opengl/CommandBufferGL.cpp
+++ b/src/dawn_native/opengl/CommandBufferGL.cpp
@@ -243,7 +243,7 @@
 
                 for (BindingIndex bindingIndex = 0;
                      bindingIndex < group->GetLayout()->GetBindingCount(); ++bindingIndex) {
-                    const BindGroupLayoutBase::BindingInfo& bindingInfo =
+                    const BindingInfo& bindingInfo =
                         group->GetLayout()->GetBindingInfo(bindingIndex);
 
                     switch (bindingInfo.type) {
diff --git a/src/dawn_native/opengl/PipelineGL.cpp b/src/dawn_native/opengl/PipelineGL.cpp
index 6539dec..212ef10 100644
--- a/src/dawn_native/opengl/PipelineGL.cpp
+++ b/src/dawn_native/opengl/PipelineGL.cpp
@@ -179,10 +179,10 @@
 
                 const BindGroupLayoutBase* bgl =
                     layout->GetBindGroupLayout(combined.textureLocation.group);
-                wgpu::TextureComponentType componentType =
+                Format::Type componentType =
                     bgl->GetBindingInfo(bgl->GetBindingIndex(combined.textureLocation.binding))
                         .textureComponentType;
-                bool shouldUseFiltering = componentType == wgpu::TextureComponentType::Float;
+                bool shouldUseFiltering = componentType == Format::Type::Float;
 
                 GLuint samplerIndex =
                     indices[combined.samplerLocation.group][combined.samplerLocation.binding];
diff --git a/src/dawn_native/vulkan/BindGroupVk.cpp b/src/dawn_native/vulkan/BindGroupVk.cpp
index 718dd24..1f41b3e 100644
--- a/src/dawn_native/vulkan/BindGroupVk.cpp
+++ b/src/dawn_native/vulkan/BindGroupVk.cpp
@@ -46,8 +46,7 @@
         for (const auto& it : GetLayout()->GetBindingMap()) {
             BindingNumber bindingNumber = it.first;
             BindingIndex bindingIndex = it.second;
-            const BindGroupLayoutBase::BindingInfo& bindingInfo =
-                GetLayout()->GetBindingInfo(bindingIndex);
+            const BindingInfo& bindingInfo = GetLayout()->GetBindingInfo(bindingIndex);
 
             auto& write = writes[numWrites];
             write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;