Skip to content

Commit

Permalink
Compat: Don't test depth textures with non-comparison samplers (#4054)
Browse files Browse the repository at this point in the history
Compat: Don't test depth textures with non-comparison samplers
  • Loading branch information
greggman authored Nov 22, 2024
1 parent 91a2cfe commit 0c09a66
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
8 changes: 8 additions & 0 deletions src/webgpu/gpu_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
})
Expand Down Expand Up @@ -779,6 +786,7 @@ Parameters:
.combine('A', ['i32', 'u32'] as const)
)
.beforeAllSubcases(t => {
t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler();
t.skipIfTextureViewDimensionNotSupported('cube-array');
t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -680,6 +683,7 @@ Parameters:
.combine('samplePoints', kCubeSamplePointMethods)
)
.beforeAllSubcases(t => {
t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler();
t.skipIfTextureViewDimensionNotSupported(t.params.viewDimension);
t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format);
})
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -874,6 +881,7 @@ Parameters:
.combine('A', ['i32', 'u32'] as const)
)
.beforeAllSubcases(t => {
t.skipIfDepthTextureCanNotBeUsedWithNonComparisonSampler();
t.skipIfTextureViewDimensionNotSupported('cube-array');
t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
})
Expand Down

0 comments on commit 0c09a66

Please sign in to comment.