Skip to content

Commit

Permalink
Don't identify sample points for texture builtin (gpuweb#3937)
Browse files Browse the repository at this point in the history
unless the debug option is passed in to the tests.
  • Loading branch information
greggman authored Sep 6, 2024
1 parent ccab92d commit eca9b0d
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 145 deletions.
2 changes: 1 addition & 1 deletion src/common/internal/logging/test_case_recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class TestCaseRecorder {
private startTime = -1;
private logs: LogMessageWithStack[] = [];
private logLinesAtCurrentSeverity = 0;
private debugging = false;
public debugging = false;

constructor(result: LiveTestCaseResult, debugging: boolean) {
this.result = result;
Expand Down
220 changes: 110 additions & 110 deletions src/resources/cache/hashes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified src/resources/cache/webgpu/shader/execution/bitcast.bin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1431,41 +1431,44 @@ export async function checkCallResults<T extends Dimensionality>(
`);

if (sampler) {
const expectedSamplePoints = [
'expected:',
...(await identifySamplePoints(texture, call, (texels: TexelView[]) => {
return Promise.resolve(
softwareTextureReadLevel(
t,
call,
{
texels,
descriptor: texture.descriptor,
viewDescriptor: texture.viewDescriptor,
},
sampler,
call.mipLevel ?? 0
)
);
})),
];
const gotSamplePoints = [
'got:',
...(await identifySamplePoints(texture, call, async (texels: TexelView[]) => {
const gpuTexture = createTextureFromTexelViewsLocal(t, texels, texture.descriptor);
const result = (await results.run(gpuTexture))[callIdx];
gpuTexture.destroy();
return result;
})),
];
errs.push(' sample points:');
errs.push(layoutTwoColumns(expectedSamplePoints, gotSamplePoints).join('\n'));
errs.push('', '');

// This path is slow so if we took it, don't report the other errors. One is enough
// to fail the test.
break;
if (t.rec.debugging) {
const expectedSamplePoints = [
'expected:',
...(await identifySamplePoints(texture, call, (texels: TexelView[]) => {
return Promise.resolve(
softwareTextureReadLevel(
t,
call,
{
texels,
descriptor: texture.descriptor,
viewDescriptor: texture.viewDescriptor,
},
sampler,
call.mipLevel ?? 0
)
);
})),
];
const gotSamplePoints = [
'got:',
...(await identifySamplePoints(texture, call, async (texels: TexelView[]) => {
const gpuTexture = createTextureFromTexelViewsLocal(t, texels, texture.descriptor);
const result = (await results.run(gpuTexture))[callIdx];
gpuTexture.destroy();
return result;
})),
];
errs.push(' sample points:');
errs.push(layoutTwoColumns(expectedSamplePoints, gotSamplePoints).join('\n'));
errs.push('', '');
}
} // if (sampler)

// Don't report the other errors. There 50 sample points per subcase and
// 50-100 subcases so the log would get enormous if all 50 fail. One
// report per subcase is enough.
break;
} // if (bad)
} // for cellNdx

Expand Down

0 comments on commit eca9b0d

Please sign in to comment.