From 71279dcde7cd1b718b137b9ed0384803f347a359 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Thu, 26 Nov 2020 12:22:55 +0000 Subject: [PATCH] Port UnsafeAPIValidationTests to WGSL Bug: dawn:572 Change-Id: I5d86e36d3bfc29c0f27e64aa86b0a662e490f1e2 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33932 Reviewed-by: Austin Eng Reviewed-by: Ben Clayton Commit-Queue: Corentin Wallez --- .../validation/UnsafeAPIValidationTests.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp b/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp index 9d627c1ba1..77dddcb22b 100644 --- a/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp +++ b/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp @@ -48,10 +48,10 @@ TEST_F(UnsafeAPIValidationTest, DrawIndexedIndirectDisallowed) { bundleDesc.cColorFormats[0] = renderPass.attachmentFormat; utils::ComboRenderPipelineDescriptor desc(device); - desc.vertexStage.module = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, - "#version 450\nvoid main() {}"); - desc.cFragmentStage.module = utils::CreateShaderModule( - device, utils::SingleShaderStage::Fragment, "#version 450\nvoid main() {}"); + desc.vertexStage.module = + utils::CreateShaderModuleFromWGSL(device, "[[stage(vertex)]] fn main() -> void {}"); + desc.cFragmentStage.module = + utils::CreateShaderModuleFromWGSL(device, "[[stage(fragment)]] fn main() -> void {}"); wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&desc); // Control cases: DrawIndirect and DrawIndexed are allowed inside a render pass. @@ -116,8 +116,8 @@ TEST_F(UnsafeAPIValidationTest, DispatchIndirectDisallowed) { // Create the dummy compute pipeline. wgpu::ComputePipelineDescriptor pipelineDesc; pipelineDesc.computeStage.entryPoint = "main"; - pipelineDesc.computeStage.module = utils::CreateShaderModule( - device, utils::SingleShaderStage::Compute, "#version 450\nvoid main() {}"); + pipelineDesc.computeStage.module = + utils::CreateShaderModuleFromWGSL(device, "[[stage(compute)]] fn main() -> void {}"); wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc); // Control case: dispatch is allowed.