Skip to content

Commit

Permalink
Fix textureSampleLevel tests. (#3903)
Browse files Browse the repository at this point in the history
The tests query the GPUs mip to mip interpolation.
The test that the query was successful was too strict
so this PR relaxes that check.
  • Loading branch information
greggman authored Aug 14, 2024
1 parent 24725f3 commit 701e646
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,12 @@ async function initMipGradientValuesForDevice(t: GPUTest) {
resultBuffer.destroy();

// Validate the weights
assert(weights[0] === 0);
assert(weights[kMipGradientSteps] === 1);
assert(weights[kMipGradientSteps / 2] === 0.5);
assert(weights[0] === 0, 'weight 0 is 0');
assert(weights[kMipGradientSteps] === 1, 'top weight is 1');
assert(
Math.abs(weights[kMipGradientSteps / 2] - 0.5) < 0.0001,
'middle weight is approximately 0.5'
);

// Note: for 16 steps, these are the AMD weights
//
Expand Down

0 comments on commit 701e646

Please sign in to comment.