diff --git a/src/common/BUILD.gn b/src/common/BUILD.gn index 372ee1b415..afaa18f2d5 100644 --- a/src/common/BUILD.gn +++ b/src/common/BUILD.gn @@ -120,6 +120,7 @@ config("dawn_internal") { "-Wstrict-prototypes", "-Wtautological-unsigned-zero-compare", "-Wunreachable-code-aggressive", + "-Wunused-but-set-variable", ] if (is_win) { diff --git a/src/dawn_native/ExternalTexture.cpp b/src/dawn_native/ExternalTexture.cpp index 6b1cee8755..254a5569e8 100644 --- a/src/dawn_native/ExternalTexture.cpp +++ b/src/dawn_native/ExternalTexture.cpp @@ -59,6 +59,7 @@ namespace dawn_native { const Format* format; DAWN_TRY_ASSIGN(format, device->GetInternalFormat(descriptor->format)); + DAWN_UNUSED(format); switch (descriptor->format) { case wgpu::TextureFormat::RGBA8Unorm: diff --git a/src/dawn_native/SubresourceStorage.h b/src/dawn_native/SubresourceStorage.h index 01bd6860d8..16feffcea2 100644 --- a/src/dawn_native/SubresourceStorage.h +++ b/src/dawn_native/SubresourceStorage.h @@ -393,13 +393,11 @@ namespace dawn_native { ASSERT(mipLevel < mMipLevelCount); // Fastest path, the aspect is compressed! - uint32_t dataIndex = aspectIndex * mArrayLayerCount * mMipLevelCount; if (mAspectCompressed[aspectIndex]) { return DataInline(aspectIndex); } // Fast path, the array layer is compressed. - dataIndex += arrayLayer * mMipLevelCount; if (LayerCompressed(aspectIndex, arrayLayer)) { return Data(aspectIndex, arrayLayer); } diff --git a/src/dawn_native/d3d12/CommandBufferD3D12.cpp b/src/dawn_native/d3d12/CommandBufferD3D12.cpp index 74159118c3..26ef0244a8 100644 --- a/src/dawn_native/d3d12/CommandBufferD3D12.cpp +++ b/src/dawn_native/d3d12/CommandBufferD3D12.cpp @@ -987,7 +987,6 @@ namespace dawn_native { namespace d3d12 { BindGroupStateTracker* bindingTracker, const ComputePassResourceUsage& resourceUsages) { uint64_t currentDispatch = 0; - PipelineLayout* lastLayout = nullptr; ID3D12GraphicsCommandList* commandList = commandContext->GetCommandList(); Command type; @@ -1035,8 +1034,6 @@ namespace dawn_native { namespace d3d12 { commandList->SetPipelineState(pipeline->GetPipelineState()); bindingTracker->OnSetPipeline(pipeline); - - lastLayout = layout; break; } diff --git a/src/dawn_native/d3d12/ResidencyManagerD3D12.cpp b/src/dawn_native/d3d12/ResidencyManagerD3D12.cpp index fe4eceec26..abf722f27f 100644 --- a/src/dawn_native/d3d12/ResidencyManagerD3D12.cpp +++ b/src/dawn_native/d3d12/ResidencyManagerD3D12.cpp @@ -184,6 +184,7 @@ namespace dawn_native { namespace d3d12 { uint64_t bytesEvicted; DAWN_TRY_ASSIGN(bytesEvicted, EnsureCanMakeResident(allocationSize, GetMemorySegmentInfo(memorySegment))); + DAWN_UNUSED(bytesEvicted); return {}; } @@ -298,6 +299,7 @@ namespace dawn_native { namespace d3d12 { ID3D12Pageable** allocations) { uint64_t bytesEvicted; DAWN_TRY_ASSIGN(bytesEvicted, EnsureCanMakeResident(sizeToMakeResident, segment)); + DAWN_UNUSED(bytesEvicted); // Note that MakeResident is a synchronous function and can add a significant // overhead to command recording. In the future, it may be possible to decrease this