Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,16 @@ export function graphWeights(height: number, weights: number[]) {
/**
* Validates the weights go from 0 to 1 in increasing order.
*/
function validateWeights(stage: string, weights: number[]) {
const showWeights = () => `
function validateWeights(t: GPUTest, stage: string, weights: number[]) {
const showWeights = t.rec.debugging
? () => `
${weights.map((v, i) => `${i.toString().padStart(2)}: ${v}`).join('\n')}

e = expected
A = actual
${graphWeights(32, weights)}
`;
`
: () => ``;

// Validate the weights
assert(
Expand Down Expand Up @@ -586,8 +588,8 @@ export async function queryMipLevelMixWeightsForDevice(t: GPUTest, stage: Shader

const [sampleLevelWeights, gradWeights] = unzip(result, kNumWeightTypes, 4);

validateWeights(stage, sampleLevelWeights);
validateWeights(stage, gradWeights);
validateWeights(t, stage, sampleLevelWeights);
validateWeights(t, stage, gradWeights);

texture.destroy();
storageBuffer.destroy();
Expand Down