diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /dom/webgpu/tests/cts/checkout/src/webgpu/util/texture/texture_ok.ts | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/webgpu/tests/cts/checkout/src/webgpu/util/texture/texture_ok.ts')
-rw-r--r-- | dom/webgpu/tests/cts/checkout/src/webgpu/util/texture/texture_ok.ts | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/util/texture/texture_ok.ts b/dom/webgpu/tests/cts/checkout/src/webgpu/util/texture/texture_ok.ts index 7b85489246..d0267f0627 100644 --- a/dom/webgpu/tests/cts/checkout/src/webgpu/util/texture/texture_ok.ts +++ b/dom/webgpu/tests/cts/checkout/src/webgpu/util/texture/texture_ok.ts @@ -2,7 +2,7 @@ import { assert, ErrorWithExtra, unreachable } from '../../../common/util/util.j import { kTextureFormatInfo, EncodableTextureFormat } from '../../format_info.js'; import { GPUTest } from '../../gpu_test.js'; import { numbersApproximatelyEqual } from '../conversion.js'; -import { generatePrettyTable } from '../pretty_diff_tables.js'; +import { generatePrettyTable, numericToStringBuilder } from '../pretty_diff_tables.js'; import { reifyExtent3D, reifyOrigin3D } from '../unions.js'; import { fullSubrectCoordinates } from './base.js'; @@ -223,11 +223,13 @@ export function findFailedPixels( const info = kTextureFormatInfo[format]; const repr = kTexelRepresentationInfo[format]; - - const integerSampleType = info.sampleType === 'uint' || info.sampleType === 'sint'; - const numberToString = integerSampleType - ? (n: number) => n.toFixed() - : (n: number) => n.toPrecision(6); + // MAINTENANCE_TODO: Print depth-stencil formats as float+int instead of float+float. + const printAsInteger = info.color + ? // For color, pick the type based on the format type + ['uint', 'sint'].includes(info.color.type) + : // Print depth as "float", depth-stencil as "float,float", stencil as "int". + !info.depth; + const numericToString = numericToStringBuilder(printAsInteger); const componentOrderStr = repr.componentOrder.join(',') + ':'; @@ -245,14 +247,14 @@ export function findFailedPixels( yield* [' act. colors', '==', componentOrderStr]; for (const coords of failedPixels) { const pixel = actTexelView.color(coords); - yield `${repr.componentOrder.map(ch => numberToString(pixel[ch]!)).join(',')}`; + yield `${repr.componentOrder.map(ch => numericToString(pixel[ch]!)).join(',')}`; } })(); const printExpectedColors = (function* () { yield* [' exp. colors', '==', componentOrderStr]; for (const coords of failedPixels) { const pixel = expTexelView.color(coords); - yield `${repr.componentOrder.map(ch => numberToString(pixel[ch]!)).join(',')}`; + yield `${repr.componentOrder.map(ch => numericToString(pixel[ch]!)).join(',')}`; } })(); const printActualULPs = (function* () { @@ -272,7 +274,7 @@ export function findFailedPixels( const opts = { fillToWidth: 120, - numberToString, + numericToString, }; return `\ between ${lowerCorner} and ${upperCorner} inclusive: |