Skip to content

Commit

Permalink
Don't test texture_depth_xxx with linear
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 gpuweb#4026
  • Loading branch information
greggman committed Nov 2, 2024
1 parent 8328265 commit 69ea11a
Showing 1 changed file with 8 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -509,15 +509,14 @@ Parameters:
.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)
)
.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 +530,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 +538,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 @@ -595,13 +591,12 @@ Parameters:
.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)
)
.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 +614,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 @@ -693,7 +685,6 @@ Parameters:
.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 +694,9 @@ Parameters:
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
skipIfNeedsFilteringAndIsUnfilterableOrSelectDevice(t, t.params.filt, 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 +712,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 +721,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 @@ -792,7 +779,6 @@ Parameters:
.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)
Expand All @@ -802,7 +788,7 @@ Parameters:
t.skipIfTextureViewDimensionNotSupported('cube-array');
})
.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 +805,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 +813,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

0 comments on commit 69ea11a

Please sign in to comment.