[webkit-changes] [WebKit/WebKit] 857fda: [WebGPU] Implement Buffer::getMappedRange in Swift

Tadeu Zagallo noreply at github.com
Wed Dec 18 09:31:19 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 857fda0f21dec394941acb716fa05dcbbceeb9da
      https://github.com/WebKit/WebKit/commit/857fda0f21dec394941acb716fa05dcbbceeb9da
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2024-12-18 (Wed, 18 Dec 2024)

  Changed paths:
    M Source/WebGPU/WebGPU/Buffer.h
    M Source/WebGPU/WebGPU/Buffer.mm
    M Source/WebGPU/WebGPU/Buffer.swift
    M Source/WebGPU/WebGPU/Internal/WebGPUSwiftInternal.h

  Log Message:
  -----------
  [WebGPU] Implement Buffer::getMappedRange in Swift
https://bugs.webkit.org/show_bug.cgi?id=284162
rdar://141045879

Reviewed by Mike Wyrzykowski.

Add a Swift version of Buffer::getMappedRange and the computeRangeSize helper
function. The implementation is disabled by default. The patch forward declares
`wtf::Range` as a workaround, as importing `<wtf/Range.h>` caused build failures.

Verified that webgpu:api,validation,buffer,mapping:* passes. Also fixed the
precondition in Swift's Buffer::copy as some of the tests were crashing.

* Source/WebGPU/WebGPU/Buffer.h:
* Source/WebGPU/WebGPU/Buffer.mm:
(WebGPU::Buffer::getMappedRange):
* Source/WebGPU/WebGPU/Buffer.swift:
(getMappedRange(_:offset:size:)):
(computeRangeSize(_:offset:)):
(WebGPU.getMappedRange(_:size:)):
* Source/WebGPU/WebGPU/Internal/WebGPUSwiftInternal.h:
(roundUpToMultipleOfNonPowerOfTwoCheckedUInt32UnsignedLong):
(checkedDifferenceUInt64):

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



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


More information about the webkit-changes mailing list