Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ad94584f0907fb464335ffe300bf93395a7ee997
https://github.com/WebKit/WebKit/commit/ad94584f0907fb464335ffe300bf93395a7ee997
Author: Kimmo Kinnunen <[email protected]>
Date: 2026-09-28 (Mon, 28 Sep 2026)
Changed paths:
M Source/WebGPU/WebGPU/RenderBundle.h
M Source/WebGPU/WebGPU/RenderBundle.mm
M Source/WebGPU/WebGPU/RenderPassEncoder.h
M Source/WebGPU/WebGPU/RenderPassEncoder.mm
M Source/WebGPU/WebGPU/RenderPipeline.h
M Source/WebGPU/WebGPU/RenderPipeline.mm
Log Message:
-----------
WebGPU: Do not store WGPURenderPassDescriptor in RenderPassEncoder
https://bugs.webkit.org/show_bug.cgi?id=325182
rdar://188316353
Reviewed by Mike Wyrzykowski.
RenderPassEncoder stored a copy of the WGPURenderPassDescriptor it was
created with, along with copies of the color and depth stencil
attachments. Storing API descriptors in implementation objects is poor
form: the descriptors communicate the wgpu API call parameters for the
duration of the call only, and pointer fields of the copy dangle after
the call returns. Here the copy's label, timestampWrites and the
attachment and occlusionQuerySet handles were stored unretained. The
colorAttachments and depthStencilAttachment pointers were fixed up to
point to member copies.
The only fields read were colorAttachmentCount and whether
depthStencilAttachment was set. These are already implied by
m_colorAttachmentViews, which has one entry per color attachment, and
m_depthStencilView, which is set exactly when depthStencilAttachment
is set. Remove the copies and drop the descriptor parameter from
RenderBundle::validateRenderPass and
RenderPipeline::errorValidatingColorDepthStencilTargets.
This is work towards being able to add nextInChain to the WebGPU.h
descriptors.
* Source/WebGPU/WebGPU/RenderBundle.h:
* Source/WebGPU/WebGPU/RenderBundle.mm:
(WebGPU::RenderBundle::validateRenderPass const):
* Source/WebGPU/WebGPU/RenderPassEncoder.h:
* Source/WebGPU/WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::RenderPassEncoder):
(WebGPU::RenderPassEncoder::splitRenderPass):
(WebGPU::RenderPassEncoder::executeBundles):
(WebGPU::RenderPassEncoder::errorValidatingColorDepthStencilTargets const):
* Source/WebGPU/WebGPU/RenderPipeline.h:
* Source/WebGPU/WebGPU/RenderPipeline.mm:
(WebGPU::RenderPipeline::errorValidatingColorDepthStencilTargets const):
Canonical link: https://commits.webkit.org/322054@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications