Skip to content

Commit

Permalink
Don't test texture_depth_xxx with linear (#4028)
Browse files Browse the repository at this point in the history
texture_depth_xxx can only be used with non-filtering samplers
or comparison samples, not with filtering samplers.

see table in #4026

Also enabled more depth tests
  • Loading branch information
greggman authored Nov 4, 2024
1 parent f2e2ada commit e4718ba
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ A texture gather operation reads from a 2D, 2D array, cube, or cube array textur
import { makeTestGroup } from '../../../../../../common/framework/test_group.js';
import {
isDepthTextureFormat,
isEncodableTextureFormat,
isFilterableAsTextureF32,
kDepthStencilFormats,
kAllTextureFormats,
Expand Down Expand Up @@ -507,17 +506,15 @@ Parameters:
.combine('format', kDepthStencilFormats)
// filter out stencil only formats
.filter(t => isDepthTextureFormat(t.format))
// MAINTENANCE_TODO: Remove when support for depth24plus, depth24plus-stencil8, and depth32float-stencil8 is added.
.filter(t => isEncodableTextureFormat(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
.combine('modeV', kShortAddressModes)
.combine('offset', [false, true] as const)
.beginSubcases()
.combine('samplePoints', kSamplePointMethods)
)
.beforeAllSubcases(t => t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format))
.fn(async t => {
const { format, stage, samplePoints, modeU, modeV, filt: minFilter, offset } = t.params;
const { format, stage, samplePoints, modeU, modeV, offset } = t.params;

// We want at least 4 blocks or something wide enough for 3 mip levels.
const [width, height] = chooseTextureSize({ minSize: 8, minBlocks: 4, format });
Expand All @@ -531,9 +528,6 @@ Parameters:
const sampler: GPUSamplerDescriptor = {
addressModeU: kShortAddressModeToAddressMode[modeU],
addressModeV: kShortAddressModeToAddressMode[modeV],
minFilter,
magFilter: minFilter,
mipmapFilter: minFilter,
};

const calls: TextureCall<vec2>[] = generateTextureBuiltinInputs2D(50, {
Expand All @@ -542,7 +536,7 @@ Parameters:
sampler,
descriptor,
offset,
hashInputs: [stage, format, samplePoints, modeU, modeV, minFilter, offset],
hashInputs: [stage, format, samplePoints, modeU, modeV, offset],
}).map(({ coords, offset }) => {
return {
builtin: 'textureGather',
Expand Down Expand Up @@ -593,15 +587,13 @@ Parameters:
.combine('format', kDepthStencilFormats)
// filter out stencil only formats
.filter(t => isDepthTextureFormat(t.format))
// MAINTENANCE_TODO: Remove when support for depth24plus, depth24plus-stencil8, and depth32float-stencil8 is added.
.filter(t => isEncodableTextureFormat(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('mode', kShortAddressModes)
.beginSubcases()
.combine('samplePoints', kCubeSamplePointMethods)
)
.beforeAllSubcases(t => t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format))
.fn(async t => {
const { format, stage, samplePoints, mode, filt: minFilter } = t.params;
const { format, stage, samplePoints, mode } = t.params;

const viewDimension: GPUTextureViewDimension = 'cube';
const [width, height] = chooseTextureSize({ minSize: 8, minBlocks: 2, format, viewDimension });
Expand All @@ -619,17 +611,14 @@ Parameters:
addressModeU: kShortAddressModeToAddressMode[mode],
addressModeV: kShortAddressModeToAddressMode[mode],
addressModeW: kShortAddressModeToAddressMode[mode],
minFilter,
magFilter: minFilter,
mipmapFilter: minFilter,
};

const calls: TextureCall<vec3>[] = generateSamplePointsCube(50, {
method: samplePoints,
sampler,
descriptor,
textureBuiltin: 'textureGather',
hashInputs: [stage, format, samplePoints, mode, minFilter],
hashInputs: [stage, format, samplePoints, mode],
}).map(({ coords, component }) => {
return {
builtin: 'textureGather',
Expand Down Expand Up @@ -691,9 +680,6 @@ Parameters:
.combine('format', kDepthStencilFormats)
// filter out stencil only formats
.filter(t => isDepthTextureFormat(t.format))
// MAINTENANCE_TODO: Remove when support for depth24plus, depth24plus-stencil8, and depth32float-stencil8 is added.
.filter(t => isEncodableTextureFormat(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
.combine('modeV', kShortAddressModes)
.combine('offset', [false, true] as const)
Expand All @@ -703,10 +689,10 @@ Parameters:
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
skipIfNeedsFilteringAndIsUnfilterableOrSelectDevice(t, t.params.filt, t.params.format);
t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format);
})
.fn(async t => {
const { format, stage, samplePoints, A, modeU, modeV, filt: minFilter, offset } = t.params;
const { format, stage, samplePoints, A, modeU, modeV, offset } = t.params;

// We want at least 4 blocks or something wide enough for 3 mip levels.
const [width, height] = chooseTextureSize({ minSize: 8, minBlocks: 4, format });
Expand All @@ -722,9 +708,6 @@ Parameters:
const sampler: GPUSamplerDescriptor = {
addressModeU: kShortAddressModeToAddressMode[modeU],
addressModeV: kShortAddressModeToAddressMode[modeV],
minFilter,
magFilter: minFilter,
mipmapFilter: minFilter,
};

const calls: TextureCall<vec2>[] = generateTextureBuiltinInputs2D(50, {
Expand All @@ -734,7 +717,7 @@ Parameters:
descriptor,
arrayIndex: { num: texture.depthOrArrayLayers, type: A },
offset,
hashInputs: [stage, format, samplePoints, A, modeU, modeV, minFilter, offset],
hashInputs: [stage, format, samplePoints, A, modeU, modeV, offset],
}).map(({ coords, arrayIndex, offset }) => {
return {
builtin: 'textureGather',
Expand Down Expand Up @@ -790,19 +773,17 @@ Parameters:
.combine('format', kDepthStencilFormats)
// filter out stencil only formats
.filter(t => isDepthTextureFormat(t.format))
// MAINTENANCE_TODO: Remove when support for depth24plus, depth24plus-stencil8, and depth32float-stencil8 is added.
.filter(t => isEncodableTextureFormat(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('mode', kShortAddressModes)
.beginSubcases()
.combine('samplePoints', kCubeSamplePointMethods)
.combine('A', ['i32', 'u32'] as const)
)
.beforeAllSubcases(t => {
t.skipIfTextureViewDimensionNotSupported('cube-array');
t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format);
})
.fn(async t => {
const { format, A, stage, samplePoints, mode, filt: minFilter } = t.params;
const { format, A, stage, samplePoints, mode } = t.params;

const viewDimension: GPUTextureViewDimension = 'cube-array';
const size = chooseTextureSize({ minSize: 8, minBlocks: 2, format, viewDimension });
Expand All @@ -819,9 +800,6 @@ Parameters:
addressModeU: kShortAddressModeToAddressMode[mode],
addressModeV: kShortAddressModeToAddressMode[mode],
addressModeW: kShortAddressModeToAddressMode[mode],
minFilter,
magFilter: minFilter,
mipmapFilter: minFilter,
};

const calls: TextureCall<vec3>[] = generateSamplePointsCube(50, {
Expand All @@ -830,7 +808,7 @@ Parameters:
descriptor,
textureBuiltin: 'textureGather',
arrayIndex: { num: texture.depthOrArrayLayers / 6, type: A },
hashInputs: [stage, format, samplePoints, mode, minFilter],
hashInputs: [stage, format, samplePoints, mode],
}).map(({ coords, arrayIndex }) => {
return {
builtin: 'textureGather',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ A texture gather compare operation performs a depth comparison on four texels in

import { makeTestGroup } from '../../../../../../common/framework/test_group.js';
import { kCompareFunctions } from '../../../../../capability_info.js';
import {
isDepthTextureFormat,
isEncodableTextureFormat,
kDepthStencilFormats,
} from '../../../../../format_info.js';
import { isDepthTextureFormat, kDepthStencilFormats } from '../../../../../format_info.js';

import {
checkCallResults,
Expand Down Expand Up @@ -74,8 +70,6 @@ Parameters:
.combine('format', kDepthStencilFormats)
// filter out stencil only formats
.filter(t => isDepthTextureFormat(t.format))
// MAINTENANCE_TODO: Remove when support for depth24plus, depth24plus-stencil8, and depth32float-stencil8 is added.
.filter(t => isEncodableTextureFormat(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
.combine('modeV', kShortAddressModes)
Expand All @@ -87,6 +81,7 @@ Parameters:
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format);
})
.fn(async t => {
const {
Expand Down Expand Up @@ -187,8 +182,6 @@ Parameters:
.combine('format', kDepthStencilFormats)
// filter out stencil only formats
.filter(t => isDepthTextureFormat(t.format))
// MAINTENANCE_TODO: Remove when support for depth24plus, depth24plus-stencil8, and depth32float-stencil8 is added.
.filter(t => isEncodableTextureFormat(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('mode', kShortAddressModes)
.beginSubcases()
Expand All @@ -198,6 +191,7 @@ Parameters:
)
.beforeAllSubcases(t => {
t.skipIfTextureViewDimensionNotSupported('cube-array');
t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format);
})
.fn(async t => {
const { format, A, stage, samplePoints, mode, filt: minFilter, compare } = t.params;
Expand Down Expand Up @@ -294,8 +288,6 @@ Parameters:
.combine('format', kDepthStencilFormats)
// filter out stencil only formats
.filter(t => isDepthTextureFormat(t.format))
// MAINTENANCE_TODO: Remove when support for depth24plus, depth24plus-stencil8, and depth32float-stencil8 is added.
.filter(t => isEncodableTextureFormat(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('mode', kShortAddressModes)
.combine('offset', [false, true] as const)
Expand All @@ -304,6 +296,7 @@ Parameters:
.combine('samplePoints', kSamplePointMethods)
.combine('compare', kCompareFunctions)
)
.beforeAllSubcases(t => t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format))
.fn(async t => {
const { format, C, stage, samplePoints, mode, compare, filt: minFilter, offset } = t.params;

Expand Down Expand Up @@ -385,14 +378,13 @@ Parameters:
.combine('format', kDepthStencilFormats)
// filter out stencil only formats
.filter(t => isDepthTextureFormat(t.format))
// MAINTENANCE_TODO: Remove when support for depth24plus, depth24plus-stencil8, and depth32float-stencil8 is added.
.filter(t => isEncodableTextureFormat(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('mode', kShortAddressModes)
.beginSubcases()
.combine('samplePoints', kCubeSamplePointMethods)
.combine('compare', kCompareFunctions)
)
.beforeAllSubcases(t => t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format))
.fn(async t => {
const { format, stage, samplePoints, mode, filt: minFilter, compare } = t.params;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
canUseAsRenderTarget,
isCompressedFloatTextureFormat,
isDepthTextureFormat,
isEncodableTextureFormat,
isMultisampledTextureFormat,
isStencilTextureFormat,
kDepthStencilFormats,
Expand Down Expand Up @@ -442,15 +441,14 @@ Parameters:
.combine('format', kDepthStencilFormats)
// filter out stencil only formats
.filter(t => isDepthTextureFormat(t.format))
// MAINTENANCE_TODO: Remove when support for depth24plus, depth24plus-stencil8, and depth32float-stencil8 is added.
.filter(t => isEncodableTextureFormat(t.format))
.beginSubcases()
.combine('samplePoints', kSamplePointMethods)
.combine('C', ['i32', 'u32'] as const)
.combine('L', ['i32', 'u32'] as const)
)
.beforeAllSubcases(t => {
t.skipIfTextureLoadNotSupportedForTextureType('texture_depth_2d');
t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format);
})
.fn(async t => {
const { format, stage, samplePoints, C, L } = t.params;
Expand Down
Loading

0 comments on commit e4718ba

Please sign in to comment.