Skip to content

webgpu: speed up sample_texture_combos - #4690

Merged
haoxli merged 2 commits into
gpuweb:mainfrom
haoxli:speed-sample-texture-combo
Aug 7, 2026
Merged

webgpu: speed up sample_texture_combos#4690
haoxli merged 2 commits into
gpuweb:mainfrom
haoxli:speed-sample-texture-combo

Conversation

@haoxli

@haoxli haoxli commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Render all texels in a single draw call using per-vertex point positioning instead of numAcross*2 setViewport + draw calls, and replace the O(N) select-chain sampling with an O(1) switch so each invocation samples only its own combo. Reduces runtime from ~13s to ~1s.


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.
  • Test descriptions are accurate and complete.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Tests avoid over-parameterization (see case count report).

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

Render all texels in a single draw call using per-vertex point
positioning instead of numAcross*2 setViewport+draw calls, and
replace the O(N) select-chain sampling with an O(1) switch so
each invocation samples only its own combo. Reduces runtime from
~13s to ~1s.
@haoxli
haoxli requested a review from greggman August 6, 2026 05:25
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Results for build job (at 0d3d15c):

 Test case/subcase counts did not change.

@greggman greggman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just the formatting needs fixing

@haoxli

haoxli commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for your review.

@haoxli
haoxli merged commit 2155da5 into gpuweb:main Aug 7, 2026
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