Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e9c7ae85d4e6160eb48afa895fd3b48b3f6f51d1
https://github.com/WebKit/WebKit/commit/e9c7ae85d4e6160eb48afa895fd3b48b3f6f51d1
Author: Kimmo Kinnunen <[email protected]>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
M Source/WebGPU/WebGPU/RenderPipeline.h
M Source/WebGPU/WebGPU/RenderPipeline.mm
Log Message:
-----------
WebGPU: Do not store WGPURenderPipelineDescriptor in RenderPipeline
https://bugs.webkit.org/show_bug.cgi?id=325181
rdar://188313394
Reviewed by Mike Wyrzykowski.
RenderPipeline stored a copy of the WGPURenderPipelineDescriptor it was
created with. 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, the vertex and fragment
entryPoint strings, constants and vertex buffer layouts dangled, and the
layout and shader module handles were stored unretained. The
depthStencil, fragment and fragment targets pointers were fixed up to
point to member copies.
Store the fields that are read instead: primitive topology, primitive
strip index format, multisample count, whether there is a fragment
state, the fragment target formats and the depth stencil format.
Compute writesStencil from the descriptor in
Device::createRenderPipeline and pass it to the constructor, so that
recomputeLastStrideAsStride() can pass the stored value.
This is work towards being able to add nextInChain to the WebGPU.h
descriptors.
* Source/WebGPU/WebGPU/RenderPipeline.h:
(WebGPU::RenderPipeline::create):
(WebGPU::RenderPipeline::primitiveTopology const):
(WebGPU::RenderPipeline::stripIndexFormat const):
* Source/WebGPU/WebGPU/RenderPipeline.mm:
(WebGPU::colorTargetFormats):
(WebGPU::writesStencil):
(WebGPU::Device::createRenderPipeline):
(WebGPU::RenderPipeline::RenderPipeline):
(WebGPU::RenderPipeline::errorValidatingColorDepthStencilTargets const):
(WebGPU::RenderPipeline::validateRenderBundle const):
(WebGPU::RenderPipeline::recomputeLastStrideAsStride const):
Canonical link: https://commits.webkit.org/321877@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications