Port UnsafeAPIValidationTests to WGSL

Bug: dawn:572
Change-Id: I5d86e36d3bfc29c0f27e64aa86b0a662e490f1e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33932
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-11-26 12:22:55 +00:00 committed by Commit Bot service account
parent 8fc755b716
commit 71279dcde7
1 changed files with 6 additions and 6 deletions

View File

@ -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.