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; bundleDesc.cColorFormats[0] = renderPass.attachmentFormat;
utils::ComboRenderPipelineDescriptor desc(device); utils::ComboRenderPipelineDescriptor desc(device);
desc.vertexStage.module = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, desc.vertexStage.module =
"#version 450\nvoid main() {}"); utils::CreateShaderModuleFromWGSL(device, "[[stage(vertex)]] fn main() -> void {}");
desc.cFragmentStage.module = utils::CreateShaderModule( desc.cFragmentStage.module =
device, utils::SingleShaderStage::Fragment, "#version 450\nvoid main() {}"); utils::CreateShaderModuleFromWGSL(device, "[[stage(fragment)]] fn main() -> void {}");
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&desc); wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&desc);
// Control cases: DrawIndirect and DrawIndexed are allowed inside a render pass. // Control cases: DrawIndirect and DrawIndexed are allowed inside a render pass.
@ -116,8 +116,8 @@ TEST_F(UnsafeAPIValidationTest, DispatchIndirectDisallowed) {
// Create the dummy compute pipeline. // Create the dummy compute pipeline.
wgpu::ComputePipelineDescriptor pipelineDesc; wgpu::ComputePipelineDescriptor pipelineDesc;
pipelineDesc.computeStage.entryPoint = "main"; pipelineDesc.computeStage.entryPoint = "main";
pipelineDesc.computeStage.module = utils::CreateShaderModule( pipelineDesc.computeStage.module =
device, utils::SingleShaderStage::Compute, "#version 450\nvoid main() {}"); utils::CreateShaderModuleFromWGSL(device, "[[stage(compute)]] fn main() -> void {}");
wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc); wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc);
// Control case: dispatch is allowed. // Control case: dispatch is allowed.