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 <dsinclair@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2022-09-20 15:58:27 +00:00 committed by Dawn LUCI CQ
parent 7d9140feb9
commit 9a6ca2878e
3 changed files with 7 additions and 7 deletions

View File

@ -1095,7 +1095,7 @@ std::ostringstream& DawnTestBase::ExpectSampledFloatDataImpl(wgpu::TextureView t
uint32_t sampleCount, uint32_t sampleCount,
detail::Expectation* expectation) { detail::Expectation* expectation) {
std::ostringstream shaderSource; 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 << "@group(0) @binding(0) var tex : " << wgslTextureType << ";\n";
shaderSource << R"( shaderSource << R"(
struct Result { struct Result {
@ -1103,8 +1103,8 @@ std::ostringstream& DawnTestBase::ExpectSampledFloatDataImpl(wgpu::TextureView t
} }
@group(0) @binding(1) var<storage, read_write> result : Result; @group(0) @binding(1) var<storage, read_write> result : Result;
)"; )";
shaderSource << "let componentCount : u32 = " << componentCount << "u;\n"; shaderSource << "const componentCount : u32 = " << componentCount << "u;\n";
shaderSource << "let sampleCount : u32 = " << sampleCount << "u;\n"; shaderSource << "const sampleCount : u32 = " << sampleCount << "u;\n";
shaderSource << "fn doTextureLoad(t: " << wgslTextureType shaderSource << "fn doTextureLoad(t: " << wgslTextureType
<< ", coord: vec2<i32>, sample: u32, component: u32) -> f32"; << ", coord: vec2<i32>, sample: u32, component: u32) -> f32";

View File

@ -71,8 +71,8 @@ void ComputeSharedMemoryTests::BasicTest(const char* shader) {
// Basic shared memory test // Basic shared memory test
TEST_P(ComputeSharedMemoryTests, Basic) { TEST_P(ComputeSharedMemoryTests, Basic) {
BasicTest(R"( BasicTest(R"(
let kTileSize : u32 = 4u; const kTileSize : u32 = 4u;
let kInstances : u32 = 11u; const kInstances : u32 = 11u;
struct Dst { struct Dst {
x : u32 x : u32

View File

@ -133,7 +133,7 @@ class DynamicBufferOffsetTests : public DawnTest {
)"; )";
} }
fs << "let multipleNumber : u32 = " << multipleNumber << "u;\n"; fs << "const multipleNumber : u32 = " << multipleNumber << "u;\n";
fs << R"( fs << R"(
@fragment fn main() -> @location(0) vec4<f32> { @fragment fn main() -> @location(0) vec4<f32> {
sBufferNotDynamic.value = uBufferNotDynamic.value.xy; 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"( cs << R"(
@compute @workgroup_size(1) fn main() { @compute @workgroup_size(1) fn main() {
sBufferNotDynamic.value = uBufferNotDynamic.value.xy; sBufferNotDynamic.value = uBufferNotDynamic.value.xy;