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

CopyEI2T: Cases To Cover Rotated Images #4111

Merged
merged 13 commits into from
Jan 7, 2025
Merged

Conversation

shaoboyan091
Copy link
Contributor

@shaoboyan091 shaoboyan091 commented Dec 19, 2024

This PR created images with rotation metadata. It tests using CopyEI2T to upload image and imageBitmap with 'from-image' orientation flag.

Issue: #4108


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.

This PR created images with rotation metadata. It tests using
CopyEI2T to upload image and imageBitmap with 'from-image' orientation
flag.

Issue:#4180
@shaoboyan091
Copy link
Contributor Author

Seems I cannot add reviewers in right side bar. Explicit @kainino0x @beaufortfrancois for reviewing.

Copy link
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

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

Test code lgtm, but a few comments

src/resources/README.md Show resolved Hide resolved
src/webgpu/web_platform/copyToTexture/image.spec.ts Outdated Show resolved Hide resolved
xhr.open('GET', url);
xhr.responseType = 'blob';
xhr.onerror = function () {
reject(new Error('Network error.'));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kainino0x I'm not sure what's the best way to handle this reject case. Do you have any suggestions?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks good, we want any error case to fail the test.

However I don't think XHR should ever be need, rather than fetch() + .blob():
https://developer.mozilla.org/en-US/docs/Web/API/Response/blob

(I'm surprised to see we don't already have any code that uses fetch(), but it seems the only place we use a still-image resource uses HTMLImageElement.)

Copy link
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

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

LGTM with a pile of small things

src/resources/README.md Outdated Show resolved Hide resolved
xhr.open('GET', url);
xhr.responseType = 'blob';
xhr.onerror = function () {
reject(new Error('Network error.'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks good, we want any error case to fail the test.

However I don't think XHR should ever be need, rather than fetch() + .blob():
https://developer.mozilla.org/en-US/docs/Web/API/Response/blob

(I'm surprised to see we don't already have any code that uses fetch(), but it seems the only place we use a still-image resource uses HTMLImageElement.)

src/webgpu/web_platform/util.ts Outdated Show resolved Hide resolved
src/webgpu/web_platform/util.ts Show resolved Hide resolved
src/webgpu/web_platform/util.ts Outdated Show resolved Hide resolved
src/webgpu/web_platform/util.ts Outdated Show resolved Hide resolved
src/webgpu/web_platform/util.ts Outdated Show resolved Hide resolved
src/webgpu/web_platform/util.ts Outdated Show resolved Hide resolved
src/webgpu/web_platform/util.ts Outdated Show resolved Hide resolved
@shaoboyan091 shaoboyan091 requested a review from kainino0x January 6, 2025 06:28
src/webgpu/web_platform/util.ts Show resolved Hide resolved
src/webgpu/web_platform/util.ts Outdated Show resolved Hide resolved
@kainino0x kainino0x enabled auto-merge (squash) January 7, 2025 01:55
@kainino0x
Copy link
Collaborator

FYI I sent your new account an invite to gpuweb (https://github.com/orgs/gpuweb/people) so you should be able to land changes once you accept it.

@shaoboyan091
Copy link
Contributor Author

@kainino0x Thanks!

FYI I sent your new account an invite to gpuweb (https://github.com/orgs/gpuweb/people) so you should be able to land changes once you accept it.

Where can I find the invitation so that I could accept it?

@kainino0x
Copy link
Collaborator

@shaoboyan091 it should be sent to the primary email address on your github account. I think this link should work:
https://github.com/orgs/gpuweb/invitation (I can't verify because there's no open invitation for me to join the org)

@kainino0x kainino0x merged commit 10b66cd into gpuweb:main Jan 7, 2025
1 check passed
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