From 84997c5ee97a89116eb552b6cb00c95f2950c8d1 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 22 Dec 2020 19:56:48 +0000 Subject: [PATCH] Update ViewportOrientationTests to use WGSL Bug: dawn:572 Change-Id: Ifef4f75dcfd0077e3361ea0854cddf3e78e84a02 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33887 Commit-Queue: Austin Eng Reviewed-by: Corentin Wallez --- .../end2end/ViewportOrientationTests.cpp | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/tests/end2end/ViewportOrientationTests.cpp b/src/tests/end2end/ViewportOrientationTests.cpp index 4485d4af10..8591d508f6 100644 --- a/src/tests/end2end/ViewportOrientationTests.cpp +++ b/src/tests/end2end/ViewportOrientationTests.cpp @@ -26,20 +26,17 @@ TEST_P(ViewportOrientationTests, OriginAt0x0) { utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 2, 2); - wgpu::ShaderModule vsModule = - utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"( - #version 450 - void main() { - gl_Position = vec4(-0.5f, 0.5f, 0.0f, 1.0f); - gl_PointSize = 1.0; + wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"( + [[builtin(position)]] var Position : vec4; + + [[stage(vertex)]] fn main() -> void { + Position = vec4(-0.5, 0.5, 0.0, 1.0); })"); - wgpu::ShaderModule fsModule = - utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"( - #version 450 - layout(location = 0) out vec4 fragColor; - void main() { - fragColor = vec4(0.0f, 1.0f, 0.0f, 1.0f); + wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( + [[location(0)]] var fragColor : vec4; + [[stage(fragment)]] fn main() -> void { + fragColor = vec4(0.0, 1.0, 0.0, 1.0); })"); utils::ComboRenderPipelineDescriptor descriptor(device);