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

Expand textureStorage tests #4039

Merged
merged 1 commit into from
Nov 14, 2024
Merged

Conversation

greggman
Copy link
Contributor

  • test 2d, 2d-array, 3d textures
  • test fragment stages
  • test out of range values

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.

@greggman greggman requested a review from shrekshao November 13, 2024 23:05
Copy link
Contributor

@shrekshao shrekshao left a comment

Choose a reason for hiding this comment

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

Post some questions first

}

@fragment fn fs(v: VOut) -> @location(0) vec4f {
setValue(vec3u(u32(v.pos.x), u32(v.pos.y), v.z));
Copy link
Contributor

Choose a reason for hiding this comment

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

v.pos.xy is in -1, 1 range. I think you want is uint coord here (something like gl_FragCoord from 0 to tex wdith/height)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

v.pos.xy is in texel coordinates (it is gl_FragCoord)

   0.5, 0.5    1.5, 0.5    2.5, 0.5
   0.5, 1.5    1.5, 1.5    2.5, 1.5
   0.5, 2.5    1.5, 2.5    2.5, 2.5

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's confusing because

struct VOut {
  @builtin(position) pos: vec4f;
  ...
};

In the vertex shader this is normalized coord used to computing triangle vertices.
In the fragment shader it's gl_FragCoord.

* test 2d, 2d-array, 3d textures
* test fragment stages
* test out of range values
@greggman greggman force-pushed the textureStorage-w-stages branch from 1c3b760 to 9f3ca8a Compare November 14, 2024 00:32
Copy link
Contributor

@shrekshao shrekshao left a comment

Choose a reason for hiding this comment

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

Thanks for the answer. LGTM

@greggman greggman merged commit 3dbe9f3 into gpuweb:main Nov 14, 2024
1 check passed
@greggman greggman deleted the textureStorage-w-stages branch November 14, 2024 02:44
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