Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test texture mix weights separately #4051

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

greggman
Copy link
Contributor

@greggman greggman commented Nov 20, 2024

Before this change, the texture builtin utils would query how the local GPU mixes texture mip levels. It expected that to be close to a linear interpolation which is true for most GPUs. The known exceptions are Mac AMD and Mac Intel in a compute stage.

It would check how far from linear interpolation the weights are. If the weights were too far off linear interpolation it would assert.

With this change, those asserts for linear interpolation are moved from all the tests that use these weights to a separate test.

This allows the texture builtin tests to run further on devices that have bad mix weights with the new test at least documenting a particular GPU's failure to implement linear interpolation between mip levels.


Requirements for PR author:

  • All missing test coverage is tracked with "TODO" or .unimplemented().
  • New helpers are /** documented */ and new helper files are found in helper_index.txt.
  • Test behaves as expected in a WebGPU implementation. (If not passing, explain above.)
  • Test have be tested with compatibility mode validation enabled and behave as expected. (If not passing, explain above.)

Requirements for reviewer sign-off:

  • Tests are properly located in the test tree.
  • Test descriptions allow a reader to "read only the test plans and evaluate coverage completeness", and accurately reflect the test code.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Helpers and types promote readability and maintainability.

When landing this PR, be sure to make any necessary issue status updates.

Before this change, the texture builtin utils would query
how the local GPU mixes texture mip levels. It expected
that to be close to a linear interpolation which is true
for most GPUs. The known exceptions are Mac AMD and Mac
Intel in a compute stage.

It would check how far from linear iterpolation the weights
are. If the weights were too far off linear interpolation
it would assert.

With this case, those asserts for linear interpolation are
moved from all the tests that use these weights to a separate
test.

This allows the texture builtin tests to run further on devices
that have bad mix weights with the new test at least documenting
a particular GPU's failure to implement linear interpolation
between mip levels.
@greggman greggman requested a review from kainino0x November 20, 2024 03:41
@greggman greggman enabled auto-merge (squash) November 20, 2024 06:02
@greggman greggman disabled auto-merge November 20, 2024 06:04
@greggman greggman force-pushed the test-for-bad-weights-allow-bad branch from 485d591 to 0ce13d7 Compare November 20, 2024 06:09
@greggman greggman enabled auto-merge (squash) November 20, 2024 06:10
@greggman greggman merged commit bc88622 into gpuweb:main Nov 20, 2024
1 check passed
@greggman greggman deleted the test-for-bad-weights-allow-bad branch November 20, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants