[webkit-changes] [WebKit/WebKit] 48ab5b: [WebGPU] Safe C++ adaption of APIConversions.h

mwyrzykowski noreply at github.com
Thu Oct 24 20:16:08 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 48ab5be919c779b4eec88a79c3fc2703c4e17346
      https://github.com/WebKit/WebKit/commit/48ab5be919c779b4eec88a79c3fc2703c4e17346
  Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
  Date:   2024-10-24 (Thu, 24 Oct 2024)

  Changed paths:
    M Source/WebGPU/WebGPU/APIConversions.h
    M Source/WebGPU/WebGPU/Adapter.mm
    M Source/WebGPU/WebGPU/BindGroup.mm
    M Source/WebGPU/WebGPU/BindGroupLayout.mm
    M Source/WebGPU/WebGPU/Buffer.mm
    M Source/WebGPU/WebGPU/CommandBuffer.mm
    M Source/WebGPU/WebGPU/CommandEncoder.mm
    M Source/WebGPU/WebGPU/ComputePassEncoder.mm
    M Source/WebGPU/WebGPU/ComputePipeline.mm
    M Source/WebGPU/WebGPU/Device.mm
    M Source/WebGPU/WebGPU/ExternalTexture.mm
    M Source/WebGPU/WebGPU/Instance.mm
    M Source/WebGPU/WebGPU/IsValidToUseWith.h
    M Source/WebGPU/WebGPU/PipelineLayout.mm
    M Source/WebGPU/WebGPU/PresentationContext.mm
    M Source/WebGPU/WebGPU/QuerySet.mm
    M Source/WebGPU/WebGPU/Queue.mm
    M Source/WebGPU/WebGPU/RenderBundle.mm
    M Source/WebGPU/WebGPU/RenderBundleEncoder.mm
    M Source/WebGPU/WebGPU/RenderPassEncoder.mm
    M Source/WebGPU/WebGPU/RenderPipeline.mm
    M Source/WebGPU/WebGPU/Sampler.mm
    M Source/WebGPU/WebGPU/ShaderModule.mm
    M Source/WebGPU/WebGPU/Texture.mm
    M Source/WebGPU/WebGPU/TextureView.mm
    M Source/WebGPU/WebGPU/XRBinding.mm
    M Source/WebGPU/WebGPU/XRProjectionLayer.mm
    M Source/WebGPU/WebGPU/XRSubImage.mm
    M Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.cpp

  Log Message:
  -----------
  [WebGPU] Safe C++ adaption of APIConversions.h
https://bugs.webkit.org/show_bug.cgi?id=281888
rdar://138358898

Reviewed by Geoffrey Garen.

Static analyzer indicated APIConversions resulted in warnings, correct
them all by switching the return type of fromAPI to Ref<T> from T&.

