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

op: Implement 'filter_mode,minFilter' test in filter_mode.spec.ts #2090

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Gyuyoung
Copy link
Collaborator

This PR adds a new test to ensure that the operation of minFilter works as expected.

Issue: #2023


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.)

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.

@Gyuyoung Gyuyoung force-pushed the filter-mode-minFilter branch from 48368fb to 73cf468 Compare December 17, 2022 13:00
@github-actions
Copy link

Previews, as seen when this build job started (48368fb):
Run tests | View tsdoc

@github-actions
Copy link

Previews, as seen when this build job started (73cf468):
Run tests | View tsdoc

This PR adds a new test to test that mipmapFilter affects drawing the
slanted plane with different filter modes.

Issue: gpuweb#2070
@Gyuyoung Gyuyoung force-pushed the filter-mode-minFilter branch from 73cf468 to 13d9899 Compare December 23, 2022 07:26
@github-actions
Copy link

Previews, as seen when this build job started (13d9899):
Run tests | View tsdoc


export const g = makeTestGroup(SamplerFilterModeSlantedPlaneTest);

g.test('mipmapFilter')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I couldn't find a proper way to test the filter modes yet. I aimed to write a test that filter mode affected the expected colors in drawing the slanted plane. But, the filter modes(mipmapFilter first for now) didn't affect the expected result. Could you please give me any idea or comment on how to test the fooFilter affects the expected color?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be useful to visualize the colorAttachment. Unfortunately we never managed to add good facilities for this - I think I started writing some but never finished.

When running in a browser, you can hack in code to visualize it, e.g. add a canvas to the document.body and change drawSlantedPlane to get its attachment from getCurrentTexture instead of createTexture. Example:

Gyuyoung/cts@filter-mode-minFilter...kainino0x:cts:example-visualization
Here you can see there is a slight difference in the result (but it's subtle):

image linear
image nearest

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for giving me more information. I don't find a way to test it yet. Let me take a look at this more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gyuyoung Gyuyoung requested a review from kainino0x December 23, 2022 07:40
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