Fix new Clang warnings about set-but-unused variables
The latest version started warning about variables declared in condition
expressions.
Bug: chromium:332931387
Change-Id: Id762fc5fa3f47fa1c2d3d66c8c73ba579f9e5f22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/182582
Auto-Submit: Hans Wennborg <hwennborg@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
diff --git a/src/dawn/native/BindGroupLayoutInternal.cpp b/src/dawn/native/BindGroupLayoutInternal.cpp
index d20bc05..0d207b2 100644
--- a/src/dawn/native/BindGroupLayoutInternal.cpp
+++ b/src/dawn/native/BindGroupLayoutInternal.cpp
@@ -195,7 +195,7 @@
DAWN_TRY(device->ValidateObject(staticSamplerBindingLayout->sampler));
}
- if (auto* externalTextureBindingLayout = entry.Get<ExternalTextureBindingLayout>()) {
+ if (entry.Get<ExternalTextureBindingLayout>()) {
bindingMemberCount++;
}
@@ -258,7 +258,7 @@
// External textures are expanded from a texture_external into two sampled texture
// bindings and one uniform buffer binding. The original binding number is used
// for the first sampled texture.
- if (auto* externalTextureBindingLayout = entry.Get<ExternalTextureBindingLayout>()) {
+ if (entry.Get<ExternalTextureBindingLayout>()) {
for (SingleShaderStage stage : IterateStages(entry->visibility)) {
// External textures are not fully implemented, which means that expanding
// the external texture at this time will not occupy the same number of
diff --git a/src/dawn/native/BindingInfo.cpp b/src/dawn/native/BindingInfo.cpp
index 32b3468..b7714e0 100644
--- a/src/dawn/native/BindingInfo.cpp
+++ b/src/dawn/native/BindingInfo.cpp
@@ -89,9 +89,9 @@
perStageBindingCountMember = &PerStageBindingCounts::sampledTextureCount;
} else if (entry->storageTexture.access != wgpu::StorageTextureAccess::Undefined) {
perStageBindingCountMember = &PerStageBindingCounts::storageTextureCount;
- } else if (auto* externalTextureBindingLayout = entry.Get<ExternalTextureBindingLayout>()) {
+ } else if (entry.Get<ExternalTextureBindingLayout>()) {
perStageBindingCountMember = &PerStageBindingCounts::externalTextureCount;
- } else if (auto* staticSamplerBindingLayout = entry.Get<StaticSamplerBindingLayout>()) {
+ } else if (entry.Get<StaticSamplerBindingLayout>()) {
++bindingCounts->staticSamplerCount;
perStageBindingCountMember = &PerStageBindingCounts::staticSamplerCount;
}
diff --git a/src/dawn/native/RenderPipeline.cpp b/src/dawn/native/RenderPipeline.cpp
index eaecd18..44e29c9 100644
--- a/src/dawn/native/RenderPipeline.cpp
+++ b/src/dawn/native/RenderPipeline.cpp
@@ -353,8 +353,7 @@
MaybeError ValidateMultisampleState(const DeviceBase* device, const MultisampleState* descriptor) {
UnpackedPtr<MultisampleState> unpacked;
DAWN_TRY_ASSIGN(unpacked, ValidateAndUnpack(descriptor));
- if (auto* msaaRenderToSingleSampledDesc =
- unpacked.Get<DawnMultisampleStateRenderToSingleSampled>()) {
+ if (unpacked.Get<DawnMultisampleStateRenderToSingleSampled>()) {
DAWN_INVALID_IF(!device->HasFeature(Feature::MSAARenderToSingleSampled),
"The msaaRenderToSingleSampledDesc is not empty while the "
"msaa-render-to-single-sampled feature is not enabled.");