From 241cd0cd8e68041b6f10322ade11c6209519ba46 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 22 Dec 2020 19:24:28 +0000 Subject: [PATCH] Update PrimitiveTopologyTests to use WGSL Bug: dawn:572 Change-Id: I9275ad78e6222b33372f5640b07801b815670fa6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33774 Reviewed-by: Corentin Wallez Commit-Queue: Austin Eng --- src/tests/end2end/PrimitiveTopologyTests.cpp | 24 +++++++++----------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/tests/end2end/PrimitiveTopologyTests.cpp b/src/tests/end2end/PrimitiveTopologyTests.cpp index 2766a4e8eb..be3e9e90ad 100644 --- a/src/tests/end2end/PrimitiveTopologyTests.cpp +++ b/src/tests/end2end/PrimitiveTopologyTests.cpp @@ -156,20 +156,18 @@ class PrimitiveTopologyTest : public DawnTest { renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize); - vsModule = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"( - #version 450 - layout(location = 0) in vec4 pos; - void main() { - gl_Position = pos; - gl_PointSize = 1.0; - })"); + vsModule = utils::CreateShaderModuleFromWGSL(device, R"( + [[location(0)]] var pos : vec4; + [[builtin(position)]] var Position : vec4; + [[stage(vertex)]] fn main() -> void { + Position = pos; + })"); - fsModule = utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"( - #version 450 - layout(location = 0) out vec4 fragColor; - void main() { - fragColor = vec4(0.0, 1.0, 0.0, 1.0); - })"); + 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); + })"); vertexBuffer = utils::CreateBufferFromData(device, kVertices, sizeof(kVertices), wgpu::BufferUsage::Vertex);