Skip to content

Validate sampling operations on unaligned block-compressed textures. - #4717

Merged
Kangz merged 1 commit into
gpuweb:mainfrom
castano:texture-compression-unaligned-sampling
Oct 7, 2026
Merged

Kangz merged 1 commit into
gpuweb:mainfrom
castano:texture-compression-unaligned-sampling

Conversation

@castano

@castano castano commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes Issue: #4707


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

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Results for build job (at 5f1ad5c):

+webgpu:shader,execution,expression,call,builtin,textureSampleLevel:sampled_2d_coords,compressed_unaligned:* - 600 cases, 1800 subcases (~3/case)
-TOTAL: 287982 cases, 2362149 subcases
+TOTAL: 288582 cases, 2363949 subcases

@castano

castano commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

I finally got some time to look into this. The CTS already had all the machinery needed to test these edge cases, so this is a single new test in textureSampleLevel.spec.ts.

One concern that I have, though, is that checkCallResults uses a softwareTexture that come from createTextureWithRandomDataAndGetTexels and is initialized by reading the compressed texture back using textureLoad to sample every texel. The JS implements filtering and address modes, but not block decoding.

A decode bug that affected textureLoad and textureSampleLevel identically on partial blocks would not be caught. Implementing a software decoder for every block compression format is out of scope for this PR.

@castano
castano marked this pull request as ready for review October 6, 2026 23:03
@castano

castano commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Tested on Chrome Canary 157.0.8089.0 in both core and compatibility mode, on an Apple M4 Pro.

@Kangz Kangz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@Kangz
Kangz merged commit 96e70a5 into gpuweb:main Oct 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