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:
parent
7d9140feb9
commit
9a6ca2878e
|
@ -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<storage, read_write> 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<i32>, sample: u32, component: u32) -> f32";
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<f32> {
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue