Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2b37cc8a5a136adc3dd5929ab7cc2a12be39f926
      
https://github.com/WebKit/WebKit/commit/2b37cc8a5a136adc3dd5929ab7cc2a12be39f926
  Author: Kimmo Kinnunen <[email protected]>
  Date:   2026-09-24 (Thu, 24 Sep 2026)

  Changed paths:
    M Source/WebGPU/WebGPU/RenderBundle.h
    M Source/WebGPU/WebGPU/RenderBundle.mm
    M Source/WebGPU/WebGPU/RenderBundleEncoder.h
    M Source/WebGPU/WebGPU/RenderBundleEncoder.mm
    M Source/WebGPU/WebGPU/RenderPipeline.h
    M Source/WebGPU/WebGPU/RenderPipeline.mm

  Log Message:
  -----------
  WebGPU: Do not store WGPURenderBundleEncoderDescriptor in RenderBundleEncoder 
and RenderBundle
https://bugs.webkit.org/show_bug.cgi?id=325145
rdar://188278917

Reviewed by Mike Wyrzykowski.

RenderBundleEncoder stored a copy of the WGPURenderBundleEncoderDescriptor
it was created with, and passed that copy to RenderBundle, which stored
another copy. 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 copies' label string views dangled. The
colorFormats pointer was fixed up to point to a member vector.

Store the fields that are read instead: colorFormats,
depthStencilFormat, sampleCount, depthReadOnly and stencilReadOnly.
Pass them to RenderBundle and RenderPipeline::validateRenderBundle
instead of the descriptor.

This is work towards being able to add nextInChain to the WebGPU.h
descriptors.

* Source/WebGPU/WebGPU/RenderBundle.h:
(WebGPU::RenderBundle::create):
* Source/WebGPU/WebGPU/RenderBundle.mm:
(WebGPU::RenderBundle::RenderBundle):
(WebGPU::RenderBundle::validateRenderPass const):
* Source/WebGPU/WebGPU/RenderBundleEncoder.h:
* Source/WebGPU/WebGPU/RenderBundleEncoder.mm:
(WebGPU::RenderBundleEncoder::RenderBundleEncoder):
(WebGPU::RenderBundleEncoder::drawIndexed):
(WebGPU::RenderBundleEncoder::drawIndexedIndirect):
(WebGPU::RenderBundleEncoder::drawIndirect):
(WebGPU::RenderBundleEncoder::finish):
(WebGPU::RenderBundleEncoder::setPipeline):
* Source/WebGPU/WebGPU/RenderPipeline.h:
* Source/WebGPU/WebGPU/RenderPipeline.mm:
(WebGPU::RenderPipeline::validateRenderBundle const):

Canonical link: https://commits.webkit.org/321819@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to