diff options
Diffstat (limited to 'testing/web-platform/mozilla/tests/webgpu/webgpu/api/validation/createBindGroupLayout.spec.js')
-rw-r--r-- | testing/web-platform/mozilla/tests/webgpu/webgpu/api/validation/createBindGroupLayout.spec.js | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/testing/web-platform/mozilla/tests/webgpu/webgpu/api/validation/createBindGroupLayout.spec.js b/testing/web-platform/mozilla/tests/webgpu/webgpu/api/validation/createBindGroupLayout.spec.js index 580a64af4f..b5d98f8d44 100644 --- a/testing/web-platform/mozilla/tests/webgpu/webgpu/api/validation/createBindGroupLayout.spec.js +++ b/testing/web-platform/mozilla/tests/webgpu/webgpu/api/validation/createBindGroupLayout.spec.js @@ -163,8 +163,10 @@ combine('access', [undefined, ...kStorageTextureAccessValues]) fn((t) => { const { shaderStage, access } = t.params; + const appliedAccess = access ?? 'write-only'; const success = !( - (access ?? 'write-only') === 'write-only' && shaderStage & GPUShaderStage.VERTEX); + // If visibility includes VERETX, storageTexture.access must be "read-only" + shaderStage & GPUShaderStage.VERTEX && appliedAccess !== 'read-only'); t.expectValidationError(() => { @@ -173,7 +175,7 @@ fn((t) => { { binding: 0, visibility: shaderStage, - storageTexture: { access, format: 'rgba8unorm' } + storageTexture: { access, format: 'r32uint' } }] }); @@ -436,29 +438,36 @@ fn((t) => { g.test('storage_texture,formats'). desc( ` - Test that a validation error is generated if the format doesn't support the storage usage. + Test that a validation error is generated if the format doesn't support the storage usage. A + validation error is also generated if the format doesn't support the 'read-write' storage access + when the storage access is 'read-write'. ` ). -params((u) => u.combine('format', kAllTextureFormats)). +params((u) => +u // +.combine('format', kAllTextureFormats) // +.combine('access', kStorageTextureAccessValues) +). beforeAllSubcases((t) => { t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format); + t.skipIfTextureFormatNotUsableAsStorageTexture(t.params.format); }). fn((t) => { - const { format } = t.params; + const { format, access } = t.params; const info = kTextureFormatInfo[format]; - t.expectValidationError( - () => { - t.device.createBindGroupLayout({ - entries: [ - { - binding: 0, - visibility: GPUShaderStage.COMPUTE, - storageTexture: { format } - }] - - }); - }, - !info.color?.storage - ); + const success = + info.color?.storage && !(access === 'read-write' && !info.color?.readWriteStorage); + + t.expectValidationError(() => { + t.device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.COMPUTE, + storageTexture: { format, access } + }] + + }); + }, !success); });
\ No newline at end of file |