Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Web GPU] Updates to GPUCommandBuffer for new GPUCommandEncoder concept
https://bugs.webkit.org/show_bug.cgi?id=195083 <rdar://problem/48423591> Reviewed by Dean Jackson. Fixing build error and re-introducing rolled-out changes. Source/WebCore: WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer is now WebGPUCommandEncoder. Affected Web GPU tests updated to match new API. New files and symbols: * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer: * Modules/webgpu/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::create): (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted. (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted. (WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted. (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted. (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted. (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted. (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted. * Modules/webgpu/WebGPUCommandBuffer.h: (WebCore::WebGPUCommandBuffer::commandBuffer): (WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted. * Modules/webgpu/WebGPUCommandBuffer.idl: Rename old WebGPUCommandBuffer to WebGPUCommandEncoder: * Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp. (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): (WebCore::WebGPUCommandEncoder::create): (WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder): (WebCore::WebGPUCommandEncoder::beginRenderPass): (WebCore::WebGPUCommandEncoder::copyBufferToBuffer): (WebCore::WebGPUCommandEncoder::copyBufferToTexture): (WebCore::WebGPUCommandEncoder::copyTextureToBuffer): (WebCore::WebGPUCommandEncoder::copyTextureToTexture): (WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission. * Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h. * Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl. * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable. (WebCore::WebGPUDevice::createCommandBuffer const): Deleted. * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUDevice.idl: * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder): (WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer. (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): (WebCore::WebGPUProgrammablePassEncoder::setPipeline): * Modules/webgpu/WebGPUProgrammablePassEncoder.h: * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: * Modules/webgpu/WebGPUQueue.cpp: (WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter. * Modules/webgpu/WebGPUQueue.h: * Modules/webgpu/WebGPUQueue.idl: * Modules/webgpu/WebGPURenderPassEncoder.cpp: (WebCore::WebGPURenderPassEncoder::create): (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder): (WebCore::WebGPURenderPassEncoder::setVertexBuffers): (WebCore::WebGPURenderPassEncoder::draw): (WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr. * Modules/webgpu/WebGPURenderPassEncoder.h: * Modules/webgpu/WebGPUSwapChain.cpp: (WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh! * platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs. * platform/graphics/gpu/GPUDevice.cpp: (WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer. (WebCore::GPUDevice::createCommandBuffer): Deleted. * platform/graphics/gpu/GPUDevice.h: * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: (WebCore::GPUCommandBuffer::tryCreate): Renamed from create. (WebCore::GPUCommandBuffer::create): Deleted. LayoutTests: Update existing Web GPU tests for GPUCommandEncoder and new GPUCommandBuffer. * webgpu/blit-commands.html: * webgpu/buffer-command-buffer-races.html: * webgpu/buffer-resource-triangles.html: * webgpu/command-buffers-expected.txt: * webgpu/command-buffers.html: * webgpu/depth-enabled-triangle-strip.html: * webgpu/js/webgpu-functions.js: (beginBasicRenderPass): * webgpu/render-command-encoding.html: * webgpu/simple-triangle-strip.html: * webgpu/texture-triangle-strip.html: * webgpu/vertex-buffer-triangle-strip.html: Canonical link: https://commits.webkit.org/210061@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
40 changed files
with
584 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,3 +1,3 @@ | ||
|
||
PASS Create a default GPUCommandBuffer. | ||
PASS Create a default GPUCommandEncoder. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.