Skip to content

Check clearing of 3d textures when rendering to a slice#4625

Merged
greggman merged 2 commits intogpuweb:mainfrom
greggman:add-3d-slice-clear-tests
Apr 20, 2026
Merged

Check clearing of 3d textures when rendering to a slice#4625
greggman merged 2 commits intogpuweb:mainfrom
greggman:add-3d-slice-clear-tests

Conversation

@greggman
Copy link
Copy Markdown
Contributor

@greggman greggman commented Apr 15, 2026

There was an issue in some browsers where, when rendering to a slice of a 3d texture, they'd mark the entire texture as initialized even though only the individual slice was initialized.

Updated the tests so they check the entire texture. Also updated them to try every format.

Several formats are failing in Chrome even with the latest updated to address this.

Issue: #


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.

@greggman greggman requested a review from kainino0x April 15, 2026 20:21
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Results for build job (at 1451f21):

-webgpu:api,operation,rendering,3d_texture_slices:one_color_attachment,mip_levels:* - 6 cases, 6 subcases (~1/case)
-webgpu:api,operation,rendering,3d_texture_slices:multiple_color_attachments,same_mip_level:* - 2 cases, 8 subcases (~4/case)
-webgpu:api,operation,rendering,3d_texture_slices:multiple_color_attachments,same_slice_with_diff_mip_levels:* - 2 cases, 2 subcases (~1/case)
+webgpu:api,operation,rendering,3d_texture_slices:one_color_attachment,mip_levels:* - 234 cases, 234 subcases (~1/case)
+webgpu:api,operation,rendering,3d_texture_slices:multiple_color_attachments,same_mip_level:* - 78 cases, 312 subcases (~4/case)
+webgpu:api,operation,rendering,3d_texture_slices:multiple_color_attachments,same_slice_with_diff_mip_levels:* - 78 cases, 78 subcases (~1/case)
-TOTAL: 280796 cases, 2322135 subcases
+TOTAL: 281176 cases, 2322743 subcases

Copy link
Copy Markdown
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.

apologies for delay, I got a huge amount of reviews at once on wednesday and this one was a bit hard to read (I still didn't read it super closely but I found the core logic and it looks good)

Comment thread src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts Outdated
Comment thread src/webgpu/api/operation/rendering/3d_texture_slices.spec.ts Outdated
There was an issue in some browsers where, when rendering
to a slice of a 3d texture, they'd mark the entire texture
as initialized even though only the individual slice was
initialized.

Updated the tests so they check the entire texture.
Also updated them to try every format.
@greggman greggman force-pushed the add-3d-slice-clear-tests branch from b21267c to 1451f21 Compare April 20, 2026 17:43
@greggman greggman enabled auto-merge (squash) April 20, 2026 17:43
@greggman greggman merged commit ded8b77 into gpuweb:main Apr 20, 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