Skip to content

Commit

Permalink
Enable depth24plus, depth24plus-stencil8, depth32float-stencil8 in te…
Browse files Browse the repository at this point in the history
…xture builins
  • Loading branch information
greggman committed Oct 29, 2024
1 parent 3046684 commit dfe2b38
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ import { makeTestGroup } from '../../../../../../common/framework/test_group.js'
import {
isDepthTextureFormat,
isEncodableTextureFormat,
kCompressedTextureFormats,
kDepthStencilFormats,
kEncodableTextureFormats,
kAllTextureFormats,
} from '../../../../../format_info.js';

import {
Expand All @@ -54,8 +53,6 @@ import {
WGSLTextureSampleTest,
} from './texture_utils.js';

const kTestableColorFormats = [...kEncodableTextureFormats, ...kCompressedTextureFormats] as const;

export const g = makeTestGroup(WGSLTextureSampleTest);

g.test('sampled_2d_coords')
Expand Down Expand Up @@ -87,7 +84,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
Expand Down Expand Up @@ -184,7 +181,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('mode', kShortAddressModes)
Expand Down Expand Up @@ -292,7 +289,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
Expand Down Expand Up @@ -398,7 +395,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('mode', kShortAddressModes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ import {
isEncodableTextureFormat,
isMultisampledTextureFormat,
isStencilTextureFormat,
kCompressedTextureFormats,
kDepthStencilFormats,
kEncodableTextureFormats,
kAllTextureFormats,
kTextureFormatInfo,
textureDimensionAndFormatCompatible,
} from '../../../../../format_info.js';
Expand All @@ -58,8 +57,6 @@ import {
createVideoFrameWithRandomDataAndGetTexels,
} from './texture_utils.js';

const kTestableColorFormats = [...kEncodableTextureFormats, ...kCompressedTextureFormats] as const;

export function normalizedCoordToTexelLoadTestCoord<T extends Dimensionality>(
descriptor: GPUTextureDescriptor,
mipLevel: number,
Expand Down Expand Up @@ -92,7 +89,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => textureDimensionAndFormatCompatible('1d', t.format))
// 1d textures can't have a height !== 1
.filter(t => kTextureFormatInfo[t.format].blockHeight === 1)
Expand Down Expand Up @@ -179,7 +176,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => !isCompressedFloatTextureFormat(t.format))
.beginSubcases()
.combine('samplePoints', kSamplePointMethods)
Expand Down Expand Up @@ -261,7 +258,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => textureDimensionAndFormatCompatible('3d', t.format))
.beginSubcases()
.combine('samplePoints', kSamplePointMethods)
Expand Down Expand Up @@ -351,7 +348,7 @@ Parameters:
'texture_multisampled_2d',
'texture_depth_multisampled_2d',
] as const)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isMultisampledTextureFormat(t.format))
.filter(t => !isStencilTextureFormat(t.format))
// Filter out texture_depth_multisampled_2d with non-depth formats
Expand Down Expand Up @@ -604,7 +601,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
// MAINTENANCE_TODO: Update createTextureFromTexelViews to support stencil8 and remove this filter.
.filter(t => t.format !== 'stencil8' && !isCompressedFloatTextureFormat(t.format))
.combine('texture_type', ['texture_2d_array', 'texture_depth_2d_array'] as const)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import { makeTestGroup } from '../../../../../../common/framework/test_group.js'
import {
isDepthTextureFormat,
isEncodableTextureFormat,
kCompressedTextureFormats,
kDepthStencilFormats,
kEncodableTextureFormats,
kAllTextureFormats,
textureDimensionAndFormatCompatible,
} from '../../../../../format_info.js';
import { TextureTestMixin } from '../../../../../gpu_test.js';
Expand Down Expand Up @@ -44,8 +43,6 @@ import {
skipIfNeedsFilteringAndIsUnfilterable,
} from './texture_utils.js';

const kTestableColorFormats = [...kEncodableTextureFormats, ...kCompressedTextureFormats] as const;

export const g = makeTestGroup(TextureTestMixin(WGSLTextureSampleTest));

