diff --git a/src/webgpu/gpu_test.ts b/src/webgpu/gpu_test.ts index b9ee2b776db5..ed8c170d93d2 100644 --- a/src/webgpu/gpu_test.ts +++ b/src/webgpu/gpu_test.ts @@ -300,6 +300,14 @@ export class GPUTestSubcaseBatchState extends SubcaseBatchState { } } + /** Skips this test case if a depth texture can not be used with a non-comparison sampler. */ + skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler() { + this.skipIf( + this.isCompatibility, + 'depth textures are not usable with non-comparison samplers in compatibility mode' + ); + } + /** Skips this test case if the `langFeature` is *not* supported. */ skipIfLanguageFeatureNotSupported(langFeature: WGSLLanguageFeature) { if (!this.hasLanguageFeature(langFeature)) { diff --git a/src/webgpu/shader/execution/expression/call/builtin/textureGather.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/textureGather.spec.ts index 85ff9027bf88..5aae5bafbe57 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/textureGather.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/textureGather.spec.ts @@ -512,7 +512,10 @@ Parameters: .beginSubcases() .combine('samplePoints', kSamplePointMethods) ) - .beforeAllSubcases(t => t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format)) + .beforeAllSubcases(t => { + t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler(); + t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format); + }) .fn(async t => { const { format, stage, samplePoints, modeU, modeV, offset } = t.params; @@ -591,7 +594,10 @@ Parameters: .beginSubcases() .combine('samplePoints', kCubeSamplePointMethods) ) - .beforeAllSubcases(t => t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format)) + .beforeAllSubcases(t => { + t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler(); + t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format); + }) .fn(async t => { const { format, stage, samplePoints, mode } = t.params; @@ -688,6 +694,7 @@ Parameters: .combine('A', ['i32', 'u32'] as const) ) .beforeAllSubcases(t => { + t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler(); t.skipIfTextureFormatNotSupported(t.params.format); t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format); }) @@ -779,6 +786,7 @@ Parameters: .combine('A', ['i32', 'u32'] as const) ) .beforeAllSubcases(t => { + t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler(); t.skipIfTextureViewDimensionNotSupported('cube-array'); t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format); }) diff --git a/src/webgpu/shader/execution/expression/call/builtin/textureSample.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/textureSample.spec.ts index 1aa84583ee55..386101462eb8 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/textureSample.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/textureSample.spec.ts @@ -389,7 +389,10 @@ Parameters: .beginSubcases() .combine('samplePoints', kSamplePointMethods) ) - .beforeAllSubcases(t => t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format)) + .beforeAllSubcases(t => { + t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler(); + t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format); + }) .fn(async t => { const { format, samplePoints, modeU, modeV, offset } = t.params; @@ -680,6 +683,7 @@ Parameters: .combine('samplePoints', kCubeSamplePointMethods) ) .beforeAllSubcases(t => { + t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler(); t.skipIfTextureViewDimensionNotSupported(t.params.viewDimension); t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format); }) @@ -786,7 +790,10 @@ Parameters: .combine('A', ['i32', 'u32'] as const) .combine('L', ['i32', 'u32'] as const) ) - .beforeAllSubcases(t => t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format)) + .beforeAllSubcases(t => { + t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler(); + t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format); + }) .fn(async t => { const { format, samplePoints, mode, A, L, offset } = t.params; @@ -874,6 +881,7 @@ Parameters: .combine('A', ['i32', 'u32'] as const) ) .beforeAllSubcases(t => { + t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler(); t.skipIfTextureViewDimensionNotSupported('cube-array'); t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format); }) diff --git a/src/webgpu/shader/execution/expression/call/builtin/textureSampleLevel.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/textureSampleLevel.spec.ts index bbc387927f16..78a3c6361379 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/textureSampleLevel.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/textureSampleLevel.spec.ts @@ -538,9 +538,10 @@ Parameters: .combine('samplePoints', kSamplePointMethods) .combine('L', ['i32', 'u32'] as const) ) - .beforeAllSubcases(t => - skipIfTextureFormatNotSupportedNotAvailableOrNotFilterable(t, t.params.format) - ) + .beforeAllSubcases(t => { + t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler(); + skipIfTextureFormatNotSupportedNotAvailableOrNotFilterable(t, t.params.format); + }) .fn(async t => { const { format, stage, samplePoints, mode, L, offset } = t.params; @@ -640,9 +641,10 @@ Parameters: .combine('A', ['i32', 'u32'] as const) .combine('L', ['i32', 'u32'] as const) ) - .beforeAllSubcases(t => - skipIfTextureFormatNotSupportedNotAvailableOrNotFilterable(t, t.params.format) - ) + .beforeAllSubcases(t => { + t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler(); + skipIfTextureFormatNotSupportedNotAvailableOrNotFilterable(t, t.params.format); + }) .fn(async t => { const { format, stage, samplePoints, mode, A, L, offset } = t.params; @@ -749,6 +751,7 @@ Parameters: .combine('L', ['i32', 'u32'] as const) ) .beforeAllSubcases(t => { + t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler(); skipIfTextureFormatNotSupportedNotAvailableOrNotFilterable(t, t.params.format); t.skipIfTextureViewDimensionNotSupported(t.params.viewDimension); })