Repository navigation
[naga spv-out] Don't mark multisampled depth images as depth - #7
Open
matthargett wants to merge 1 commit into
Open
matthargett wants to merge 1 commit into
matthargett wants to merge 1 commit into
Conversation
Naga set the `Depth` operand of `OpTypeImage` to 1 for every depth texture type, including `texture_depth_multisampled_2d`. Arm's proprietary Mali driver (seen with r20p0 on a Mali-G52 MC2) fails pipeline creation with VK_ERROR_INITIALIZATION_FAILED for any shader that declares a multisampled image with `Depth` set to 1, whatever the shader does with it. wgpu-hal treats that error as unexpected and panics. Vulkan ignores the operand, and a multisampled image cannot be used with a comparison sampler, so leave it at 0 for multisampled depth images. They then share the SPIR-V type of `texture_multisampled_2d<f32>`. Non-multisampled depth images are unchanged.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connections
Found running the WebGPU CTS with
cts_runneron a Mali-G52 MC2 (Arm proprietary Vulkan 1.1 driverr20p0, Android 10). Other fixes for the same device: #8, #9, #10.Description
Naga sets the
Depthoperand ofOpTypeImageto 1 fortexture_depth_multisampled_2d. This driver then fails pipeline creation withVK_ERROR_INITIALIZATION_FAILEDfor any shader that declares one, whatever the shader does with it. Non-multisampled depth images andtexture_multisampled_2d<f32>are fine.Vulkan ignores the operand, and a multisampled image can't be used with a comparison sampler, so this leaves it at 0 for multisampled depth images. Other depth images are unchanged.
Testing
cargo fmt --checkand clippy for naga are clean; all 423 naga tests pass, with four SPIR-V snapshots updated.cts_runnerbuilt from trunk60cef2be8and from this branch:textureNumSamples(execution) and the compute and renderresource_compatibilityselectors, 199 cases: on trunk four of nine processes abort and 139 cases report a result; all 199 pass with this branch.cts_runner/test.lston the device (54,915 of 54,931 cases; 16 left out to protect the phone's memory): 45,478 pass, 86 fail, 9,351 skip. 85 of the failures are in selectors markedfails-if(vulkan).Squash or Rebase?
Single commit.
LLM Use?
Claude Code (Claude Mythos 5.2) found the failure on the device, reduced it to the probes in the image, wrote the change, ran the tests and drafted this description.