g.test('sampled_1d_coords')
Expand All @@ -62,7 +59,7 @@ Parameters:
)
.params(u =>
u
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => textureDimensionAndFormatCompatible('1d', t.format))
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
Expand Down Expand Up @@ -151,7 +148,7 @@ Parameters:
)
.params(u =>
u
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
Expand Down Expand Up @@ -249,7 +246,7 @@ Parameters:
)
.params(u =>
u
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('dim', ['3d', 'cube'] as const)
.filter(t => isSupportedViewFormatCombo(t.format, t.dim))
Expand Down Expand Up @@ -478,7 +475,7 @@ Parameters:
)
.params(u =>
u
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
Expand Down Expand Up @@ -574,7 +571,7 @@ Parameters:
)
.params(u =>
u
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('mode', kShortAddressModes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Samples a texture with a bias to the mip level.
`;

import { makeTestGroup } from '../../../../../../common/framework/test_group.js';
import { kCompressedTextureFormats, kEncodableTextureFormats } from '../../../../../format_info.js';
import { kAllTextureFormats } from '../../../../../format_info.js';
import { TextureTestMixin } from '../../../../../gpu_test.js';

import {
Expand All @@ -35,8 +35,6 @@ import {
skipIfNeedsFilteringAndIsUnfilterable,
} from './texture_utils.js';

const kTestableColorFormats = [...kEncodableTextureFormats, ...kCompressedTextureFormats] as const;

export const g = makeTestGroup(TextureTestMixin(WGSLTextureSampleTest));

g.test('sampled_2d_coords')
Expand All @@ -61,7 +59,7 @@ Parameters:
)
.params(u =>
u
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
Expand Down Expand Up @@ -159,7 +157,7 @@ Parameters:
)
.params(u =>
u
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('dim', ['3d', 'cube'] as const)
.filter(t => isSupportedViewFormatCombo(t.format, t.dim))
Expand Down Expand Up @@ -296,7 +294,7 @@ Parameters:
)
.params(u =>
u
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
Expand Down Expand Up @@ -400,7 +398,7 @@ Parameters:
)
.params(u =>
u
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('mode', kShortAddressModes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Samples a texture using explicit gradients.
`;

import { makeTestGroup } from '../../../../../../common/framework/test_group.js';
import { kCompressedTextureFormats, kEncodableTextureFormats } from '../../../../../format_info.js';
import { kAllTextureFormats } from '../../../../../format_info.js';

import {
appendComponentTypeForFormatToTextureType,
Expand Down Expand Up @@ -34,8 +34,6 @@ import {
WGSLTextureSampleTest,
} from './texture_utils.js';

const kTestableColorFormats = [...kEncodableTextureFormats, ...kCompressedTextureFormats] as const;

export const g = makeTestGroup(WGSLTextureSampleTest);

g.test('sampled_2d_coords')
Expand All @@ -62,7 +60,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
Expand Down Expand Up @@ -161,7 +159,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('dim', ['3d', 'cube'] as const)
.filter(t => isSupportedViewFormatCombo(t.format, t.dim))
Expand Down Expand Up @@ -301,7 +299,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
Expand Down Expand Up @@ -407,7 +405,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('mode', kShortAddressModes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import { makeTestGroup } from '../../../../../../common/framework/test_group.js'
import {
isDepthTextureFormat,
isEncodableTextureFormat,
kCompressedTextureFormats,
kAllTextureFormats,
kDepthStencilFormats,
kEncodableTextureFormats,
} from '../../../../../format_info.js';

import {
Expand Down Expand Up @@ -40,8 +39,6 @@ import {
WGSLTextureSampleTest,
} from './texture_utils.js';

const kTestableColorFormats = [...kEncodableTextureFormats, ...kCompressedTextureFormats] as const;

export const g = makeTestGroup(WGSLTextureSampleTest);

g.test('sampled_2d_coords')
Expand Down Expand Up @@ -71,7 +68,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
Expand Down Expand Up @@ -175,7 +172,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('modeU', kShortAddressModes)
Expand Down Expand Up @@ -283,7 +280,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('dim', ['3d', 'cube'] as const)
.filter(t => isSupportedViewFormatCombo(t.format, t.dim))
Expand Down Expand Up @@ -416,7 +413,7 @@ Parameters:
.params(u =>
u
.combine('stage', kShortShaderStages)
.combine('format', kTestableColorFormats)
.combine('format', kAllTextureFormats)
.filter(t => isPotentiallyFilterableAndFillable(t.format))
.combine('filt', ['nearest', 'linear'] as const)
.combine('mode', kShortAddressModes)
Expand Down
Loading

0 comments on commit dfe2b38

Please sign in to comment.