From c9b72f03c07d609d8342398afdb9aafce4382c81 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Thu, 22 Jul 2021 13:21:29 -0700 Subject: [PATCH] Update tests following changes to GPUFragmentState validation (#655) Tests that use fragment shaders that don't write to the output must declare the color target with writeMask 0. Spec PR: https://github.com/gpuweb/gpuweb/pull/1918 Bug: crbug.com/dawn/962 --- .../api/validation/attachment_compatibility.spec.ts | 10 ++++++---- src/webgpu/api/validation/validation_test.ts | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/webgpu/api/validation/attachment_compatibility.spec.ts b/src/webgpu/api/validation/attachment_compatibility.spec.ts index d703518dec00..64b3b07e2cf2 100644 --- a/src/webgpu/api/validation/attachment_compatibility.spec.ts +++ b/src/webgpu/api/validation/attachment_compatibility.spec.ts @@ -215,7 +215,7 @@ Test that color attachment formats in render passes or bundles match the pipelin ) .fn(t => { const { encoderType, encoderFormat, pipelineFormat } = t.params; - const pipeline = t.createRenderPipeline([{ format: pipelineFormat }]); + const pipeline = t.createRenderPipeline([{ format: pipelineFormat, writeMask: 0 }]); const { encoder, validateFinishAndSubmit } = t.createEncoder(encoderType, { attachmentInfo: { colorFormats: [encoderFormat] }, @@ -242,7 +242,9 @@ TODO: Add sparse color attachment compatibility test when defined by specificati ) .fn(t => { const { encoderType, encoderCount, pipelineCount } = t.params; - const pipeline = t.createRenderPipeline(range(pipelineCount, () => ({ format: 'rgba8unorm' }))); + const pipeline = t.createRenderPipeline( + range(pipelineCount, () => ({ format: 'rgba8unorm', writeMask: 0 })) + ); const { encoder, validateFinishAndSubmit } = t.createEncoder(encoderType, { attachmentInfo: { colorFormats: range(encoderCount, () => 'rgba8unorm') }, @@ -269,7 +271,7 @@ Test that the depth attachment format in render passes or bundles match the pipe await t.selectDeviceForTextureFormatOrSkipTestCase([encoderFormat, pipelineFormat]); const pipeline = t.createRenderPipeline( - [{ format: 'rgba8unorm' }], + [{ format: 'rgba8unorm', writeMask: 0 }], pipelineFormat !== undefined ? { format: pipelineFormat } : undefined ); @@ -302,7 +304,7 @@ Test that the sample count in render passes or bundles match the pipeline sample attachmentType === 'depthstencil' ? ('depth24plus-stencil8' as const) : undefined; const pipeline = t.createRenderPipeline( - colorFormats.map(format => ({ format })), + colorFormats.map(format => ({ format, writeMask: 0 })), depthStencilFormat ? { format: depthStencilFormat } : undefined, pipelineSampleCount ); diff --git a/src/webgpu/api/validation/validation_test.ts b/src/webgpu/api/validation/validation_test.ts index 86c2a9df485e..41075acfde41 100644 --- a/src/webgpu/api/validation/validation_test.ts +++ b/src/webgpu/api/validation/validation_test.ts @@ -229,7 +229,7 @@ export class ValidationTest extends GPUTest { code: '[[stage(fragment)]] fn main() {}', }), entryPoint: 'main', - targets: [{ format: 'rgba8unorm' }], + targets: [{ format: 'rgba8unorm', writeMask: 0 }], }, primitive: { topology: 'triangle-list' }, });