Invalid render pass usage leads to crashes in the WebGPU Swift backend#59661
Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom Mar 2, 2026
Merged
Invalid render pass usage leads to crashes in the WebGPU Swift backend#59661webkit-commit-queue merged 1 commit intoWebKit:mainfrom
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Conversation
Collaborator
|
EWS run on previous version of this PR (hash 6df40a1) Details
|
Collaborator
|
EWS run on current version of this PR (hash 744164d) Details |
lilyspiniolas
approved these changes
Mar 1, 2026
Contributor
|
Is this testable? |
aprotyas
approved these changes
Mar 1, 2026
Contributor
It should be covered by LayoutTests/fast/webgpu/nocrash/fuzz-283006.html but it's not clear to me that WebGPU Swift is running in EWS yet due to compiler requirements. |
mwyrzykowski
approved these changes
Mar 1, 2026
Contributor
mwyrzykowski
left a comment
There was a problem hiding this comment.
Thank you for fixing! :) This matches the objective-C++ backend now:
mtlDescriptor.defaultRasterSampleCount = metalDepthStencilTexture.sampleCount;
if (!mtlDescriptor.defaultRasterSampleCount)
return RenderPassEncoder::createInvalid(*this, m_device, @"no color targets and depth-stencil texture is nil");
mtlDescriptor.renderTargetWidth = metalDepthStencilTexture.width;
mtlDescriptor.renderTargetHeight = metalDepthStencilTexture.height;
https://bugs.webkit.org/show_bug.cgi?id=308471 rdar://170997914 Reviewed by Mike Wyrzykowski, Lily Spiniolas, and Abrar Rahman Protyasha. Check that metalDepthStencilTexture is non-nil and has a sampleCount greater than 0 instead of assuming it is non-nil and force unwrapping it. This matches the non-Swift implementation logic. Also fix a swift-format formatting error in `USDModel.swift`. * Source/WebGPU/WebGPU/CommandEncoder.swift: (WebGPU.beginRenderPass(_:)): * Source/WebKit/GPUProcess/graphics/Model/USDModel.swift: Canonical link: https://commits.webkit.org/308434@main
744164d to
ff519ea
Compare
Collaborator
|
Committed 308434@main (ff519ea): https://commits.webkit.org/308434@main Reviewed commits have been landed. Closing PR #59661 and removing active labels. |
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.
ff519ea
744164d