From 9a6ca2878e6c0faccf458ee63de39fdb28af69b3 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 20 Sep 2022 15:58:27 +0000 Subject: [PATCH] Fix deprecation warnings of module-scope lets By promoting them to "const" as the deprecation warning suggests. Bug: None Change-Id: I7110b8d38754a0785d7fd56343c2c905dc491e1a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103023 Reviewed-by: Dan Sinclair Commit-Queue: Corentin Wallez --- src/dawn/tests/DawnTest.cpp | 6 +++--- src/dawn/tests/end2end/ComputeSharedMemoryTests.cpp | 4 ++-- src/dawn/tests/end2end/DynamicBufferOffsetTests.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dawn/tests/DawnTest.cpp b/src/dawn/tests/DawnTest.cpp index ff72d3482c..8dc4d5d3b3 100644 --- a/src/dawn/tests/DawnTest.cpp +++ b/src/dawn/tests/DawnTest.cpp @@ -1095,7 +1095,7 @@ std::ostringstream& DawnTestBase::ExpectSampledFloatDataImpl(wgpu::TextureView t uint32_t sampleCount, detail::Expectation* expectation) { std::ostringstream shaderSource; - shaderSource << "let width : u32 = " << width << "u;\n"; + shaderSource << "const width : u32 = " << width << "u;\n"; shaderSource << "@group(0) @binding(0) var tex : " << wgslTextureType << ";\n"; shaderSource << R"( struct Result { @@ -1103,8 +1103,8 @@ std::ostringstream& DawnTestBase::ExpectSampledFloatDataImpl(wgpu::TextureView t } @group(0) @binding(1) var result : Result; )"; - shaderSource << "let componentCount : u32 = " << componentCount << "u;\n"; - shaderSource << "let sampleCount : u32 = " << sampleCount << "u;\n"; + shaderSource << "const componentCount : u32 = " << componentCount << "u;\n"; + shaderSource << "const sampleCount : u32 = " << sampleCount << "u;\n"; shaderSource << "fn doTextureLoad(t: " << wgslTextureType << ", coord: vec2, sample: u32, component: u32) -> f32"; diff --git a/src/dawn/tests/end2end/ComputeSharedMemoryTests.cpp b/src/dawn/tests/end2end/ComputeSharedMemoryTests.cpp index c63e762285..94822df06f 100644 --- a/src/dawn/tests/end2end/ComputeSharedMemoryTests.cpp +++ b/src/dawn/tests/end2end/ComputeSharedMemoryTests.cpp @@ -71,8 +71,8 @@ void ComputeSharedMemoryTests::BasicTest(const char* shader) { // Basic shared memory test TEST_P(ComputeSharedMemoryTests, Basic) { BasicTest(R"( - let kTileSize : u32 = 4u; - let kInstances : u32 = 11u; + const kTileSize : u32 = 4u; + const kInstances : u32 = 11u; struct Dst { x : u32 diff --git a/src/dawn/tests/end2end/DynamicBufferOffsetTests.cpp b/src/dawn/tests/end2end/DynamicBufferOffsetTests.cpp index 61caf90608..91332c6708 100644 --- a/src/dawn/tests/end2end/DynamicBufferOffsetTests.cpp +++ b/src/dawn/tests/end2end/DynamicBufferOffsetTests.cpp @@ -133,7 +133,7 @@ class DynamicBufferOffsetTests : public DawnTest { )"; } - fs << "let multipleNumber : u32 = " << multipleNumber << "u;\n"; + fs << "const multipleNumber : u32 = " << multipleNumber << "u;\n"; fs << R"( @fragment fn main() -> @location(0) vec4 { sBufferNotDynamic.value = uBufferNotDynamic.value.xy; @@ -183,7 +183,7 @@ class DynamicBufferOffsetTests : public DawnTest { )"; } - cs << "let multipleNumber : u32 = " << multipleNumber << "u;\n"; + cs << "const multipleNumber : u32 = " << multipleNumber << "u;\n"; cs << R"( @compute @workgroup_size(1) fn main() { sBufferNotDynamic.value = uBufferNotDynamic.value.xy;