Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 29dc3ab6691480185716a98b13ea752b4ede85be
https://github.com/WebKit/WebKit/commit/29dc3ab6691480185716a98b13ea752b4ede85be
Author: Geoffrey Garen <[email protected]>
Date: 2025-09-24 (Wed, 24 Sep 2025)
Changed paths:
M Source/WebGPU/WebGPU/Buffer.swift
M Source/WebGPU/WebGPU/CommandEncoder.swift
M Source/WebGPU/WebGPU/Queue.h
M Source/WebGPU/WebGPU/Queue.mm
M Source/WebGPU/WebGPU/Queue.swift
Log Message:
-----------
Reduce use of 'unsafe' in WebGPU+Swift
https://bugs.webkit.org/show_bug.cgi?id=299472
rdar://161268232
Reviewed by Mike Wyrzykowski.
* Source/WebGPU/WebGPU/Buffer.swift:
(Buffer_getMappedRange_thunk(_:offset:size:)): Compiler said this 'unsafe'
wasn't needed.
* Source/WebGPU/WebGPU/CommandEncoder.swift:
(CommandEncoder_copyBufferToTexture_thunk(_:source:destination:copySize:)):
(CommandEncoder_copyTextureToBuffer_thunk(_:source:destination:copySize:)):
Style fixups.
(WebGPU.beginRenderPass(_:)): Use 'let' instead of 'var' to address a warning.
(WebGPU.beginComputePass(_:)): Compiler said this 'unsafe' wasn't needed.
* Source/WebGPU/WebGPU/Queue.h: Use a thunk for writeBuffer to match our
standard
pattern and avoid an extra wrapper function. Remove 'const' from
newTemporaryBufferWithBytes
because it doesn't do anything.
* Source/WebGPU/WebGPU/Queue.mm:
(WebGPU::Queue::writeBuffer): No need for two code paths at the call site now
that we have a thunk.
* Source/WebGPU/WebGPU/Queue.swift:
(Queue_writeBuffer_thunk(_:buffer:bufferOffset:data:)): Move the conversion to
Swift Span into the thunk, to make clearer that the unsafety is at the point of
conversion.
(WebGPU.writeBuffer(_:bufferOffset:data:)): Use '_' to address a warning about
an unused variable. Removed some unsafe because we're using a safe
MutableSpan<T>
now.
Canonical link: https://commits.webkit.org/300492@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes