diff --git a/.gitattributes b/.gitattributes
index d31b156d20..5333936d7e 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,4 +1,9 @@
-* text=auto
-*.sh eol=lf
-*.gn eol=lf
-*.gni eol=lf
+* text=auto
+*.glsl eol=lf
+*.gn eol=lf
+*.gni eol=lf
+*.hlsl eol=lf
+*.msl eol=lf
+*.sh eol=lf
+*.spvasm eol=lf
+*.wgsl eol=lf
diff --git a/CMakeSettings.json b/CMakeSettings.json
index ee3ee56fd8..3eb93c25ba 100644
--- a/CMakeSettings.json
+++ b/CMakeSettings.json
@@ -1,100 +1,100 @@
-{
- "configurations": [
- {
- "name": "x64-Debug",
- "generator": "Ninja",
- "configurationType": "Debug",
- "inheritEnvironments": [ "msvc_x64_x64" ],
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "",
- "ctestCommandArgs": "",
- "variables": []
- },
- {
- "name": "x64-Release",
- "generator": "Ninja",
- "configurationType": "RelWithDebInfo",
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "",
- "ctestCommandArgs": "",
- "inheritEnvironments": [ "msvc_x64_x64" ],
- "variables": []
- },
- {
- "name": "x86-Debug",
- "generator": "Ninja",
- "configurationType": "Debug",
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "",
- "ctestCommandArgs": "",
- "inheritEnvironments": [ "msvc_x86" ],
- "variables": []
- },
- {
- "name": "x86-Release",
- "generator": "Ninja",
- "configurationType": "RelWithDebInfo",
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "",
- "ctestCommandArgs": "",
- "inheritEnvironments": [ "msvc_x86" ],
- "variables": []
- },
- {
- "name": "x64-Clang-Debug",
- "generator": "Ninja",
- "configurationType": "Debug",
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "",
- "ctestCommandArgs": "",
- "inheritEnvironments": [ "clang_cl_x64_x64" ],
- "variables": []
- },
- {
- "name": "x64-Clang-Release",
- "generator": "Ninja",
- "configurationType": "RelWithDebInfo",
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "",
- "ctestCommandArgs": "",
- "inheritEnvironments": [ "clang_cl_x64_x64" ],
- "variables": []
- },
- {
- "name": "x86-Clang-Debug",
- "generator": "Ninja",
- "configurationType": "Debug",
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "",
- "ctestCommandArgs": "",
- "inheritEnvironments": [ "clang_cl_x86" ],
- "variables": []
- },
- {
- "name": "x86-Clang-Release",
- "generator": "Ninja",
- "configurationType": "RelWithDebInfo",
- "buildRoot": "${projectDir}\\out\\build\\${name}",
- "installRoot": "${projectDir}\\out\\install\\${name}",
- "cmakeCommandArgs": "",
- "buildCommandArgs": "",
- "ctestCommandArgs": "",
- "inheritEnvironments": [ "clang_cl_x86" ],
- "variables": []
- }
- ]
-}
\ No newline at end of file
+{
+ "configurations": [
+ {
+ "name": "x64-Debug",
+ "generator": "Ninja",
+ "configurationType": "Debug",
+ "inheritEnvironments": ["msvc_x64_x64"],
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "",
+ "ctestCommandArgs": "",
+ "variables": []
+ },
+ {
+ "name": "x64-Release",
+ "generator": "Ninja",
+ "configurationType": "RelWithDebInfo",
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "",
+ "ctestCommandArgs": "",
+ "inheritEnvironments": ["msvc_x64_x64"],
+ "variables": []
+ },
+ {
+ "name": "x86-Debug",
+ "generator": "Ninja",
+ "configurationType": "Debug",
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "",
+ "ctestCommandArgs": "",
+ "inheritEnvironments": ["msvc_x86"],
+ "variables": []
+ },
+ {
+ "name": "x86-Release",
+ "generator": "Ninja",
+ "configurationType": "RelWithDebInfo",
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "",
+ "ctestCommandArgs": "",
+ "inheritEnvironments": ["msvc_x86"],
+ "variables": []
+ },
+ {
+ "name": "x64-Clang-Debug",
+ "generator": "Ninja",
+ "configurationType": "Debug",
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "",
+ "ctestCommandArgs": "",
+ "inheritEnvironments": ["clang_cl_x64_x64"],
+ "variables": []
+ },
+ {
+ "name": "x64-Clang-Release",
+ "generator": "Ninja",
+ "configurationType": "RelWithDebInfo",
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "",
+ "ctestCommandArgs": "",
+ "inheritEnvironments": ["clang_cl_x64_x64"],
+ "variables": []
+ },
+ {
+ "name": "x86-Clang-Debug",
+ "generator": "Ninja",
+ "configurationType": "Debug",
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "",
+ "ctestCommandArgs": "",
+ "inheritEnvironments": ["clang_cl_x86"],
+ "variables": []
+ },
+ {
+ "name": "x86-Clang-Release",
+ "generator": "Ninja",
+ "configurationType": "RelWithDebInfo",
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "",
+ "ctestCommandArgs": "",
+ "inheritEnvironments": ["clang_cl_x86"],
+ "variables": []
+ }
+ ]
+}
diff --git a/src/tint/tint.natvis b/src/tint/tint.natvis
index 2687196fad..c1fd1f398e 100644
--- a/src/tint/tint.natvis
+++ b/src/tint/tint.natvis
@@ -1,189 +1,189 @@
-
-
-
-
-
-
- {debug_name_,sb}
-
-
-
- {*lhs} = {*rhs};
-
- - *lhs
- - *rhs
-
-
-
-
- if ({*condition}) {*body}
- if ({*condition}) {*body} {*else_statements[0]}
- if ({*condition}) {*body} {*else_statements[0]} {*else_statements[1]}
- if ({*condition}) {*body} {*else_statements[0]} {*else_statements[1]} {*else_statements[2]}
- if ({*condition}) {*body} {*else_statements[0]} {*else_statements[1]} {*else_statements[2]} else {else_statements.size()-3} more...
-
-
-
- else {*body}
- else if ({*condition}) {*body}
-
-
-
- {{ {*statements[0]} }}
- {{ {*statements[0]} {*statements[1]} }}
- {{ {*statements[0]} {*statements[1]} {*statements[2]} }}
- {{ {*statements[0]} {*statements[1]} {*statements[2]} {statements.size()-3} more... }}
-
-
-
- return;
- return {*value};
-
-
-
- fn {symbol}() -> {*return_type} {*body}
- fn {symbol}({*params[0]}) -> {*return_type} {*body}
- fn {symbol}({*params[0]} {*params[1]}) -> {*return_type} {*body}
- fn {symbol}({*params[0]} {*params[1]} {*params[2]}) -> {*return_type} {*body}
- fn {symbol}({*params[0]} {*params[1]} {*params[2]} {params.size()-3} more...) -> {*return_type} {*body}
-
-
-
-
- {symbol}
-
- - symbol
-
-
-
-
- {*object}[{*index}]
-
- - *object
- - *index
-
-
-
-
- {*structure}.{*member}
-
- - *structure
- - *member
-
-
-
-
-
- {symbol} : {*type}
-
- let {symbol} : {*type} = {*constructor}
- let {symbol} = {*constructor}
- var {symbol} : {*type} = {*constructor}
- var {symbol} = {*constructor}
- var {symbol}
-
-
-
- {*variable};
-
-
-
- {value}
-
-
-
- {value}
-
-
-
- {value}
-
-
-
- void
-
-
-
- &({expr})
- ~({expr})
- *({expr})
- -({expr})
- !({expr})
-
-
-
- ({*lhs} NONE {*rhs})
- ({*lhs} & {*rhs})
- ({*lhs} | {*rhs})
- ({*lhs} ^ {*rhs})
- ({*lhs} && {*rhs})
- ({*lhs} || {*rhs})
- ({*lhs} == {*rhs})
- ({*lhs} != {*rhs})
- ({*lhs} < {*rhs})
- ({*lhs} > {*rhs})
- ({*lhs} <= {*rhs})
- ({*lhs} >= {*rhs})
- ({*lhs} << {*rhs})
- ({*lhs} >> {*rhs})
- ({*lhs} + {*rhs})
- ({*lhs} - {*rhs})
- ({*lhs} * {*rhs})
- ({*lhs} / {*rhs})
- ({*lhs} % {*rhs})
-
-
-
- {target}()
- {target}({*args[0]})
- {target}({*args[0]}, {*args[1]})
- {target}({*args[0]}, {*args[1]}, {*args[2]})
- {target}({*args[0]}, {*args[1]}, {*args[2]}, {args.size()-3} more...)
-
-
-
-
- {*name}
- {*type}
-
-
-
- array<{*type},{*count}>
- array<{*type}>
-
-
-
- {name}
-
-
-
- bool
-
-
-
- i32
-
-
-
- u32
-
-
-
- f32
-
-
-
+
+
+
+
+
+
+ {debug_name_,sb}
+
+
+
+ {*lhs} = {*rhs};
+
+ - *lhs
+ - *rhs
+
+
+
+
+ if ({*condition}) {*body}
+ if ({*condition}) {*body} {*else_statements[0]}
+ if ({*condition}) {*body} {*else_statements[0]} {*else_statements[1]}
+ if ({*condition}) {*body} {*else_statements[0]} {*else_statements[1]} {*else_statements[2]}
+ if ({*condition}) {*body} {*else_statements[0]} {*else_statements[1]} {*else_statements[2]} else {else_statements.size()-3} more...
+
+
+
+ else {*body}
+ else if ({*condition}) {*body}
+
+
+
+ {{ {*statements[0]} }}
+ {{ {*statements[0]} {*statements[1]} }}
+ {{ {*statements[0]} {*statements[1]} {*statements[2]} }}
+ {{ {*statements[0]} {*statements[1]} {*statements[2]} {statements.size()-3} more... }}
+
+
+
+ return;
+ return {*value};
+
+
+
+ fn {symbol}() -> {*return_type} {*body}
+ fn {symbol}({*params[0]}) -> {*return_type} {*body}
+ fn {symbol}({*params[0]} {*params[1]}) -> {*return_type} {*body}
+ fn {symbol}({*params[0]} {*params[1]} {*params[2]}) -> {*return_type} {*body}
+ fn {symbol}({*params[0]} {*params[1]} {*params[2]} {params.size()-3} more...) -> {*return_type} {*body}
+
+
+
+
+ {symbol}
+
+ - symbol
+
+
+
+
+ {*object}[{*index}]
+
+ - *object
+ - *index
+
+
+
+
+ {*structure}.{*member}
+
+ - *structure
+ - *member
+
+
+
+
+
+ {symbol} : {*type}
+
+ let {symbol} : {*type} = {*constructor}
+ let {symbol} = {*constructor}
+ var {symbol} : {*type} = {*constructor}
+ var {symbol} = {*constructor}
+ var {symbol}
+
+
+
+ {*variable};
+
+
+
+ {value}
+
+
+
+ {value}
+
+
+
+ {value}
+
+
+
+ void
+
+
+
+ &({expr})
+ ~({expr})
+ *({expr})
+ -({expr})
+ !({expr})
+
+
+
+ ({*lhs} NONE {*rhs})
+ ({*lhs} & {*rhs})
+ ({*lhs} | {*rhs})
+ ({*lhs} ^ {*rhs})
+ ({*lhs} && {*rhs})
+ ({*lhs} || {*rhs})
+ ({*lhs} == {*rhs})
+ ({*lhs} != {*rhs})
+ ({*lhs} < {*rhs})
+ ({*lhs} > {*rhs})
+ ({*lhs} <= {*rhs})
+ ({*lhs} >= {*rhs})
+ ({*lhs} << {*rhs})
+ ({*lhs} >> {*rhs})
+ ({*lhs} + {*rhs})
+ ({*lhs} - {*rhs})
+ ({*lhs} * {*rhs})
+ ({*lhs} / {*rhs})
+ ({*lhs} % {*rhs})
+
+
+
+ {target}()
+ {target}({*args[0]})
+ {target}({*args[0]}, {*args[1]})
+ {target}({*args[0]}, {*args[1]}, {*args[2]})
+ {target}({*args[0]}, {*args[1]}, {*args[2]}, {args.size()-3} more...)
+
+
+
+
+ {*name}
+ {*type}
+
+
+
+ array<{*type},{*count}>
+ array<{*type}>
+
+
+
+ {name}
+
+
+
+ bool
+
+
+
+ i32
+
+
+
+ u32
+
+
+
+ f32
+
+
+
diff --git a/test/tint/bug/dawn/947.wgsl b/test/tint/bug/dawn/947.wgsl
index deeb46734d..f89542ff94 100644
--- a/test/tint/bug/dawn/947.wgsl
+++ b/test/tint/bug/dawn/947.wgsl
@@ -1,63 +1,63 @@
- struct Uniforms {
- u_scale : vec2,
- u_offset : vec2,
-};
-@binding(0) @group(0) var uniforms : Uniforms;
-
-struct VertexOutputs {
- @location(0) texcoords : vec2,
- @builtin(position) position : vec4,
-};
-
-@stage(vertex) fn vs_main(
- @builtin(vertex_index) VertexIndex : u32
-) -> VertexOutputs {
- var texcoord = array, 3>(
- vec2(-0.5, 0.0),
- vec2( 1.5, 0.0),
- vec2( 0.5, 2.0));
-
- var output : VertexOutputs;
- output.position = vec4((texcoord[VertexIndex] * 2.0 - vec2(1.0, 1.0)), 0.0, 1.0);
-
- // Y component of scale is calculated by the copySizeHeight / textureHeight. Only
- // flipY case can get negative number.
- var flipY = uniforms.u_scale.y < 0.0;
-
- // Texture coordinate takes top-left as origin point. We need to map the
- // texture to triangle carefully.
- if (flipY) {
- // We need to get the mirror positions(mirrored based on y = 0.5) on flip cases.
- // Adopt transform to src texture and then mapping it to triangle coord which
- // do a +1 shift on Y dimension will help us got that mirror position perfectly.
- output.texcoords = (texcoord[VertexIndex] * uniforms.u_scale + uniforms.u_offset) *
- vec2(1.0, -1.0) + vec2(0.0, 1.0);
- } else {
- // For the normal case, we need to get the exact position.
- // So mapping texture to triangle firstly then adopt the transform.
- output.texcoords = (texcoord[VertexIndex] *
- vec2(1.0, -1.0) + vec2(0.0, 1.0)) *
- uniforms.u_scale + uniforms.u_offset;
- }
-
- return output;
-}
-
-@binding(1) @group(0) var mySampler: sampler;
-@binding(2) @group(0) var myTexture: texture_2d;
-
-@stage(fragment) fn fs_main(
- @location(0) texcoord : vec2
-) -> @location(0) vec4 {
- // Clamp the texcoord and discard the out-of-bound pixels.
- var clampedTexcoord =
- clamp(texcoord, vec2(0.0, 0.0), vec2(1.0, 1.0));
- if (!all(clampedTexcoord == texcoord)) {
- discard;
- }
-
- var srcColor = textureSample(myTexture, mySampler, texcoord);
- // Swizzling of texture formats when sampling / rendering is handled by the
- // hardware so we don't need special logic in this shader. This is covered by tests.
- return srcColor;
-}
+ struct Uniforms {
+ u_scale : vec2,
+ u_offset : vec2,
+};
+@binding(0) @group(0) var uniforms : Uniforms;
+
+struct VertexOutputs {
+ @location(0) texcoords : vec2,
+ @builtin(position) position : vec4,
+};
+
+@stage(vertex) fn vs_main(
+ @builtin(vertex_index) VertexIndex : u32
+) -> VertexOutputs {
+ var texcoord = array, 3>(
+ vec2(-0.5, 0.0),
+ vec2( 1.5, 0.0),
+ vec2( 0.5, 2.0));
+
+ var output : VertexOutputs;
+ output.position = vec4((texcoord[VertexIndex] * 2.0 - vec2(1.0, 1.0)), 0.0, 1.0);
+
+ // Y component of scale is calculated by the copySizeHeight / textureHeight. Only
+ // flipY case can get negative number.
+ var flipY = uniforms.u_scale.y < 0.0;
+
+ // Texture coordinate takes top-left as origin point. We need to map the
+ // texture to triangle carefully.
+ if (flipY) {
+ // We need to get the mirror positions(mirrored based on y = 0.5) on flip cases.
+ // Adopt transform to src texture and then mapping it to triangle coord which
+ // do a +1 shift on Y dimension will help us got that mirror position perfectly.
+ output.texcoords = (texcoord[VertexIndex] * uniforms.u_scale + uniforms.u_offset) *
+ vec2(1.0, -1.0) + vec2(0.0, 1.0);
+ } else {
+ // For the normal case, we need to get the exact position.
+ // So mapping texture to triangle firstly then adopt the transform.
+ output.texcoords = (texcoord[VertexIndex] *
+ vec2(1.0, -1.0) + vec2(0.0, 1.0)) *
+ uniforms.u_scale + uniforms.u_offset;
+ }
+
+ return output;
+}
+
+@binding(1) @group(0) var mySampler: sampler;
+@binding(2) @group(0) var myTexture: texture_2d;
+
+@stage(fragment) fn fs_main(
+ @location(0) texcoord : vec2
+) -> @location(0) vec4 {
+ // Clamp the texcoord and discard the out-of-bound pixels.
+ var clampedTexcoord =
+ clamp(texcoord, vec2(0.0, 0.0), vec2(1.0, 1.0));
+ if (!all(clampedTexcoord == texcoord)) {
+ discard;
+ }
+
+ var srcColor = textureSample(myTexture, mySampler, texcoord);
+ // Swizzling of texture formats when sampling / rendering is handled by the
+ // hardware so we don't need special logic in this shader. This is covered by tests.
+ return srcColor;
+}
diff --git a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl
index bc9a36c5d9..a18d525655 100644
--- a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl
+++ b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl
@@ -1,28 +1,28 @@
-// 1112.wgsl
-@group(0) @binding(0) var Sampler: sampler;
-@group(0) @binding(1) var randomTexture: texture_2d;
-@group(0) @binding(2) var depthTexture: texture_2d;
-
-@stage(fragment)
-fn main(@location(0) vUV : vec2) -> @location(0) vec4 {
- let random: vec3 = textureSample(randomTexture, Sampler, vUV).rgb;
-
- var i = 0;
- loop {
- if (i < 1) {
- } else {
- break;
- }
- let offset : vec3 = vec3(random.x);
-
- if (offset.x < 0.0 || offset.y < 0.0 || offset.x > 1.0 || offset.y > 1.0) {
- i = i + 1;
- continue;
- }
-
- let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r;
- i = i + 1;
- }
-
- return vec4(1.0);
-}
+// 1112.wgsl
+@group(0) @binding(0) var Sampler: sampler;
+@group(0) @binding(1) var randomTexture: texture_2d;
+@group(0) @binding(2) var depthTexture: texture_2d;
+
+@stage(fragment)
+fn main(@location(0) vUV : vec2) -> @location(0) vec4 {
+ let random: vec3 = textureSample(randomTexture, Sampler, vUV).rgb;
+
+ var i = 0;
+ loop {
+ if (i < 1) {
+ } else {
+ break;
+ }
+ let offset : vec3 = vec3(random.x);
+
+ if (offset.x < 0.0 || offset.y < 0.0 || offset.x > 1.0 || offset.y > 1.0) {
+ i = i + 1;
+ continue;
+ }
+
+ let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r;
+ i = i + 1;
+ }
+
+ return vec4(1.0);
+}
diff --git a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl
index e439d7805a..4ac0a51ce2 100644
--- a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl
+++ b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl
@@ -1,23 +1,23 @@
-struct Simulation {
- i : u32,
-};
-
-struct Particle {
- position : array, 8>,
- lifetime : f32,
- color : vec4,
- velocity : vec3,
-};
-
-struct Particles {
- p : array,
-};
-
-@group(1) @binding(3) var particles : Particles;
-@group(1) @binding(4) var sim : Simulation;
-
-@stage(compute) @workgroup_size(1)
-fn main() {
- var particle = particles.p[0];
- particle.position[sim.i] = particle.position[sim.i];
-}
+struct Simulation {
+ i : u32,
+};
+
+struct Particle {
+ position : array, 8>,
+ lifetime : f32,
+ color : vec4,
+ velocity : vec3,
+};
+
+struct Particles {
+ p : array,
+};
+
+@group(1) @binding(3) var particles : Particles;
+@group(1) @binding(4) var sim : Simulation;
+
+@stage(compute) @workgroup_size(1)
+fn main() {
+ var particle = particles.p[0];
+ particle.position[sim.i] = particle.position[sim.i];
+}
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl
index 6168492e30..2e7870bfb2 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl
@@ -1,12 +1,12 @@
- struct Uniforms {
- i : u32,
- j : u32,
-};
-
-@group(1) @binding(4) var uniforms : Uniforms;
-
-@stage(compute) @workgroup_size(1)
-fn main() {
- var m1 : mat2x4;
- m1[uniforms.i][0] = 1.0;
-}
+ struct Uniforms {
+ i : u32,
+ j : u32,
+};
+
+@group(1) @binding(4) var uniforms : Uniforms;
+
+@stage(compute) @workgroup_size(1)
+fn main() {
+ var m1 : mat2x4;
+ m1[uniforms.i][0] = 1.0;
+}
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl
index 4321cfe4fe..11678921c3 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl
@@ -1,12 +1,12 @@
- struct Uniforms {
- i : u32,
- j : u32,
-};
-
-@group(1) @binding(4) var uniforms : Uniforms;
-
-@stage(compute) @workgroup_size(1)
-fn main() {
- var m1 : mat2x4;
- m1[uniforms.i][uniforms.j] = 1.0;
-}
+ struct Uniforms {
+ i : u32,
+ j : u32,
+};
+
+@group(1) @binding(4) var uniforms : Uniforms;
+
+@stage(compute) @workgroup_size(1)
+fn main() {
+ var m1 : mat2x4;
+ m1[uniforms.i][uniforms.j] = 1.0;
+}
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_y.wgsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_y.wgsl
index d40d4e571b..138c9a7c34 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_y.wgsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_y.wgsl
@@ -1,13 +1,13 @@
- struct Uniforms {
- i : u32,
- j : u32,
-};
-
-@group(1) @binding(4) var uniforms : Uniforms;
-
-var m1 : mat2x4;
-
-@stage(compute) @workgroup_size(1)
-fn main() {
- m1[0][uniforms.j] = 1.0;
-}
+ struct Uniforms {
+ i : u32,
+ j : u32,
+};
+
+@group(1) @binding(4) var uniforms : Uniforms;
+
+var m1 : mat2x4;
+
+@stage(compute) @workgroup_size(1)
+fn main() {
+ m1[0][uniforms.j] = 1.0;
+}
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl
index de88c76432..e531d92d9c 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl
@@ -1,12 +1,12 @@
- struct Uniforms {
- i : u32,
- j : u32,
-};
-
-@group(1) @binding(4) var uniforms : Uniforms;
-
-@stage(compute) @workgroup_size(1)
-fn main() {
- var m1 : mat2x4;
- m1[uniforms.i] = vec4(1.0);
-}
+ struct Uniforms {
+ i : u32,
+ j : u32,
+};
+
+@group(1) @binding(4) var uniforms : Uniforms;
+
+@stage(compute) @workgroup_size(1)
+fn main() {
+ var m1 : mat2x4;
+ m1[uniforms.i] = vec4(1.0);
+}
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl
index 70c6a82b90..0ec75d9e54 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl
@@ -1,13 +1,13 @@
- struct Uniforms {
- i : u32,
- j : u32,
-};
-
-@group(1) @binding(4) var uniforms : Uniforms;
-
-var m1 : mat2x4;
-
-@stage(compute) @workgroup_size(1)
-fn main() {
- m1[uniforms.i][0] = 1.0;
-}
+ struct Uniforms {
+ i : u32,
+ j : u32,
+};
+
+@group(1) @binding(4) var uniforms : Uniforms;
+
+var m1 : mat2x4;
+
+@stage(compute) @workgroup_size(1)
+fn main() {
+ m1[uniforms.i][0] = 1.0;
+}
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl
index 4cffbb20bc..89630b73a6 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl
@@ -1,13 +1,13 @@
- struct Uniforms {
- i : u32,
- j : u32,
-};
-
-@group(1) @binding(4) var uniforms : Uniforms;
-
-var m1 : mat2x4;
-
-@stage(compute) @workgroup_size(1)
-fn main() {
- m1[uniforms.i][uniforms.j] = 1.0;
-}
+ struct Uniforms {
+ i : u32,
+ j : u32,
+};
+
+@group(1) @binding(4) var uniforms : Uniforms;
+
+var m1 : mat2x4;
+
+@stage(compute) @workgroup_size(1)
+fn main() {
+ m1[uniforms.i][uniforms.j] = 1.0;
+}
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_y.wgsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_y.wgsl
index d40d4e571b..138c9a7c34 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_y.wgsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_y.wgsl
@@ -1,13 +1,13 @@
- struct Uniforms {
- i : u32,
- j : u32,
-};
-
-@group(1) @binding(4) var uniforms : Uniforms;
-
-var m1 : mat2x4;
-
-@stage(compute) @workgroup_size(1)
-fn main() {
- m1[0][uniforms.j] = 1.0;
-}
+ struct Uniforms {
+ i : u32,
+ j : u32,
+};
+
+@group(1) @binding(4) var uniforms : Uniforms;
+
+var m1 : mat2x4;
+
+@stage(compute) @workgroup_size(1)
+fn main() {
+ m1[0][uniforms.j] = 1.0;
+}
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl
index 7fab9b7d24..31cee85a6f 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl
@@ -1,13 +1,13 @@
- struct Uniforms {
- i : u32,
- j : u32,
-};
-
-@group(1) @binding(4) var uniforms : Uniforms;
-
-var m1 : mat2x4;
-
-@stage(compute) @workgroup_size(1)
-fn main() {
- m1[uniforms.i] = vec4(1.0);
-}
+ struct Uniforms {
+ i : u32,
+ j : u32,
+};
+
+@group(1) @binding(4) var uniforms : Uniforms;
+
+var m1 : mat2x4;
+
+@stage(compute) @workgroup_size(1)
+fn main() {
+ m1[uniforms.i] = vec4(1.0);
+}
diff --git a/test/tint/bug/tint/1118.wgsl b/test/tint/bug/tint/1118.wgsl
index 0e689f178c..c8e3d046b7 100644
--- a/test/tint/bug/tint/1118.wgsl
+++ b/test/tint/bug/tint/1118.wgsl
@@ -1,117 +1,117 @@
-struct Scene {
- vEyePosition : vec4,
-};
-
-struct Material {
- vDiffuseColor : vec4,
- vAmbientColor : vec3,
- dummy: f32,
- vEmissiveColor : vec3,
- dummy2: f32,
-};
-
-struct Mesh {
- visibility : f32,
-};
-
-var fClipDistance3 : f32;
-
-var fClipDistance4 : f32;
-
-@group(0) @binding(0) var x_29 : Scene;
-
-@group(0) @binding(1) var x_49 : Material;
-
-@group(0) @binding(2) var x_137 : Mesh;
-
-var glFragColor : vec4;
-
-fn main_1() {
- var viewDirectionW : vec3;
- var baseColor : vec4;
- var diffuseColor : vec3;
- var alpha : f32;
- var normalW : vec3;
- var uvOffset : vec2;
- var baseAmbientColor : vec3;
- var glossiness : f32;
- var diffuseBase : vec3;
- var shadow : f32;
- var refractionColor : vec4;
- var reflectionColor : vec4;
- var emissiveColor : vec3;
- var finalDiffuse : vec3;
- var finalSpecular : vec3;
- var color : vec4;
- let x_9 : f32 = fClipDistance3;
- if ((x_9 > 0.0)) {
- discard;
- }
- let x_17 : f32 = fClipDistance4;
- if ((x_17 > 0.0)) {
- discard;
- }
- let x_34 : vec4 = x_29.vEyePosition;
- let x_38 : vec3 = vec3(0., 0., 0.);
- viewDirectionW = normalize((vec3(x_34.x, x_34.y, x_34.z) - x_38));
- baseColor = vec4(1.0, 1.0, 1.0, 1.0);
- let x_52 : vec4 = x_49.vDiffuseColor;
- diffuseColor = vec3(x_52.x, x_52.y, x_52.z);
- let x_60 : f32 = x_49.vDiffuseColor.w;
- alpha = x_60;
- let x_62 : vec3 = vec3(0., 0., 0.);
- let x_64 : vec3 = vec3(0., 0., 0.);
- normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64))));
- uvOffset = vec2(0.0, 0.0);
- let x_74 : vec4 = vec4(0., 0., 0., 0.);
- let x_76 : vec4 = baseColor;
- let x_78 : vec3 = (vec3(x_76.x, x_76.y, x_76.z) * vec3(x_74.x, x_74.y, x_74.z));
- let x_79 : vec4 = baseColor;
- baseColor = vec4(x_78.x, x_78.y, x_78.z, x_79.w);
- baseAmbientColor = vec3(1.0, 1.0, 1.0);
- glossiness = 0.0;
- diffuseBase = vec3(0.0, 0.0, 0.0);
- shadow = 1.0;
- refractionColor = vec4(0.0, 0.0, 0.0, 1.0);
- reflectionColor = vec4(0.0, 0.0, 0.0, 1.0);
- let x_94 : vec3 = x_49.vEmissiveColor;
- emissiveColor = x_94;
- let x_96 : vec3 = diffuseBase;
- let x_97 : vec3 = diffuseColor;
- let x_99 : vec3 = emissiveColor;
- let x_103 : vec3 = x_49.vAmbientColor;
- let x_108 : vec4 = baseColor;
- finalDiffuse = (clamp((((x_96 * x_97) + x_99) + x_103), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0)) * vec3(x_108.x, x_108.y, x_108.z));
- finalSpecular = vec3(0.0, 0.0, 0.0);
- let x_113 : vec3 = finalDiffuse;
- let x_114 : vec3 = baseAmbientColor;
- let x_116 : vec3 = finalSpecular;
- let x_118 : vec4 = reflectionColor;
- let x_121 : vec4 = refractionColor;
- let x_123 : vec3 = ((((x_113 * x_114) + x_116) + vec3(x_118.x, x_118.y, x_118.z)) + vec3(x_121.x, x_121.y, x_121.z));
- let x_124 : f32 = alpha;
- color = vec4(x_123.x, x_123.y, x_123.z, x_124);
- let x_129 : vec4 = color;
- let x_132 : vec3 = max(vec3(x_129.x, x_129.y, x_129.z), vec3(0.0, 0.0, 0.0));
- let x_133 : vec4 = color;
- color = vec4(x_132.x, x_132.y, x_132.z, x_133.w);
- let x_140 : f32 = x_137.visibility;
- let x_142 : f32 = color.w;
- color.w = (x_142 * x_140);
- let x_147 : vec4 = color;
- glFragColor = x_147;
- return;
-}
-
-struct main_out {
- @location(0)
- glFragColor_1 : vec4,
-};
-
-@stage(fragment)
-fn main(@location(2) fClipDistance3_param : f32, @location(3) fClipDistance4_param : f32) -> main_out {
- fClipDistance3 = fClipDistance3_param;
- fClipDistance4 = fClipDistance4_param;
- main_1();
- return main_out(glFragColor);
-}
+struct Scene {
+ vEyePosition : vec4,
+};
+
+struct Material {
+ vDiffuseColor : vec4,
+ vAmbientColor : vec3,
+ dummy: f32,
+ vEmissiveColor : vec3,
+ dummy2: f32,
+};
+
+struct Mesh {
+ visibility : f32,
+};
+
+var fClipDistance3 : f32;
+
+var fClipDistance4 : f32;
+
+@group(0) @binding(0) var x_29 : Scene;
+
+@group(0) @binding(1) var x_49 : Material;
+
+@group(0) @binding(2) var x_137 : Mesh;
+
+var glFragColor : vec4;
+
+fn main_1() {
+ var viewDirectionW : vec3;
+ var baseColor : vec4;
+ var diffuseColor : vec3;
+ var alpha : f32;
+ var normalW : vec3;
+ var uvOffset : vec2;
+ var baseAmbientColor : vec3;
+ var glossiness : f32;
+ var diffuseBase : vec3;
+ var shadow : f32;
+ var refractionColor : vec4;
+ var reflectionColor : vec4;
+ var emissiveColor : vec3;
+ var finalDiffuse : vec3;
+ var finalSpecular : vec3;
+ var color : vec4;
+ let x_9 : f32 = fClipDistance3;
+ if ((x_9 > 0.0)) {
+ discard;
+ }
+ let x_17 : f32 = fClipDistance4;
+ if ((x_17 > 0.0)) {
+ discard;
+ }
+ let x_34 : vec4 = x_29.vEyePosition;
+ let x_38 : vec3 = vec3(0., 0., 0.);
+ viewDirectionW = normalize((vec3(x_34.x, x_34.y, x_34.z) - x_38));
+ baseColor = vec4(1.0, 1.0, 1.0, 1.0);
+ let x_52 : vec4 = x_49.vDiffuseColor;
+ diffuseColor = vec3(x_52.x, x_52.y, x_52.z);
+ let x_60 : f32 = x_49.vDiffuseColor.w;
+ alpha = x_60;
+ let x_62 : vec3 = vec3(0., 0., 0.);
+ let x_64 : vec3 = vec3(0., 0., 0.);
+ normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64))));
+ uvOffset = vec2(0.0, 0.0);
+ let x_74 : vec4 = vec4(0., 0., 0., 0.);
+ let x_76 : vec4 = baseColor;
+ let x_78 : vec3 = (vec3(x_76.x, x_76.y, x_76.z) * vec3(x_74.x, x_74.y, x_74.z));
+ let x_79 : vec4 = baseColor;
+ baseColor = vec4(x_78.x, x_78.y, x_78.z, x_79.w);
+ baseAmbientColor = vec3(1.0, 1.0, 1.0);
+ glossiness = 0.0;
+ diffuseBase = vec3(0.0, 0.0, 0.0);
+ shadow = 1.0;
+ refractionColor = vec4(0.0, 0.0, 0.0, 1.0);
+ reflectionColor = vec4(0.0, 0.0, 0.0, 1.0);
+ let x_94 : vec3 = x_49.vEmissiveColor;
+ emissiveColor = x_94;
+ let x_96 : vec3 = diffuseBase;
+ let x_97 : vec3 = diffuseColor;
+ let x_99 : vec3 = emissiveColor;
+ let x_103 : vec3 = x_49.vAmbientColor;
+ let x_108 : vec4 = baseColor;
+ finalDiffuse = (clamp((((x_96 * x_97) + x_99) + x_103), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0)) * vec3(x_108.x, x_108.y, x_108.z));
+ finalSpecular = vec3(0.0, 0.0, 0.0);
+ let x_113 : vec3 = finalDiffuse;
+ let x_114 : vec3 = baseAmbientColor;
+ let x_116 : vec3 = finalSpecular;
+ let x_118 : vec4 = reflectionColor;
+ let x_121 : vec4 = refractionColor;
+ let x_123 : vec3 = ((((x_113 * x_114) + x_116) + vec3(x_118.x, x_118.y, x_118.z)) + vec3