From 21bd02becfdbc26a285aa93d5c7b1d0e3a07145e Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 13 Apr 2021 09:48:24 +0000 Subject: [PATCH] Remove deprecated WGSL "-> void" Bug: dawn:755 Change-Id: I10f2fb3afd26560df10b21d149a65b625bdb2b4b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47600 Reviewed-by: Ben Clayton Commit-Queue: Corentin Wallez Auto-Submit: Corentin Wallez --- examples/Animometer.cpp | 4 +- examples/CHelloTriangle.cpp | 4 +- examples/ComputeBoids.cpp | 6 +- examples/CppHelloTriangle.cpp | 4 +- examples/CubeReflection.cpp | 6 +- examples/ManualSwapChainTest.cpp | 4 +- .../CopyTextureForBrowserHelper.cpp | 4 +- src/dawn_native/QueryHelper.cpp | 2 +- src/dawn_native/d3d12/CommandBufferD3D12.cpp | 2 +- src/tests/end2end/BindGroupTests.cpp | 33 ++++--- src/tests/end2end/BufferZeroInitTests.cpp | 18 ++-- src/tests/end2end/ClipSpaceTests.cpp | 4 +- src/tests/end2end/ColorStateTests.cpp | 10 +- .../end2end/CompressedTextureFormatTests.cpp | 4 +- .../end2end/ComputeCopyStorageBufferTests.cpp | 6 +- src/tests/end2end/ComputeDispatchTests.cpp | 2 +- .../end2end/ComputeSharedMemoryTests.cpp | 2 +- .../ComputeStorageBufferBarrierTests.cpp | 10 +- .../end2end/CopyTextureForBrowserTests.cpp | 2 +- .../end2end/CreatePipelineAsyncTests.cpp | 22 ++--- src/tests/end2end/CullingTests.cpp | 4 +- src/tests/end2end/D3D12CachingTests.cpp | 16 ++-- src/tests/end2end/D3D12VideoViewsTests.cpp | 8 +- src/tests/end2end/DeprecatedAPITests.cpp | 4 +- src/tests/end2end/DepthBiasTests.cpp | 6 +- src/tests/end2end/DepthStencilCopyTests.cpp | 10 +- .../end2end/DepthStencilSamplingTests.cpp | 12 +-- src/tests/end2end/DepthStencilStateTests.cpp | 4 +- src/tests/end2end/DestroyTests.cpp | 4 +- src/tests/end2end/DeviceLostTests.cpp | 4 +- .../end2end/DrawIndexedIndirectTests.cpp | 4 +- src/tests/end2end/DrawIndexedTests.cpp | 4 +- src/tests/end2end/DrawIndirectTests.cpp | 4 +- src/tests/end2end/DrawTests.cpp | 4 +- .../end2end/DynamicBufferOffsetTests.cpp | 6 +- src/tests/end2end/EntryPointTests.cpp | 8 +- src/tests/end2end/FirstIndexOffsetTests.cpp | 4 +- .../end2end/GpuMemorySynchronizationTests.cpp | 26 ++--- src/tests/end2end/IOSurfaceWrappingTests.cpp | 4 +- src/tests/end2end/IndexFormatTests.cpp | 4 +- .../end2end/MultisampledRenderingTests.cpp | 14 +-- .../end2end/MultisampledSamplingTests.cpp | 6 +- src/tests/end2end/ObjectCachingTests.cpp | 34 +++---- src/tests/end2end/OpArrayLengthTests.cpp | 10 +- src/tests/end2end/PrimitiveStateTests.cpp | 4 +- src/tests/end2end/PrimitiveTopologyTests.cpp | 4 +- src/tests/end2end/QueryTests.cpp | 4 +- src/tests/end2end/RenderBundleTests.cpp | 4 +- src/tests/end2end/RenderPassLoadOpTests.cpp | 4 +- src/tests/end2end/RenderPassTests.cpp | 6 +- .../end2end/SamplerFilterAnisotropicTests.cpp | 4 +- src/tests/end2end/SamplerTests.cpp | 4 +- src/tests/end2end/ScissorTests.cpp | 4 +- src/tests/end2end/ShaderTests.cpp | 2 +- src/tests/end2end/StorageTextureTests.cpp | 28 +++--- .../end2end/SwapChainValidationTests.cpp | 4 +- src/tests/end2end/TextureFormatTests.cpp | 4 +- src/tests/end2end/TextureSubresourceTests.cpp | 8 +- src/tests/end2end/TextureViewTests.cpp | 12 +-- src/tests/end2end/TextureZeroInitTests.cpp | 8 +- .../end2end/VertexBufferRobustnessTests.cpp | 4 +- src/tests/end2end/VertexFormatTests.cpp | 4 +- src/tests/end2end/VertexStateTests.cpp | 12 +-- .../end2end/ViewportOrientationTests.cpp | 4 +- src/tests/end2end/ViewportTests.cpp | 6 +- src/tests/perf_tests/DrawCallPerf.cpp | 6 +- .../perf_tests/SubresourceTrackingPerf.cpp | 4 +- .../validation/BindGroupValidationTests.cpp | 34 +++---- .../ComputeIndirectValidationTests.cpp | 2 +- .../DrawIndirectValidationTests.cpp | 4 +- .../GetBindGroupLayoutValidationTests.cpp | 96 +++++++++---------- .../validation/IndexBufferValidationTests.cpp | 4 +- .../MinimumBufferSizeValidationTests.cpp | 8 +- .../validation/MultipleDeviceTests.cpp | 2 +- .../validation/QueueSubmitValidationTests.cpp | 6 +- .../RenderBundleValidationTests.cpp | 4 +- .../RenderPipelineValidationTests.cpp | 28 +++--- .../validation/ResourceUsageTrackingTests.cpp | 18 ++-- .../ShaderModuleValidationTests.cpp | 4 +- .../StorageTextureValidationTests.cpp | 24 ++--- .../validation/UnsafeAPIValidationTests.cpp | 8 +- .../VertexBufferValidationTests.cpp | 4 +- .../validation/VertexStateValidationTests.cpp | 10 +- .../white_box/D3D12DescriptorHeapTests.cpp | 10 +- src/tests/white_box/D3D12ResidencyTests.cpp | 4 +- 85 files changed, 381 insertions(+), 386 deletions(-) diff --git a/examples/Animometer.cpp b/examples/Animometer.cpp index 67d34057a8..80cc96ca2a 100644 --- a/examples/Animometer.cpp +++ b/examples/Animometer.cpp @@ -70,7 +70,7 @@ void init() { [[builtin(vertex_idx)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { var positions : array, 3> = array, 3>( vec4( 0.0, 0.1, 0.0, 1.0), vec4(-0.1, -0.1, 0.0, 1.0), @@ -111,7 +111,7 @@ void init() { [[location(0)]] var FragColor : vec4; [[location(0)]] var v_color : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = v_color; })"); diff --git a/examples/CHelloTriangle.cpp b/examples/CHelloTriangle.cpp index 2de76572ed..a184fb3656 100644 --- a/examples/CHelloTriangle.cpp +++ b/examples/CHelloTriangle.cpp @@ -44,7 +44,7 @@ void init() { " vec2(-0.5, -0.5),\n" " vec2( 0.5, -0.5)\n" ");\n" - "[[stage(vertex)]] fn main() -> void {\n" + "[[stage(vertex)]] fn main() {\n" " Position = vec4(pos[VertexIndex], 0.0, 1.0);\n" " return;\n" "}\n"; @@ -52,7 +52,7 @@ void init() { const char* fs = "[[location(0)]] var fragColor : vec4;\n" - "[[stage(fragment)]] fn main() -> void {\n" + "[[stage(fragment)]] fn main() {\n" " fragColor = vec4(1.0, 0.0, 0.0, 1.0);\n" " return;\n" "}\n"; diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp index 9cf7245b24..35314f2071 100644 --- a/examples/ComputeBoids.cpp +++ b/examples/ComputeBoids.cpp @@ -102,7 +102,7 @@ void initRender() { [[builtin(position)]] var Position : vec4; [[stage(vertex)]] - fn main() -> void { + fn main() { var angle : f32 = -atan2(a_particleVel.x, a_particleVel.y); var pos : vec2 = vec2( (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 FragColor : vec4; [[stage(fragment)]] - fn main() -> void { + fn main() { FragColor = vec4(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; diff --git a/examples/CppHelloTriangle.cpp b/examples/CppHelloTriangle.cpp index b65839cb23..a0c2cbef50 100644 --- a/examples/CppHelloTriangle.cpp +++ b/examples/CppHelloTriangle.cpp @@ -98,7 +98,7 @@ void init() { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; [[location(0)]] var pos : vec4; - [[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; [[location(0)]] var FragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = textureSample(myTexture, mySampler, FragCoord.xy / vec2(640.0, 480.0)); return; })"); diff --git a/examples/CubeReflection.cpp b/examples/CubeReflection.cpp index e50bc337d7..f8d43aaf79 100644 --- a/examples/CubeReflection.cpp +++ b/examples/CubeReflection.cpp @@ -119,7 +119,7 @@ void init() { [[location(2)]] var f_col : vec3; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { f_col = col; Position = camera.proj * camera.view * model.matrix * vec4(pos, 1.0); return; @@ -129,7 +129,7 @@ void init() { [[location(0)]] var FragColor : vec4; [[location(2)]] var f_col : vec3; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = vec4(f_col, 1.0); return; })"); @@ -138,7 +138,7 @@ void init() { [[location(0)]] var FragColor : vec4; [[location(2)]] var f_col : vec3; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = vec4(mix(f_col, vec3(0.5, 0.5, 0.5), vec3(0.5, 0.5, 0.5)), 1.0); return; })"); diff --git a/examples/ManualSwapChainTest.cpp b/examples/ManualSwapChainTest.cpp index c99bf04756..674d18502b 100644 --- a/examples/ManualSwapChainTest.cpp +++ b/examples/ManualSwapChainTest.cpp @@ -320,13 +320,13 @@ int main(int argc, const char* argv[]) { vec2(-0.5, -0.5), vec2( 0.5, -0.5) ); - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(pos[VertexIndex], 0.0, 1.0); return; })"); pipelineDesc.cFragment.module = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(1.0, 0.0, 0.0, 1.0); return; })"); diff --git a/src/dawn_native/CopyTextureForBrowserHelper.cpp b/src/dawn_native/CopyTextureForBrowserHelper.cpp index 1dc232989d..86a0a53fc3 100644 --- a/src/dawn_native/CopyTextureForBrowserHelper.cpp +++ b/src/dawn_native/CopyTextureForBrowserHelper.cpp @@ -46,7 +46,7 @@ namespace dawn_native { [[builtin(position)]] var Position : vec4; [[builtin(vertex_index)]] var VertexIndex : u32; [[binding(0), group(0)]] var uniforms : Uniforms; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { 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 @@ -76,7 +76,7 @@ namespace dawn_native { [[binding(2), group(0)]] var myTexture: texture_2d; [[location(0)]] var v_texcoord : vec2; [[location(0)]] var outputColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { // Clamp the texcoord and discard the out-of-bound pixels. var clampedTexcoord : vec2 = clamp(v_texcoord, vec2(0.0, 0.0), vec2(1.0, 1.0)); diff --git a/src/dawn_native/QueryHelper.cpp b/src/dawn_native/QueryHelper.cpp index 585e844c74..cf24c571a9 100644 --- a/src/dawn_native/QueryHelper.cpp +++ b/src/dawn_native/QueryHelper.cpp @@ -63,7 +63,7 @@ namespace dawn_native { const sizeofTimestamp : u32 = 8u; [[stage(compute), workgroup_size(8, 1, 1)]] - fn main() -> void { + fn main() { if (GlobalInvocationID.x >= params.count) { return; } var index : u32 = GlobalInvocationID.x + params.offset / sizeofTimestamp; diff --git a/src/dawn_native/d3d12/CommandBufferD3D12.cpp b/src/dawn_native/d3d12/CommandBufferD3D12.cpp index 8d0056adf6..7fb5e22168 100644 --- a/src/dawn_native/d3d12/CommandBufferD3D12.cpp +++ b/src/dawn_native/d3d12/CommandBufferD3D12.cpp @@ -664,7 +664,7 @@ namespace dawn_native { namespace d3d12 { // TODO(jiawei.shao@intel.com): move the resource lazy clearing inside the barrier tracking // for compute passes. auto PrepareResourcesForComputePass = [](CommandRecordingContext* commandContext, - const PassResourceUsage& usages) -> void { + const PassResourceUsage& usages) { for (size_t i = 0; i < usages.buffers.size(); ++i) { Buffer* buffer = ToBackend(usages.buffers[i]); diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp index b51fc76223..8566678516 100644 --- a/src/tests/end2end/BindGroupTests.cpp +++ b/src/tests/end2end/BindGroupTests.cpp @@ -49,7 +49,7 @@ class BindGroupTests : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, 1.0), @@ -84,7 +84,7 @@ class BindGroupTests : public DawnTest { } } - fs << "\n[[stage(fragment)]] fn main() -> void {\n"; + fs << "\n[[stage(fragment)]] fn main() {\n"; for (size_t i = 0; i < bindingTypes.size(); ++i) { fs << "fragColor = fragColor + buffer" << i << ".color;\n"; } @@ -129,7 +129,7 @@ TEST_P(BindGroupTests, ReusedBindGroupSingleSubmit) { }; [[group(0), binding(0)]] var contents: Contents; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { var f : f32 = contents.f; })"); @@ -168,7 +168,7 @@ TEST_P(BindGroupTests, ReusedUBO) { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, 1.0), @@ -186,7 +186,7 @@ TEST_P(BindGroupTests, ReusedUBO) { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = fragmentUbo.color; })"); @@ -249,7 +249,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, 1.0), @@ -266,7 +266,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = textureSample(tex, samp, FragCoord.xy); })"); @@ -364,7 +364,7 @@ TEST_P(BindGroupTests, MultipleBindLayouts) { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, 1.0), @@ -392,7 +392,7 @@ TEST_P(BindGroupTests, MultipleBindLayouts) { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = fragmentUbo1.color + fragmentUbo2.color; })"); @@ -855,7 +855,7 @@ TEST_P(BindGroupTests, DynamicOffsetOrder) { [[group(0), binding(0)]] var buffer0 : [[access(read)]] Buffer0; [[group(0), binding(4)]] var outputBuffer : [[access(read_write)]] OutputBuffer; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { outputBuffer.value = vec3(buffer0.value, buffer2.value, buffer3.value); })"); pipelineDescriptor.computeStage.entryPoint = "main"; @@ -954,7 +954,7 @@ TEST_P(BindGroupTests, ArbitraryBindingNumbers) { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, 1.0), @@ -984,7 +984,7 @@ TEST_P(BindGroupTests, ArbitraryBindingNumbers) { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = ubo1.color + 2.0 * ubo2.color + 4.0 * ubo3.color; })"); @@ -1084,7 +1084,7 @@ TEST_P(BindGroupTests, EmptyLayout) { pipelineDesc.layout = utils::MakeBasicPipelineLayout(device, &bgl); pipelineDesc.computeStage.entryPoint = "main"; pipelineDesc.computeStage.module = utils::CreateShaderModule(device, R"( - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })"); wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc); @@ -1110,7 +1110,7 @@ TEST_P(BindGroupTests, ReadonlyStorage) { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, 1.0), @@ -1126,7 +1126,7 @@ TEST_P(BindGroupTests, ReadonlyStorage) { [[group(0), binding(0)]] var buffer0 : [[access(read)]] Buffer0; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = buffer0.color; })"); @@ -1282,8 +1282,7 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) { body << "result.value = 1u;\n"; - std::string shader = - interface.str() + "[[stage(compute)]] fn main() -> void {\n" + body.str() + "}\n"; + std::string shader = interface.str() + "[[stage(compute)]] fn main() {\n" + body.str() + "}\n"; wgpu::ComputePipelineDescriptor cpDesc; cpDesc.computeStage.module = utils::CreateShaderModule(device, shader.c_str()); cpDesc.computeStage.entryPoint = "main"; diff --git a/src/tests/end2end/BufferZeroInitTests.cpp b/src/tests/end2end/BufferZeroInitTests.cpp index da478b4829..22879f8b59 100644 --- a/src/tests/end2end/BufferZeroInitTests.cpp +++ b/src/tests/end2end/BufferZeroInitTests.cpp @@ -210,7 +210,7 @@ class BufferZeroInitTest : public DawnTest { [[location(0)]] var i_color : vec4; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = i_color; })"); @@ -253,7 +253,7 @@ class BufferZeroInitTest : public DawnTest { [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { if (all(pos == vec4(0.0, 0.0, 0.0, 0.0))) { o_color = vec4(0.0, 1.0, 0.0, 1.0); } else { @@ -295,7 +295,7 @@ class BufferZeroInitTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { if (VertexIndex == 0u) { o_color = vec4(0.0, 1.0, 0.0, 1.0); } else { @@ -341,7 +341,7 @@ class BufferZeroInitTest : public DawnTest { [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { o_color = vec4(1.0, 0.0, 0.0, 1.0); Position = vec4(0.0, 0.0, 0.0, 1.0); })", @@ -379,7 +379,7 @@ class BufferZeroInitTest : public DawnTest { [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { o_color = vec4(1.0, 0.0, 0.0, 1.0); Position = vec4(0.0, 0.0, 0.0, 1.0); })", @@ -418,7 +418,7 @@ class BufferZeroInitTest : public DawnTest { const char* computeShader = R"( [[group(0), binding(0)]] var outImage : [[access(write)]] texture_storage_2d; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { textureStore(outImage, vec2(0, 0), vec4(1.0, 0.0, 0.0, 1.0)); })"; @@ -990,7 +990,7 @@ TEST_P(BufferZeroInitTest, BoundAsUniformBuffer) { [[group(0), binding(0)]] var ubo : UBO; [[group(0), binding(1)]] var outImage : [[access(write)]] texture_storage_2d; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { if (all(ubo.value == vec4(0u, 0u, 0u, 0u))) { textureStore(outImage, vec2(0, 0), vec4(0.0, 1.0, 0.0, 1.0)); } else { @@ -1029,7 +1029,7 @@ TEST_P(BufferZeroInitTest, BoundAsReadonlyStorageBuffer) { [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; [[group(0), binding(1)]] var outImage : [[access(write)]] texture_storage_2d; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { if (all(ssbo.value == vec4(0u, 0u, 0u, 0u))) { textureStore(outImage, vec2(0, 0), vec4(0.0, 1.0, 0.0, 1.0)); } else { @@ -1068,7 +1068,7 @@ TEST_P(BufferZeroInitTest, BoundAsStorageBuffer) { [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; [[group(0), binding(1)]] var outImage : [[access(write)]] texture_storage_2d; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { if (all(ssbo.value[0] == vec4(0u, 0u, 0u, 0u)) && all(ssbo.value[1] == vec4(0u, 0u, 0u, 0u))) { textureStore(outImage, vec2(0, 0), vec4(0.0, 1.0, 0.0, 1.0)); diff --git a/src/tests/end2end/ClipSpaceTests.cpp b/src/tests/end2end/ClipSpaceTests.cpp index aebc4d1b4b..886641e467 100644 --- a/src/tests/end2end/ClipSpaceTests.cpp +++ b/src/tests/end2end/ClipSpaceTests.cpp @@ -37,14 +37,14 @@ class ClipSpaceTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(pos[VertexIndex], 1.0); return; })"); pipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4;; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(1.0, 0.0, 0.0, 1.0); return; })"); diff --git a/src/tests/end2end/ColorStateTests.cpp b/src/tests/end2end/ColorStateTests.cpp index 8e30fdf5e9..7e51cc1b87 100644 --- a/src/tests/end2end/ColorStateTests.cpp +++ b/src/tests/end2end/ColorStateTests.cpp @@ -38,7 +38,7 @@ class ColorStateTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, -1.0), vec2(3.0, -1.0), @@ -68,7 +68,7 @@ class ColorStateTest : public DawnTest { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = myUbo.color; return; } @@ -804,7 +804,7 @@ TEST_P(ColorStateTest, IndependentColorState) { [[location(2)]] var fragColor2 : vec4; [[location(3)]] var fragColor3 : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor0 = myUbo.color0; fragColor1 = myUbo.color1; fragColor2 = myUbo.color2; @@ -917,7 +917,7 @@ TEST_P(ColorStateTest, DefaultBlendColor) { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = myUbo.color; return; } @@ -1044,7 +1044,7 @@ TEST_P(ColorStateTest, ColorWriteMaskDoesNotAffectRenderPassLoadOpClear) { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = myUbo.color; return; } diff --git a/src/tests/end2end/CompressedTextureFormatTests.cpp b/src/tests/end2end/CompressedTextureFormatTests.cpp index f9a9e0a070..e763899b38 100644 --- a/src/tests/end2end/CompressedTextureFormatTests.cpp +++ b/src/tests/end2end/CompressedTextureFormatTests.cpp @@ -145,7 +145,7 @@ class CompressedTextureBCFormatTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-3.0, 1.0), vec2( 3.0, 1.0), @@ -162,7 +162,7 @@ class CompressedTextureBCFormatTest : public DawnTest { [[location(0)]] var texCoord : vec2; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = textureSample(texture0, sampler0, texCoord); return; })"); diff --git a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp index a1c64a7a0b..1cdf2c7b82 100644 --- a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp +++ b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp @@ -101,7 +101,7 @@ TEST_P(ComputeCopyStorageBufferTests, SizedArrayOfBasic) { [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { var index : u32 = GlobalInvocationID.x; if (index >= 4u) { return; } dst.s[index] = src.s[index]; @@ -129,7 +129,7 @@ TEST_P(ComputeCopyStorageBufferTests, SizedArrayOfStruct) { [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { var index : u32 = GlobalInvocationID.x; if (index >= 4u) { return; } dst.s[index] = src.s[index]; @@ -152,7 +152,7 @@ TEST_P(ComputeCopyStorageBufferTests, UnsizedArrayOfBasic) { [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { var index : u32 = GlobalInvocationID.x; if (index >= 4u) { return; } dst.s[index] = src.s[index]; diff --git a/src/tests/end2end/ComputeDispatchTests.cpp b/src/tests/end2end/ComputeDispatchTests.cpp index a86209be55..e343091a59 100644 --- a/src/tests/end2end/ComputeDispatchTests.cpp +++ b/src/tests/end2end/ComputeDispatchTests.cpp @@ -42,7 +42,7 @@ class ComputeDispatchTests : public DawnTest { [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; [[stage(compute), workgroup_size(1, 1, 1)]] - fn main() -> void { + fn main() { const dispatch : vec3 = input.expectedDispatch; if (dispatch.x == 0u || dispatch.y == 0u || dispatch.z == 0u) { diff --git a/src/tests/end2end/ComputeSharedMemoryTests.cpp b/src/tests/end2end/ComputeSharedMemoryTests.cpp index 2bc4d61fa6..c0a2e23d1e 100644 --- a/src/tests/end2end/ComputeSharedMemoryTests.cpp +++ b/src/tests/end2end/ComputeSharedMemoryTests.cpp @@ -84,7 +84,7 @@ TEST_P(ComputeSharedMemoryTests, Basic) { var tmp : u32; [[stage(compute), workgroup_size(4,4,1)]] - fn main() -> void { + fn main() { var index : u32 = LocalInvocationID.y * kTileSize + LocalInvocationID.x; if (index == 0u) { tmp = 0u; diff --git a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp index 5049c29570..06c8a6e62a 100644 --- a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp +++ b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp @@ -40,7 +40,7 @@ TEST_P(ComputeStorageBufferBarrierTests, AddIncrement) { [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { buf.data[GlobalInvocationID.x] = buf.data[GlobalInvocationID.x] + 0x1234u; } )"); @@ -96,7 +96,7 @@ TEST_P(ComputeStorageBufferBarrierTests, AddPingPong) { [[group(0), binding(1)]] var dst : [[access(read_write)]] Dst; [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { dst.data[GlobalInvocationID.x] = src.data[GlobalInvocationID.x] + 0x1234u; } )"); @@ -168,7 +168,7 @@ TEST_P(ComputeStorageBufferBarrierTests, StorageAndReadonlyStoragePingPongInOneP [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { dst.data[GlobalInvocationID.x] = src.data[GlobalInvocationID.x] + 0x1234u; } )"); @@ -236,7 +236,7 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPong) { [[group(0), binding(1)]] var dst : [[access(read_write)]] Buf; [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { dst.data[GlobalInvocationID.x] = src.data[GlobalInvocationID.x] + vec4(0x1234u, 0x1234u, 0x1234u, 0x1234u); } @@ -304,7 +304,7 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPongInOnePass) { [[group(0), binding(1)]] var dst : [[access(read_write)]] Buf; [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { dst.data[GlobalInvocationID.x] = src.data[GlobalInvocationID.x] + vec4(0x1234u, 0x1234u, 0x1234u, 0x1234u); } diff --git a/src/tests/end2end/CopyTextureForBrowserTests.cpp b/src/tests/end2end/CopyTextureForBrowserTests.cpp index 86892805c0..fd03f62fa6 100644 --- a/src/tests/end2end/CopyTextureForBrowserTests.cpp +++ b/src/tests/end2end/CopyTextureForBrowserTests.cpp @@ -153,7 +153,7 @@ class CopyTextureForBrowserTests : public DawnTest { // The value diff should be smaller than the hard coded tolerance. return abs(value - expect) < 0.001; } - [[stage(compute), workgroup_size(1, 1, 1)]] fn main() -> void { + [[stage(compute), workgroup_size(1, 1, 1)]] fn main() { var srcSize : vec2 = textureDimensions(src); var dstSize : vec2 = textureDimensions(dst); var dstTexCoord : vec2 = vec2(GlobalInvocationID.xy); diff --git a/src/tests/end2end/CreatePipelineAsyncTests.cpp b/src/tests/end2end/CreatePipelineAsyncTests.cpp index 76460353d2..362fc1b4e1 100644 --- a/src/tests/end2end/CreatePipelineAsyncTests.cpp +++ b/src/tests/end2end/CreatePipelineAsyncTests.cpp @@ -80,7 +80,7 @@ TEST_P(CreatePipelineAsyncTest, BasicUseOfCreateComputePipelineAsync) { }; [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { ssbo.value = 1u; })"); csDesc.computeStage.entryPoint = "main"; @@ -115,7 +115,7 @@ TEST_P(CreatePipelineAsyncTest, CreateComputePipelineFailed) { }; [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { ssbo.value = 1u; })"); csDesc.computeStage.entryPoint = "main0"; @@ -148,12 +148,12 @@ TEST_P(CreatePipelineAsyncTest, BasicUseOfCreateRenderPipelineAsync) { utils::ComboRenderPipelineDescriptor2 renderPipelineDescriptor; wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var o_color : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { o_color = vec4(0.0, 1.0, 0.0, 1.0); })"); renderPipelineDescriptor.vertex.module = vsModule; @@ -218,12 +218,12 @@ TEST_P(CreatePipelineAsyncTest, CreateRenderPipelineFailed) { utils::ComboRenderPipelineDescriptor2 renderPipelineDescriptor; wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var o_color : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { o_color = vec4(0.0, 1.0, 0.0, 1.0); })"); renderPipelineDescriptor.vertex.module = vsModule; @@ -257,7 +257,7 @@ TEST_P(CreatePipelineAsyncTest, CreateRenderPipelineFailed) { TEST_P(CreatePipelineAsyncTest, ReleaseDeviceBeforeCallbackOfCreateComputePipelineAsync) { wgpu::ComputePipelineDescriptor csDesc; csDesc.computeStage.module = utils::CreateShaderModule(device, R"( - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })"); csDesc.computeStage.entryPoint = "main"; @@ -282,12 +282,12 @@ TEST_P(CreatePipelineAsyncTest, ReleaseDeviceBeforeCallbackOfCreateRenderPipelin utils::ComboRenderPipelineDescriptor2 renderPipelineDescriptor; wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var o_color : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { o_color = vec4(0.0, 1.0, 0.0, 1.0); })"); renderPipelineDescriptor.vertex.module = vsModule; @@ -320,7 +320,7 @@ TEST_P(CreatePipelineAsyncTest, CreateSameComputePipelineTwice) { }; [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { ssbo.value = 1u; })"); csDesc.computeStage.entryPoint = "main"; @@ -361,7 +361,7 @@ TEST_P(CreatePipelineAsyncTest, CreateSamePipelineTwiceAtSameTime) { }; [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { ssbo.value = 1u; })"); csDesc.computeStage.entryPoint = "main"; diff --git a/src/tests/end2end/CullingTests.cpp b/src/tests/end2end/CullingTests.cpp index 34723e6d4f..ec05127fab 100644 --- a/src/tests/end2end/CullingTests.cpp +++ b/src/tests/end2end/CullingTests.cpp @@ -37,7 +37,7 @@ class CullingTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(pos[VertexIndex], 0.0, 1.0); return; })"); @@ -49,7 +49,7 @@ class CullingTest : public DawnTest { [[location(0)]] var fragColor : vec4;; [[builtin(frag_coord)]] var FragCoord : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4( (FragCoord.xy - vec2(0.5, 0.5)) / vec2(255.0, 255.0), 0.0, 1.0); diff --git a/src/tests/end2end/D3D12CachingTests.cpp b/src/tests/end2end/D3D12CachingTests.cpp index a0d00af33d..1295caa27c 100644 --- a/src/tests/end2end/D3D12CachingTests.cpp +++ b/src/tests/end2end/D3D12CachingTests.cpp @@ -103,14 +103,14 @@ TEST_P(D3D12CachingTests, SameShaderNoCache) { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn vertex_main() -> void { + [[stage(vertex)]] fn vertex_main() { Position = vec4(0.0, 0.0, 0.0, 1.0); return; } [[location(0)]] var outColor : vec4; - [[stage(fragment)]] fn fragment_main() -> void { + [[stage(fragment)]] fn fragment_main() { outColor = vec4(1.0, 0.0, 0.0, 1.0); return; } @@ -150,14 +150,14 @@ TEST_P(D3D12CachingTests, ReuseShaderWithMultipleEntryPointsPerStage) { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn vertex_main() -> void { + [[stage(vertex)]] fn vertex_main() { Position = vec4(0.0, 0.0, 0.0, 1.0); return; } [[location(0)]] var outColor : vec4; - [[stage(fragment)]] fn fragment_main() -> void { + [[stage(fragment)]] fn fragment_main() { outColor = vec4(1.0, 0.0, 0.0, 1.0); return; } @@ -195,14 +195,14 @@ TEST_P(D3D12CachingTests, ReuseShaderWithMultipleEntryPointsPerStage) { wgpu::ShaderModule newModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn vertex_main() -> void { + [[stage(vertex)]] fn vertex_main() { Position = vec4(1.0, 1.0, 1.0, 1.0); return; } [[location(0)]] var outColor : vec4; - [[stage(fragment)]] fn fragment_main() -> void { + [[stage(fragment)]] fn fragment_main() { outColor = vec4(1.0, 1.0, 1.0, 1.0); return; } @@ -231,12 +231,12 @@ TEST_P(D3D12CachingTests, ReuseShaderWithMultipleEntryPoints) { }; [[binding(0), group(0)]] var data : [[access(read_write)]] Data; - [[stage(compute)]] fn write1() -> void { + [[stage(compute)]] fn write1() { data.data = 1u; return; } - [[stage(compute)]] fn write42() -> void { + [[stage(compute)]] fn write42() { data.data = 42u; return; } diff --git a/src/tests/end2end/D3D12VideoViewsTests.cpp b/src/tests/end2end/D3D12VideoViewsTests.cpp index 0e4edb38ed..dfe5af6967 100644 --- a/src/tests/end2end/D3D12VideoViewsTests.cpp +++ b/src/tests/end2end/D3D12VideoViewsTests.cpp @@ -236,7 +236,7 @@ namespace { [[builtin(vertex_index)]] var VertexIndex : u32; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 6> = array, 6>( vec2(-1.0, 1.0), vec2(-1.0, -1.0), @@ -300,7 +300,7 @@ TEST_P(D3D12VideoViewsTests, NV12SampleYtoR) { [[location(0)]] var texCoord : vec2; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { var y : f32 = textureSample(texture, sampler0, texCoord).r; fragColor = vec4(y, 0.0, 0.0, 1.0); })"); @@ -353,7 +353,7 @@ TEST_P(D3D12VideoViewsTests, NV12SampleUVtoRG) { [[location(0)]] var texCoord : vec2; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { var u : f32 = textureSample(texture, sampler0, texCoord).r; var v : f32 = textureSample(texture, sampler0, texCoord).g; fragColor = vec4(u, v, 0.0, 1.0); @@ -416,7 +416,7 @@ TEST_P(D3D12VideoViewsTests, NV12SampleYUVtoRGB) { [[location(0)]] var texCoord : vec2; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { var y : f32 = textureSample(lumaTexture, sampler0, texCoord).r; var u : f32 = textureSample(chromaTexture, sampler0, texCoord).r; var v : f32 = textureSample(chromaTexture, sampler0, texCoord).g; diff --git a/src/tests/end2end/DeprecatedAPITests.cpp b/src/tests/end2end/DeprecatedAPITests.cpp index 9512ea094c..9d95bad3a8 100644 --- a/src/tests/end2end/DeprecatedAPITests.cpp +++ b/src/tests/end2end/DeprecatedAPITests.cpp @@ -499,7 +499,7 @@ class VertexFormatDeprecationTests : public DeprecationTests { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, (attribute + R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = )" + attribAccess + R"(; return; } @@ -508,7 +508,7 @@ class VertexFormatDeprecationTests : public DeprecationTests { wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var outColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { outColor = vec4(1.0, 1.0, 1.0, 1.0); return; } diff --git a/src/tests/end2end/DepthBiasTests.cpp b/src/tests/end2end/DepthBiasTests.cpp index a6fa361fc3..5cc22d6ba3 100644 --- a/src/tests/end2end/DepthBiasTests.cpp +++ b/src/tests/end2end/DepthBiasTests.cpp @@ -38,7 +38,7 @@ class DepthBiasTests : public DawnTest { vertexSource = R"( [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 6> = array, 6>( vec2(-1.0, -1.0), vec2( 1.0, -1.0), @@ -56,7 +56,7 @@ class DepthBiasTests : public DawnTest { vertexSource = R"( [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 6> = array, 6>( vec3(-1.0, -1.0, 0.0), vec3( 1.0, -1.0, 0.0), @@ -74,7 +74,7 @@ class DepthBiasTests : public DawnTest { wgpu::ShaderModule fragmentModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4;; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(1.0, 0.0, 0.0, 1.0); return; })"); diff --git a/src/tests/end2end/DepthStencilCopyTests.cpp b/src/tests/end2end/DepthStencilCopyTests.cpp index 356c0784f1..166a9260be 100644 --- a/src/tests/end2end/DepthStencilCopyTests.cpp +++ b/src/tests/end2end/DepthStencilCopyTests.cpp @@ -32,7 +32,7 @@ class DepthStencilCopyTests : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 6> = array, 6>( vec2(-1.0, -1.0), vec2( 0.0, -1.0), @@ -75,7 +75,7 @@ class DepthStencilCopyTests : public DawnTest { std::string fsSource = R"( [[builtin(frag_depth)]] var FragDepth : f32; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragDepth = )" + std::to_string(regionDepth) + ";\n}"; @@ -242,7 +242,7 @@ class DepthStencilCopyTests : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, -1.0), vec2( 3.0, -1.0), @@ -259,7 +259,7 @@ class DepthStencilCopyTests : public DawnTest { [[location(0)]] var result : u32; [[builtin(frag_depth)]] var FragDepth : f32; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { result = 1u; FragDepth = textureLoad(texture0, vec2(FragCoord.xy), 0)[0]; })"); @@ -646,7 +646,7 @@ TEST_P(DepthStencilCopyTests, ToStencilAspect) { utils::ComboRenderPipelineDescriptor2 renderPipelineDesc; renderPipelineDesc.vertex.module = mVertexModule; renderPipelineDesc.cFragment.module = utils::CreateShaderModule(device, R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); wgpu::DepthStencilState* depthStencil = renderPipelineDesc.EnableDepthStencil(wgpu::TextureFormat::Depth24PlusStencil8); diff --git a/src/tests/end2end/DepthStencilSamplingTests.cpp b/src/tests/end2end/DepthStencilSamplingTests.cpp index d0906de100..28274d539f 100644 --- a/src/tests/end2end/DepthStencilSamplingTests.cpp +++ b/src/tests/end2end/DepthStencilSamplingTests.cpp @@ -67,7 +67,7 @@ class DepthStencilSamplingTest : public DawnTest { uint32_t componentIndex) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); @@ -106,7 +106,7 @@ class DepthStencilSamplingTest : public DawnTest { index++; } - shaderSource << "[[stage(fragment)]] fn main() -> void { " << shaderBody.str() << "\n}"; + shaderSource << "[[stage(fragment)]] fn main() { " << shaderBody.str() << "\n}"; wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, shaderSource.str().c_str()); pipelineDescriptor.vertex.module = vsModule; @@ -160,7 +160,7 @@ class DepthStencilSamplingTest : public DawnTest { index++; } - shaderSource << "[[stage(compute)]] fn main() -> void { " << shaderBody.str() << "\n}"; + shaderSource << "[[stage(compute)]] fn main() { " << shaderBody.str() << "\n}"; wgpu::ShaderModule csModule = utils::CreateShaderModule(device, shaderSource.str().c_str()); @@ -174,7 +174,7 @@ class DepthStencilSamplingTest : public DawnTest { wgpu::RenderPipeline CreateComparisonRenderPipeline() { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); @@ -188,7 +188,7 @@ class DepthStencilSamplingTest : public DawnTest { [[location(0)]] var samplerResult : f32; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { samplerResult = textureSampleCompare(tex, samp, vec2(0.5, 0.5), uniforms.compareRef); })"); @@ -223,7 +223,7 @@ class DepthStencilSamplingTest : public DawnTest { }; [[group(0), binding(3)]] var samplerResult : [[access(read_write)]] SamplerResult; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { samplerResult.value = textureSampleCompare(tex, samp, vec2(0.5, 0.5), uniforms.compareRef); })"); diff --git a/src/tests/end2end/DepthStencilStateTests.cpp b/src/tests/end2end/DepthStencilStateTests.cpp index c5393d0357..0c011434e7 100644 --- a/src/tests/end2end/DepthStencilStateTests.cpp +++ b/src/tests/end2end/DepthStencilStateTests.cpp @@ -64,7 +64,7 @@ class DepthStencilStateTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 6> = array, 6>( vec2(-1.0, 1.0), vec2(-1.0, -1.0), @@ -84,7 +84,7 @@ class DepthStencilStateTest : public DawnTest { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(ubo.color, 1.0); })"); } diff --git a/src/tests/end2end/DestroyTests.cpp b/src/tests/end2end/DestroyTests.cpp index 67d740e017..eaa7b7f84d 100644 --- a/src/tests/end2end/DestroyTests.cpp +++ b/src/tests/end2end/DestroyTests.cpp @@ -30,13 +30,13 @@ class DestroyTest : public DawnTest { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var pos : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = pos; })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/end2end/DeviceLostTests.cpp b/src/tests/end2end/DeviceLostTests.cpp index d5e0673d94..3055e008c1 100644 --- a/src/tests/end2end/DeviceLostTests.cpp +++ b/src/tests/end2end/DeviceLostTests.cpp @@ -129,7 +129,7 @@ TEST_P(DeviceLostTest, GetBindGroupLayoutFails) { pos : vec4; }; [[group(0), binding(0)]] var ubo : UniformBuffer; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })"); wgpu::ComputePipelineDescriptor descriptor; @@ -214,7 +214,7 @@ TEST_P(DeviceLostTest, CreateShaderModuleFails) { ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"( [[location(0)]] var color : vec4; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = color; })")); } diff --git a/src/tests/end2end/DrawIndexedIndirectTests.cpp b/src/tests/end2end/DrawIndexedIndirectTests.cpp index e8d018ff9e..0da508f7df 100644 --- a/src/tests/end2end/DrawIndexedIndirectTests.cpp +++ b/src/tests/end2end/DrawIndexedIndirectTests.cpp @@ -29,13 +29,13 @@ class DrawIndexedIndirectTest : public DawnTest { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var pos : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = pos; })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/end2end/DrawIndexedTests.cpp b/src/tests/end2end/DrawIndexedTests.cpp index 7751c1229b..3c696ac927 100644 --- a/src/tests/end2end/DrawIndexedTests.cpp +++ b/src/tests/end2end/DrawIndexedTests.cpp @@ -29,13 +29,13 @@ class DrawIndexedTest : public DawnTest { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var pos : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = pos; })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/end2end/DrawIndirectTests.cpp b/src/tests/end2end/DrawIndirectTests.cpp index 2efa7cbcfa..4887f7a260 100644 --- a/src/tests/end2end/DrawIndirectTests.cpp +++ b/src/tests/end2end/DrawIndirectTests.cpp @@ -29,13 +29,13 @@ class DrawIndirectTest : public DawnTest { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var pos : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = pos; })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/end2end/DrawTests.cpp b/src/tests/end2end/DrawTests.cpp index 4e662d5822..dc30a55112 100644 --- a/src/tests/end2end/DrawTests.cpp +++ b/src/tests/end2end/DrawTests.cpp @@ -29,13 +29,13 @@ class DrawTest : public DawnTest { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var pos : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = pos; })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/end2end/DynamicBufferOffsetTests.cpp b/src/tests/end2end/DynamicBufferOffsetTests.cpp index abdfe031fc..afabe47e64 100644 --- a/src/tests/end2end/DynamicBufferOffsetTests.cpp +++ b/src/tests/end2end/DynamicBufferOffsetTests.cpp @@ -96,7 +96,7 @@ class DynamicBufferOffsetTests : public DawnTest { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 0.0), vec2(-1.0, 1.0), @@ -145,7 +145,7 @@ class DynamicBufferOffsetTests : public DawnTest { fs << "const multipleNumber : u32 = " << multipleNumber << "u;\n"; fs << R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { sBufferNotDynamic.value = uBufferNotDynamic.value.xy; sBuffer.value = vec2(multipleNumber, multipleNumber) * (uBuffer.value.xy + sBufferNotDynamic.value.xy); fragColor = vec4(f32(uBuffer.value.x) / 255.0, f32(uBuffer.value.y) / 255.0, @@ -212,7 +212,7 @@ class DynamicBufferOffsetTests : public DawnTest { cs << "const multipleNumber : u32 = " << multipleNumber << "u;\n"; cs << R"( - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { sBufferNotDynamic.value = uBufferNotDynamic.value.xy; sBuffer.value = vec2(multipleNumber, multipleNumber) * (uBuffer.value.xy + sBufferNotDynamic.value.xy); } diff --git a/src/tests/end2end/EntryPointTests.cpp b/src/tests/end2end/EntryPointTests.cpp index 116e36d091..f0bd0622cc 100644 --- a/src/tests/end2end/EntryPointTests.cpp +++ b/src/tests/end2end/EntryPointTests.cpp @@ -26,14 +26,14 @@ TEST_P(EntryPointTests, FragAndVertexSameModule) { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn vertex_main() -> void { + [[stage(vertex)]] fn vertex_main() { Position = vec4(0.0, 0.0, 0.0, 1.0); return; } [[location(0)]] var outColor : vec4; - [[stage(fragment)]] fn fragment_main() -> void { + [[stage(fragment)]] fn fragment_main() { outColor = vec4(1.0, 0.0, 0.0, 1.0); return; } @@ -72,12 +72,12 @@ TEST_P(EntryPointTests, TwoComputeInModule) { }; [[binding(0), group(0)]] var data : [[access(read_write)]] Data; - [[stage(compute)]] fn write1() -> void { + [[stage(compute)]] fn write1() { data.data = 1u; return; } - [[stage(compute)]] fn write42() -> void { + [[stage(compute)]] fn write42() { data.data = 42u; return; } diff --git a/src/tests/end2end/FirstIndexOffsetTests.cpp b/src/tests/end2end/FirstIndexOffsetTests.cpp index 59efbbfe0c..d64b926e91 100644 --- a/src/tests/end2end/FirstIndexOffsetTests.cpp +++ b/src/tests/end2end/FirstIndexOffsetTests.cpp @@ -112,7 +112,7 @@ void FirstIndexOffsetTests::TestImpl(DrawMode mode, [[builtin(position)]] var position : vec4; [[location(0)]] var pos : vec4; - [[stage(vertex)]] fn main() -> void {)"; + [[stage(vertex)]] fn main() {)"; fragmentShader << R"( [[block]] struct IndexVals { vertex_index : u32; @@ -121,7 +121,7 @@ void FirstIndexOffsetTests::TestImpl(DrawMode mode, [[group(0), binding(0)]] var idx_vals : [[access(read_write)]] IndexVals; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { )"; if ((checkIndex & CheckIndex::Vertex) != 0) { diff --git a/src/tests/end2end/GpuMemorySynchronizationTests.cpp b/src/tests/end2end/GpuMemorySynchronizationTests.cpp index 4ab19d1d49..fe768b5d0f 100644 --- a/src/tests/end2end/GpuMemorySynchronizationTests.cpp +++ b/src/tests/end2end/GpuMemorySynchronizationTests.cpp @@ -40,7 +40,7 @@ class GpuMemorySyncTests : public DawnTest { a : i32; }; [[group(0), binding(0)]] var data : [[access(read_write)]] Data; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { data.a = data.a + 1; })"); @@ -59,7 +59,7 @@ class GpuMemorySyncTests : public DawnTest { wgpu::TextureFormat colorFormat) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); @@ -69,7 +69,7 @@ class GpuMemorySyncTests : public DawnTest { }; [[group(0), binding(0)]] var data : [[access(read_write)]] Data; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { data.i = data.i + 1; fragColor = vec4(f32(data.i) / 255.0, 0.0, 0.0, 1.0); })"); @@ -261,7 +261,7 @@ TEST_P(GpuMemorySyncTests, SampledAndROStorageTextureInComputePass) { [[group(0), binding(1)]] var sampledTex : texture_2d; [[group(0), binding(2)]] var storageTex : [[access(read)]] texture_storage_2d; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { output.sampledOut = textureLoad(sampledTex, vec2(0, 0), 0).x; output.storageOut = textureLoad(storageTex, vec2(0, 0)).x; } @@ -318,7 +318,7 @@ class StorageToUniformSyncTests : public DawnTest { a : f32; }; [[group(0), binding(0)]] var data : [[access(read_write)]] Data; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { data.a = 1.0; })"); @@ -336,7 +336,7 @@ class StorageToUniformSyncTests : public DawnTest { wgpu::TextureFormat colorFormat) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); @@ -347,7 +347,7 @@ class StorageToUniformSyncTests : public DawnTest { [[group(0), binding(0)]] var contents : Contents; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(contents.color, 0.0, 0.0, 1.0); })"); @@ -533,7 +533,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) { [[group(0), binding(2)]] var uniformContents : [[access(read_write)]] ColorContents1; [[group(0), binding(3)]] var storageContents : [[access(read_write)]] ColorContents2; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { vbContents.pos[0] = vec4(-1.0, 1.0, 0.0, 1.0); vbContents.pos[1] = vec4(1.0, 1.0, 0.0, 1.0); vbContents.pos[2] = vec4(1.0, -1.0, 0.0, 1.0); @@ -576,7 +576,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var pos : vec4; [[builtin(position)]] var Position: vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = pos; })"); @@ -589,7 +589,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) { [[group(0), binding(1)]] var storageBuffer : [[access(read)]] Buf; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(uniformBuffer.color, storageBuffer.color, 0.0, 1.0); })"); @@ -650,7 +650,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) { [[group(0), binding(0)]] var contents : [[access(read_write)]] Contents; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { contents.pos[0] = vec4(-1.0, 1.0, 0.0, 1.0); contents.pos[1] = vec4(1.0, 1.0, 0.0, 1.0); contents.pos[2] = vec4(1.0, -1.0, 0.0, 1.0); @@ -694,7 +694,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var pos : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = pos; })"); @@ -706,7 +706,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) { [[group(0), binding(1)]] var storageBuffer : [[access(read)]] Buf; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(uniformBuffer.color, storageBuffer.color, 0.0, 1.0); })"); diff --git a/src/tests/end2end/IOSurfaceWrappingTests.cpp b/src/tests/end2end/IOSurfaceWrappingTests.cpp index bf2c5e5202..74a060ab5b 100644 --- a/src/tests/end2end/IOSurfaceWrappingTests.cpp +++ b/src/tests/end2end/IOSurfaceWrappingTests.cpp @@ -252,7 +252,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase { [[location(0)]] var o_texCoord : vec2; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 6> = array, 6>( vec2(-2.0, -2.0), vec2(-2.0, 2.0), @@ -280,7 +280,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase { [[location(0)]] var texCoord : vec2; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = textureSample(texture0, sampler0, texCoord); } )"); diff --git a/src/tests/end2end/IndexFormatTests.cpp b/src/tests/end2end/IndexFormatTests.cpp index 9d934479cd..9c9ff198c7 100644 --- a/src/tests/end2end/IndexFormatTests.cpp +++ b/src/tests/end2end/IndexFormatTests.cpp @@ -36,7 +36,7 @@ class IndexFormatTest : public DawnTest { [[location(0)]] var pos : vec4; [[builtin(vertex_index)]] var idx : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { // 0xFFFFFFFE is a designated invalid index used by some tests. if (idx == 0xFFFFFFFEu) { Position = vec4(0.0, 0.0, 0.0, 1.0); @@ -47,7 +47,7 @@ class IndexFormatTest : public DawnTest { wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/end2end/MultisampledRenderingTests.cpp b/src/tests/end2end/MultisampledRenderingTests.cpp index 35b3b9250e..5d1968db4e 100644 --- a/src/tests/end2end/MultisampledRenderingTests.cpp +++ b/src/tests/end2end/MultisampledRenderingTests.cpp @@ -53,7 +53,7 @@ class MultisampledRenderingTest : public DawnTest { [[location(0)]] var FragColor : vec4; [[builtin(frag_depth)]] var FragDepth : f32; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = uBuffer.color; FragDepth = uBuffer.depth; })"; @@ -65,7 +65,7 @@ class MultisampledRenderingTest : public DawnTest { [[group(0), binding(0)]] var uBuffer : U; [[location(0)]] var FragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = uBuffer.color; })"; @@ -87,7 +87,7 @@ class MultisampledRenderingTest : public DawnTest { [[location(0)]] var FragColor0 : vec4; [[location(1)]] var FragColor1 : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor0 = uBuffer.color0; FragColor1 = uBuffer.color1; })"; @@ -217,7 +217,7 @@ class MultisampledRenderingTest : public DawnTest { [[builtin(position)]] var Position : vec4; [[builtin(vertex_index)]] var VertexIndex : u32; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, 1.0), @@ -231,7 +231,7 @@ class MultisampledRenderingTest : public DawnTest { [[builtin(position)]] var Position : vec4; [[builtin(vertex_index)]] var VertexIndex : u32; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, 1.0), @@ -779,7 +779,7 @@ TEST_P(MultisampledRenderingTest, ResolveInto2DTextureWithSampleMaskAndShaderOut [[location(0)]] var FragColor : vec4; [[builtin(sample_mask_out)]] var SampleMask : u32; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = uBuffer.color; SampleMask = 6u; })"; @@ -837,7 +837,7 @@ TEST_P(MultisampledRenderingTest, ResolveIntoMultipleResolveTargetsWithShaderOut [[location(1)]] var FragColor1 : vec4; [[builtin(sample_mask_out)]] var SampleMask : u32; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor0 = uBuffer.color0; FragColor1 = uBuffer.color1; SampleMask = 6u; diff --git a/src/tests/end2end/MultisampledSamplingTests.cpp b/src/tests/end2end/MultisampledSamplingTests.cpp index c727be7265..cfa53070ee 100644 --- a/src/tests/end2end/MultisampledSamplingTests.cpp +++ b/src/tests/end2end/MultisampledSamplingTests.cpp @@ -56,14 +56,14 @@ class MultisampledSamplingTest : public DawnTest { desc.vertex.module = utils::CreateShaderModule(device, R"( [[location(0)]] var pos : vec2; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(pos, 0.0, 1.0); })"); desc.cFragment.module = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : f32; [[builtin(frag_depth)]] var FragDepth : f32; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = 1.0; FragDepth = 0.7; })"); @@ -98,7 +98,7 @@ class MultisampledSamplingTest : public DawnTest { }; [[group(0), binding(2)]] var results : [[access(read_write)]] Results; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { for (var i : i32 = 0; i < 4; i = i + 1) { results.colorSamples[i] = textureLoad(texture0, vec2(0, 0), i).x; results.depthSamples[i] = textureLoad(texture1, vec2(0, 0), i).x; diff --git a/src/tests/end2end/ObjectCachingTests.cpp b/src/tests/end2end/ObjectCachingTests.cpp index bf233b7208..3be9e998f6 100644 --- a/src/tests/end2end/ObjectCachingTests.cpp +++ b/src/tests/end2end/ObjectCachingTests.cpp @@ -105,17 +105,17 @@ TEST_P(ObjectCachingTest, PipelineLayoutDeduplication) { TEST_P(ObjectCachingTest, ShaderModuleDeduplication) { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); wgpu::ShaderModule sameModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); wgpu::ShaderModule otherModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 0.0, 0.0, 0.0); })"); @@ -127,16 +127,16 @@ TEST_P(ObjectCachingTest, ShaderModuleDeduplication) { TEST_P(ObjectCachingTest, ComputePipelineDeduplicationOnShaderModule) { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( var i : u32; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { i = 0u; })"); wgpu::ShaderModule sameModule = utils::CreateShaderModule(device, R"( var i : u32; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { i = 0u; })"); wgpu::ShaderModule otherModule = utils::CreateShaderModule(device, R"( - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })"); EXPECT_NE(module.Get(), otherModule.Get()); @@ -179,7 +179,7 @@ TEST_P(ObjectCachingTest, ComputePipelineDeduplicationOnLayout) { desc.computeStage.entryPoint = "main"; desc.computeStage.module = utils::CreateShaderModule(device, R"( var i : u32; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { i = 0u; })"); @@ -213,11 +213,11 @@ TEST_P(ObjectCachingTest, RenderPipelineDeduplicationOnLayout) { utils::ComboRenderPipelineDescriptor2 desc; desc.vertex.module = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 0.0); })"); desc.cFragment.module = utils::CreateShaderModule(device, R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); desc.layout = pl; @@ -237,17 +237,17 @@ TEST_P(ObjectCachingTest, RenderPipelineDeduplicationOnLayout) { TEST_P(ObjectCachingTest, RenderPipelineDeduplicationOnVertexModule) { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 0.0); })"); wgpu::ShaderModule sameModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 0.0); })"); wgpu::ShaderModule otherModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(1.0, 1.0, 1.0, 1.0); })"); @@ -256,7 +256,7 @@ TEST_P(ObjectCachingTest, RenderPipelineDeduplicationOnVertexModule) { utils::ComboRenderPipelineDescriptor2 desc; desc.cFragment.module = utils::CreateShaderModule(device, R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); desc.vertex.module = module; @@ -275,14 +275,14 @@ TEST_P(ObjectCachingTest, RenderPipelineDeduplicationOnVertexModule) { // Test that RenderPipelines are correctly deduplicated wrt. their fragment module TEST_P(ObjectCachingTest, RenderPipelineDeduplicationOnFragmentModule) { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); wgpu::ShaderModule sameModule = utils::CreateShaderModule(device, R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); wgpu::ShaderModule otherModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 0.0, 0.0, 0.0); })"); @@ -292,7 +292,7 @@ TEST_P(ObjectCachingTest, RenderPipelineDeduplicationOnFragmentModule) { utils::ComboRenderPipelineDescriptor2 desc; desc.vertex.module = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 0.0); })"); diff --git a/src/tests/end2end/OpArrayLengthTests.cpp b/src/tests/end2end/OpArrayLengthTests.cpp index a936e084cb..efc02fed5a 100644 --- a/src/tests/end2end/OpArrayLengthTests.cpp +++ b/src/tests/end2end/OpArrayLengthTests.cpp @@ -130,7 +130,7 @@ TEST_P(OpArrayLengthTest, Compute) { }; [[group(1), binding(0)]] var result : [[access(read_write)]] ResultBuffer; )" + mShaderInterface + R"( - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { result.data[0] = arrayLength(buffer1.data); result.data[1] = arrayLength(buffer2.data); result.data[2] = arrayLength(buffer3.data); @@ -166,13 +166,13 @@ TEST_P(OpArrayLengthTest, Fragment) { // pass pixel. wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, (mShaderInterface + R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor.r = f32(arrayLength(buffer1.data)) / 255.0; fragColor.g = f32(arrayLength(buffer2.data)) / 255.0; fragColor.b = f32(arrayLength(buffer3.data)) / 255.0; @@ -220,7 +220,7 @@ TEST_P(OpArrayLengthTest, Vertex) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, (mShaderInterface + R"( [[location(0)]] var pointColor : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { pointColor.r = f32(arrayLength(buffer1.data)) / 255.0; pointColor.g = f32(arrayLength(buffer2.data)) / 255.0; pointColor.b = f32(arrayLength(buffer3.data)) / 255.0; @@ -233,7 +233,7 @@ TEST_P(OpArrayLengthTest, Vertex) { wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; [[location(0)]] var pointColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = pointColor; })"); diff --git a/src/tests/end2end/PrimitiveStateTests.cpp b/src/tests/end2end/PrimitiveStateTests.cpp index 3cee443858..470f5aeefe 100644 --- a/src/tests/end2end/PrimitiveStateTests.cpp +++ b/src/tests/end2end/PrimitiveStateTests.cpp @@ -52,7 +52,7 @@ class DepthClampingTest : public DawnTest { [[group(0), binding(0)]] var ubo : UBO; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, ubo.depth, 1.0); })"); @@ -65,7 +65,7 @@ class DepthClampingTest : public DawnTest { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(ubo.color, 1.0); })"); } diff --git a/src/tests/end2end/PrimitiveTopologyTests.cpp b/src/tests/end2end/PrimitiveTopologyTests.cpp index a09c2e36c3..155987c837 100644 --- a/src/tests/end2end/PrimitiveTopologyTests.cpp +++ b/src/tests/end2end/PrimitiveTopologyTests.cpp @@ -156,13 +156,13 @@ class PrimitiveTopologyTest : public DawnTest { vsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var pos : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = pos; })"); fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/end2end/QueryTests.cpp b/src/tests/end2end/QueryTests.cpp index 1dd3464751..746ba59463 100644 --- a/src/tests/end2end/QueryTests.cpp +++ b/src/tests/end2end/QueryTests.cpp @@ -83,7 +83,7 @@ class OcclusionQueryTests : public QueryTests { vsModule = utils::CreateShaderModule(device, R"( [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2( 1.0, 1.0), vec2(-1.0, -1.0), @@ -93,7 +93,7 @@ class OcclusionQueryTests : public QueryTests { fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/end2end/RenderBundleTests.cpp b/src/tests/end2end/RenderBundleTests.cpp index d4964dbc52..74a489da13 100644 --- a/src/tests/end2end/RenderBundleTests.cpp +++ b/src/tests/end2end/RenderBundleTests.cpp @@ -34,7 +34,7 @@ class RenderBundleTest : public DawnTest { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var pos : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = pos; })"); @@ -45,7 +45,7 @@ class RenderBundleTest : public DawnTest { }; [[group(0), binding(0)]] var fragmentUniformBuffer : Ubo; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = fragmentUniformBuffer.color; })"); diff --git a/src/tests/end2end/RenderPassLoadOpTests.cpp b/src/tests/end2end/RenderPassLoadOpTests.cpp index 54e888846a..6193b529cb 100644 --- a/src/tests/end2end/RenderPassLoadOpTests.cpp +++ b/src/tests/end2end/RenderPassLoadOpTests.cpp @@ -80,7 +80,7 @@ class RenderPassLoadOpTests : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 6> = array, 6>( vec2( 0.0, -1.0), vec2( 1.0, -1.0), @@ -94,7 +94,7 @@ class RenderPassLoadOpTests : public DawnTest { const char* fsSource = R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 0.0, 1.0, 1.0); })"; blueQuad = DrawQuad(device, vsSource, fsSource); diff --git a/src/tests/end2end/RenderPassTests.cpp b/src/tests/end2end/RenderPassTests.cpp index 5273d8cc6e..e262403fcd 100644 --- a/src/tests/end2end/RenderPassTests.cpp +++ b/src/tests/end2end/RenderPassTests.cpp @@ -30,7 +30,7 @@ class RenderPassTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, -1.0), @@ -41,7 +41,7 @@ class RenderPassTest : public DawnTest { wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 0.0, 1.0, 1.0); })"); @@ -141,7 +141,7 @@ TEST_P(RenderPassTest, NoCorrespondingFragmentShaderOutputs) { { // Next we use a pipeline whose fragment shader has no outputs. wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 descriptor; descriptor.vertex.module = mVSModule; diff --git a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp index c946697b80..4487396778 100644 --- a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp +++ b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp @@ -50,7 +50,7 @@ class SamplerFilterAnisotropicTest : public DawnTest { [[builtin(position)]] var Position : vec4; [[location(0)]] var fragUV : vec2; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { fragUV = uv; Position = uniforms.matrix * position; } @@ -65,7 +65,7 @@ class SamplerFilterAnisotropicTest : public DawnTest { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = textureSample(texture0, sampler0, fragUV); })"); diff --git a/src/tests/end2end/SamplerTests.cpp b/src/tests/end2end/SamplerTests.cpp index 09eb389a4b..fe10de2d0d 100644 --- a/src/tests/end2end/SamplerTests.cpp +++ b/src/tests/end2end/SamplerTests.cpp @@ -58,7 +58,7 @@ class SamplerTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 6> = array, 6>( vec2(-2.0, -2.0), vec2(-2.0, 2.0), @@ -77,7 +77,7 @@ class SamplerTest : public DawnTest { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = textureSample(texture0, sampler0, FragCoord.xy / vec2(2.0, 2.0)); })"); diff --git a/src/tests/end2end/ScissorTests.cpp b/src/tests/end2end/ScissorTests.cpp index 912ef2bdba..993ae41a38 100644 --- a/src/tests/end2end/ScissorTests.cpp +++ b/src/tests/end2end/ScissorTests.cpp @@ -32,13 +32,13 @@ class ScissorTest : public DawnTest { vec2(-1.0, 1.0), vec2( 1.0, -1.0)); - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(pos[VertexIndex], 0.5, 1.0); })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/end2end/ShaderTests.cpp b/src/tests/end2end/ShaderTests.cpp index 1bcc02448d..089a285f0e 100644 --- a/src/tests/end2end/ShaderTests.cpp +++ b/src/tests/end2end/ShaderTests.cpp @@ -37,7 +37,7 @@ TEST_P(ShaderTests, ComputeLog2) { [[group(0), binding(0)]] var buf : [[access(read_write)]] Buf; -[[stage(compute)]] fn main() -> void { +[[stage(compute)]] fn main() { const factor : f32 = 1.0001; buf.data[0] = u32(log2(1.0 * factor)); diff --git a/src/tests/end2end/StorageTextureTests.cpp b/src/tests/end2end/StorageTextureTests.cpp index 0ffcef0f85..9a2e86cb75 100644 --- a/src/tests/end2end/StorageTextureTests.cpp +++ b/src/tests/end2end/StorageTextureTests.cpp @@ -330,7 +330,7 @@ fn IsEqualTo(pixel : vec4, expected : vec4) -> bool { std::ostringstream ostream; ostream << GetImageDeclaration(format, "write", is2DArray, 0) << "\n"; ostream << "[[stage(" << stage << ")]]\n"; - ostream << "fn main() -> void {\n"; + ostream << "fn main() {\n"; ostream << " var size : vec2 = textureDimensions(storageImage0);\n"; ostream << " const layerCount : i32 = " << layerCount << ";\n"; ostream << " for (var layer : i32 = 0; layer < layerCount; layer = layer + 1) {\n"; @@ -358,7 +358,7 @@ fn IsEqualTo(pixel : vec4, expected : vec4) -> bool { std::ostringstream ostream; ostream << GetImageDeclaration(format, "write", is2DArray, 0) << "\n"; ostream << GetImageDeclaration(format, "read", is2DArray, 1) << "\n"; - ostream << "[[stage(compute)]] fn main() -> void {\n"; + ostream << "[[stage(compute)]] fn main() {\n"; ostream << " var size : vec2 = textureDimensions(storageImage0);\n"; ostream << " const layerCount : i32 = " << layerCount << ";\n"; ostream << " for (var layer : i32 = 0; layer < layerCount; layer = layer + 1) {\n"; @@ -649,7 +649,7 @@ fn IsEqualTo(pixel : vec4, expected : vec4) -> bool { const char* kSimpleVertexShader = R"( [[builtin(position)]] var position : vec4; -[[stage(vertex)]] fn main() -> void { +[[stage(vertex)]] fn main() { position = vec4(0.0, 0.0, 0.0, 1.0); })"; @@ -715,7 +715,7 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInComputeShader) { [[group(0), binding(1)]] var dstBuffer : [[access(read_write)]] DstBuffer; )" << CommonReadOnlyTestCode(format) << R"( -[[stage(compute)]] fn main() -> void { +[[stage(compute)]] fn main() { if (doTest()) { dstBuffer.result = 1u; } else { @@ -750,7 +750,7 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInVertexShader) { [[location(0)]] var o_color : vec4; )" << CommonReadOnlyTestCode(format) << R"( -[[stage(vertex)]] fn main() -> void { +[[stage(vertex)]] fn main() { position = vec4(0.0, 0.0, 0.0, 1.0); if (doTest()) { o_color = vec4(0.0, 1.0, 0.0, 1.0); @@ -761,7 +761,7 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInVertexShader) { const char* kFragmentShader = R"( [[location(0)]] var o_color : vec4; [[location(0)]] var fragColor : vec4; -[[stage(fragment)]] fn main() -> void { +[[stage(fragment)]] fn main() { fragColor = o_color; })"; CheckDrawsGreen(vsStream.str().c_str(), kFragmentShader, readonlyStorageTexture); @@ -795,7 +795,7 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInFragmentShader) { [[location(0)]] var o_color : vec4; )" << CommonReadOnlyTestCode(format) << R"( -[[stage(fragment)]] fn main() -> void { +[[stage(fragment)]] fn main() { if (doTest()) { o_color = vec4(0.0, 1.0, 0.0, 1.0); } else { @@ -940,7 +940,7 @@ TEST_P(StorageTextureTests, Readonly2DArrayStorageTexture) { [[group(0), binding(1)]] var dstBuffer : [[access(read_write)]] DstBuffer; )" << CommonReadOnlyTestCode(kTextureFormat, true) << R"( -[[stage(compute)]] fn main() -> void { +[[stage(compute)]] fn main() { if (doTest()) { dstBuffer.result = 1u; } else { @@ -985,7 +985,7 @@ TEST_P(StorageTextureTests, ReadonlyAndWriteonlyStorageTexturePingPong) { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var Src : [[access(read)]] texture_storage_2d; [[group(0), binding(1)]] var Dst : [[access(write)]] texture_storage_2d; -[[stage(compute)]] fn main() -> void { +[[stage(compute)]] fn main() { var srcValue : vec4 = textureLoad(Src, vec2(0, 0)); srcValue.x = srcValue.x + 1u; textureStore(Dst, vec2(0, 0), srcValue); @@ -1059,7 +1059,7 @@ TEST_P(StorageTextureTests, SampledAndWriteonlyStorageTexturePingPong) { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var Src : texture_2d; [[group(0), binding(1)]] var Dst : [[access(write)]] texture_storage_2d; -[[stage(compute)]] fn main() -> void { +[[stage(compute)]] fn main() { var srcValue : vec4 = textureLoad(Src, vec2(0, 0), 0); srcValue.x = srcValue.x + 1u; textureStore(Dst, vec2(0, 0), srcValue); @@ -1158,13 +1158,13 @@ fn doTest() -> bool { const char* kCommonWriteOnlyZeroInitTestCodeFragment = R"( [[group(0), binding(0)]] var dstImage : [[access(write)]] texture_storage_2d; -[[stage(fragment)]] fn main() -> void { +[[stage(fragment)]] fn main() { textureStore(dstImage, vec2(0, 0), vec4(1u, 0u, 0u, 1u)); })"; const char* kCommonWriteOnlyZeroInitTestCodeCompute = R"( [[group(0), binding(0)]] var dstImage : [[access(write)]] texture_storage_2d; -[[stage(compute)]] fn main() -> void { +[[stage(compute)]] fn main() { textureStore(dstImage, vec2(0, 0), vec4(1u, 0u, 0u, 1u)); })"; }; @@ -1183,7 +1183,7 @@ TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInRenderPa [[location(0)]] var o_color : vec4; )") + kCommonReadOnlyZeroInitTestCode + R"( -[[stage(fragment)]] fn main() -> void { +[[stage(fragment)]] fn main() { if (doTest()) { o_color = vec4(0.0, 1.0, 0.0, 1.0); } else { @@ -1209,7 +1209,7 @@ TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInComputeP [[group(0), binding(0)]] var srcImage : [[access(read)]] texture_storage_2d; [[group(0), binding(1)]] var dstBuffer : [[access(read_write)]] DstBuffer; )") + kCommonReadOnlyZeroInitTestCode + R"( -[[stage(compute)]] fn main() -> void { +[[stage(compute)]] fn main() { if (doTest()) { dstBuffer.result = 1u; } else { diff --git a/src/tests/end2end/SwapChainValidationTests.cpp b/src/tests/end2end/SwapChainValidationTests.cpp index b257bca475..1584e295b5 100644 --- a/src/tests/end2end/SwapChainValidationTests.cpp +++ b/src/tests/end2end/SwapChainValidationTests.cpp @@ -223,12 +223,12 @@ TEST_P(SwapChainValidationTests, ReturnedViewCharacteristics) { utils::ComboRenderPipelineDescriptor2 pipelineDesc; pipelineDesc.vertex.module = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); pipelineDesc.cFragment.module = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); // Validation will check that the sample count of the view matches this format. diff --git a/src/tests/end2end/TextureFormatTests.cpp b/src/tests/end2end/TextureFormatTests.cpp index efbad7d9e8..f5edb89bb8 100644 --- a/src/tests/end2end/TextureFormatTests.cpp +++ b/src/tests/end2end/TextureFormatTests.cpp @@ -146,7 +146,7 @@ class TextureFormatTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-3.0, -1.0), vec2( 3.0, -1.0), @@ -162,7 +162,7 @@ class TextureFormatTest : public DawnTest { fsSource << "[[group(0), binding(0)]] var myTexture : texture_2d<" << type << ">;\n"; fsSource << "[[builtin(frag_coord)]] var FragCoord : vec4;\n"; fsSource << "[[location(0)]] var fragColor : vec4<" << type << ">;\n"; - fsSource << "[[stage(fragment)]] fn main() -> void {\n"; + fsSource << "[[stage(fragment)]] fn main() {\n"; fsSource << " fragColor = textureLoad(myTexture, vec2(FragCoord.xy), 0);\n"; fsSource << "}"; diff --git a/src/tests/end2end/TextureSubresourceTests.cpp b/src/tests/end2end/TextureSubresourceTests.cpp index b6c7855070..5044805aa5 100644 --- a/src/tests/end2end/TextureSubresourceTests.cpp +++ b/src/tests/end2end/TextureSubresourceTests.cpp @@ -53,7 +53,7 @@ class TextureSubresourceTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2(-1.0, -1.0), @@ -64,7 +64,7 @@ class TextureSubresourceTest : public DawnTest { wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(1.0, 0.0, 0.0, 1.0); })"); @@ -93,7 +93,7 @@ class TextureSubresourceTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 6> = array, 6>( vec2(-1.0, -1.0), vec2( 1.0, 1.0), @@ -113,7 +113,7 @@ class TextureSubresourceTest : public DawnTest { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = textureSample(tex, samp, FragCoord.xy / vec2(4.0, 4.0)); })"); diff --git a/src/tests/end2end/TextureViewTests.cpp b/src/tests/end2end/TextureViewTests.cpp index 407d17383b..f487b9ffa5 100644 --- a/src/tests/end2end/TextureViewTests.cpp +++ b/src/tests/end2end/TextureViewTests.cpp @@ -64,7 +64,7 @@ namespace { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; [[location(0)]] var TexCoord : vec2; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 6> = array, 6>( vec2(-2., -2.), vec2(-2., 2.), @@ -219,7 +219,7 @@ class TextureViewSamplingTest : public DawnTest { [[location(0)]] var texCoord : vec2; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = textureSample(texture0, sampler0, texCoord); } )"; @@ -258,7 +258,7 @@ class TextureViewSamplingTest : public DawnTest { [[location(0)]] var texCoord : vec2; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = textureSample(texture0, sampler0, texCoord, 0) + textureSample(texture0, sampler0, texCoord, 1) + textureSample(texture0, sampler0, texCoord, 2); @@ -295,7 +295,7 @@ class TextureViewSamplingTest : public DawnTest { [[location(0)]] var texCoord : vec2; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { var sc : f32 = 2.0 * texCoord.x - 1.0; var tc : f32 = 2.0 * texCoord.y - 1.0; fragColor = textureSample(texture0, sampler0, vec3()" @@ -368,7 +368,7 @@ TEST_P(TextureViewSamplingTest, Default2DArrayTexture) { [[location(0)]] var texCoord : vec2; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = textureSample(texture0, sampler0, texCoord, 0) + textureSample(texture0, sampler0, texCoord, 1) + textureSample(texture0, sampler0, texCoord, 2); @@ -498,7 +498,7 @@ class TextureViewRenderingTest : public DawnTest { const char* oneColorFragmentShader = R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); } )"; diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp index fbd981d385..665abe51bb 100644 --- a/src/tests/end2end/TextureZeroInitTests.cpp +++ b/src/tests/end2end/TextureZeroInitTests.cpp @@ -70,7 +70,7 @@ class TextureZeroInitTest : public DawnTest { pipelineDescriptor.vertex.module = CreateBasicVertexShaderForTest(depth); const char* fs = R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(1.0, 0.0, 0.0, 1.0); } )"; @@ -95,7 +95,7 @@ class TextureZeroInitTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(pos[VertexIndex], )" + std::to_string(depth) + R"(, 1.0); })"; @@ -106,7 +106,7 @@ class TextureZeroInitTest : public DawnTest { [[group(0), binding(0)]] var texture0 : texture_2d; [[builtin(frag_coord)]] var FragCoord : vec4; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = textureLoad(texture0, vec2(FragCoord.xy), 0); } )"); @@ -977,7 +977,7 @@ TEST_P(TextureZeroInitTest, ComputePassSampledTextureClear) { value : vec4; }; [[group(0), binding(1)]] var result : [[access(read_write)]] Result; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { result.value = textureLoad(tex, vec2(0,0), 0); } )"; diff --git a/src/tests/end2end/VertexBufferRobustnessTests.cpp b/src/tests/end2end/VertexBufferRobustnessTests.cpp index ca93c46d6e..befcd7ab8f 100644 --- a/src/tests/end2end/VertexBufferRobustnessTests.cpp +++ b/src/tests/end2end/VertexBufferRobustnessTests.cpp @@ -35,7 +35,7 @@ class VertexBufferRobustnessTest : public DawnTest { return utils::CreateShaderModule(device, (attributes + R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { if ()" + successExpression + R"() { // Success case, move the vertex out of the viewport Position = vec4(-10.0, 0.0, 0.0, 1.0); @@ -60,7 +60,7 @@ class VertexBufferRobustnessTest : public DawnTest { wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var outColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { outColor = vec4(1.0, 1.0, 1.0, 1.0); return; } diff --git a/src/tests/end2end/VertexFormatTests.cpp b/src/tests/end2end/VertexFormatTests.cpp index a3f9293ded..d702e7d526 100644 --- a/src/tests/end2end/VertexFormatTests.cpp +++ b/src/tests/end2end/VertexFormatTests.cpp @@ -255,7 +255,7 @@ class VertexFormatTest : public DawnTest { [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, -1.0), vec2( 2.0, 0.0), @@ -343,7 +343,7 @@ class VertexFormatTest : public DawnTest { wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var color : vec4; [[location(0)]] var FragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = color; })"); diff --git a/src/tests/end2end/VertexStateTests.cpp b/src/tests/end2end/VertexStateTests.cpp index dbda1a9367..61a3636cec 100644 --- a/src/tests/end2end/VertexStateTests.cpp +++ b/src/tests/end2end/VertexStateTests.cpp @@ -83,7 +83,7 @@ class VertexStateTest : public DawnTest { vs << "[[builtin(instance_index)]] var InstanceIndex : u32;\n"; vs << "[[location(0)]] var color : vec4;\n"; vs << "[[builtin(position)]] var Position : vec4;\n"; - vs << "[[stage(vertex)]] fn main() -> void {\n"; + vs << "[[stage(vertex)]] fn main() {\n"; // Hard code the triangle in the shader so that we don't have to add a vertex input for it. // Also this places the triangle in the grid based on its VertexID and InstanceID @@ -127,7 +127,7 @@ class VertexStateTest : public DawnTest { wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var color : vec4; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = color; } )"); @@ -578,7 +578,7 @@ TEST_P(VertexStateTest, OverlappingVertexAttributes) { [[location(0)]] var color : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); var success : bool = ( @@ -598,7 +598,7 @@ TEST_P(VertexStateTest, OverlappingVertexAttributes) { pipelineDesc.cFragment.module = utils::CreateShaderModule(device, R"( [[location(0)]] var color : vec4; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = color; })"); pipelineDesc.vertex.bufferCount = vertexState.vertexBufferCount; @@ -643,13 +643,13 @@ TEST_P(OptionalVertexStateTest, Basic) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/end2end/ViewportOrientationTests.cpp b/src/tests/end2end/ViewportOrientationTests.cpp index c6bb0651c4..372bba36d7 100644 --- a/src/tests/end2end/ViewportOrientationTests.cpp +++ b/src/tests/end2end/ViewportOrientationTests.cpp @@ -26,13 +26,13 @@ TEST_P(ViewportOrientationTests, OriginAt0x0) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(-0.5, 0.5, 0.0, 1.0); })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/end2end/ViewportTests.cpp b/src/tests/end2end/ViewportTests.cpp index 00eeab557b..3f448f5d00 100644 --- a/src/tests/end2end/ViewportTests.cpp +++ b/src/tests/end2end/ViewportTests.cpp @@ -34,13 +34,13 @@ class ViewportTest : public DawnTest { vec2(-1.0, -1.0), vec2( 1.0, -1.0)); - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(pos[VertexIndex], 0.0, 1.0); })"); mQuadFS = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(1.0, 1.0, 1.0, 1.0); })"); } @@ -104,7 +104,7 @@ class ViewportTest : public DawnTest { vec3( 0.0, 0.0, 0.5), vec3( 0.9, 0.0, 0.0)); - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(points[VertexIndex], 1.0); })"); pipelineDesc.cFragment.module = mQuadFS; diff --git a/src/tests/perf_tests/DrawCallPerf.cpp b/src/tests/perf_tests/DrawCallPerf.cpp index ba12e5861e..bbff208128 100644 --- a/src/tests/perf_tests/DrawCallPerf.cpp +++ b/src/tests/perf_tests/DrawCallPerf.cpp @@ -35,7 +35,7 @@ namespace { constexpr char kVertexShader[] = R"( [[location(0)]] var pos : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = pos; })"; @@ -45,7 +45,7 @@ namespace { }; [[group(0), binding(0)]] var uniforms : Uniforms; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(uniforms.color * (1.0 / 5000.0), 1.0); })"; @@ -61,7 +61,7 @@ namespace { [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4((constants.color + uniforms.color) * (1.0 / 5000.0), 1.0); })"; diff --git a/src/tests/perf_tests/SubresourceTrackingPerf.cpp b/src/tests/perf_tests/SubresourceTrackingPerf.cpp index d967c0b94a..3a49a1eb3a 100644 --- a/src/tests/perf_tests/SubresourceTrackingPerf.cpp +++ b/src/tests/perf_tests/SubresourceTrackingPerf.cpp @@ -72,14 +72,14 @@ class SubresourceTrackingPerf : public DawnPerfTestWithParams Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(1.0, 0.0, 0.0, 1.0); } )"); pipelineDesc.cFragment.module = utils::CreateShaderModule(device, R"( [[location(0)]] var FragColor : vec4; [[group(0), binding(0)]] var materials : texture_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { const foo : vec2 = textureDimensions(materials); FragColor = vec4(1.0, 0.0, 0.0, 1.0); } diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp index e31e4dd7b7..f2e4be1d24 100644 --- a/src/tests/unittests/validation/BindGroupValidationTests.cpp +++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp @@ -1084,7 +1084,7 @@ class SetBindGroupValidationTest : public ValidationTest { wgpu::RenderPipeline CreateRenderPipeline() { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( @@ -1097,7 +1097,7 @@ class SetBindGroupValidationTest : public ValidationTest { [[group(0), binding(2)]] var sBufferDynamic : [[access(read_write)]] S; [[group(0), binding(3)]] var sReadonlyBufferDynamic : [[access(read)]] S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 pipelineDescriptor; @@ -1120,7 +1120,7 @@ class SetBindGroupValidationTest : public ValidationTest { [[group(0), binding(2)]] var sBufferDynamic : [[access(read_write)]] S; [[group(0), binding(3)]] var sReadonlyBufferDynamic : [[access(read)]] S; - [[stage(compute), workgroup_size(4, 4, 1)]] fn main() -> void { + [[stage(compute), workgroup_size(4, 4, 1)]] fn main() { })"); wgpu::PipelineLayout pipelineLayout = @@ -1487,7 +1487,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest { ValidationTest::SetUp(); mVsModule = utils::CreateShaderModule(device, R"( - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); } @@ -1555,7 +1555,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest { } } - ss << "[[stage(fragment)]] fn main() -> void {}"; + ss << "[[stage(fragment)]] fn main() {}"; wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, ss.str().c_str()); @@ -1689,7 +1689,7 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest { const char* fsShader, std::vector bindGroupLayout) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, fsShader); @@ -1714,7 +1714,7 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest { [[group(0), binding(0)]] var sBufferDynamic : [[access(read_write)]] S; [[group(1), binding(0)]] var sReadonlyBufferDynamic : [[access(read)]] S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })", std::move(bindGroupLayouts)); } @@ -1747,7 +1747,7 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest { [[group(0), binding(0)]] var sBufferDynamic : [[access(read_write)]] S; [[group(1), binding(0)]] var sReadonlyBufferDynamic : [[access(read)]] S; - [[stage(compute), workgroup_size(4, 4, 1)]] fn main() -> void { + [[stage(compute), workgroup_size(4, 4, 1)]] fn main() { })", std::move(bindGroupLayouts)); } @@ -1788,11 +1788,11 @@ TEST_F(BindGroupLayoutCompatibilityTest, ROStorageInBGLWithRWStorageInShader) { TEST_F(BindGroupLayoutCompatibilityTest, TextureViewDimension) { constexpr char kTexture2DShaderFS[] = R"( [[group(0), binding(0)]] var myTexture : texture_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"; constexpr char kTexture2DShaderCS[] = R"( [[group(0), binding(0)]] var myTexture : texture_2d; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })"; // Render: Test that 2D texture with 2D view dimension works @@ -1825,11 +1825,11 @@ TEST_F(BindGroupLayoutCompatibilityTest, TextureViewDimension) { constexpr char kTexture2DArrayShaderFS[] = R"( [[group(0), binding(0)]] var myTexture : texture_2d_array; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"; constexpr char kTexture2DArrayShaderCS[] = R"( [[group(0), binding(0)]] var myTexture : texture_2d_array; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })"; // Render: Test that 2D texture array with 2D array view dimension works @@ -2053,7 +2053,7 @@ class ComparisonSamplerBindingTest : public ValidationTest { wgpu::RenderPipeline CreateFragmentPipeline(wgpu::BindGroupLayout* bindGroupLayout, const char* fragmentSource) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, fragmentSource); @@ -2078,7 +2078,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) { CreateFragmentPipeline(&bindGroupLayout, R"( [[group(0), binding(0)]] var mySampler: sampler; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); } @@ -2089,7 +2089,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) { CreateFragmentPipeline(&bindGroupLayout, R"( [[group(0), binding(0)]] var mySampler: sampler_comparison; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); } @@ -2100,7 +2100,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) { ASSERT_DEVICE_ERROR(CreateFragmentPipeline(&bindGroupLayout, R"( [[group(0), binding(0)]] var mySampler: sampler_comparison; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })")); } @@ -2111,7 +2111,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) { ASSERT_DEVICE_ERROR(CreateFragmentPipeline(&bindGroupLayout, R"( [[group(0), binding(0)]] var mySampler: sampler; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })")); } } diff --git a/src/tests/unittests/validation/ComputeIndirectValidationTests.cpp b/src/tests/unittests/validation/ComputeIndirectValidationTests.cpp index 40460eea5d..f0d5466bf6 100644 --- a/src/tests/unittests/validation/ComputeIndirectValidationTests.cpp +++ b/src/tests/unittests/validation/ComputeIndirectValidationTests.cpp @@ -23,7 +23,7 @@ class ComputeIndirectValidationTest : public ValidationTest { ValidationTest::SetUp(); wgpu::ShaderModule computeModule = utils::CreateShaderModule(device, R"( - [[stage(compute), workgroup_size(1)]] fn main() -> void { + [[stage(compute), workgroup_size(1)]] fn main() { })"); // Set up compute pipeline diff --git a/src/tests/unittests/validation/DrawIndirectValidationTests.cpp b/src/tests/unittests/validation/DrawIndirectValidationTests.cpp index aa328f32c8..3870f1afe0 100644 --- a/src/tests/unittests/validation/DrawIndirectValidationTests.cpp +++ b/src/tests/unittests/validation/DrawIndirectValidationTests.cpp @@ -25,13 +25,13 @@ class DrawIndirectValidationTest : public ValidationTest { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 0.0); })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 0.0, 0.0, 0.0); })"); diff --git a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp index 9c6eff6b52..8a6f358d98 100644 --- a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp +++ b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp @@ -21,7 +21,7 @@ class GetBindGroupLayoutTests : public ValidationTest { protected: wgpu::RenderPipeline RenderPipelineFromFragmentShader(const char* shader) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, shader); @@ -50,7 +50,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) { [[group(0), binding(0)]] var uniform0 : S; [[group(1), binding(0)]] var uniform1 : S; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( @@ -64,7 +64,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) { }; [[group(3), binding(0)]] var storage3 : [[access(read_write)]] S3; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 descriptor; @@ -102,7 +102,7 @@ TEST_F(GetBindGroupLayoutTests, DefaultShaderStageAndDynamicOffsets) { }; [[group(0), binding(0)]] var uniforms : S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); wgpu::BindGroupLayoutEntry binding = {}; @@ -145,7 +145,7 @@ TEST_F(GetBindGroupLayoutTests, ComputePipeline) { }; [[group(0), binding(0)]] var uniforms : S; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })"); wgpu::ComputePipelineDescriptor descriptor; @@ -196,7 +196,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { }; [[group(0), binding(0)]] var ssbo : [[access(read_write)]] S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -208,7 +208,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { }; [[group(0), binding(0)]] var uniforms : S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -221,7 +221,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { }; [[group(0), binding(0)]] var ssbo : [[access(read)]] S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -233,7 +233,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var myTexture : texture_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -243,7 +243,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var myTexture : texture_multisampled_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -254,7 +254,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var mySampler: sampler; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -281,7 +281,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var myTexture : texture_1d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -291,7 +291,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var myTexture : texture_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -301,7 +301,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var myTexture : texture_2d_array; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -311,7 +311,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var myTexture : texture_3d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -321,7 +321,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var myTexture : texture_cube; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -331,7 +331,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var myTexture : texture_cube_array; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -357,7 +357,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var myTexture : texture_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -367,7 +367,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var myTexture : texture_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -377,7 +377,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) { wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( [[group(0), binding(0)]] var myTexture : texture_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -408,7 +408,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { }; [[group(0), binding(0)]] var uniforms : S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -421,7 +421,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { }; [[group(0), binding(1)]] var uniforms : S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -434,7 +434,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { }; [[group(0), binding(1)]] var uniforms : S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); EXPECT_NE(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()); } @@ -449,7 +449,7 @@ TEST_F(GetBindGroupLayoutTests, DuplicateBinding) { [[group(0), binding(0)]] var uniform0 : S; [[group(1), binding(0)]] var uniform1 : S; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( @@ -458,7 +458,7 @@ TEST_F(GetBindGroupLayoutTests, DuplicateBinding) { }; [[group(1), binding(0)]] var uniforms : S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 descriptor; @@ -482,7 +482,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { }; [[group(0), binding(0)]] var uniforms : S; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule vsModule64 = utils::CreateShaderModule(device, R"( @@ -491,7 +491,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { }; [[group(0), binding(0)]] var uniforms : S; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule4 = utils::CreateShaderModule(device, R"( @@ -500,7 +500,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { }; [[group(0), binding(0)]] var uniforms : S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); wgpu::ShaderModule fsModule64 = utils::CreateShaderModule(device, R"( @@ -509,7 +509,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { }; [[group(0), binding(0)]] var uniforms : S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); // Create BGLs with minBufferBindingSize 4 and 64. @@ -563,21 +563,21 @@ TEST_F(GetBindGroupLayoutTests, StageAggregation) { DAWN_SKIP_TEST_IF(UsesWire()); wgpu::ShaderModule vsModuleNoSampler = utils::CreateShaderModule(device, R"( - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule vsModuleSampler = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var mySampler: sampler; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModuleNoSampler = utils::CreateShaderModule(device, R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); wgpu::ShaderModule fsModuleSampler = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var mySampler: sampler; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); // Create BGLs with minBufferBindingSize 4 and 64. @@ -631,7 +631,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) { }; [[group(0), binding(0)]] var ubo : S; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( @@ -640,7 +640,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) { }; [[group(0), binding(0)]] var ssbo : [[access(read_write)]] S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 descriptor; @@ -656,13 +656,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureMultisampling) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var myTexture : texture_2d; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var myTexture : texture_multisampled_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 descriptor; @@ -678,13 +678,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingViewDimension) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var myTexture : texture_2d; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var myTexture : texture_3d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 descriptor; @@ -700,13 +700,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureComponentType) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var myTexture : texture_2d; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var myTexture : texture_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 descriptor; @@ -720,12 +720,12 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureComponentType) { // Test it is an error to query an out of range bind group layout. TEST_F(GetBindGroupLayoutTests, OutOfRangeIndex) { ASSERT_DEVICE_ERROR(RenderPipelineFromFragmentShader(R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })") .GetBindGroupLayout(kMaxBindGroups)); ASSERT_DEVICE_ERROR(RenderPipelineFromFragmentShader(R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })") .GetBindGroupLayout(kMaxBindGroups + 1)); } @@ -744,7 +744,7 @@ TEST_F(GetBindGroupLayoutTests, UnusedIndex) { [[group(0), binding(0)]] var uniforms0 : S; [[group(2), binding(0)]] var uniforms2 : S; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); wgpu::BindGroupLayoutDescriptor desc = {}; @@ -790,11 +790,11 @@ TEST_F(GetBindGroupLayoutTests, Reflection) { }; [[group(0), binding(0)]] var uniforms : S; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 pipelineDesc; @@ -830,11 +830,11 @@ TEST_F(GetBindGroupLayoutTests, DISABLED_FromCorrectEntryPoint) { [[binding 0, set 0]] var data0 : [[access(read_write)]] Data; [[binding 1, set 0]] var data1 : [[access(read_write)]] Data; - fn compute0() -> void { + fn compute0() { data0.data = 0.0; return; } - fn compute1() -> void { + fn compute1() { data1.data = 0.0; return; } diff --git a/src/tests/unittests/validation/IndexBufferValidationTests.cpp b/src/tests/unittests/validation/IndexBufferValidationTests.cpp index 91e3e556f3..0320913205 100644 --- a/src/tests/unittests/validation/IndexBufferValidationTests.cpp +++ b/src/tests/unittests/validation/IndexBufferValidationTests.cpp @@ -24,13 +24,13 @@ class IndexBufferValidationTest : public ValidationTest { wgpu::PrimitiveTopology primitiveTopology) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); diff --git a/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp b/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp index 1737e69523..5db20d1bd3 100644 --- a/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp +++ b/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp @@ -99,19 +99,17 @@ namespace { // Creates a compute shader with given bindings std::string CreateComputeShaderWithBindings(const std::vector& bindings) { return kStructs + GenerateBindingString(bindings) + - "[[stage(compute), workgroup_size(1,1,1)]] fn main() -> void {}"; + "[[stage(compute), workgroup_size(1,1,1)]] fn main() {}"; } // Creates a vertex shader with given bindings std::string CreateVertexShaderWithBindings(const std::vector& bindings) { - return kStructs + GenerateBindingString(bindings) + - "[[stage(vertex)]] fn main() -> void {}"; + return kStructs + GenerateBindingString(bindings) + "[[stage(vertex)]] fn main() {}"; } // Creates a fragment shader with given bindings std::string CreateFragmentShaderWithBindings(const std::vector& bindings) { - return kStructs + GenerateBindingString(bindings) + - "[[stage(fragment)]] fn main() -> void {}"; + return kStructs + GenerateBindingString(bindings) + "[[stage(fragment)]] fn main() {}"; } // Concatenates vectors containing BindingDescriptor diff --git a/src/tests/unittests/validation/MultipleDeviceTests.cpp b/src/tests/unittests/validation/MultipleDeviceTests.cpp index 0f940b0684..144d99504b 100644 --- a/src/tests/unittests/validation/MultipleDeviceTests.cpp +++ b/src/tests/unittests/validation/MultipleDeviceTests.cpp @@ -33,7 +33,7 @@ TEST_F(MultipleDeviceTest, ValidatesSameDevice) { TEST_F(MultipleDeviceTest, ValidatesSameDeviceCreatePipelineAsync) { wgpu::ShaderModuleWGSLDescriptor wgslDesc = {}; wgslDesc.source = R"( - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { } )"; diff --git a/src/tests/unittests/validation/QueueSubmitValidationTests.cpp b/src/tests/unittests/validation/QueueSubmitValidationTests.cpp index 06b3a41a49..184994d4e9 100644 --- a/src/tests/unittests/validation/QueueSubmitValidationTests.cpp +++ b/src/tests/unittests/validation/QueueSubmitValidationTests.cpp @@ -176,13 +176,13 @@ namespace { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); @@ -213,7 +213,7 @@ namespace { wgpu::ComputePipelineDescriptor descriptor; descriptor.computeStage.module = utils::CreateShaderModule(device, R"( - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })"); descriptor.computeStage.entryPoint = "main"; device.CreateComputePipelineAsync(&descriptor, callback, &callbackData); diff --git a/src/tests/unittests/validation/RenderBundleValidationTests.cpp b/src/tests/unittests/validation/RenderBundleValidationTests.cpp index 3104603763..51e6d8b5f0 100644 --- a/src/tests/unittests/validation/RenderBundleValidationTests.cpp +++ b/src/tests/unittests/validation/RenderBundleValidationTests.cpp @@ -35,7 +35,7 @@ namespace { }; [[group(0), binding(0)]] var uniforms : S; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); fsModule = utils::CreateShaderModule(device, R"( @@ -49,7 +49,7 @@ namespace { }; [[group(1), binding(1)]] var ssbo : [[access(read_write)]] Storage; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); wgpu::BindGroupLayout bgls[] = { diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index 8a8643d2a1..a4cfa43407 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -28,13 +28,13 @@ class RenderPipelineValidationTest : public ValidationTest { vsModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); } @@ -193,7 +193,7 @@ TEST_F(RenderPipelineValidationTest, FragmentOutputFormatCompatibility) { stream << R"( [[location(0)]] var fragColor : vec4<)" << kScalarTypes[i] << R"(>; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"; descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str()); @@ -411,7 +411,7 @@ TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) { [[group(0), binding(0)]] var myTexture : texture_2d<)" << kScalarTypes[i] << R"(>; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"; descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str()); @@ -458,7 +458,7 @@ TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) { stream << R"( [[group(0), binding(0)]] var myTexture : )" << kTextureKeywords[i] << R"(; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"; descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str()); @@ -485,7 +485,7 @@ TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) { }; [[group(0), binding(0)]] var dst : [[access(read_write)]] Dst; [[builtin(vertex_index)]] var VertexIndex : u32; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { dst.data[VertexIndex] = 0x1234u; })"); @@ -592,13 +592,13 @@ TEST_F(RenderPipelineValidationTest, DepthCompareUndefinedIsError) { TEST_F(RenderPipelineValidationTest, EntryPointNameValidation) { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( [[builtin(position)]] var position : vec4; - [[stage(vertex)]] fn vertex_main() -> void { + [[stage(vertex)]] fn vertex_main() { position = vec4(0.0, 0.0, 0.0, 1.0); return; } [[location(0)]] var color : vec4; - [[stage(fragment)]] fn fragment_main() -> void { + [[stage(fragment)]] fn fragment_main() { color = vec4(1.0, 0.0, 0.0, 1.0); return; } @@ -645,11 +645,11 @@ TEST_F(RenderPipelineValidationTest, VertexAttribCorrectEntryPoint) { [[location(0)]] var attrib0 : vec4; [[location(1)]] var attrib1 : vec4; - [[stage(vertex)]] fn vertex0() -> void { + [[stage(vertex)]] fn vertex0() { position = attrib0; return; } - [[stage(vertex)]] fn vertex1() -> void { + [[stage(vertex)]] fn vertex1() { position = attrib1; return; } @@ -690,11 +690,11 @@ TEST_F(RenderPipelineValidationTest, FragmentOutputCorrectEntryPoint) { [[location(0)]] var colorFloat : vec4; [[location(0)]] var colorUint : vec4; - [[stage(fragment)]] fn fragmentFloat() -> void { + [[stage(fragment)]] fn fragmentFloat() { colorFloat = vec4(0.0, 0.0, 0.0, 0.0); return; } - [[stage(fragment)]] fn fragmentUint() -> void { + [[stage(fragment)]] fn fragmentUint() { colorUint = vec4(0u, 0u, 0u, 0u); return; } @@ -734,11 +734,11 @@ TEST_F(RenderPipelineValidationTest, DISABLED_BindingsFromCorrectEntryPoint) { [[binding 1, set 0]] var var1 : Uniforms; [[builtin(position)]] var position : vec4; - fn vertex0() -> void { + fn vertex0() { position = var0.data; return; } - fn vertex1() -> void { + fn vertex1() { position = var1.data; return; } diff --git a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp index 0acd61271d..0fca1091e5 100644 --- a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp +++ b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp @@ -47,11 +47,11 @@ namespace { // pipeline. But those bind groups in caller can be used for validation for other purposes. wgpu::RenderPipeline CreateNoOpRenderPipeline() { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 pipelineDescriptor; pipelineDescriptor.vertex.module = vsModule; @@ -62,7 +62,7 @@ namespace { wgpu::ComputePipeline CreateNoOpComputePipeline() { wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"( - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })"); wgpu::ComputePipelineDescriptor pipelineDescriptor; pipelineDescriptor.layout = utils::MakeBasicPipelineLayout(device, nullptr); @@ -772,7 +772,7 @@ namespace { // Create a passthrough render pipeline with a readonly buffer wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( @@ -780,7 +780,7 @@ namespace { value : f32; }; [[group(0), binding(0)]] var rBuffer : [[access(read)]] RBuffer; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 pipelineDescriptor; pipelineDescriptor.vertex.module = vsModule; @@ -820,7 +820,7 @@ namespace { value : f32; }; [[group(0), binding(0)]] var rBuffer : [[access(read)]] RBuffer; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })"); wgpu::ComputePipelineDescriptor pipelineDescriptor; pipelineDescriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl0); @@ -1550,12 +1550,12 @@ namespace { { // Create a passthrough render pipeline with a readonly storage texture wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var tex : [[access(read)]] texture_storage_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor2 pipelineDescriptor; pipelineDescriptor.vertex.module = vsModule; @@ -1581,7 +1581,7 @@ namespace { // Create a passthrough compute pipeline with a readonly storage texture wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var tex : [[access(read)]] texture_storage_2d; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })"); wgpu::ComputePipelineDescriptor pipelineDescriptor; pipelineDescriptor.layout = utils::MakeBasicPipelineLayout(device, &readBGL); diff --git a/src/tests/unittests/validation/ShaderModuleValidationTests.cpp b/src/tests/unittests/validation/ShaderModuleValidationTests.cpp index 73d32a56a5..1bc39f6ef5 100644 --- a/src/tests/unittests/validation/ShaderModuleValidationTests.cpp +++ b/src/tests/unittests/validation/ShaderModuleValidationTests.cpp @@ -61,7 +61,7 @@ TEST_F(ShaderModuleValidationTest, CreationSuccess) { TEST_F(ShaderModuleValidationTest, FragmentOutputLocationExceedsMaxColorAttachments) { std::ostringstream stream; stream << "[[location(" << kMaxColorAttachments << R"()]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"; ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, stream.str().c_str())); @@ -164,7 +164,7 @@ TEST_F(ShaderModuleValidationTest, CompilationMessages) { std::ostringstream stream; stream << R"([[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"; wgpu::ShaderModule shaderModule = utils::CreateShaderModule(device, stream.str().c_str()); diff --git a/src/tests/unittests/validation/StorageTextureValidationTests.cpp b/src/tests/unittests/validation/StorageTextureValidationTests.cpp index cc9bbc9c1b..f705049c52 100644 --- a/src/tests/unittests/validation/StorageTextureValidationTests.cpp +++ b/src/tests/unittests/validation/StorageTextureValidationTests.cpp @@ -25,12 +25,12 @@ class StorageTextureValidationTests : public ValidationTest { mDefaultVSModule = utils::CreateShaderModule(device, R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 1.0); })"); mDefaultFSModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(1.0, 0.0, 0.0, 1.0); })"); } @@ -88,7 +88,7 @@ class StorageTextureValidationTests : public ValidationTest { << "[[access(" << access << ")]] " << imageTypeDeclaration << "<" << imageFormatQualifier << ">;\n" - "[[stage(compute)]] fn main() -> void {\n" + "[[stage(compute)]] fn main() {\n" "}\n"; return ostream.str(); @@ -124,7 +124,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) { [[group(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d; [[builtin(vertex_index)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = textureLoad(image0, vec2(i32(VertexIndex), 0)); })"); @@ -141,7 +141,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) { [[group(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d; [[builtin(frag_coord)]] var FragCoord : vec4; [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = textureLoad(image0, vec2(FragCoord.xy)); })"); @@ -157,7 +157,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( [[builtin(vertex_index)]] var vertex_index : u32; [[group(0), binding(0)]] var image0 : [[access(write)]] texture_storage_2d; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { textureStore(image0, vec2(i32(vertex_index), 0), vec4(1.0, 0.0, 0.0, 1.0)); })"); @@ -173,7 +173,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) { wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[builtin(frag_coord)]] var frag_coord : vec4; [[group(0), binding(0)]] var image0 : [[access(write)]] texture_storage_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { textureStore(image0, vec2(frag_coord.xy), vec4(1.0, 0.0, 0.0, 1.0)); })"); @@ -199,7 +199,7 @@ TEST_F(StorageTextureValidationTests, ComputePipeline) { }; [[group(0), binding(1)]] var buf : [[access(read_write)]] Buf; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { buf.data = textureLoad(image0, vec2(LocalInvocationID.xy)).x; })"); @@ -217,7 +217,7 @@ TEST_F(StorageTextureValidationTests, ComputePipeline) { [[group(0), binding(0)]] var image0 : [[access(write)]] texture_storage_2d; [[builtin(local_invocation_id)]] var LocalInvocationID : vec3; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { textureStore(image0, vec2(LocalInvocationID.xy), vec4(0.0, 0.0, 0.0, 0.0)); })"); @@ -236,7 +236,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) { { ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var image0 : [[access(read_write)]] texture_storage_2d; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { })")); } @@ -244,7 +244,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) { { ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var image0 : [[access(read_write)]] texture_storage_2d; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { })")); } @@ -252,7 +252,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) { { ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"( [[group(0), binding(0)]] var image0 : [[access(read_write)]] texture_storage_2d; - [[stage(compute)]] fn main() -> void { + [[stage(compute)]] fn main() { })")); } } diff --git a/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp b/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp index f4f66f8654..d6e5b4f209 100644 --- a/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp +++ b/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp @@ -65,10 +65,8 @@ TEST_F(UnsafeAPIValidationTest, DrawIndexedIndirectDisallowed) { bundleDesc.cColorFormats[0] = renderPass.attachmentFormat; utils::ComboRenderPipelineDescriptor2 desc; - desc.vertex.module = - utils::CreateShaderModule(device, "[[stage(vertex)]] fn main() -> void {}"); - desc.cFragment.module = - utils::CreateShaderModule(device, "[[stage(fragment)]] fn main() -> void {}"); + desc.vertex.module = utils::CreateShaderModule(device, "[[stage(vertex)]] fn main() {}"); + desc.cFragment.module = utils::CreateShaderModule(device, "[[stage(fragment)]] fn main() {}"); wgpu::RenderPipeline pipeline = device.CreateRenderPipeline2(&desc); // Control cases: DrawIndirect and DrawIndexed are allowed inside a render pass. @@ -134,7 +132,7 @@ TEST_F(UnsafeAPIValidationTest, DispatchIndirectDisallowed) { wgpu::ComputePipelineDescriptor pipelineDesc; pipelineDesc.computeStage.entryPoint = "main"; pipelineDesc.computeStage.module = - utils::CreateShaderModule(device, "[[stage(compute)]] fn main() -> void {}"); + utils::CreateShaderModule(device, "[[stage(compute)]] fn main() {}"); wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc); // Control case: dispatch is allowed. diff --git a/src/tests/unittests/validation/VertexBufferValidationTests.cpp b/src/tests/unittests/validation/VertexBufferValidationTests.cpp index 9558711c0e..cbab0e764b 100644 --- a/src/tests/unittests/validation/VertexBufferValidationTests.cpp +++ b/src/tests/unittests/validation/VertexBufferValidationTests.cpp @@ -27,7 +27,7 @@ class VertexBufferValidationTest : public ValidationTest { fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); } @@ -46,7 +46,7 @@ class VertexBufferValidationTest : public ValidationTest { vs << "[[location(" << i << ")]] var a_position" << i << " : vec3;\n"; } vs << "[[builtin(position)]] var Position : vec4;"; - vs << "[[stage(vertex)]] fn main() -> void {\n"; + vs << "[[stage(vertex)]] fn main() {\n"; vs << "Position = vec4("; for (unsigned int i = 0; i < bufferCount; ++i) { diff --git a/src/tests/unittests/validation/VertexStateValidationTests.cpp b/src/tests/unittests/validation/VertexStateValidationTests.cpp index 014efafd41..2a4c601ec8 100644 --- a/src/tests/unittests/validation/VertexStateValidationTests.cpp +++ b/src/tests/unittests/validation/VertexStateValidationTests.cpp @@ -25,7 +25,7 @@ class VertexStateTest : public ValidationTest { wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, vertexSource); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( [[location(0)]] var fragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { fragColor = vec4(1.0, 0.0, 0.0, 1.0); } )"); @@ -46,7 +46,7 @@ class VertexStateTest : public ValidationTest { const char* kDummyVertexShader = R"( [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 0.0); } )"; @@ -102,7 +102,7 @@ TEST_F(VertexStateTest, PipelineCompatibility) { [[location(0)]] var a : vec4; [[location(1)]] var b : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 0.0); } )"); @@ -111,7 +111,7 @@ TEST_F(VertexStateTest, PipelineCompatibility) { CreatePipeline(true, state, R"( [[location(0)]] var a : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 0.0); } )"); @@ -120,7 +120,7 @@ TEST_F(VertexStateTest, PipelineCompatibility) { CreatePipeline(false, state, R"( [[location(2)]] var a : vec4; [[builtin(position)]] var Position : vec4; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { Position = vec4(0.0, 0.0, 0.0, 0.0); } )"); diff --git a/src/tests/white_box/D3D12DescriptorHeapTests.cpp b/src/tests/white_box/D3D12DescriptorHeapTests.cpp index 5bca80a053..e4f6fe62f6 100644 --- a/src/tests/white_box/D3D12DescriptorHeapTests.cpp +++ b/src/tests/white_box/D3D12DescriptorHeapTests.cpp @@ -43,7 +43,7 @@ class D3D12DescriptorHeapTests : public DawnTest { [[builtin(position)]] var Position : vec4; [[builtin(vertex_index)]] var VertexIndex : u32; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, 1.0), @@ -59,7 +59,7 @@ class D3D12DescriptorHeapTests : public DawnTest { [[group(0), binding(0)]] var colorBuffer : U; [[location(0)]] var FragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = colorBuffer.color; })"); } @@ -453,7 +453,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeManyUBO) { [[group(0), binding(0)]] var buffer0 : U; [[location(0)]] var FragColor : f32; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = buffer0.heapSize; })"); @@ -790,7 +790,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeManyUBOAndSamplers) { [[builtin(position)]] var Position : vec4; [[builtin(vertex_index)]] var VertexIndex : u32; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, 1.0), @@ -809,7 +809,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeManyUBOAndSamplers) { [[location(0)]] var FragColor : vec4; [[builtin(frag_coord)]] var FragCoord : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = textureSample(texture0, sampler0, FragCoord.xy) + buffer0.color; })"); diff --git a/src/tests/white_box/D3D12ResidencyTests.cpp b/src/tests/white_box/D3D12ResidencyTests.cpp index 2a12c5cb60..1b5ce49413 100644 --- a/src/tests/white_box/D3D12ResidencyTests.cpp +++ b/src/tests/white_box/D3D12ResidencyTests.cpp @@ -342,7 +342,7 @@ TEST_P(D3D12DescriptorResidencyTests, SwitchedViewHeapResidency) { [[builtin(position)]] var Position : vec4; [[builtin(vertex_index)]] var VertexIndex : u32; - [[stage(vertex)]] fn main() -> void { + [[stage(vertex)]] fn main() { const pos : array, 3> = array, 3>( vec2(-1.0, 1.0), vec2( 1.0, 1.0), @@ -358,7 +358,7 @@ TEST_P(D3D12DescriptorResidencyTests, SwitchedViewHeapResidency) { [[group(0), binding(0)]] var colorBuffer : U; [[location(0)]] var FragColor : vec4; - [[stage(fragment)]] fn main() -> void { + [[stage(fragment)]] fn main() { FragColor = colorBuffer.color; })");