* Source/WebGPU/WebGPU/APIConversions.h:
(WebGPU::fromAPI):
* Source/WebGPU/WebGPU/Adapter.mm:
(wgpuAdapterReference):
(wgpuAdapterRelease):
(wgpuAdapterEnumerateFeatures):
(wgpuAdapterGetLimits):
(wgpuAdapterGetProperties):
(wgpuAdapterHasFeature):
(wgpuAdapterRequestDevice):
(wgpuAdapterRequestDeviceWithBlock):
(wgpuAdapterXRCompatible):
* Source/WebGPU/WebGPU/BindGroup.mm:
(WebGPU::makeBindGroupEntryUsageData):
(WebGPU::Device::createBindGroup):
(wgpuBindGroupReference):
(wgpuBindGroupRelease):
(wgpuBindGroupSetLabel):
(wgpuBindGroupUpdateExternalTextures):
* Source/WebGPU/WebGPU/BindGroupLayout.mm:
(wgpuBindGroupLayoutReference):
(wgpuBindGroupLayoutRelease):
(wgpuBindGroupLayoutSetLabel):
* Source/WebGPU/WebGPU/Buffer.mm:
(wgpuBufferReference):
(wgpuBufferRelease):
(wgpuBufferDestroy):
(wgpuBufferGetMapState):
(wgpuBufferGetMappedRange):
(wgpuBufferGetBufferContents):
(wgpuBufferGetInitialSize):
(wgpuBufferGetCurrentSize):
(wgpuBufferMapAsync):
(wgpuBufferMapAsyncWithBlock):
(wgpuBufferUnmap):
(wgpuBufferSetLabel):
(wgpuBufferGetUsage):
(wgpuBufferCopy):
* Source/WebGPU/WebGPU/CommandBuffer.mm:
(wgpuCommandBufferReference):
(wgpuCommandBufferRelease):
(wgpuCommandBufferSetLabel):
* Source/WebGPU/WebGPU/CommandEncoder.mm:
(WebGPU::errorValidatingTimestampWrites):
(WebGPU::CommandEncoder::errorValidatingRenderPassDescriptor const):
(WebGPU::CommandEncoder::beginRenderPass):
(WebGPU::CommandEncoder::errorValidatingImageCopyBuffer const):
(WebGPU::CommandEncoder::errorValidatingCopyBufferToTexture const):
(WebGPU::CommandEncoder::copyBufferToTexture):
(WebGPU::CommandEncoder::errorValidatingCopyTextureToBuffer const):
(WebGPU::CommandEncoder::clearTextureIfNeeded):
(WebGPU::CommandEncoder::copyTextureToBuffer):
(WebGPU::errorValidatingCopyTextureToTexture):
(WebGPU::CommandEncoder::copyTextureToTexture):
(wgpuCommandEncoderReference):
(wgpuCommandEncoderRelease):
(wgpuCommandEncoderBeginComputePass):
(wgpuCommandEncoderBeginRenderPass):
(wgpuCommandEncoderCopyBufferToBuffer):
(wgpuCommandEncoderCopyBufferToTexture):
(wgpuCommandEncoderCopyTextureToBuffer):
(wgpuCommandEncoderCopyTextureToTexture):
(wgpuCommandEncoderClearBuffer):
(wgpuCommandEncoderFinish):
(wgpuCommandEncoderInsertDebugMarker):
(wgpuCommandEncoderPopDebugGroup):
(wgpuCommandEncoderPushDebugGroup):
(wgpuCommandEncoderResolveQuerySet):
(wgpuCommandEncoderWriteTimestamp):
(wgpuCommandEncoderSetLabel):
* Source/WebGPU/WebGPU/ComputePassEncoder.mm:
(wgpuComputePassEncoderReference):
(wgpuComputePassEncoderRelease):
(wgpuComputePassEncoderDispatchWorkgroups):
(wgpuComputePassEncoderDispatchWorkgroupsIndirect):
(wgpuComputePassEncoderEnd):
(wgpuComputePassEncoderInsertDebugMarker):
(wgpuComputePassEncoderPopDebugGroup):
(wgpuComputePassEncoderPushDebugGroup):
(wgpuComputePassEncoderSetBindGroup):
(wgpuComputePassEncoderSetPipeline):
(wgpuComputePassEncoderSetLabel):
* Source/WebGPU/WebGPU/ComputePipeline.mm:
(wgpuComputePipelineReference):
(wgpuComputePipelineRelease):
(wgpuComputePipelineGetBindGroupLayout):
(wgpuComputePipelineSetLabel):
* Source/WebGPU/WebGPU/Device.mm:
* Source/WebGPU/WebGPU/ExternalTexture.mm:
(wgpuExternalTextureReference):
(wgpuExternalTextureRelease):
(wgpuExternalTextureDestroy):
(wgpuExternalTextureUndestroy):
(wgpuExternalTextureUpdate):
* Source/WebGPU/WebGPU/Instance.mm:
(wgpuInstanceReference):
(wgpuInstanceRelease):
(wgpuInstanceCreateSurface):
(wgpuInstanceProcessEvents):
(wgpuInstanceRequestAdapter):
(wgpuInstanceRequestAdapterWithBlock):
(wgpuBufferIsValid):
(wgpuAdapterIsValid):
(wgpuBindGroupIsValid):
(wgpuBindGroupLayoutIsValid):
(wgpuCommandBufferIsValid):
(wgpuCommandEncoderIsValid):
(wgpuComputePassEncoderIsValid):
(wgpuComputePipelineIsValid):
(wgpuDeviceIsValid):
(wgpuExternalTextureIsValid):
(wgpuPipelineLayoutIsValid):
(wgpuPresentationContextIsValid):
(wgpuQuerySetIsValid):
(wgpuQueueIsValid):
(wgpuRenderBundleEncoderIsValid):
(wgpuRenderBundleIsValid):
(wgpuRenderPassEncoderIsValid):
(wgpuRenderPipelineIsValid):
(wgpuSamplerIsValid):
(wgpuShaderModuleIsValid):
(wgpuTextureIsValid):
(wgpuTextureViewIsValid):
(wgpuXRBindingIsValid):
(wgpuXRSubImageIsValid):
(wgpuXRProjectionLayerIsValid):
(wgpuXRViewIsValid):
* Source/WebGPU/WebGPU/IsValidToUseWith.h:
(WebGPU::isValidToUseWith):
* Source/WebGPU/WebGPU/PipelineLayout.mm:
(wgpuPipelineLayoutReference):
(wgpuPipelineLayoutRelease):
(wgpuPipelineLayoutSetLabel):
* Source/WebGPU/WebGPU/PresentationContext.mm:
(wgpuSurfaceReference):
(wgpuSurfaceRelease):
(wgpuSwapChainReference):
(wgpuSwapChainRelease):
(wgpuSurfaceGetPreferredFormat):
(wgpuSwapChainGetCurrentTexture):
(wgpuSwapChainGetCurrentTextureView):
(wgpuSwapChainPresent):
(wgpuSwapChainGetTextureAsNativeImage):
* Source/WebGPU/WebGPU/QuerySet.mm:
(wgpuQuerySetReference):
(wgpuQuerySetRelease):
(wgpuQuerySetDestroy):
(wgpuQuerySetSetLabel):
(wgpuQuerySetGetCount):
(wgpuQuerySetGetType):
* Source/WebGPU/WebGPU/Queue.mm:
(WebGPU::Queue::clearTextureIfNeeded):
(WebGPU::Queue::writeTexture):
(wgpuQueueReference):
(wgpuQueueRelease):
(wgpuQueueOnSubmittedWorkDone):
(wgpuQueueOnSubmittedWorkDoneWithBlock):
(wgpuQueueSubmit):
(wgpuQueueWriteBuffer):
(wgpuQueueWriteTexture):
(wgpuQueueSetLabel):
* Source/WebGPU/WebGPU/RenderBundle.mm:
(wgpuRenderBundleReference):
(wgpuRenderBundleRelease):
(wgpuRenderBundleSetLabel):
* Source/WebGPU/WebGPU/RenderBundleEncoder.mm:
(WebGPU::RenderBundleEncoder::makeInvalid):
(WebGPU::RenderBundleEncoder::currentRenderCommand):
(WebGPU::RenderBundleEncoder::addResource):
(WebGPU::RenderBundleEncoder::executePreDrawCommands):
(WebGPU::RenderBundleEncoder::drawIndexed):
(WebGPU::RenderBundleEncoder::drawIndexedIndirect):
(WebGPU::RenderBundleEncoder::drawIndirect):
(WebGPU::RenderBundleEncoder::validToEncodeCommand const):
(WebGPU::RenderBundleEncoder::setBindGroup):
(WebGPU::RenderBundleEncoder::setPipeline):
(wgpuRenderBundleEncoderReference):
(wgpuRenderBundleEncoderRelease):
(wgpuRenderBundleEncoderDraw):
(wgpuRenderBundleEncoderDrawIndexed):
(wgpuRenderBundleEncoderDrawIndexedIndirect):
(wgpuRenderBundleEncoderDrawIndirect):
(wgpuRenderBundleEncoderFinish):
(wgpuRenderBundleEncoderInsertDebugMarker):
(wgpuRenderBundleEncoderPopDebugGroup):
(wgpuRenderBundleEncoderPushDebugGroup):
(wgpuRenderBundleEncoderSetBindGroupWithDynamicOffsets):
(wgpuRenderBundleEncoderSetIndexBuffer):
(wgpuRenderBundleEncoderSetPipeline):
(wgpuRenderBundleEncoderSetVertexBuffer):
(wgpuRenderBundleEncoderSetLabel):
* Source/WebGPU/WebGPU/RenderPassEncoder.mm:
(WebGPU::m_maxDrawCount):
(wgpuRenderPassEncoderReference):
(wgpuRenderPassEncoderRelease):
(wgpuRenderPassEncoderBeginOcclusionQuery):
(wgpuRenderPassEncoderDraw):
(wgpuRenderPassEncoderDrawIndexed):
(wgpuRenderPassEncoderDrawIndexedIndirect):
(wgpuRenderPassEncoderDrawIndirect):
(wgpuRenderPassEncoderEndOcclusionQuery):
(wgpuRenderPassEncoderEnd):
(wgpuRenderPassEncoderExecuteBundles):
(wgpuRenderPassEncoderInsertDebugMarker):
(wgpuRenderPassEncoderPopDebugGroup):
(wgpuRenderPassEncoderPushDebugGroup):
(wgpuRenderPassEncoderSetBindGroup):
(wgpuRenderPassEncoderSetBlendConstant):
(wgpuRenderPassEncoderSetIndexBuffer):
(wgpuRenderPassEncoderSetPipeline):
(wgpuRenderPassEncoderSetScissorRect):
(wgpuRenderPassEncoderSetStencilReference):
(wgpuRenderPassEncoderSetVertexBuffer):
(wgpuRenderPassEncoderSetViewport):
(wgpuRenderPassEncoderSetLabel):
* Source/WebGPU/WebGPU/RenderPipeline.mm:
(wgpuRenderPipelineReference):
(wgpuRenderPipelineRelease):
(wgpuRenderPipelineGetBindGroupLayout):
(wgpuRenderPipelineSetLabel):
* Source/WebGPU/WebGPU/Sampler.mm:
(wgpuSamplerReference):
(wgpuSamplerRelease):
(wgpuSamplerSetLabel):
* Source/WebGPU/WebGPU/ShaderModule.mm:
(WebGPU::earlyCompileShaderModule):
(wgpuShaderModuleReference):
(wgpuShaderModuleRelease):
(wgpuShaderModuleGetCompilationInfo):
(wgpuShaderModuleGetCompilationInfoWithBlock):
(wgpuShaderModuleSetLabel):
* Source/WebGPU/WebGPU/Texture.mm:
(WebGPU::imageCopyTextureSubresourceSize):
(WebGPU::Texture::errorValidatingImageCopyTexture):
(WebGPU::Texture::errorValidatingTextureCopyRange):
(wgpuTextureReference):
(wgpuTextureRelease):
(wgpuTextureCreateView):
(wgpuTextureDestroy):
(wgpuTextureSetLabel):
(wgpuTextureGetDepthOrArrayLayers):
(wgpuTextureGetDimension):
(wgpuTextureGetFormat):
(wgpuTextureGetHeight):
(wgpuTextureGetWidth):
(wgpuTextureGetMipLevelCount):
(wgpuTextureGetSampleCount):
(wgpuTextureGetUsage):
* Source/WebGPU/WebGPU/TextureView.mm:
(wgpuTextureViewReference):
(wgpuTextureViewRelease):
(wgpuTextureViewSetLabel):
* Source/WebGPU/WebGPU/XRBinding.mm:
(wgpuXRBindingReference):
(wgpuXRBindingRelease):
(wgpuBindingCreateXRProjectionLayer):
(wgpuBindingGetViewSubImage):
* Source/WebGPU/WebGPU/XRProjectionLayer.mm:
(wgpuXRProjectionLayerReference):
(wgpuXRProjectionLayerRelease):
(wgpuXRProjectionLayerStartFrame):
* Source/WebGPU/WebGPU/XRSubImage.mm:
(wgpuXRSubImageReference):
(wgpuXRSubImageRelease):
(wgpuXRSubImageGetColorTexture):
(wgpuXRSubImageGetDepthStencilTexture):
* Source/WebGPU/WebGPU/XRView.mm:
(wgpuXRViewReference):
(wgpuXRViewRelease):

Canonical link: https://commits.webkit.org/285684@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