Remove deprecated WGSL "-> void"

Bug: dawn:755
Change-Id: I10f2fb3afd26560df10b21d149a65b625bdb2b4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47600
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez
2021-04-13 09:48:24 +00:00
committed by Commit Bot service account
parent 71f3d58939
commit 21bd02becf
85 changed files with 381 additions and 386 deletions

View File

@@ -70,7 +70,7 @@ void init() {
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
var positions : array<vec4<f32>, 3> = array<vec4<f32>, 3>(
vec4<f32>( 0.0, 0.1, 0.0, 1.0),
vec4<f32>(-0.1, -0.1, 0.0, 1.0),
@@ -111,7 +111,7 @@ void init() {
[[location(0)]] var<out> FragColor : vec4<f32>;
[[location(0)]] var<in> v_color : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
FragColor = v_color;
})");

View File

@@ -44,7 +44,7 @@ void init() {
" vec2<f32>(-0.5, -0.5),\n"
" vec2<f32>( 0.5, -0.5)\n"
");\n"
"[[stage(vertex)]] fn main() -> void {\n"
"[[stage(vertex)]] fn main() {\n"
" Position = vec4<f32>(pos[VertexIndex], 0.0, 1.0);\n"
" return;\n"
"}\n";
@@ -52,7 +52,7 @@ void init() {
const char* fs =
"[[location(0)]] var<out> fragColor : vec4<f32>;\n"
"[[stage(fragment)]] fn main() -> void {\n"
"[[stage(fragment)]] fn main() {\n"
" fragColor = vec4<f32>(1.0, 0.0, 0.0, 1.0);\n"
" return;\n"
"}\n";

View File

@@ -102,7 +102,7 @@ void initRender() {
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]]
fn main() -> void {
fn main() {
var angle : f32 = -atan2(a_particleVel.x, a_particleVel.y);
var pos : vec2<f32> = vec2<f32>(
(a_pos.x * cos(angle)) - (a_pos.y * sin(angle)),
@@ -115,7 +115,7 @@ void initRender() {
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[location(0)]] var<out> FragColor : vec4<f32>;
[[stage(fragment)]]
fn main() -> void {
fn main() {
FragColor = vec4<f32>(1.0, 1.0, 1.0, 1.0);
return;
}
@@ -174,7 +174,7 @@ void initSim() {
// https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp
[[stage(compute)]]
fn main() -> void {
fn main() {
var index : u32 = GlobalInvocationID.x;
if (index >= params.particleCount) {
return;

View File

@@ -98,7 +98,7 @@ void init() {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[builtin(position)]] var<out> Position : vec4<f32>;
[[location(0)]] var<in> pos : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = pos;
return;
})");
@@ -109,7 +109,7 @@ void init() {
[[group(0), binding(1)]] var myTexture : texture_2d<f32>;
[[location(0)]] var<out> FragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
FragColor = textureSample(myTexture, mySampler, FragCoord.xy / vec2<f32>(640.0, 480.0));
return;
})");

View File

@@ -119,7 +119,7 @@ void init() {
[[location(2)]] var<out> f_col : vec3<f32>;
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
f_col = col;
Position = camera.proj * camera.view * model.matrix * vec4<f32>(pos, 1.0);
return;
@@ -129,7 +129,7 @@ void init() {
[[location(0)]] var<out> FragColor : vec4<f32>;
[[location(2)]] var<in> f_col : vec3<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
FragColor = vec4<f32>(f_col, 1.0);
return;
})");
@@ -138,7 +138,7 @@ void init() {
[[location(0)]] var<out> FragColor : vec4<f32>;
[[location(2)]] var<in> f_col : vec3<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
FragColor = vec4<f32>(mix(f_col, vec3<f32>(0.5, 0.5, 0.5), vec3<f32>(0.5, 0.5, 0.5)), 1.0);
return;
})");

View File

@@ -320,13 +320,13 @@ int main(int argc, const char* argv[]) {
vec2<f32>(-0.5, -0.5),
vec2<f32>( 0.5, -0.5)
);
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = vec4<f32>(pos[VertexIndex], 0.0, 1.0);
return;
})");
pipelineDesc.cFragment.module = utils::CreateShaderModule(device, R"(
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
fragColor = vec4<f32>(1.0, 0.0, 0.0, 1.0);
return;
})");