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

  Changed paths:
    M Source/WebGPU/WebGPU/Adapter.mm
    M Source/WebGPU/WebGPU/Device.h
    M Source/WebGPU/WebGPU/Device.mm
    M Source/WebGPU/WebGPU/HardwareCapabilities.h
    M Source/WebGPU/WebGPU/HardwareCapabilities.mm
    M Source/WebGPU/WebGPU/RenderPipeline.mm

  Log Message:
  -----------
  WebGPU: Do not store WGPULimits in HardwareCapabilities
https://bugs.webkit.org/show_bug.cgi?id=325276
rdar://188381320

Reviewed by Mike Wyrzykowski.

HardwareCapabilities stored the limits as a WGPULimits API struct, and
Device and Adapter handed out references to it. Storing API structs in
implementation objects is poor form: the structs communicate the wgpu
API call parameters and results for the duration of the call only.
WGPULimits has no pointer fields today, but in the standard webgpu.h it
has nextInChain, which would dangle in the stored copy.

Store an internal Limits struct with the same fields instead. Convert
with fromAPI() for the requested limits in Adapter::requestDevice, and
with toAPI() in wgpuAdapterGetLimits, wgpuDeviceGetLimits and
wgpuDefaultLimits.

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

* Source/WebGPU/WebGPU/Adapter.mm:
(WebGPU::Adapter::getLimits):
(WebGPU::Adapter::requestDevice):
* Source/WebGPU/WebGPU/Device.h:
(WebGPU::Device::limits const):
(WebGPU::Device::limitsCopy const):
* Source/WebGPU/WebGPU/Device.mm:
(WebGPU::Device::getLimits):
* Source/WebGPU/WebGPU/HardwareCapabilities.h:
* Source/WebGPU/WebGPU/HardwareCapabilities.mm:
(WebGPU::mergeLimits):
(WebGPU::anyLimitIsBetterThan):
(WebGPU::defaultLimits):
(WebGPU::isValid):
(WebGPU::fromAPI):
(WebGPU::toAPI):
(wgpuDefaultLimits):
* Source/WebGPU/WebGPU/RenderPipeline.mm:
(WebGPU::createVertexDescriptor):

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



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

Reply via email to